CN107807857B - Method and device for cleaning running memory and computer storage medium - Google Patents

Method and device for cleaning running memory and computer storage medium Download PDF

Info

Publication number
CN107807857B
CN107807857B CN201711227554.5A CN201711227554A CN107807857B CN 107807857 B CN107807857 B CN 107807857B CN 201711227554 A CN201711227554 A CN 201711227554A CN 107807857 B CN107807857 B CN 107807857B
Authority
CN
China
Prior art keywords
background
application
running
occupancy rate
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.)
Active
Application number
CN201711227554.5A
Other languages
Chinese (zh)
Other versions
CN107807857A (en
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 CN201711227554.5A priority Critical patent/CN107807857B/en
Publication of CN107807857A publication Critical patent/CN107807857A/en
Application granted granted Critical
Publication of CN107807857B publication Critical patent/CN107807857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Abstract

The invention discloses a method for cleaning an operating memory, which comprises the following steps: acquiring background duration of the application running in the background and occupancy rate of the running memory; judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate; when the background time length is determined to exceed the preset background time length and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed; and closing the application to be processed and releasing the running memory occupied by the application to be processed. The invention also discloses a device for cleaning the running memory and a computer storage medium. By the scheme of the invention, the closing of background applications which are not desired to be closed by users can be prevented, the precision and intelligence for cleaning the running memory are improved, and the user experience can be effectively improved.

Description

Method and device for cleaning running memory and computer storage medium
Technical Field
The invention relates to the technical field of intellectualization of intelligent terminals, in particular to a method and equipment for clearing running internal memory and a computer storage medium.
Background
With the development of science and technology, the functions of the mobile phone are more and more abundant, and the use experience of the user is more and more important while the functions are abundant; when the utilization rate of the running memory of the mobile phone is too high, the mobile phone can generate a stuck phenomenon, the running memory needs to be cleaned in order to eliminate the stuck phenomenon, and the application running in the background is closed to release the occupied running memory; at present, a method for cleaning an operating memory of a mobile phone mainly comprises two modes of manual cleaning by a user or automatic cleaning after screen locking.
The manual cleaning of the user generally refers to that the user selects to manually clean the memory when feeling that the mobile phone is stuck, and the mobile phone cannot intelligently clean the running memory in such a way, so that the user experience is poor; the method comprises the following steps that after a screen is locked, an operating memory is automatically cleaned, although the operating memory can be intelligently cleaned, some bad user experience can be brought, for example, a user watches an online video with a certain application, the screen of a mobile phone is locked occasionally suddenly, the mobile phone is turned back to be opened after a period of time, the online video of the application which is opened before is found to be closed due to the fact that the operating memory is automatically cleaned after the screen is locked, and the user also needs to enter the application again to search the online video which is just closed; therefore, some applications which users do not want to close can be closed in a mode of automatically cleaning the running memory after the screen is locked, so that the accuracy is not high enough, and the intelligence is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a method, a device, and a computer-readable storage medium for clearing an operating memory, so as to improve accuracy and intelligence of clearing the operating memory and improve user experience.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a first aspect of an embodiment of the present invention provides a method for clearing an operating memory, where the method includes:
acquiring background duration of the application running in the background and occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
and closing the application to be processed and releasing the running memory occupied by the application to be processed.
Optionally, the determining that the application running in the background is the application to be processed includes:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
and when the processed result meets a preset condition, determining the application running in the background as the application to be processed.
Optionally, the processing the occupancy rate of the application running in the background for occupying the running memory and the starting frequency of the application running in the background to obtain a processed result includes:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
acquiring a first weight coefficient and a second weight coefficient set by a user, distributing the first weight coefficient to the normalized occupancy rate, distributing the second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both more than 0 and less than 1;
calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient;
the normalization mode is one of a logarithmic function normalization mode, an exponential function normalization mode and a trigonometric or inverse trigonometric function normalization mode, and when the importance of the user on the occupancy rate of the running memory is greater than the starting times, the first weight coefficient is greater than the second weight coefficient.
Optionally, the preset condition includes: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
A second aspect of the present invention provides an apparatus for clearing an operating memory, where the apparatus includes: an interface, a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication among the interface, the processor and the memory;
the processor is configured to execute the program for cleaning the running memory stored in the storage, so as to implement the following steps:
acquiring background duration of the application running in the background and occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
and closing the application to be processed and releasing the running memory occupied by the application to be processed.
Optionally, the processor is configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
and when the processed result meets a preset condition, determining the application running in the background as the application to be processed.
Optionally, the processor is configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
acquiring a first weight coefficient and a second weight coefficient set by a user, distributing the first weight coefficient to the normalized occupancy rate, distributing the second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both more than 0 and less than 1;
calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient;
the normalization mode is one of a logarithmic function normalization mode, an exponential function normalization mode and a trigonometric or inverse trigonometric function normalization mode, and when the importance of the user on the occupancy rate of the running memory is greater than the starting times, the first weight coefficient is greater than the second weight coefficient.
Optionally, the preset condition includes: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores one or more programs that are executable by one or more processors to implement the steps of the method for cleaning up operating memory as described above.
The method, the device and the computer storage medium for clearing the running memory provided by the invention have the advantages that the background duration of the application running in the background and the occupancy rate of the running memory are obtained; judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate; when the background time length is determined to exceed the preset background time length and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed; closing the application to be processed and releasing the running memory occupied by the application to be processed; the comparison of the background duration and the occupancy rate is added for the application running in the background, and the background application exceeding the preset background duration and the preset occupancy rate is determined as the application needing to be processed, so that the background application which a user does not want to close can be prevented from being closed, the accuracy and the intelligence of cleaning the running memory are improved, and the user experience can be effectively improved.
Drawings
Fig. 1 is a schematic hardware configuration diagram of an alternative mobile terminal implementing various embodiments of the present invention;
fig. 2 is a schematic structural diagram of a communication network system in which a mobile terminal can operate according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a first embodiment of a method for clearing operating memory according to the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a method for clearing operating memory according to the present invention;
FIG. 5 is a first diagram illustrating a first scenario of a method for clearing a running memory according to an embodiment of the present invention;
FIG. 6 is a second diagram illustrating an embodiment of a method for clearing operating memory according to the present invention;
FIG. 7 is a third schematic diagram illustrating an embodiment of a method for clearing operating memory according to the present invention;
FIG. 8 is a schematic structural diagram illustrating an embodiment of an apparatus for clearing operating memory according to the present invention;
fig. 9 is a schematic structural diagram of an embodiment of an apparatus for clearing operating memory according to the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
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 terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal 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, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention, where 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 architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
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 the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
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 touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined 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 the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a communication Network system capable of being operated by a mobile terminal 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 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 Rules Function) 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 mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Example one
If the terminal for cleaning the running memory described in the embodiment of the present invention has an operating system, the operating system may be at least one operating system of UNIX, Linux, Windows, Mac OS X, Android (Android), Windows Phone, and the like.
Application software (APP) is a third-party Application program of the intelligent terminal, and a user can work, entertain, acquire information and the like through various Application software, and the formats of the APP include ipa, pxl, deb, apk and the like.
Fig. 3 is a flowchart of a first embodiment of a method for clearing an operating memory according to the present invention, and as shown in fig. 3, the method for clearing an operating memory according to the present invention can be applied to a terminal (hereinafter referred to as a terminal) for clearing an operating memory, and the method includes the following steps:
step 301, obtaining a background duration of the application running in the background and an occupancy rate of the running memory occupied.
The method comprises the steps that a terminal obtains background duration of an application running in a background and the occupancy rate of an operating memory occupied by the application running in the background; the background duration of the application running in the background is the duration of the application running in the background detected in a time period lasting until the current moment after the operating system of the terminal is started.
For example, the background duration of the application running in the background acquired by the terminal is 60000 seconds, and the occupancy rate of the running memory occupied by the application running in the background is 10%.
Step 302, judging whether the background time length exceeds a preset background time length and whether the occupancy rate exceeds a preset occupancy rate.
After acquiring the background time length of the application in background operation and the occupancy rate of the occupied operation memory, the terminal judges whether the background time length exceeds the preset background time length and judges whether the occupancy rate exceeds the preset occupancy rate, and executes step 303 when the background time length does not exceed the preset background time length and/or the occupancy rate exceeds the preset occupancy rate (namely when only one of the background time length and the occupancy rate does not exceed the corresponding judgment object); when it is determined that the background duration exceeds the preset background duration and the occupancy rate exceeds the preset occupancy rate, step 304 is performed.
It should be noted that, in the embodiment of the present invention, the preset background duration and the preset occupancy rate may be set according to a user or a manufacturer of the terminal, and are set according to an actual situation, which is not limited herein.
And step 303, ending the processing task.
And the terminal finishes the current processing task and executes the current processing task according to the normal processing task flow.
And step 304, determining the application running in the background as the application to be processed.
The terminal considers that the application running in the background needs to be processed, so the application running in the background is determined as the application to be processed.
It should be noted here that the number of the to-be-processed applications determined by the terminal is not necessarily only one, but may also be two or more, and as long as the background duration and the occupancy rate of the applications running in the background meet the determination conditions described in step 302, all the applications running in the background that meet the determination conditions are determined as the to-be-processed applications.
And 305, closing the application to be processed, and releasing the running memory occupied by the application to be processed.
The terminal closes the application to be processed determined in step 304, and releases the running memory occupied by the application to be processed, thereby achieving the purpose of cleaning the running memory of the terminal.
According to the method for clearing the running memory provided by the embodiment of the invention, the background duration of the application running in the background and the occupancy rate of the running memory are acquired; judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate; when the background time length is determined to exceed the preset background time length and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed; closing the application to be processed and releasing the running memory occupied by the application to be processed; the comparison of the background duration and the occupancy rate is added for the application running in the background, and the background application exceeding the preset background duration and the preset occupancy rate is determined as the application needing to be processed, so that the background application which a user does not want to close can be prevented from being closed, the accuracy and the intelligence of cleaning the running memory are improved, and the user experience can be effectively improved.
To further illustrate the object of the present invention, the above embodiments are further illustrated.
Example two
Fig. 4 is a flowchart of a second embodiment of the method for clearing an operating memory according to the present invention, and as shown in fig. 4, the method for clearing an operating memory according to the embodiment of the present invention is applied to a smart phone, and the method may include the following steps:
step 401, setting a white list of applications running in the background.
The smart phone provides a white list of applications running in the background for a user, the user cleans the applications running in the background in the white list of the applications running in the background according to actual needs, and the applications running in the background do not need to be cleaned, and finally the smart phone generates a white list of the applications running in the background, and the applications in the white list of the applications running in the background are not influenced by cleaning; by setting the white list, the application in the white list cannot be cleaned, and the accuracy of cleaning the running memory can be further improved.
Step 402, judging whether the application running in the background is the application in the white list of the application running in the background.
The smart phone judges whether the application running in the background is an application in a white list of the application running in the background, and executes step 403 when the application running in the background is determined to be an application in the white list of the application running in the background; upon determining that the background-running application is not an application in the whitelist of background-running applications, step 404 is performed.
And step 403, ending the processing task.
And the smart phone finishes the current processing task and executes the current processing task according to the normal processing task flow.
And step 404, acquiring the background duration of the application running in the background and the occupancy rate of the running memory.
The smart phone acquires the background duration of the application running in the background and the occupancy rate of the running memory occupied by the application running in the background; the background duration of the application running in the background is the duration of the application running in the background detected in a time period lasting until the current moment after the operating system of the smart phone is started.
Step 405, judging whether the background time length exceeds a preset background time length and judging whether the occupancy rate exceeds a preset occupancy rate.
After acquiring the background time length applied to background operation and the occupancy rate of the occupied operation memory, the smart phone judges whether the background time length exceeds a preset background time length and judges whether the occupancy rate exceeds a preset occupancy rate, and executes step 406 when determining that the background time length does not exceed the preset background time length and/or the occupancy rate exceeds the preset occupancy rate (namely, only one of the background time length and the occupancy rate does not exceed a corresponding judgment object); and when the background time length is determined to exceed the preset background time length and the occupancy rate exceeds the preset occupancy rate, executing step 407.
It should be noted that, in the embodiment of the present invention, the preset background duration and the preset occupancy rate may be set according to a user or a manufacturer of the terminal, and are set according to an actual situation, which is not limited herein.
Step 406, ending the processing task.
And the smart phone finishes the current processing task and executes the current processing task according to the normal processing task flow.
And 407, acquiring the starting times of the application running in the background.
The smart phone obtains the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current time.
And step 408, processing the occupancy rate of the running memory occupied by the application running in the background and the starting frequency of the application running in the background to obtain a processed result.
The smart phone performs normalization processing aiming at the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background, and the specific processing mode is as follows:
firstly, the smart phone processes the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalized occupancy rate, processes the starting times of the application running in the background by utilizing the normalization mode, and obtains the normalized starting times by taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1.
Secondly, the smart phone distributes a first weight coefficient for the normalized occupancy rate and a second weight coefficient for the normalized starting times, the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both larger than 0 and smaller than 1; it should be noted that, the specific first weight coefficient and the specific second weight coefficient may be set according to the actual requirement of the user, for example, if the occupancy rate of the operating memory of the user is more important, the first weight coefficient may be set to be larger than the second weight coefficient, and if the occupancy rate of the operating memory of the user is more important, the second weight coefficient may be set to be larger than the first weight coefficient.
And finally, the smart phone calculates to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and a first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and a second weight coefficient.
In the embodiment of the present invention, the normalization method includes, but is not limited to: a logarithmic function normalization method, an exponential normalization method, a trigonometric or inverse trigonometric function normalization method, or the like.
And step 409, judging whether the processed result meets a preset condition.
After obtaining the comprehensive weight value of the application running in the background, the smart phone may determine whether the comprehensive weight value of the application running in the background meets a preset condition, where the preset condition includes but is not limited to: the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value; the preset integrated weight value can be set according to the actual requirements of the user, and is not limited herein.
When it is determined that the processed result does not satisfy the preset condition, performing step 410; when it is determined that the processed result satisfies the preset condition, step 411 is performed.
By increasing judgment and comparison of comprehensive weighted values of applications running in the background, the comparison dimensionality is increased, the accuracy of cleaning running memories can be further improved, and the possibility of misoperation is reduced.
And step 410, ending the processing task.
And the smart phone finishes the current processing task and executes the current processing task according to the normal processing task flow.
And 411, determining the application running in the background as the application to be processed.
The smart phone considers that the application running in the background needs to be processed, so that the application running in the background is determined as the application to be processed.
It should be noted here that the smart phone determines that the to-be-processed application is not necessarily only one, but may also be two or more, and in the case of two or more, the implementation principle is the same as that in the case of one, and therefore, the details are not described here.
And step 412, closing the application to be processed, and releasing the running memory occupied by the application to be processed.
The smart phone closes the application to be processed determined in step 411, and releases the running memory occupied by the application to be processed, thereby achieving the purpose of cleaning the running memory of the smart phone.
According to the method for clearing the running memory, the white list of the application running in the background is set; judging whether the application running in the background is the application in a white list of the application running in the background; when the background running application is determined not to be the application in the white list of the background running application, acquiring the background duration of the background running application and the occupancy rate of the running memory; judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate; when it is determined that the background duration exceeds the preset background duration and the occupancy rate exceeds the preset occupancy rate, acquiring the starting times of the application running in the background; processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result; judging whether the processed result meets a preset condition or not; when the processed result meets the preset condition, determining the application running in the background as the application to be processed; closing the application to be processed and releasing the running memory occupied by the application to be processed; the comparison of the background duration and the occupancy rate is added for the application running in the background, the starting times of the background application exceeding the preset background duration and the preset occupancy rate are processed, the processed result is obtained, and when the processed result meets the preset condition, the application running in the background is determined to be the application needing to be processed, so that the background application which a user does not want to close can be prevented from being closed, the accuracy and the intelligence of cleaning the running memory are improved, and the user experience can be effectively improved.
To further embody the purpose of the present invention, a scenario embodiment is further illustrated on the basis of the second embodiment.
Fig. 5 is a first schematic diagram of a scenario of a method for clearing running memory according to an embodiment of the present invention, and as shown in fig. 5, in a background of a smart phone, 4 applications run in the background, which are application a, application B, application C, and application D, respectively.
The white list of the background running application set by the user contains an application D, and does not contain an application A, an application B and an application C, so that the application D is removed when the running memory is cleared by the smart phone, and only the application A, the application B and the application C are processed.
Fig. 6 is a schematic view of a second scenario of the method for clearing an operating memory according to the present invention, and as shown in fig. 6, a smart phone obtains respective corresponding background durations and occupancy rates of the operating memory for an application a, an application B, and an application C, where the obtained contents are respectively: the background time of the application A is 5000 seconds, the occupancy rate of the occupied running memory is 12%, the background time of the application B is 7000 seconds, the occupancy rate of the occupied running memory is 18%, the background time of the application C is 8000 seconds, and the occupancy rate of the occupied running memory is 20%.
The preset background duration is 4000 seconds, the preset occupancy rate is 8%, and it is seen that the background durations and the occupancy rates of the application a, the application B and the application C all exceed the preset background duration and the preset occupancy rate, so that the smart phone continues to perform subsequent processing on the application a, the application B and the application C.
Fig. 7 is a third schematic view of a scenario of the method for clearing the operating memory according to the present invention, where as shown in fig. 7, the smart phone continues to obtain the start times of the application a, the application B, and the application C, the obtained start time of the application a is 5 times, the obtained start time of the application B is 15 times, and the obtained start time of the application C is 30 times.
Firstly, the smart phone normalizes the occupancy rates of an application A, an application B and an application C to obtain the corresponding normalized occupancy rates; specifically, the occupancy of each application is divided by the sum of the occupancy of application a, application B, and application C, and for application a: 12%/(12% + 18% + 20%) + 0.24, for application B: 18%/(12% + 18% + 20%) -0.36, for application C: 20%/(12% + 18% + 20%) -0.4; meanwhile, the smart phone performs normalization processing on the starting times of the application A, the application B and the application C to obtain respective corresponding normalized starting times; specifically, the starting times of the respective applications are divided by the sum of the starting times of the application a, the application B and the application C, and then the absolute value of the difference from 1 is taken, and for the application a: | 1- (5/(5+15+30) | 0.9, | 1- (15/(5+15+30) | 0.7 for application B, and | 1- (30/(5+15+30) | 0.4 for application C.
Secondly, the smart phone assigns a first weight coefficient of 0.6 to the normalized occupancy rates of the application a, the application B and the application C, and assigns a second weight coefficient of 0.4 to the normalized starting times of the application a, the application B and the application C.
Then, the smart phone calculates and obtains a neutralization weight value corresponding to each of the application A, the application B and the application C, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and a first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and a second weight coefficient; specifically, the comprehensive weight value for application a is: (0.24 × 0.6) + (0.9 × 0.4) ═ 0.504, the combined weight for application B is: (0.36 × 0.6) + (0.7 × 0.4) ═ 0.496, the combined weight for application C is: (0.4 × 0.6) + (0.4 × 0.4) ═ 0.4.
And finally, presetting the comprehensive weight value to be 0.45, determining the application A and the application B with the comprehensive weight value larger than 0.45 as the applications to be processed by the smart phone, closing the applications to be processed and releasing the running memory occupied by the applications to be processed.
EXAMPLE III
Fig. 8 is a schematic structural diagram of an apparatus for clearing an operating memory according to an embodiment of the present invention, and as shown in fig. 8, an apparatus 08 for clearing an operating memory according to an embodiment of the present invention includes:
an obtaining module 81, configured to obtain a background duration of an application running in a background and an occupancy rate of an occupied running memory;
the judging module 82 is configured to judge whether the background duration exceeds a preset background duration and judge whether the occupancy rate exceeds a preset occupancy rate;
a determining module 83, configured to determine, when the determining module 82 determines that the background duration exceeds the preset background duration and the occupancy rate exceeds the preset occupancy rate, that the application running in the background is the application to be processed;
and the processing module 84 is configured to close the to-be-processed application and release the running memory occupied by the to-be-processed application.
Further, the determining module 83 is specifically configured to obtain the starting times of the application running in the background, where the starting times are starting times from the start of the operating system to the current time;
the determining module 83 is further specifically configured to process the occupancy rate of the running memory occupied by the application running in the background and the starting frequency of the application running in the background, so as to obtain a processed result;
the determining module 83 is further specifically configured to determine whether the processed result meets a preset condition;
the determining module 83 is further specifically configured to determine that the application running in the background is the application to be processed when it is determined that the processed result meets a preset condition.
Further, the determining module 83 is further specifically configured to utilize a normalization manner to process an occupancy rate of the running memory occupied by the application running in the background, so as to obtain a normalized occupancy rate, utilize a normalization manner to process the starting times of the application running in the background, and obtain an absolute value of a difference between the starting times processed by the normalization manner and 1, so as to obtain a normalized starting time;
the determining module 83 is further specifically configured to assign a first weight coefficient to the normalized occupancy rate, and assign a second weight coefficient to the normalized starting times, where a sum of the first weight coefficient and the second weight coefficient is 1, and both the first weight coefficient and the second weight coefficient are greater than 0 and smaller than 1;
the determining module 83 is further specifically configured to calculate a comprehensive weight value of the application running in the background, where the comprehensive weight value is a sum of a weight value of the normalized occupancy rate and a weight value of the normalized start-up frequency, the weight value of the normalized occupancy rate is a product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized start-up frequency is a product of the normalized start-up frequency and the second weight coefficient.
Further, the preset conditions include: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
Further, the normalization method includes: a logarithmic function normalization mode, an exponential normalization mode, a trigonometric or inverse trigonometric function normalization mode.
The apparatus of this embodiment may be configured to implement the technical solutions of the above-described method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Example four
Fig. 9 is a schematic structural diagram of an embodiment of the apparatus for clearing an operating memory according to the present invention, and as shown in fig. 9, the apparatus 09 for clearing an operating memory according to the embodiment of the present invention includes: an interface 91, a processor 92, a memory 93, and a communication bus 94;
wherein, the communication bus 94 is used for realizing the connection communication among the interface 91, the processor 92 and the memory 93;
the processor 92 is configured to execute the program for cleaning the running memory stored in the storage 93, so as to implement the following steps:
acquiring background duration of the application running in the background and occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
and closing the application to be processed and releasing the running memory occupied by the application to be processed.
Further, the processor 92 is configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
and when the processed result meets a preset condition, determining the application running in the background as the application to be processed.
Further, the processor 92 is configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
distributing a first weight coefficient to the normalized occupancy rate, distributing a second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both larger than 0 and smaller than 1;
and calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient.
Further, the preset conditions include: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
Further, the normalization method includes: a logarithmic function normalization mode, an exponential normalization mode, a trigonometric or inverse trigonometric function normalization mode.
As shown in fig. 9, the device 09 for cleaning up the operating memory may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, or the like; it will be appreciated that the communication bus 94 includes a power bus, a control bus, and a status signal bus in addition to a data bus, but for clarity of illustration, the various buses are labeled as communication bus 94 in fig. 9.
The interface 91 may include a display, a keyboard, a mouse, a track ball, a click wheel, a key, a button, a touch pad, a touch screen, or the like.
It will be appreciated that the memory 93 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory; among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage; volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Synchronous Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous link Dynamic Random Access Memory (DRAM, Synchronous Dynamic Random Access Memory), Direct Memory (DRmb Random Access Memory); the memory 93 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The storage 93 in the embodiment of the present invention is used to store various types of data to support the operation of the device 09 that cleans the running memory; examples of such data include: any computer program for operating on the device 09 for clearing running memory, such as operating systems and application programs, contact data, phonebook data, messages, pictures, videos, etc.; the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks; the application programs may include various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services; the program for implementing the method of the embodiment of the present invention may be included in the application program.
The method disclosed by the above embodiment of the present invention may be applied to the processor 92, or implemented by the processor 92; the processor 92 may be an integrated circuit chip having signal processing capabilities; in implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 92; the Processor 92 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.; processor 92 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention; a general purpose processor may be a microprocessor or any conventional processor or the like; the steps of the method disclosed by the embodiment of the invention can be directly embodied as the execution of a hardware decoding processor, or the combination of hardware and software modules in the decoding processor; the software modules may be located in a storage medium located in memory 93, and processor 92 reads the information in memory 93 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the Device for clearing running memory 09 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
The device of this embodiment may be configured to implement the technical solutions of the above-described method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
EXAMPLE five
The invention also provides a computer readable storage medium, which can be a Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk or CD-ROM; or various devices including one or any combination of the above memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.; the computer readable storage medium stores one or more programs, which are executable by one or more processors, to implement the steps of:
acquiring background duration of the application running in the background and occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
and closing the application to be processed and releasing the running memory occupied by the application to be processed.
Further, the one or more programs are executable by the one or more processors to implement the steps of:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
and when the processed result meets a preset condition, determining the application running in the background as the application to be processed.
Further, the one or more programs are executable by the one or more processors to implement the steps of:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
distributing a first weight coefficient to the normalized occupancy rate, distributing a second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both larger than 0 and smaller than 1;
and calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient.
Further, the preset conditions include: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
Further, the normalization method includes: a logarithmic function normalization mode, an exponential normalization mode, a trigonometric or inverse trigonometric function normalization mode.
The computer-readable storage medium of this embodiment may be used to implement the technical solutions of the above-mentioned method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
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 solutions 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 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 (5)

1. A method of clearing operating memory, the method comprising:
setting a white list of the application running in the background, and judging whether the application running in the background is the application in the white list of the application running in the background;
when the background running application is determined not to be the application in the white list of the background running application, acquiring the background duration of the background running application and the occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
closing the application to be processed and releasing the running memory occupied by the application to be processed;
wherein the determining that the application running in the background is the application to be processed includes:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
when the processed result meets a preset condition, determining the application running in the background as the application to be processed;
wherein, the processing the occupancy rate of the application running in the background occupying the running memory and the starting frequency of the application running in the background to obtain the processed result comprises:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
acquiring a first weight coefficient and a second weight coefficient set by a user, distributing the first weight coefficient to the normalized occupancy rate, distributing the second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both more than 0 and less than 1;
calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient;
the normalization mode is one of a logarithmic function normalization mode, an exponential function normalization mode and a trigonometric or inverse trigonometric function normalization mode, and when the importance of the user on the occupancy rate of the running memory is greater than the starting times, the first weight coefficient is greater than the second weight coefficient.
2. The method according to claim 1, wherein the preset condition comprises: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
3. An apparatus for clearing operating memory, the apparatus comprising: an interface, a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication among the interface, the processor and the memory;
the processor is configured to execute the program for cleaning the running memory stored in the storage, so as to implement the following steps:
setting a white list of the application running in the background, and judging whether the application running in the background is the application in the white list of the application running in the background; when the background running application is determined not to be the application in the white list of the background running application, acquiring the background duration of the background running application and the occupancy rate of the running memory;
judging whether the background time exceeds a preset background time and judging whether the occupancy rate exceeds a preset occupancy rate;
when the background duration is determined to exceed the preset background duration and the occupancy rate exceeds the preset occupancy rate, determining the application running in the background as the application to be processed;
closing the application to be processed and releasing the running memory occupied by the application to be processed;
the processor is further configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
acquiring the starting times of the application running in the background, wherein the starting times are the starting times from the starting of the operating system to the current moment;
processing the occupancy rate of the application running in the background for occupying the running memory and the starting times of the application running in the background to obtain a processed result;
judging whether the processed result meets a preset condition or not;
when the processed result meets a preset condition, determining the application running in the background as the application to be processed;
the processor is further configured to execute the program for cleaning the running memory, so as to specifically implement the following steps:
processing the occupancy rate of the application running in the background occupying the running memory by utilizing a normalization mode to obtain the normalization occupancy rate, processing the starting times of the application running in the background by utilizing the normalization mode, and taking the absolute value of the difference value between the starting times processed by utilizing the normalization mode and 1 to obtain the normalization starting times;
acquiring a first weight coefficient and a second weight coefficient set by a user, distributing the first weight coefficient to the normalized occupancy rate, distributing the second weight coefficient to the normalized starting times, wherein the sum of the first weight coefficient and the second weight coefficient is 1, and the first weight coefficient and the second weight coefficient are both more than 0 and less than 1;
calculating to obtain a comprehensive weight value of the application running in the background, wherein the comprehensive weight value is the sum of the weight value of the normalized occupancy rate and the weight value of the normalized starting times, the weight value of the normalized occupancy rate is the product of the normalized occupancy rate and the first weight coefficient, and the weight value of the normalized starting times is the product of the normalized starting times and the second weight coefficient;
the normalization mode is one of a logarithmic function normalization mode, an exponential function normalization mode and a trigonometric or inverse trigonometric function normalization mode, and when the importance of the user on the occupancy rate of the running memory is greater than the starting times, the first weight coefficient is greater than the second weight coefficient.
4. The apparatus of claim 3, wherein the preset conditions comprise: and the comprehensive weight value of the application running in the background is greater than the condition of the preset comprehensive weight value.
5. 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 method for clearing operating memory as claimed in any one of claims 1 and 2.
CN201711227554.5A 2017-11-29 2017-11-29 Method and device for cleaning running memory and computer storage medium Active CN107807857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711227554.5A CN107807857B (en) 2017-11-29 2017-11-29 Method and device for cleaning running memory and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711227554.5A CN107807857B (en) 2017-11-29 2017-11-29 Method and device for cleaning running memory and computer storage medium

Publications (2)

Publication Number Publication Date
CN107807857A CN107807857A (en) 2018-03-16
CN107807857B true CN107807857B (en) 2021-05-21

Family

ID=61589475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711227554.5A Active CN107807857B (en) 2017-11-29 2017-11-29 Method and device for cleaning running memory and computer storage medium

Country Status (1)

Country Link
CN (1) CN107807857B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108717376A (en) * 2018-03-23 2018-10-30 河源市美晨智能研究院 Management method, electronic equipment and the device with store function of background application
CN108549563A (en) * 2018-03-29 2018-09-18 努比亚技术有限公司 A kind of application deployment method, terminal and computer readable storage medium
CN109117384A (en) * 2018-07-05 2019-01-01 麒麟合盛网络技术股份有限公司 A kind of reminding method and device of memory cleaning
CN111050385A (en) * 2018-10-15 2020-04-21 中兴通讯股份有限公司 Application cleaning method, device, equipment and readable storage medium
CN109388947B (en) * 2018-10-30 2023-06-20 浙江解纷链数字科技有限公司 Background management method, device and computer readable storage medium
CN109947503A (en) * 2019-03-27 2019-06-28 重庆传音通讯技术有限公司 Application control method, device, terminal and computer readable storage medium
CN111988778B (en) * 2019-05-21 2023-09-26 广东美的制冷设备有限公司 Device, multi-protocol authentication method of WIFI module and computer readable storage medium
CN110716437A (en) * 2019-10-10 2020-01-21 中国联合网络通信集团有限公司 Smart home use method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092700A (en) * 2013-02-01 2013-05-08 华为终端有限公司 Internal memory cleaning method and cleaning device and terminal device
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN105701025A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Memory recovery method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103220427A (en) * 2013-04-16 2013-07-24 广东欧珀移动通信有限公司 Mobile phone background program cleaning method and mobile phone

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092700A (en) * 2013-02-01 2013-05-08 华为终端有限公司 Internal memory cleaning method and cleaning device and terminal device
CN103324500A (en) * 2013-05-06 2013-09-25 广州市动景计算机科技有限公司 Method and device for recycling internal memory
CN105701025A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Memory recovery method and device

Also Published As

Publication number Publication date
CN107807857A (en) 2018-03-16

Similar Documents

Publication Publication Date Title
CN107807857B (en) Method and device for cleaning running memory and computer storage medium
CN109040441B (en) Application body-separating display method, mobile terminal and computer readable storage medium
CN110035176B (en) Brightness adjusting method of mobile terminal, mobile terminal and storage medium
CN107635070B (en) Message reminding method, terminal and storage medium
CN107463243B (en) Screen control method, mobile terminal and computer readable storage medium
CN108833690B (en) Authority control method, terminal and computer readable storage medium
CN107563158B (en) Method, device and computer readable storage medium for displaying hidden application icon
CN110187808B (en) Dynamic wallpaper setting method and device and computer-readable storage medium
CN108121681B (en) Hot plug implementation method, terminal and storage medium
CN108563388B (en) Screen operation method, mobile terminal and computer-readable storage medium
CN108322602B (en) Method, terminal and computer readable storage medium for processing application no response
CN110381202B (en) Display adjustment method, mobile terminal and computer-readable storage medium
CN109309762B (en) Message processing method, device, mobile terminal and storage medium
CN107453984B (en) Method, apparatus and computer-readable storage medium for replying to a message
CN107239208B (en) Method, apparatus, and computer-readable storage medium for processing screenshot
CN107194217B (en) User data access control method, apparatus and computer-readable storage medium
CN112712815A (en) Software-based pop sound suppression method, terminal and computer readable medium
CN110187934B (en) Application control method, terminal and computer readable storage medium
CN110099173B (en) Touch experience mode switching method, terminal and storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN108108054B (en) Method, apparatus and computer-readable storage medium for predicting user sliding operation
CN109151201B (en) Anti-addiction method, mobile terminal and computer storage medium
CN109062688B (en) Memory allocation method, server and mobile terminal
CN107743204B (en) Exposure processing method, terminal, and computer-readable storage medium
CN107894958B (en) Junk information cleaning method, terminal, server 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
GR01 Patent grant
GR01 Patent grant