CN109857544A - Resource reclaim control method, terminal and computer readable storage medium - Google Patents

Resource reclaim control method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109857544A
CN109857544A CN201811616222.0A CN201811616222A CN109857544A CN 109857544 A CN109857544 A CN 109857544A CN 201811616222 A CN201811616222 A CN 201811616222A CN 109857544 A CN109857544 A CN 109857544A
Authority
CN
China
Prior art keywords
application
terminal
background
switching
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811616222.0A
Other languages
Chinese (zh)
Inventor
董德亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201811616222.0A priority Critical patent/CN109857544A/en
Publication of CN109857544A publication Critical patent/CN109857544A/en
Pending legal-status Critical Current

Links

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of resource reclaim control method, terminal and computer readable storage mediums, and in terminal use process, whether detection terminal resource recycling condition is triggered;When detecting terminal resource recycling condition triggering, the currently running reservation priority respectively applied in terminal backstage is obtained, the reason of which is switched to backstage according to each priority using itself and each application, corresponding weighted value determined;Then again from the currently running each application in terminal backstage, corresponding application is removed by the sequence of priority from low to high is retained;The invention also discloses a kind of terminal and computer readable storage mediums, by implementing above scheme, the factor for the one side whether the reason of application switching to backstage should be removed by weighting scheme as the application, therefore the reasonability and accuracy that can largely promote the target application selection that should be removed, promote satisfaction of users.

Description

Resource recovery control method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a resource recycling control method, a terminal, and a computer-readable storage medium.
Background
With the rapid development of mobile communication, the intelligent terminal product has functions of not only being a communication tool, but also being a tool for people to entertain. At present, people can use the intelligent terminal, or read, or play games, or chat no matter in what place. And as the intelligent terminal occupies an increasingly important role in life and work of people, the dependence of users on the intelligent terminal in life and work is more and more serious.
The intelligent terminal running the Android system and other related systems is divided into foreground applications and background applications, the number of the background applications cannot be unlimited due to the limitation of the size of the memory, and specifically, a plurality of background applications are reserved, and the reserved background applications are related to the current residual memory on one hand and the priority of the background applications (namely background APPs) on the other hand. The following description takes process recycling of the Android system as an example: the memory recovery of the Android system process is responsible for a LowMemory Killer (LMK), and the LMK killing process is as follows: when the remaining free memory of the system is lower than a certain threshold (for example 147MB), the target process with the maximum ADJ value is selected from the processes with the ADJ value larger than or equal to the corresponding threshold (for example 900), and the target process is sent signal 9 to kill the process. In the above process, in brief, each background APP has its own ADJ priority, and APPs with lower priorities are easier to be cleared.
For the resource recycling control scheme, whether the background APP is cleared depends on the ADJ priority of the background APP, the ADJ priority is weighted by four major components of the application, and the scheme has great rationality but ignores a point that the background application is suspended (in the background). For example, suppose that a user is editing a document with a mobile phone office word, and suddenly calls, the word is transferred to the background, and suppose that the application of the background is WeChat, SMS, etc. When resource recovery is needed, the office word is ranked lower according to the ADJ priority, and the office word is likely to be cleared, but obviously not wanted by the user; and assuming another scene, assuming that the user is recording things by using the mobile phone office word, and then the user changes the idea and wants to change the note book record, the user presses the home key to return to the desktop, selects the note book to open and starts editing, and then the word is transferred to the background, in which case the office word is in accordance with the user expectation if the office word is cleared by the mechanism. It can be seen that the resource recycling control mechanism is not accurate and reasonable enough for selecting which applications to clean the background, which results in poor user experience satisfaction.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the related resource recovery control mechanism is not accurate and reasonable enough for selecting which applications in the background are cleaned, and the user experience satisfaction is poor. In view of the technical problem, a resource recycling control method, a terminal and a computer-readable storage medium are provided.
In order to solve the above technical problem, the present invention provides a resource recovery control method, which is applied to a terminal, and the resource recovery control method includes:
detecting whether a terminal resource recovery condition is triggered;
when the condition that the terminal resource recovery is triggered is detected, acquiring the retention priority of each application currently running in the terminal background, wherein the retention priority is determined according to the priority of each application and the weighted value corresponding to the reason why each application is switched to the background;
and clearing the corresponding applications from the applications currently running in the background of the terminal according to the sequence of the reserved priorities from low to high.
Optionally, the clearing, from among the applications currently running in the background of the terminal, the corresponding applications in the order from low retention priority to high retention priority includes:
and when the application with the lowest retention priority comprises a plurality of applications, clearing the applications according to the sequence from large to small of the occupied memory until the terminal resource recovery condition is relieved after clearing.
Optionally, the terminal resource recycling condition includes at least one of the following:
the current residual memory of the terminal is smaller than a preset memory threshold value;
and the current residual memory of the terminal can not meet the requirement of the current application to be operated.
Optionally, the weighted value corresponding to the reason why the application is switched to the background includes:
when the reason for switching a certain application to the background is active switching, the corresponding weighted value is 1;
when the reason for switching an application to the background is passive switching, the corresponding weighted value is a value less than 1.
Optionally, when the reason for switching an application to the background is passive switching, the higher the priority of the application or the video frequency, the smaller the corresponding weighted value.
Optionally, when the reason for switching an application to the background is passive switching, the smaller the memory occupied by the application is, the smaller the corresponding weighted value is.
Optionally, the active switching includes switching the indicated application to the background according to a switching instruction of the user.
Optionally, the passive switching includes that an application running in the foreground occupies foreground resources by an application with a higher priority and is forced to be switched to the background running.
Furthermore, the invention also provides a terminal, which further comprises a processor, a memory and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps of the resource reclamation control method as described above.
Further, the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs, which are executable by one or more processors to implement the steps of the resource recovery control method as described above.
Advantageous effects
The invention provides a resource recovery control method, a terminal and a computer readable storage medium, wherein in the using process of the terminal, whether a terminal resource recovery condition is triggered or not is detected; when the triggering of a terminal resource recovery condition is detected, acquiring the retention priority of each application currently running in a terminal background, wherein the retention priority is determined according to the priority of each application and the weighted value corresponding to the reason that each application is switched to the background; and then clearing the corresponding applications from the applications currently running in the background of the terminal according to the sequence of the reserved priorities from low to high. In the invention, the retention priority of each application in the background is determined according to the priority of each application and the weighted value corresponding to the reason for switching each application to the background, namely, the reason for switching the application to the background is used as a factor on the one hand whether the application is to be cleaned or not in a weighting mode, so that the rationality and the accuracy of the selection of the target application to be cleaned can be improved to a greater extent, and the user experience satisfaction is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware structure of an alternative mobile terminal for implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
FIG. 3 is a flowchart illustrating a resource recycling control method according to a first embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal provided in a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a resource recycling control method according to a third embodiment of the present invention;
fig. 6 is a flowchart illustrating another resource recycling control method according to a third embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The mobile terminal may be implemented in various forms. For example, the mobile terminal described in the present invention may include mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, etc., and fixed terminals such as a digital TV, a desktop computer, etc., and the mobile terminal in the present invention may be various flexible screen mobile terminals made using a flexible screen; or a non-flexible screen terminal.
It will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type mobile terminal in addition to elements particularly used for moving purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 does not constitute a limitation of the mobile terminal, that the mobile terminal may include more or less components than those shown, or some components may be combined, or different component arrangements may be adopted, and that the mobile terminal may be adapted to change the positions, materials and functions of the components according to its own bending performance.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex-Long Term Evolution), and TDD-LTE (Time Division duplex-Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and various flexible screens and non-flexible screens (i.e., normal screens) may be employed. The display panel 1061 is configured in the form of, for example, an Organic Light-Emitting Diode (OLED), an Active-matrix Organic Light-Emitting Diode (AMOLED), or the like. In this embodiment, one mobile terminal may have one display panel, or a plurality of display panels may be provided, for example, a flexible screen or a non-flexible screen that is bendable and flexible on each of the front and back sides.
In addition, the display unit 106 may be configured to include a 2D display supporting 2D display and may also include a 3D display supporting 3D display according to display requirements. Of course, in some application scenarios, 3D display may also be implemented by a 2D display in combination with corresponding 3D display software. The type of the 3D display can be flexibly set according to the principle of the 3D display technology (e.g., but not limited to, technologies such as a color difference type 3D display technology, a shutter type 3D display technology, a polarization type 3D display technology, etc., a light barrier type 3D display technology, a lenticular lens 3D display technology, and a directional light source 3D display technology). For example, it may be a 3D display supporting naked eye 3D, or may be a 3D display that needs to be fitted with 3D eyes or a helmet to realize 3D reality.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a bendable touch panel 1071 and other input devices 1072. The flexible touch panel 1071, also called a flexible touch screen, can collect touch operations of a user (for example, operations of the user on or near the touch panel 1071 using any suitable object or accessory such as a finger, a stylus pen, etc.) and drive the corresponding connection device according to a preset program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which an exemplary mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the mobile terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
First embodiment
The embodiment provides a resource recovery control method, which is characterized in that when a terminal resource recovery condition is detected to be triggered, the retention priority of each background application is determined according to the priority of each current background application and the weighted value corresponding to the reason why each background application is switched to the background; and then, removing the corresponding applications from the applications currently running in the background of the terminal according to the sequence of the reserved priorities from low to high, namely, taking the reason for switching the applications to the background as a factor on the one hand of whether the applications should be removed or not in a weighting mode, so that the rationality and the accuracy of selecting the target applications to be removed can be improved to a greater extent, and the user experience satisfaction is improved.
For ease of understanding, the present embodiment will be described below with reference to a process of a resource recycling control method as an example. Please refer to fig. 3, which includes:
s301: and detecting whether the terminal resource recovery condition is triggered.
In this embodiment, the mechanism for detecting whether the terminal resource recycling condition is triggered can be flexibly selected and set. For example, in one example, a mechanism for real-time detection may be employed. In another example, the detection may be at preset time intervals. For example, every 30 seconds, 1 minute, etc.
In this embodiment, the resource recovery condition may also be flexibly set. For example, in one example, the resource reclamation conditions may include, but are not limited to:
the current residual memory of the terminal is smaller than a preset memory threshold value; at this time, it is shown that when the number of application processes running on the terminal is too many and exceeds the maximum value of the memory capable of being loaded by the terminal, in the subsequent running process of the terminal, the situation that the terminal runs slowly or even is jammed due to insufficient redundancy of the current memory is likely to occur. In order to avoid the situation, the current residual memory of the visible terminal is smaller than a preset memory threshold value and is used as a trigger condition for resource recovery; however, it should be understood that the size of the preset memory threshold in this embodiment may be flexibly set according to the terminal memory configuration condition, the comprehensive performance of the terminal, the use habit of the user, and the like. And in some examples, a user can also be supported to dynamically set and update the preset memory threshold.
The current residual memory of the terminal does not meet the requirements of the current application to be operated; at this time, the current remaining memory of the terminal may not meet the condition that the current remaining memory is smaller than the preset memory threshold, but does not meet the requirement of the current application to be run, so that the running can be normally started after resource recovery processing is performed, and therefore, the condition that the current remaining memory of the terminal does not meet the requirement of the current application to be run can also be used as a condition for triggering resource recovery control.
It should be understood that the terminal resource reclamation conditions are not limited to the two cases of the above example. The terminal resource recovery condition can be flexibly set according to the actual application scene requirements, and in some examples, the user can also be supported to dynamically set and update the terminal resource recovery condition.
The terminal in this embodiment may be a mobile intelligent terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a PDA, a portable media player, an intelligent bracelet, an intelligent watch, or a fixed intelligent terminal such as a digital TV, a desktop computer, and a vehicle-mounted computer. The system run by the terminal in this embodiment may include various operating systems, which may include, but are not limited to, Android, iOS, windows phone, Symbian, BlackBerry OS, web OS, and windows mobile.
S302: and when detecting that the terminal resource recovery condition is triggered, acquiring the retention priority of each application currently running in the terminal background.
In this step, the retention priority of each application currently running in the background of the terminal (in this embodiment, these applications are referred to as background applications) is obtained, which is substantially different from the ADJ priority obtained in the background art. In this embodiment, the retention priority of each background application is determined according to the priority of each application itself and the weighted value corresponding to the reason why each application is switched to the background. The reason for switching the application to the background is taken as a factor on one aspect of whether the application should be cleared or not in a weighting mode, and the ADJ priority of the background application is not simply considered, so that the reasonability and the accuracy of selecting the target application to be cleared can be improved to a greater extent, and the user experience satisfaction is improved.
S303: and clearing the corresponding applications from the applications currently running in the background of the terminal according to the sequence of the reserved priorities from low to high.
It should be understood that, in this embodiment, the specific purging manner for purging the corresponding applications from the applications currently running in the background of the terminal in the order from low retention priority to high retention priority may also be flexibly set. For ease of understanding, several cleaning examples are described below.
The first method is as follows: and clearing the applications one by one, namely clearing the corresponding applications one by one from the applications currently running in the terminal background according to the sequence of the retention priority from low to high until the recovery condition of the terminal resources is relieved after clearing. If the background application is not cleared, judging whether the current memory surplus condition after one clearing enables the terminal resource recovery condition to be relieved, for example, whether the current memory surplus after the clearing is larger than a preset memory threshold value or whether the current memory surplus condition meets the requirement of the current application to be operated, if so, stopping clearing so as to avoid bad experience of a user caused by clearing excessive applications; if the terminal resource recovery condition is not released, the terminal resource recovery condition needs to be cleared continuously according to the rule.
In this exemplary manner, when the application with the lowest retention priority (or the retention priority cleared in the current clearing sequence) includes a plurality of applications, the applications may be cleared in sequence from large to small according to the occupied memory until the terminal resource recycling condition is released after the clearing.
For example, assume that there are 4 background applications in the current background running application: application A, application B, application C and application D; the ordering of the retention priorities for these 4 background applications is: the retention priority of A is higher than that of application B, the retention priority of application B is higher than that of application C, the retention priority of application C is equal to that of application D, and the memory occupied by application C is larger than that of application D.
In this exemplary embodiment, when the trigger of the terminal resource recycling condition is detected, one of the application C and the application D with the lowest retention priority is first selected to be cleared, since the memory occupied by the application C is larger than that occupied by the application D, the application C is first cleared, and then it is determined whether the current terminal resource recycling condition is removed after the application C is cleared, and if the condition is removed, the clearing is stopped. And if the terminal resource recovery condition is not released, continuing to clean the application D, then judging whether the current terminal resource recovery condition is released after the application D is cleaned, and if the current terminal resource recovery condition is released, stopping cleaning. And if the terminal resource recovery condition is not released, cleaning the application in the next level of retention priority according to the rule until the terminal resource recovery condition is released after the application is cleaned.
The second method comprises the following steps: and in a priority clearing mode one by one, after the retention priority of each background application is obtained from each application currently running in the background of the terminal, sequencing the retention priority of each background application, and clearing the applications corresponding to the corresponding retention priority one by one according to the sequence of the retention priority from low to high until the recovery condition of the terminal resources is relieved after clearing. At this time, if an application corresponding to the retention priority is not cleared, it is determined whether the current remaining memory condition after one clearing relieves the terminal resource recycling condition, for example, whether the current remaining memory condition after the clearing is greater than a preset memory threshold value or meets the requirement of the current application to be run, and if the current remaining memory condition after the clearing is greater than the preset memory threshold value, the clearing can be stopped, so as to avoid bad experience of the user caused by too many applications being cleared. If the terminal resource recovery condition is not released, the terminal resource recovery condition needs to be cleared continuously according to the rule.
For example, assume that there are 6 background applications in the current background running application: application A, application B, application C, application D, application E; the ordering of the retention priorities for these 4 background applications is: the retention priority of A is higher than that of the application B and the application E, the retention priority of the application B is equal to that of the application E and is higher than that of the application C, the retention priority of the application C is equal to that of the application D, and the memory occupied by the application C is larger than that of the application D.
In this exemplary manner, when it is detected that the terminal resource recovery condition is triggered, the application C and the application D with the lowest retention priority are directly cleared first without considering whether the memory occupied by the application C is large in application D, and the two applications are cleared together; this can improve the resource recovery efficiency. And after each application in the lowest retention priority is cleared, judging whether the current terminal resource recovery condition is cleared, and if the current terminal resource recovery condition is cleared, stopping clearing. And if the terminal resource recovery condition is not released, continuously cleaning each background application (namely the application B and the application E) in the next-level retention priority until the terminal resource recovery condition is released after cleaning.
It can be seen that the two exemplary cleaning methods have respective advantages, and thus can be flexibly selected according to requirements. And it should be understood that the manner of clearing in the present embodiment is not limited to the two manners exemplified above. But is flexibly set and updated according to the requirements.
By the resource recovery control method provided by the embodiment, when the triggering of the terminal resource recovery condition is detected, the priority of each current background application and the reason why each background application is switched to the background can be combined to determine the retention priority of each background application; and then, the corresponding applications are cleared from the applications currently running in the background of the terminal by adopting a flexible clearing mechanism according to the sequence of the retention priority from low to high, so that the reasonability and the accuracy of the selection of the target application to be cleared can be improved to a greater extent, and the user experience satisfaction is improved.
Second embodiment
For ease of understanding, the present embodiment will be described below with reference to a weight value setting example of a reason why an application is switched to the background.
In the present embodiment, the priority of an application is described by taking the ADJ priority as an example. In this example, the higher the ADJ value is applied, the lower the ADJ priority thereof, whereas the lower the ADJ value is, the higher the ADJ priority thereof, and the ADJ value is set to a value of 0 or more in this example. However, it should be understood that in some examples, when setting the ADJ value to be smaller, the ADJ priority thereof is lower, the ADJ value is larger, the ADJ priority thereof is higher, or the ADJ value may be smaller than 0, and a simple equivalent substitution may be made according to the example provided by the present embodiment.
In this embodiment, the reason why the application is switched to the background may include, but is not limited to: active switching and passive switching; wherein,
active switching includes, but is not limited to: and switching the indicated application to the background according to the switching instruction of the user.
Passive switching then includes, but is not limited to, at least one of the following:
the active switching comprises switching the indicated application to a background according to a switching instruction of a user;
the application running in a certain foreground occupies foreground resources by the application with higher priority and is forced to be switched to the background running.
It should be understood that the definition and determination manner of the active handover and the passive handover in this embodiment is not limited to the above exemplary manner, and the definition may be flexibly set according to the specific application requirement, and optionally, only user-defined setting or updating may be supported.
In this embodiment, the weighted value corresponding to the reason for switching the application to the background includes:
when the reason for switching a certain application to the background is active switching, the corresponding weighted value is 1; of course, the value may be set to be greater than 1 or less than 1 according to the requirement, as long as it is smaller than the corresponding weighted value when the reason that the application is switched to the background is passive switching.
When the reason for switching a certain application to the background is passive switching, the corresponding weighted value is a value smaller than 1; the specific value of the weighted value can be flexibly set. For each background application that is passively switched to the background, the weighted values corresponding to the background applications may be the same, for example, all the weighted values are set to 0.9, 0.8, 0.5, and the corresponding relationship at this time is shown in table one:
watch 1
Reason for handover Weighted values
Active handover 1
Passive switching q (q is less than 1)
In this embodiment, for each background application that is passively switched to the background, a corresponding weighted value may also be flexibly set according to the characteristics of the specific background application itself. The characteristics may include, but are not limited to, the priority of the application itself, the video frequency of the application, the size of the resources occupied by the application, etc.
In one example, when the reason for an application to be switched to the background is a passive switch, the higher the priority of the application is, the smaller the corresponding weighted value is.
For example, assume that there are 4 background applications in the current background running application: the reason that the application a is switched to the background is active switching, the reason that the application B, the application C and the application D are switched to the background is passive switching, the priority of the application B is higher than that of the application C, and the priority of the application C is higher than that of the application D, and then a corresponding relationship at this time is shown in table two:
watch two
Applications of Reason for handover Weighted values
Applications A Active handover 1
Application B Passive switching 0.8
Applications C Passive switching 0.85
Applications D Passive switching 0.9
For another example, in an example, when the reason for an application to be switched to the background is passive switching, the higher the usage frequency of the application is, the smaller the weighting value corresponding to the application is, and at this time, the weighting value corresponding to the application changes with the change of the usage frequency of the application.
In one example, when the reason for an application to be switched to the background is a passive switch, the higher the priority of the application is, the smaller the corresponding weighted value is.
There are 4 background applications in the application that are still running in the current background: taking application a, application B, application C, and application D as examples, where the reason that application a is switched to the background is active switching, the reason that application B, application C, and application D are switched to the background is passive switching, the use frequency of application B is lower than that of application C, and the use frequency of application C is lower than that of application D, then a corresponding relationship at this time is shown in table three:
watch III
In an example, when the reason for switching an application to the background is passive switching, the smaller the memory occupied by the application is, the smaller the corresponding weighted value is, so that the application can be further prevented from being unreasonably cleared and reasonably retained, and the satisfaction of user experience is further improved.
There are 4 background applications in the application that are still running in the current background: taking an application a, an application B, an application C, and an application D as examples, where the reason that the application a is switched to the background is active switching, the reason that the application B, the application C, and the application D are switched to the background is passive switching, the occupied memory of the application B is lower than that of the application C, and the occupied memory of the application C is higher than that of the application D, then a corresponding relationship at this time is shown in table three:
watch III
Applications of Reason for handover Weighted values
Applications A Active handover 1
Application B Passive switching 0.88
Applications C Passive switching 0.9
Applications D Passive switching 0.89
In other examples of this embodiment, at least two of the self-priority, the occupied memory size, the frequency used by the user, and other characteristics of the background application may be combined to set a corresponding weighted value for the background application. However, when at least two of the weighted values are combined, the specific gravity of the weighted value can be set according to different characteristics, and the weighted value corresponding to the application is determined comprehensively according to the specific gravity of the weighted value.
It can be seen that, in this embodiment, for various background applications, when the reason for switching to the background is passive switching, a corresponding weighted value may be further set for each different background application according to at least one of the characteristics of the background application, such as its own priority, the size of the occupied memory, and the frequency used by the user, so that the control on the background applications is more refined, the rationality and accuracy for selecting the target application to be cleared in the resource recovery process can be further improved, and the satisfaction degree of the user experience is further improved.
Third embodiment
The embodiment provides a terminal, which may be a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a PDA, a portable media player, a navigation device, a wearable device, an intelligent bracelet, a pedometer, and the like, or a fixed mobile terminal such as a digital TV, a desktop computer, and the like. Referring to fig. 4, the terminal in the present embodiment includes a processor 401, a memory 402, and a communication bus 403;
the communication bus 403 is used for realizing communication connection between the processor 401 and the memory 402;
the processor 401 is configured to execute one or more programs stored in the memory 402 to implement the steps of the resource reclamation control method as exemplified in the embodiments above.
The present embodiment also provides a computer-readable storage medium, which is applicable in various terminals, and which stores one or more programs, which are executable by one or more processors, to implement the steps of the resource recovery control method as exemplified in the above embodiments.
For convenience of understanding, in the present embodiment, a terminal is taken as an example, and a resource recycling control process is described as an example, with reference to fig. 5, the method includes:
s501: in the using process of the terminal, it is detected that the current residual memory of the terminal is smaller than a preset memory threshold value.
S502: and acquiring the retention priority of each application currently running in the background of the terminal. The retention priority is the product of the ADJ priority of each background application and the weighted value corresponding to the reason for switching each background application to the background.
S503: sequencing the background applications in sequence according to the sequence of the retention priority from low to high, and then clearing the corresponding background applications one by one according to the sequence of the retention priority from low to high until the current residual memory of the terminal is greater than or equal to a preset memory threshold value.
For convenience of understanding, in the present embodiment, taking a terminal as an example, a resource recycling control process of the terminal is described as an example, and referring to fig. 6, the resource recycling control process includes:
s601: in the using process of the terminal, the current residual memory of the terminal is detected to not meet the requirement of the current application to be operated.
S602: and acquiring the retention priority of each application currently running in the background of the terminal. The retention priority is the product of the ADJ priority of each background application and the weighted value corresponding to the reason for switching each background application to the background.
S603: sequencing all background applications in sequence according to the sequence of the retention priorities from low to high, and then clearing the background applications in the corresponding retention priorities step by step according to the sequence of the retention priorities from low to high (clearing the applications in one retention priority simultaneously) until the current residual memory of the terminal is detected to meet the requirements of the current applications to be operated.
It can be seen that, in the using process of the terminal, when resource recovery is required to be performed in detection, the corresponding target application can be reasonably selected from the acquired applications to be cleared according to the priority of each background application and the weighted value corresponding to the reason that each application is switched to the background, so that the reasonability and the accuracy of the selection of the target application to be cleared can be improved to a greater extent, and the satisfaction degree of user experience is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a flexible screen terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A resource recovery control method is applied to a terminal, and the resource recovery control method comprises the following steps:
detecting whether a terminal resource recovery condition is triggered;
when the condition that the terminal resource recovery is triggered is detected, acquiring the retention priority of each application currently running in the terminal background, wherein the retention priority is determined according to the priority of each application and the weighted value corresponding to the reason why each application is switched to the background;
and clearing the corresponding applications from the applications currently running in the background of the terminal according to the sequence of the reserved priorities from low to high.
2. The method according to claim 1, wherein the purging the corresponding applications from the applications currently running in the background of the terminal in the order of the retention priority from low to high comprises:
and when the application with the lowest retention priority comprises a plurality of applications, clearing the applications according to the sequence from large to small of the occupied memory until the terminal resource recovery condition is relieved after clearing.
3. The resource recovery control method of claim 1, wherein the terminal resource recovery condition comprises at least one of:
the current residual memory of the terminal is smaller than a preset memory threshold value;
and the current residual memory of the terminal can not meet the requirement of the current application to be operated.
4. The resource recycling control method according to any one of claims 1 to 3, wherein the weighting value corresponding to the reason why the application is switched to the background comprises:
when the reason for switching a certain application to the background is active switching, the corresponding weighted value is 1;
when the reason for switching an application to the background is passive switching, the corresponding weighted value is a value less than 1.
5. The method as claimed in claim 4, wherein when the reason for switching an application to the background is passive switching, the higher the priority of the application or the video frequency, the smaller the corresponding weight.
6. The method as claimed in claim 4, wherein when the reason for switching an application to the background is passive switching, the smaller the memory occupied by the application is, the smaller the corresponding weighted value is.
7. The resource recovery control method of claim 4 wherein the actively switching comprises switching the indicated application to the background in accordance with a user's switching instructions.
8. The resource recovery control method of claim 4 wherein the passive switch comprises an application running in foreground being forced to switch to background running with foreground resources being occupied by a higher priority application.
9. A terminal, characterized in that the terminal comprises a processor, a memory and a communication bus;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps of the resource reclamation control method as recited in any one of claims 1-8.
10. A computer-readable storage medium, storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of the resource reclamation control method as recited in any one of claims 1 to 8.
CN201811616222.0A 2018-12-27 2018-12-27 Resource reclaim control method, terminal and computer readable storage medium Pending CN109857544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811616222.0A CN109857544A (en) 2018-12-27 2018-12-27 Resource reclaim control method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811616222.0A CN109857544A (en) 2018-12-27 2018-12-27 Resource reclaim control method, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109857544A true CN109857544A (en) 2019-06-07

Family

ID=66892978

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811616222.0A Pending CN109857544A (en) 2018-12-27 2018-12-27 Resource reclaim control method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109857544A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221921A (en) * 2019-06-13 2019-09-10 深圳Tcl新技术有限公司 EMS memory management process, terminal and computer readable storage medium
CN110727473A (en) * 2019-10-10 2020-01-24 Oppo广东移动通信有限公司 Resource control method, device, system, storage medium and electronic equipment
CN111371949A (en) * 2020-02-28 2020-07-03 Oppo广东移动通信有限公司 Application program switching method and device, storage medium and touch terminal
CN112148448A (en) * 2020-09-22 2020-12-29 北京字节跳动网络技术有限公司 Resource allocation method, device, equipment and computer readable medium
CN112291205A (en) * 2020-10-13 2021-01-29 杭州迪普科技股份有限公司 Control method and device for deep packet inspection service and computer equipment
CN113392037A (en) * 2020-03-12 2021-09-14 深圳市万普拉斯科技有限公司 Memory recovery method and device, computer equipment and storage medium
CN117130947A (en) * 2023-01-31 2023-11-28 荣耀终端有限公司 Memory management method and electronic equipment
CN118175362A (en) * 2024-05-16 2024-06-11 四川天邑康和通信股份有限公司 ROM space recycling method and device, storage medium and set top box

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843650A (en) * 2016-03-31 2016-08-10 青岛海信移动通信技术股份有限公司 Application program management method and device in intelligent terminal
CN107291549A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 A kind of method and device for managing application program
CN107463437A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Using management-control method, device, storage medium and electronic equipment
CN107479967A (en) * 2017-07-04 2017-12-15 深圳天珑无线科技有限公司 A kind of automatic method and intelligent terminal for removing internal memory
CN107844333A (en) * 2017-09-06 2018-03-27 努比亚技术有限公司 One kind applies method for cleaning, mobile terminal and computer-readable recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843650A (en) * 2016-03-31 2016-08-10 青岛海信移动通信技术股份有限公司 Application program management method and device in intelligent terminal
CN107291549A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 A kind of method and device for managing application program
CN107479967A (en) * 2017-07-04 2017-12-15 深圳天珑无线科技有限公司 A kind of automatic method and intelligent terminal for removing internal memory
CN107463437A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Using management-control method, device, storage medium and electronic equipment
CN107844333A (en) * 2017-09-06 2018-03-27 努比亚技术有限公司 One kind applies method for cleaning, mobile terminal and computer-readable recording medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221921A (en) * 2019-06-13 2019-09-10 深圳Tcl新技术有限公司 EMS memory management process, terminal and computer readable storage medium
CN110727473A (en) * 2019-10-10 2020-01-24 Oppo广东移动通信有限公司 Resource control method, device, system, storage medium and electronic equipment
CN110727473B (en) * 2019-10-10 2023-11-03 Oppo广东移动通信有限公司 Resource control method, device, system, storage medium and electronic equipment
CN111371949A (en) * 2020-02-28 2020-07-03 Oppo广东移动通信有限公司 Application program switching method and device, storage medium and touch terminal
CN113392037A (en) * 2020-03-12 2021-09-14 深圳市万普拉斯科技有限公司 Memory recovery method and device, computer equipment and storage medium
CN112148448A (en) * 2020-09-22 2020-12-29 北京字节跳动网络技术有限公司 Resource allocation method, device, equipment and computer readable medium
CN112148448B (en) * 2020-09-22 2024-01-19 抖音视界有限公司 Resource allocation method, apparatus, device and computer readable medium
CN112291205A (en) * 2020-10-13 2021-01-29 杭州迪普科技股份有限公司 Control method and device for deep packet inspection service and computer equipment
CN117130947A (en) * 2023-01-31 2023-11-28 荣耀终端有限公司 Memory management method and electronic equipment
CN117130947B (en) * 2023-01-31 2024-07-12 荣耀终端有限公司 Memory management method and electronic equipment
CN118175362A (en) * 2024-05-16 2024-06-11 四川天邑康和通信股份有限公司 ROM space recycling method and device, storage medium and set top box
CN118175362B (en) * 2024-05-16 2024-07-16 四川天邑康和通信股份有限公司 ROM space recycling method and device, storage medium and set top box

Similar Documents

Publication Publication Date Title
CN109857544A (en) Resource reclaim control method, terminal and computer readable storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN109040441B (en) Application body-separating display method, mobile terminal and computer readable storage medium
CN108280136B (en) Multimedia object preview method, equipment and computer readable storage medium
CN108234773A (en) A kind of switching method of double-sided screen, terminal and storage medium
CN107635070B (en) Message reminding method, terminal and storage medium
CN108958936B (en) Application program switching method, mobile terminal and computer readable storage medium
CN108449513B (en) Interactive regulation and control method, equipment and computer readable storage medium
CN107979667B (en) Dual-screen display method, mobile terminal and computer-readable storage medium
CN108062162B (en) Flexible screen terminal, placement form control method thereof and computer-readable storage medium
CN110064192A (en) Interface control method, mobile terminal and computer readable storage medium
CN108984063B (en) Desktop interaction regulation and control method and device and computer readable storage medium
CN108563388B (en) Screen operation method, mobile terminal and computer-readable storage medium
CN110381202B (en) Display adjustment method, mobile terminal and computer-readable storage medium
CN108543306B (en) Game brightness control method and device and computer readable storage medium
CN111381762A (en) Double-screen switching method and device and computer readable storage medium
CN110083294B (en) Screen capturing method, terminal and computer readable storage medium
CN112346824A (en) Screen projection application control method and device and computer readable storage medium
CN112423102A (en) Small window screen projection control method and device and computer readable storage medium
CN109710149B (en) Interactive display method, equipment and computer readable storage medium
CN109683796B (en) Interaction control method, equipment and computer readable storage medium
CN109684020B (en) Theme switching method, device and computer readable storage medium
CN109062688B (en) Memory allocation method, server and mobile terminal
CN108037959B (en) Intelligent interface merging method, mobile terminal and computer readable storage medium
CN108364595B (en) Electrostatic discharge detection method, mobile terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190607

RJ01 Rejection of invention patent application after publication