WO2017185569A1 - 内存清理方法及装置、电子设备 - Google Patents

内存清理方法及装置、电子设备 Download PDF

Info

Publication number
WO2017185569A1
WO2017185569A1 PCT/CN2016/095983 CN2016095983W WO2017185569A1 WO 2017185569 A1 WO2017185569 A1 WO 2017185569A1 CN 2016095983 W CN2016095983 W CN 2016095983W WO 2017185569 A1 WO2017185569 A1 WO 2017185569A1
Authority
WO
WIPO (PCT)
Prior art keywords
determining
memory
level
application
preset
Prior art date
Application number
PCT/CN2016/095983
Other languages
English (en)
French (fr)
Inventor
张晓亮
闫昊
刘任
Original Assignee
北京小米移动软件有限公司
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 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Publication of WO2017185569A1 publication Critical patent/WO2017185569A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/30Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/805Real-time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/81Threshold

Definitions

  • the embodiments of the present disclosure relate to the field of terminal technologies, and in particular, to a memory cleaning method and device, and an electronic device.
  • the embodiments of the present disclosure provide a memory cleaning method and device, and an electronic device, to make the operation of the electronic device smoother.
  • a memory cleaning method including:
  • the application running in the memory is cleaned according to the cleaning mode.
  • the determining the preset level corresponding to the detected stuck state may include:
  • the determining a cleaning mode corresponding to the preset level may include:
  • the cleaning the application running in the memory according to the cleaning mode may include:
  • the operating states of the respective corresponding applications in the memory are controlled according to the processing manner.
  • the processing mode is to close or stop running the application, and the respective corresponding application is controlled in the memory according to the processing manner.
  • the operating status in the process can include:
  • the application that needs to be shut down or stopped running currently occupies more memory than the pre- When the memory threshold is set, the application that needs to be shut down or stopped is controlled to be shut down or stopped.
  • the method may further include:
  • the whitelist is obtained from the server, and the whitelist is used to record a preset memory threshold corresponding to a plurality of applications that have been counted under different memory capacities.
  • a memory cleaning apparatus including:
  • a first determining module configured to determine a preset level corresponding to the detected stuck state
  • a second determining module configured to determine a cleaning mode corresponding to the preset level determined by the first determining module
  • the cleaning module is configured to clean the application running in the memory according to the cleaning mode determined by the second determining module.
  • the first determining module may include:
  • the first determining submodule is configured to: when it is detected that the electronic device first jams, determine that the preset level corresponding to the detected stuck state is the first level;
  • a statistic sub-module configured to count the number of times the electronic device has a stuck state during a set time period corresponding to a time point when the first jam occurs
  • a second determining sub-module configured to determine whether the number of times counted by the statistical sub-module is greater than or equal to a preset number of times threshold corresponding to the second level
  • a third determining sub-module configured to: when the second determining sub-module determines that the number of times is greater than or equal to the preset number of times threshold, determining that the preset level corresponding to the detected stuck state is the second level .
  • the second determining module may include:
  • a fourth determining submodule configured to determine a first cleanup mode corresponding to the first level when the stuck state corresponds to the first level determined by the first determining submodule
  • a fifth determining submodule configured to correspond to the third determining submodule when the stuck state When the second level is determined, a second cleanup mode corresponding to the second level is determined.
  • the cleaning module may include:
  • a sixth determining submodule configured to determine a program type corresponding to each of the plurality of applications running in the memory
  • a seventh determining sub-module configured to determine, according to the respective corresponding program types determined by the sixth determining sub-module, a processing manner corresponding to each of the multiple applications in the cleaning mode
  • the first control submodule is configured to control an operating state of the corresponding application in the memory according to the processing manner determined by the seventh determining submodule.
  • the processing mode is to close or stop running the application
  • the first control submodule may include:
  • An eighth determining submodule configured to determine, from the whitelist, a preset memory threshold that allows an application that needs to be shut down or stops running to allow memory to be occupied under the memory capacity of the electronic device;
  • a second control submodule configured to control the need to shut down or stop running when the eighth determining submodule determines that the memory currently occupied by the application that needs to be shut down or stops running is greater than the preset memory threshold The application closes or stops running.
  • the apparatus may further include:
  • the obtaining module is configured to obtain the whitelist from the server, where the whitelist is used to record a preset memory threshold corresponding to a plurality of applications that have been counted under different memory capacities.
  • an electronic device including:
  • a memory configured to store processor executable instructions
  • processor is configured to:
  • the application running in the memory is cleaned according to the cleaning mode.
  • the application running in the memory is cleaned according to the cleaning mode, and when the electronic device starts more applications, the degree of the state may be determined according to the state of the stuck state.
  • the unnecessary application is cleaned up in the case of no user perception, so that the operation of the electronic device is smoother and the user experience is improved.
  • FIG. 1 is a flowchart of a memory cleaning method according to an exemplary embodiment
  • FIG. 2 is a flowchart of a memory cleaning method according to an exemplary embodiment
  • FIG. 3A is a flowchart of a memory cleaning method according to an exemplary embodiment
  • FIG. 3B is a flowchart of cleaning an application recorded in a whitelist with a program type according to an exemplary embodiment
  • FIG. 4 is a block diagram of a memory cleaning device according to an exemplary embodiment
  • FIG. 5 is a block diagram of another memory cleaning device according to an exemplary embodiment
  • FIG. 6 is a block diagram of still another memory cleaning device according to an exemplary embodiment
  • FIG. 7 is a block diagram of a memory cleaning device, according to an exemplary embodiment.
  • FIG. 1 is a flowchart of a memory cleaning method according to an exemplary embodiment; the memory cleaning method can be applied to an electronic device (eg, a smart phone, a tablet), as shown in FIG. 1 , the memory cleaning method includes the following Steps S101-S103:
  • step S101 a preset level corresponding to the detected stuck state is determined.
  • step S102 a cleaning mode corresponding to the preset level is determined.
  • step S103 the application running in the memory is cleaned according to the cleanup mode.
  • a preset level may be set according to the number of times the electronic device is stuck, for example, when a jam occurs, the corresponding preset level is The first level, in the set time period after the first occurrence of the card, if there is another more than three times of the last, the corresponding preset level is the second level, if there are more than three times, the corresponding The preset level is the third level.
  • the cleaning mode corresponds to the preset level, and according to different levels corresponding to the stuck state, different cleaning modes may be corresponding, for example, if the preset level is the first level, the cleaning mode is The cleaning mode may be the second cleaning mode. If the preset level is the second level, the cleaning mode may be the second cleaning mode. If the preset level is the third level, the cleaning mode may be the third cleaning mode.
  • step S103 for example, in the first cleaning mode, the foreground application in the electronic device or the application whose startup time is within a set period of time (for example, within 10 seconds of startup) may not be cleaned up, and the cleaning is recorded in the The cache of the application in the whitelist, controlling the application provided by the third party to stop running, cleaning up the cache of other applications; in the second cleanup mode, the foreground application in the electronic device or the startup time is within a set time period The application (for example, within 10 seconds of startup) does not clean up, cleans up the cache of the application recorded in the whitelist, and closes itself.
  • a set period of time for example, within 10 seconds of startup
  • the launched application controls the application provided by the third party to stop running and cleans up the cache of other applications; in the third cleanup mode, the foreground application in the electronic device or the startup time can be set within a set period of time (for example, starting The application does not clean up within 10 seconds, cleans up the cache of the application recorded in the whitelist, closes the self-starting application, controls the application provided by the third party to stop running, and closes other applications.
  • the cleaning mode corresponding to the preset level corresponding to the stuck state is determined, and the application running in the memory is cleaned according to the cleaning mode.
  • the The degree of the state of the card is selected to correspond to the cleaning mode, and the unnecessary application is cleaned in the case where the user does not perceive, so that the operation of the electronic device is smoother and the user experience is improved.
  • determining the preset level corresponding to the detected stuck state may include:
  • the preset level corresponding to the detected stuck state is the second level.
  • determining a cleaning mode corresponding to the preset level may include:
  • the second clean mode corresponding to the second level is determined.
  • cleaning the application running in the memory according to the cleanup mode may include:
  • the processing mode is to close or stop the running of the application, and the running state of the corresponding application in the memory is controlled according to the processing manner, which may include:
  • the application that needs to be shut down or stopped running currently occupies more than the preset memory threshold, the application that needs to be shut down or stopped running is shut down or stopped.
  • the method may further include:
  • the whitelist is obtained from the server, and the whitelist is configured to record the preset preset memory thresholds of the plurality of applications that have been counted under different memory capacities.
  • the above method provided by the embodiment of the present disclosure can select a corresponding cleaning mode according to the degree of the state of the stuck state, and clean unnecessary applications in a situation where the user does not perceive, so that the operation of the electronic device is smoother. To improve the user experience.
  • FIG. 2 is a flowchart of a memory cleaning method according to an exemplary embodiment of the present invention.
  • This embodiment uses the foregoing method provided by an embodiment of the present disclosure to determine how to determine a preset level and how to clean the application according to the cleaning mode. For exemplary explanation, as shown in FIG. 2A, the following steps are included:
  • step S201 when it is detected that the electronic device is jammed for the first time, it is determined that the preset level corresponding to the detected stuck state is the first level, and step S202 and step S207 may be simultaneously performed.
  • step S202 the number of times the electronic device has a stuck state is counted in the set time period corresponding to the time point when the first jam occurs, and step S203 is performed.
  • step S203 it is determined whether the number of times is greater than or equal to the preset number of times threshold corresponding to the second level.
  • step S204 is performed, and when the number of times is less than the preset number of times threshold, the state of the card is continuously detected. .
  • step S204 when the number of times is greater than or equal to the preset number of times threshold, it is determined that the preset level corresponding to the detected stuck state is the second level, and step S205 is performed.
  • step S205 when the stuck state corresponds to the second level, the second cleaning mode corresponding to the second level is determined, and step S206 is performed.
  • step S206 the application running in the memory is cleaned according to the second cleaning mode, and the process ends.
  • step S207 when the stuck state corresponds to the first level, the first clean mode corresponding to the first level is determined, and step S208 is performed.
  • step S208 the application running in the memory is cleaned according to the first cleaning mode, and the process ends.
  • the first level may indicate that the stuck state is at a lighter level.
  • the electronic device has the first card segment at 10:11, and the card state of the electronic device can be continuously detected within 20 minutes from 10:11.
  • the number of times the electronic device has a stuck state for example, the number of occurrences of the stuck state is one.
  • the preset number of times threshold may be set according to the size of the memory capacity of the electronic device. For example, if the memory capacity of the electronic device is 1 G, the corresponding preset number of times threshold is 1, the electronic device The memory capacity is 2G, the corresponding preset number threshold is 2, the memory capacity of the electronic device is 3G, and the corresponding preset number threshold is 3, and the memory capacity of the electronic device is larger, indicating that the application can be run at the same time. The greater the number.
  • steps S204-S206 when the number of times is greater than or equal to the preset number of times threshold, Determining that the preset level corresponding to the detected stuck state is the second level, indicating that the burden of running the application of the electronic device is increased.
  • the cleaning mode of the first cleaning mode is insufficient to avoid the card of the electronic device.
  • the application running in memory is cleaned according to the second cleaning mode corresponding to the second level, for example, cleaning the cache of the application recorded in the whitelist, closing the self-starting application, and controlling the third-party provided The application stops running and cleans up the cache of other applications.
  • the present embodiment classifies the degree of the stuckon state, and cleans the application running in the memory according to the cleaning mode corresponding to the different levels, so that different states can be made for different states.
  • the application gets cleaned up to varying degrees, refining the cleanup of the application hierarchy.
  • FIG. 3A is a flowchart of a memory cleaning method according to an exemplary embodiment
  • FIG. 3B is a flowchart of cleaning an application recorded in a whitelist according to a program type according to an exemplary embodiment
  • This embodiment uses the above method provided by the embodiment of the present disclosure to exemplify how to clean the application running in the memory according to the cleaning mode. As shown in FIG. 3A, the following steps are included:
  • step S301 a preset level corresponding to the detected stuck state is determined.
  • step S302 a cleaning mode corresponding to the preset level is determined.
  • step S303 a program type corresponding to each of a plurality of applications running in the memory is determined.
  • step S304 the respective processing modes of the plurality of applications in the clean mode are determined according to the respective program types.
  • step S305 the operating states of the respective corresponding applications in the memory are controlled according to the processing mode.
  • the program type may include: a foreground application or an application whose startup time is within a set time period (for example, within 10 seconds of startup), an application recorded in a white list, Third-party-provided applications, user- and system-locked applications, self-starting applications, other applications not in the above categories, and more.
  • the processing manner may include: cleaning the application's cache, closing the application, controlling the application to stop running, cleaning the application's cache, and the like.
  • a plurality of applications running in the memory are respectively an application A, an application B, an application C, and an application D, wherein the application A is an application of the foreground application, and the application B is recorded in the white list.
  • the application, the application C is an application provided by a third party, and the application D is a self-starting application.
  • the cleaning mode is the first cleaning mode
  • the application A can be cleaned, the application B cache is cleaned, and the control is cleared.
  • Application C stops running and cleans up the cache of application D.
  • the second cleanup mode application A can be cleaned, the application B's cache is cleaned, control application C stops running, and application D is closed.
  • step S305 can be performed.
  • step S311 the whitelist is obtained from the server, and the whitelist is used to record the preset memory threshold corresponding to the plurality of applications that have been counted under different memory capacities.
  • step S312 a preset memory threshold that allows the application to be shut down to allow the memory to be occupied under the memory capacity of the electronic device is determined from the white list.
  • step S313 when the memory that needs to be closed and the current memory occupied by the application is greater than the preset memory threshold, the running application is closed.
  • the whitelist can be obtained by counting the situation in which a large number of users are stuck in the process of using the electronic device, and the whitelist can record the preset content threshold of the statistically applied application when the memory capacity is different. .
  • the preset memory threshold recorded in the whitelist is 100M, and the map application can be closed when the local map application has more than 100M of memory at runtime.
  • the way to control the application recorded in the whitelist to stop running is similar to the above, and will not be described in detail here.
  • the present embodiment determines different processing modes of multiple applications in the cleaning mode by using the respective program types corresponding to the plurality of applications running in the memory, thereby making different Applications have different cleanup strategies, which can be more refined for applications of different program types, ensuring that users can use the electronic devices normally.
  • FIG. 4 is a block diagram of a memory cleaning device according to an exemplary embodiment. As shown in FIG. 4, the memory cleaning device includes:
  • the first determining module 41 is configured to determine a preset level corresponding to the detected stuck state
  • the second determining module 42 is configured to determine a cleaning mode corresponding to the preset level determined by the first determining module 41;
  • the cleaning module 43 is configured to clean the application running in the memory according to the cleaning mode determined by the second determining module 42.
  • FIG. 5 is a block diagram of another memory cleaning apparatus according to an exemplary embodiment. As shown in FIG. 5, based on the embodiment shown in FIG. 4, in an embodiment, the first determining module 41 may be include:
  • the first determining sub-module 411 is configured to: when it is detected that the electronic device first jams, determine that the preset level corresponding to the detected stuck state is the first level;
  • the statistics sub-module 412 is configured to be set at a corresponding time point when the first jam occurs In the interval, the number of times the electronic device has a stuck state;
  • the second determining sub-module 413 is configured to determine whether the number of times counted by the statistical sub-module 412 is greater than or equal to a preset number of times threshold corresponding to the second level;
  • the third determining sub-module 414 is configured to determine that the preset level corresponding to the detected stuck state is the second level when the second determining sub-module 413 determines that the number of times is greater than or equal to the preset number of times threshold.
  • the second determining module 42 can include:
  • the fourth determining submodule 421 is configured to determine, according to the first level determined by the first determining submodule 411, the first cleaning mode corresponding to the first level;
  • the fifth determining sub-module 422 is configured to determine a second cleaning mode corresponding to the second level when the stuck state corresponds to the second level determined by the third determining sub-module 414.
  • FIG. 6 is a block diagram of still another memory cleaning device according to an exemplary embodiment.
  • the cleaning module 43 Can include:
  • the sixth determining submodule 431 is configured to determine a program type corresponding to each of the plurality of applications running in the memory;
  • the seventh determining sub-module 432 is configured to determine, according to the respective program types determined by the sixth determining sub-module 431, a processing manner corresponding to each of the multiple applications in the clean-up mode;
  • the first control sub-module 433 is configured to control the running state of the respective corresponding application in the memory according to the processing manner determined by the seventh determining sub-module 432.
  • the processing mode is to close or stop running the application
  • the first control submodule 433 may include:
  • the eighth determining submodule 4331 is configured to determine, from the whitelist, a preset memory threshold that allows an application that needs to be shut down or stops running to allow the memory to be occupied under the memory capacity of the electronic device;
  • the second control submodule 4332 is configured to determine that the eighth determination submodule 4331 needs to be closed If the current memory of the stopped application is greater than the preset memory threshold, the application that needs to be shut down or stopped will be shut down or stopped.
  • the apparatus may further include:
  • the obtaining module 44 is configured to obtain a whitelist from the server, where the whitelist is configured to record a preset memory threshold corresponding to the plurality of applications that have been counted under different memory capacities, and the eighth determining submodule 4331 is obtained from the obtaining module 44.
  • the whitelist determines the default memory threshold that allows applications that need to be shut down or stopped to run in memory under the memory capacity of the electronic device.
  • FIG. 7 is a block diagram of a memory cleaning device, according to an exemplary embodiment.
  • device 700 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
  • apparatus 700 can include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor component 714, and Communication component 716.
  • Processing component 702 typically controls the overall operation of device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • Processing component 702 can include one or more processors 720 to execute instructions to perform all or part of the steps described above.
  • processing component 702 can include one or more modules to facilitate interaction between component 702 and other components.
  • processing component 702 can include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
  • Memory 704 is configured to store various types of data to support operation at device 700. Examples of such data include instructions for any application or method operating on device 700, contact data, phone book data, messages, pictures, videos, and the like. Memory 704 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access Memory (SRAM), EEPROM, EEPROM, Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Fast Flash memory, disk or disc.
  • SRAM static random access Memory
  • EEPROM Electrically erasable Read Only Memory
  • PROM Read Only Memory
  • Magnetic Memory Magnetic Memory
  • Fast Flash memory disk or disc.
  • Power component 706 provides power to various components of device 700.
  • Power component 706 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for device 700.
  • the multimedia component 708 includes a screen between the device 700 and the user that provides an output interface.
  • the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
  • the multimedia component 708 includes a front camera and/or a rear camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 710 is configured to output and/or input an audio signal.
  • audio component 710 includes a microphone (MIC) that is configured to receive an external audio signal when device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
  • the received audio signal may be further stored in memory 704 or transmitted via communication component 716.
  • the audio component 710 also includes a speaker configured to output an audio signal.
  • the I/O interface 712 provides an interface between the processing component 702 and the peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
  • Sensor assembly 714 includes one or more sensors configured to provide each of device 700 State assessment of aspects.
  • sensor assembly 714 can detect an open/closed state of device 700, relative positioning of components, such as the display and keypad of device 700, and sensor component 714 can also detect a change in position of one component of device 700 or device 700. The presence or absence of user contact with device 700, device 700 orientation or acceleration/deceleration, and temperature variation of device 700.
  • Sensor assembly 714 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor component 714 can also include a light sensor, such as a CMOS or CCD image sensor, configured for use in imaging applications.
  • the sensor component 714 can also include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 716 is configured to facilitate wired or wireless communication between device 700 and other devices.
  • the device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • communication component 716 receives broadcast signals or broadcast associated information from an external broadcast management system via a broadcast channel.
  • the communication component 716 also includes a near field communication (NFC) module to facilitate short range communication.
  • NFC near field communication
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 700 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor, or other electronic component implementation configured to perform the above methods.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor, or other electronic component implementation configured to perform the above methods.
  • non-transitory computer readable storage medium comprising instructions, such as a memory 704 comprising instructions executable by processor 720 of apparatus 700 to perform the above method.
  • the non-transitory computer readable storage medium may be a ROM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.
  • the cleaning mode corresponding to the preset level corresponding to the stuck state is determined, and the application running in the memory is cleaned according to the cleaning mode, when the electronic device starts more applications.
  • the corresponding cleaning mode can be selected according to the degree of the state of the stuckon, and the unnecessary application is cleaned in the case where the user does not perceive, so that the operation of the electronic device is smoother and the user experience is improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

一种内存清理方法及装置、电子设备。所述方法包括:确定检测到的卡顿状态对应的预设级别(S101);确定与所述预设级别相对应的清理模式(S102);根据所述清理模式对内存中运行的应用程序进行清理(S103)。

Description

内存清理方法及装置、电子设备
相关申请的交叉引用
本申请基于申请号为201610282786.X、申请日为2016年04月29日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开实施例涉及终端技术领域,尤其涉及一种内存清理方法及装置、电子设备。
背景技术
当用户使用手机的时间持续太长时,用户通常会不断的启动新的应用程序,忘记关闭需要关闭的应用程序。在用户未关闭应用程序的情形下,手机的内存会由于启动太多的应用程序表现出卡顿,给用户带来较差的使用体验。
发明内容
为克服相关技术中存在的问题,本公开实施例提供一种内存清理方法及装置、电子设备,用以使电子设备的运行更为顺畅。
根据本公开实施例的第一方面,提供一种内存清理方法,包括:
确定检测到的卡顿状态对应的预设级别;
确定与所述预设级别相对应的清理模式;
根据所述清理模式对内存中运行的应用程序进行清理。
在一实施例中,所述确定检测到的卡顿状态对应的预设级别,可包括:
当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
在出现所述第一次卡顿时对应的时间点的设定时间段内,统计所述电子设备出现卡顿状态的次数;
确定所述次数是否大于或者等于第二级别对应的预设次数阈值;
当所述次数大于或者等于所述预设次数阈值时,确定检测到的卡顿状态对应的预设级别为所述第二级别。
在一实施例中,所述确定与所述预设级别相对应的清理模式,可包括:
当所述卡顿状态对应所述第一级别时,确定与所述第一级别相对应的第一清理模式;
当所述卡顿状态对应所述第二级别时,确定与所述第二级别相对应的第二清理模式。
在一实施例中,所述根据所述清理模式对内存中运行的应用程序进行清理,可包括:
确定内存中运行的多个应用程序各自对应的程序类型;
根据所述各自对应的程序类型确定所述多个应用程序在所述清理模式下各自对应的处理方式;
根据所述处理方式控制各自对应的应用程序在所述内存中的运行状态。
在一实施例中,当所述程序类型为白名单中记录的应用程序时,所述处理方式为关闭或者停止运行应用程序,所述根据所述处理方式控制各自对应的应用程序在所述内存中的运行状态,可包括:
从所述白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
当所述需要关闭或者停止运行的应用程序当前占用的内存大于所述预 设内存阈值时,控制所述需要关闭或者停止运行的应用程序关闭或者停止运行。
在一实施例中,所述方法还可包括:
从服务器获取所述白名单,所述白名单用于记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
根据本公开实施例的第二方面,提供一种内存清理装置,包括:
第一确定模块,被配置为确定检测到的卡顿状态对应的预设级别;
第二确定模块,被配置为确定与所述第一确定模块确定的所述预设级别相对应的清理模式;
清理模块,被配置为根据所述第二确定模块确定的所述清理模式对内存中运行的应用程序进行清理。
在一实施例中,所述第一确定模块可包括:
第一确定子模块,被配置为当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
统计子模块,被配置为在出现所述第一次卡顿时对应的时间点的设定时间段内,统计所述电子设备出现卡顿状态的次数;
第二确定子模块,被配置为确定所述统计子模块统计到的所述次数是否大于或者等于第二级别对应的预设次数阈值;
第三确定子模块,被配置为当所述第二确定子模块确定所述次数大于或者等于所述预设次数阈值时,确定检测到的卡顿状态对应的预设级别为所述第二级别。
在一实施例中,所述第二确定模块可包括:
第四确定子模块,被配置为当所述卡顿状态对应所述第一确定子模块确定的所述第一级别时,确定与所述第一级别相对应的第一清理模式;
第五确定子模块,被配置为当所述卡顿状态对应所述第三确定子模块 确定的所述第二级别时,确定与所述第二级别相对应的第二清理模式。
在一实施例中,所述清理模块可包括:
第六确定子模块,被配置为确定内存中运行的多个应用程序各自对应的程序类型;
第七确定子模块,被配置为根据所述第六确定子模块确定的所述各自对应的程序类型确定所述多个应用程序在所述清理模式下各自对应的处理方式;
第一控制子模块,被配置为根据所述第七确定子模块确定的所述处理方式控制各自对应的应用程序在所述内存中的运行状态。
在一实施例中,当所述程序类型为白名单中记录的应用程序时,所述处理方式为关闭或者停止运行应用程序,所述第一控制子模块可包括:
第八确定子模块,被配置为从所述白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
第二控制子模块,被配置为当所述第八确定子模块确定所述需要关闭或者停止运行的应用程序当前占用的内存大于所述预设内存阈值时,控制所述需要关闭或者停止运行的应用程序关闭或者停止运行。
在一实施例中,所述装置还可包括:
获取模块,被配置为从服务器获取所述白名单,所述白名单用于记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
根据本公开实施例的第三方面,提供一种电子设备,包括:
处理器;
配置为存储处理器可执行指令的存储器;
其中,所述处理器被配置为:
确定检测到的卡顿状态对应的预设级别;
确定与所述预设级别相对应的清理模式;
根据所述清理模式对内存中运行的应用程序进行清理。
本公开的实施例提供的技术方案可以包括以下有益效果:
通过确定与卡顿状态对应的预设级别相对应的清理模式,根据清理模式对内存中运行的应用程序进行清理,当电子设备启动较多的应用程序的情况下,可以根据卡顿状态的程度来选择对应的清理模式,在用户无感知的情形下,将不必要的应用程序进行清理,使电子设备的运行更为顺畅,提高用户的使用体验。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
图1是根据一示例性实施例示出的内存清理方法的流程图;
图2是根据一示例性实施例一示出的内存清理方法的流程图;
图3A是根据一示例性实施例二示出的内存清理方法的流程图;
图3B是根据一示例性实施例二示出的对程序类型为白名单中记录的应用程序进行清理的流程图;
图4是根据一示例性实施例示出的一种内存清理装置的框图;
图5是根据一示例性实施例示出的另一种内存清理装置的框图;
图6是根据一示例性实施例示出的再一种内存清理装置的框图;
图7是根据一示例性实施例示出的一种适用于内存清理装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相 似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
图1是根据一示例性实施例示出的内存清理方法的流程图;该内存清理方法可以应用在电子设备(例如:智能手机、平板电脑)上,如图1所示,该内存清理方法包括以下步骤S101-S103:
在步骤S101中,确定检测到的卡顿状态对应的预设级别。
在步骤S102中,确定与预设级别相对应的清理模式。
在步骤S103中,根据清理模式对内存中运行的应用程序进行清理。
在上述步骤S101中,在一实施例中,可以为电子设备卡顿状态按照电子设备出现卡顿的次数来设定一个预设级别,例如,检测到出现一次卡顿时,对应的预设级别为第一级别,在出现第一次卡顿之后的设定时间段内,如果又出现一次以上三次以下的卡顿,对应的预设级别为第二级别,如果出现三次以上的卡顿,对应的预设级别为第三级别。
在上述步骤S102中,在一实施例中,清理模式与预设级别相对应,根据卡顿状态对应的不同级别,可对应不同的清理模式,例如,如果预设级别为第一级别,清理模式可以为第一清理模式,如果预设级别为第二级别,清理模式可以为第二清理模式,如果预设级别为第三级别,清理模式可以为第三清理模式。
在上述步骤S103中,例如,在第一清理模式下,可以对电子设备中的前台应用或者启动时间在设定时间段内(例如,启动10秒之内)的应用程序不清理,清理记录在白名单中的应用程序的缓存,控制第三方提供的应用程序停止运行,清理其它应用程序的缓存;在第二清理模式下,可以对电子设备中的前台应用或者启动时间在设定时间段内(例如,启动10秒之内)的应用程序不清理,清理记录在白名单中的应用程序的缓存,关闭自 启动的应用程序,控制第三方提供的应用程序停止运行,清理其它应用程序的缓存;在第三清理模式下,可以对电子设备中的前台应用或者启动时间在设定时间段内(例如,启动10秒之内)的应用程序不清理,清理记录在白名单中的应用程序的缓存,关闭自启动的应用程序,控制第三方提供的应用程序停止运行,关闭其它应用程序。
本实施例中,通过确定与卡顿状态对应的预设级别相对应的清理模式,根据清理模式对内存中运行的应用程序进行清理,当电子设备启动较多的应用程序的情况下,可以根据卡顿状态的程度来选择对应的清理模式,在用户无感知的情形下,将不必要的应用程序进行清理,使电子设备的运行更为顺畅,提高用户的使用体验。
在一实施例中,确定检测到的卡顿状态对应的预设级别,可包括:
当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
在出现第一次卡顿时对应的时间点的设定时间段内,统计电子设备出现卡顿状态的次数;
确定次数是否大于或者等于第二级别对应的预设次数阈值;
当次数大于或者等于预设次数阈值时,确定检测到的卡顿状态对应的预设级别为第二级别。
在一实施例中,确定与预设级别相对应的清理模式,可包括:
当卡顿状态对应第一级别时,确定与第一级别相对应的第一清理模式;
当卡顿状态对应第二级别时,确定与第二级别相对应的第二清理模式。
在一实施例中,根据清理模式对内存中运行的应用程序进行清理,可包括:
确定内存中运行的多个应用程序各自对应的程序类型;
根据各自对应的程序类型确定多个应用程序在清理模式下各自对应的 处理方式;
根据处理方式控制各自对应的应用程序在内存中的运行状态。
在一实施例中,当程序类型为白名单中记录的应用程序时,处理方式为关闭或者停止运行应用程序,根据处理方式控制各自对应的应用程序在内存中的运行状态,可包括:
从白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
当需要关闭或者停止运行的应用程序当前占用的内存大于预设内存阈值时,控制需要关闭或者停止运行的应用程序关闭或者停止运行。
在一实施例中,方法还可包括:
从服务器获取白名单,白名单配置为记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
具体如何内存清理的,请参考后续实施例。
至此,本公开实施例提供的上述方法,可以根据卡顿状态的程度来选择对应的清理模式,在用户无感知的情形下,将不必要的应用程序进行清理,使电子设备的运行更为顺畅,提高用户的使用体验。
下面以具体实施例来说明本公开实施例提供的技术方案。
图2是根据一示例性实施例一示出的内存清理方法的流程图;本实施例利用本公开实施例提供的上述方法,以如何确定预设级别以及如何根据清理模式对应用程序进行清理为例进行示例性说明,如图2A所示,包括如下步骤:
在步骤S201中,当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别,可同时执行步骤S202和步骤S207。
在步骤S202中,在出现第一次卡顿时对应的时间点的设定时间段内,统计电子设备出现卡顿状态的次数,执行步骤S203。
在步骤S203中,确定次数是否大于或者等于第二级别对应的预设次数阈值,当次数大于或者等于预设次数阈值时,执行步骤S204,当次数小于预设次数阈值时,继续检测卡顿状态。
在步骤S204中,当次数大于或者等于预设次数阈值时,确定检测到的卡顿状态对应的预设级别为第二级别,执行步骤S205。
在步骤S205中,当卡顿状态对应第二级别时,确定与第二级别相对应的第二清理模式,执行步骤S206。
在步骤S206中,根据第二清理模式对内存中运行的应用程序进行清理,流程结束。
在步骤S207中,当卡顿状态对应第一级别时,确定与第一级别相对应的第一清理模式,执行步骤S208。
在步骤S208中,根据第一清理模式对内存中运行的应用程序进行清理,流程结束。
在上述步骤S201中,在一实施例中,第一级别可以表示卡顿状态处于较轻的级别。
在上述步骤S202中,在一实施例中,例如,电子设备在10点11分出现了第一次卡段,则在10点11分开始的20分钟内,可继续检测电子设备的卡顿状态,统计电子设备出现卡顿状态的次数,例如,出现卡顿状态的次数为1次。
在上述步骤S203中,在一实施例中,预设次数阈值可以根据电子设备的内存容量的大小来设置,例如,电子设备的内存容量为1G,则对应的预设次数阈值为1,电子设备的内存容量为2G,则对应的预设次数阈值为2,电子设备的内存容量为3G,则对应的预设次数阈值为3,电子设备的内存容量越大,表示同时可以运行的应用程序的数量越大。
在上述步骤S204-步骤S206中,当次数大于或者等于预设次数阈值时, 确定检测到的卡顿状态对应的预设级别为第二级别,表示电子设备的内存运行应用程序的负担加重,在此情形下,第一清理模式的清理方式以不足以能够避免电子设备的卡顿状态,此时按照第二级别对应的第二清理模式对内存运行的应用程序进行清理,例如,清理记录在白名单中的应用程序的缓存,关闭自启动的应用程序,控制第三方提供的应用程序停止运行,清理其它应用程序的缓存。
在上述步骤S207-步骤S208中根据第一级别对应的第一清理模式对内存中运行的应用程序进行清理的描述可以参见上述图1所示实施例的描述,本实施例不再详述。
本实施例在具有上述实施例有益技术效果的基础上,通过对卡顿状态的程度进行分级,按照不同级别对应的清理模式清理内存中运行的应用程序,从而可以针对不同的卡顿状态使不同应用程序得到不同程度的清理,细化了对应用层序的清理操作。
图3A是根据一示例性实施例二示出的内存清理方法的流程图,图3B是根据一示例性实施例二示出的对程序类型为白名单中记录的应用程序进行清理的流程图;本实施例利用本公开实施例提供的上述方法,以如何根据清理模式对内存中运行的应用程序进行清理为例进行示例性说明,如图3A所示,包括如下步骤:
在步骤S301中,确定检测到的卡顿状态对应的预设级别。
在步骤S302中,确定与预设级别相对应的清理模式。
在步骤S303中,确定内存中运行的多个应用程序各自对应的程序类型。
在步骤S304中,根据各自对应的程序类型确定多个应用程序在清理模式下各自对应的处理方式。
在步骤S305中,根据处理方式控制各自对应的应用程序在内存中的运行状态。
上述步骤S301和步骤S302的描述可以参见上述图1所示实施例的描述,在此不再详述。
在上述步骤S303中,在一实施例中,程序类型可以包括:前台应用或者启动时间在设定时间段内(例如,启动10秒之内)的应用程序、记录在白名单中的应用程序、第三方提供的应用程序、用户和系统加锁的应用程序、自启动的应用程序、未在上述分类中的其它应用程序,等等。
在上述步骤S304和步骤S305中,在一实施例中,处理方式可以包括:清理应用程序的缓存、关闭应用程序、控制应用程序停止运行、清理应用程序的缓存等等。例如,内存中运行的多个应用程序分别为应用程序A、应用程序B、应用程序C、应用程序D,其中,应用程序A为前台应用的应用程序、应用程序B为记录在白名单中的应用程序、应用程序C为第三方提供的应用程序、应用程序D为自启动的应用程序,当清理模式为第一清理模式时,可以对应用程序A不清理,清理应用程序B的缓存,控制应用程序C停止运行,清理应用程序D的缓存;在第二清理模式下,可以对应用程序A不清理,清理应用程序B的缓存,控制应用程序C停止运行,关闭应用程序D。
如图3B所示,当程序类型为白名单中记录的应用程序时,处理方式为关闭或者停止运行应用程序,以关闭记录在白名单中的应用程序为例进行示例性说明,上述步骤S305可包括:
在步骤S311中,从服务器获取白名单,白名单用于记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
在步骤S312中,从白名单中确定需要关闭运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值。
在步骤S313中,当需要关闭运行的应用程序当前占用的内存大于预设内存阈值时,关闭该运行的应用程序。
在上述步骤S311中,白名单可以通过对海量用户在使用电子设备的过程中出现卡顿的情形进行统计得到,白名单可以记录统计到的应用程序在不同内存容量出现卡顿时的预设内容阈值。
例如,对于地图应用程序,记录在白名单中的预设内存阈值为100M,当地图应用程序在运行时的内存容量超过该100M时,可以关闭地图应用程序。控制记录在白名单中的应用程序停止运行的方式与上述相似,在此不再详述。
本实施例在具有上述实施例有益技术效果的基础上,通过对内存中运行的多个应用程序各自对应的程序类型确定多个应用程序在清理模式下各自对应的处理方式,从而可以使不同的应用程序具有不同的清理策略,从而可以针对不同程序类型的应用程序的清理更加精细化,确保用户能够正常使用电子设备。
图4是根据一示例性实施例示出的一种内存清理装置的框图,如图4所示,内存清理装置包括:
第一确定模块41,被配置为确定检测到的卡顿状态对应的预设级别;
第二确定模块42,被配置为确定与第一确定模块41确定的预设级别相对应的清理模式;
清理模块43,被配置为根据第二确定模块42确定的清理模式对内存中运行的应用程序进行清理。
图5是根据一示例性实施例示出的另一种内存清理装置的框图,如图5所示,在上述图4所示实施例的基础上,在一实施例中,第一确定模块41可包括:
第一确定子模块411,被配置为当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
统计子模块412,被配置为在出现第一次卡顿时对应的时间点的设定时 间段内,统计电子设备出现卡顿状态的次数;
第二确定子模块413,被配置为确定统计子模块412统计到的次数是否大于或者等于第二级别对应的预设次数阈值;
第三确定子模块414,被配置为当第二确定子模块413确定次数大于或者等于预设次数阈值时,确定检测到的卡顿状态对应的预设级别为第二级别。
在一实施例中,第二确定模块42可包括:
第四确定子模块421,被配置为当卡顿状态对应第一确定子模块411确定的第一级别时,确定与第一级别相对应的第一清理模式;
第五确定子模块422,被配置为当卡顿状态对应第三确定子模块414确定的第二级别时,确定与第二级别相对应的第二清理模式。
图6是根据一示例性实施例示出的再一种内存清理装置的框图,如图6所示,在上述图4或图5所示实施例的基础上,在一实施例中,清理模块43可包括:
第六确定子模块431,被配置为确定内存中运行的多个应用程序各自对应的程序类型;
第七确定子模块432,被配置为根据第六确定子模块431确定的各自对应的程序类型确定多个应用程序在清理模式下各自对应的处理方式;
第一控制子模块433,被配置为根据第七确定子模块432确定的处理方式控制各自对应的应用程序在内存中的运行状态。
在一实施例中,当程序类型为白名单中记录的应用程序时,处理方式为关闭或者停止运行应用程序,第一控制子模块433可包括:
第八确定子模块4331,被配置为从白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
第二控制子模块4332,被配置为当第八确定子模块4331确定需要关闭 或者停止运行的应用程序当前占用的内存大于预设内存阈值时,控制需要关闭或者停止运行的应用程序关闭或者停止运行。
在一实施例中,装置还可包括:
获取模块44,被配置为从服务器获取白名单,白名单配置为记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值,第八确定子模块4331从获取模块44获取到的白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图7是根据一示例性实施例示出的一种适用于内存清理装置的框图。例如,装置700可以是移动电话、计算机、数字广播终端、消息收发设备、游戏控制台、平板设备、医疗设备、健身设备、个人数字助理等。
参照图7,装置700可以包括以下一个或多个组件:处理组件702,存储器704,电源组件706,多媒体组件708,音频组件710,输入/输出(I/O)接口712,传感器组件714,以及通信组件716。
处理组件702通常控制装置700的整体操作,诸如与显示、电话呼叫、数据通信、相机操作和记录操作相关联的操作。处理组件702可以包括一个或多个处理器720来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件702可以包括一个或多个模块,便于处理组件702和其他组件之间的交互。例如,处理组件702可以包括多媒体模块,以方便多媒体组件708和处理组件702之间的交互。
存储器704被配置为存储各种类型的数据以支持在装置700的操作。这些数据的示例包括用于在装置700上操作的任何应用程序或方法的指令、联系人数据、电话簿数据、消息、图片、视频等。存储器704可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取 存储器(SRAM)、电可擦除可编程只读存储器(EEPROM)、可擦除可编程只读存储器(EPROM)、可编程只读存储器(PROM)、只读存储器(ROM)、磁存储器、快闪存储器、磁盘或光盘。
电源组件706为装置700的各种组件提供电力。电源组件706可以包括电源管理系统,一个或多个电源,及其他与为装置700生成、管理和分配电力相关联的组件。
多媒体组件708包括在所述装置700和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件708包括一个前置摄像头和/或后置摄像头。当装置700处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件710被配置为输出和/或输入音频信号。例如,音频组件710包括一个麦克风(MIC),当装置700处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器704或经由通信组件716发送。在一些实施例中,音频组件710还包括一个扬声器,配置为输出音频信号。
I/O接口712为处理组件702和外围接口模块之间提供接口,上述外围接口模块可以是键盘、点击轮、按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件714包括一个或多个传感器,配置为为装置700提供各个 方面的状态评估。例如,传感器组件714可以检测到装置700的打开/关闭状态,组件的相对定位,例如所述组件为装置700的显示器和小键盘,传感器组件714还可以检测装置700或装置700一个组件的位置改变,用户与装置700接触的存在或不存在,装置700方位或加速/减速和装置700的温度变化。传感器组件714可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件714还可以包括光传感器,如CMOS或CCD图像传感器,配置为在成像应用中使用。在一些实施例中,该传感器组件714还可以包括加速度传感器、陀螺仪传感器、磁传感器、压力传感器或温度传感器。
通信组件716被配置为便于装置700和其他设备之间有线或无线方式的通信。装置700可以接入基于通信标准的无线网络,如WiFi、2G或3G,或它们的组合。在一个示例性实施例中,通信组件716经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件716还包括近场通信(NFC)模块,以促进短程通信。例如,NFC模块可基于射频识别(RFID)技术、红外数据协会(IrDA)技术、超宽带(UWB)技术、蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置700可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,配置为执行上述方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器704,上述指令可由装置700的处理器720执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、CD-ROM、磁带、软盘和光数据存储设备等。
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到 本公开实施例的其它实施方案。本申请旨在涵盖本公开实施例的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开实施例的一般性原理并包括本公开实施例未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开实施例的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开实施例并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开实施例的范围仅由所附的权利要求来限制。
工业实用性
本公开实施例提供的技术方案,通过确定与卡顿状态对应的预设级别相对应的清理模式,根据清理模式对内存中运行的应用程序进行清理,当电子设备启动较多的应用程序的情况下,可以根据卡顿状态的程度来选择对应的清理模式,在用户无感知的情形下,将不必要的应用程序进行清理,使电子设备的运行更为顺畅,提高用户的使用体验。

Claims (13)

  1. 一种内存清理方法,包括:
    确定检测到的卡顿状态对应的预设级别;
    确定与所述预设级别相对应的清理模式;
    根据所述清理模式对内存中运行的应用程序进行清理。
  2. 根据权利要求1所述的方法,其中,所述确定检测到的卡顿状态对应的预设级别,包括:
    当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
    在出现所述第一次卡顿时对应的时间点的设定时间段内,统计所述电子设备出现卡顿状态的次数;
    确定所述次数是否大于或者等于第二级别对应的预设次数阈值;
    当所述次数大于或者等于所述预设次数阈值时,确定检测到的卡顿状态对应的预设级别为所述第二级别。
  3. 根据权利要求2所述的方法,其中,所述确定与所述预设级别相对应的清理模式,包括:
    当所述卡顿状态对应所述第一级别时,确定与所述第一级别相对应的第一清理模式;
    当所述卡顿状态对应所述第二级别时,确定与所述第二级别相对应的第二清理模式。
  4. 根据权利要求1所述的方法,其中,所述根据所述清理模式对内存中运行的应用程序进行清理,包括:
    确定内存中运行的多个应用程序各自对应的程序类型;
    根据所述各自对应的程序类型确定所述多个应用程序在所述清理模式下各自对应的处理方式;
    根据所述处理方式控制各自对应的应用程序在所述内存中的运行状态。
  5. 根据权利要求4所述的方法,其中,当所述程序类型为白名单中记录的应用程序时,所述处理方式为关闭或者停止运行应用程序,所述根据所述处理方式控制各自对应的应用程序在所述内存中的运行状态,包括:
    从所述白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
    当所述需要关闭或者停止运行的应用程序当前占用的内存大于所述预设内存阈值时,控制所述需要关闭或者停止运行的应用程序关闭或者停止运行。
  6. 根据权利要求5所述的方法,其中,所述方法还包括:
    从服务器获取所述白名单,所述白名单用于记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
  7. 一种内存清理装置,包括:
    第一确定模块,被配置为确定检测到的卡顿状态对应的预设级别;
    第二确定模块,被配置为确定与所述第一确定模块确定的所述预设级别相对应的清理模式;
    清理模块,被配置为根据所述第二确定模块确定的所述清理模式对内存中运行的应用程序进行清理。
  8. 根据权利要求7所述的装置,其中,所述第一确定模块包括:
    第一确定子模块,被配置为当检测到电子设备出现第一次卡顿时,确定检测到的卡顿状态对应的预设级别为第一级别;
    统计子模块,被配置为在出现所述第一次卡顿时对应的时间点的设定时间段内,统计所述电子设备出现卡顿状态的次数;
    第二确定子模块,被配置为确定所述统计子模块统计到的所述次数是否大于或者等于第二级别对应的预设次数阈值;
    第三确定子模块,被配置为当所述第二确定子模块确定所述次数大于或者等于所述预设次数阈值时,确定检测到的卡顿状态对应的预设级别为所述第二级别。
  9. 根据权利要求8所述的装置,其中,所述第二确定模块包括:
    第四确定子模块,被配置为当所述卡顿状态对应所述第一确定子模块确定的所述第一级别时,确定与所述第一级别相对应的第一清理模式;
    第五确定子模块,被配置为当所述卡顿状态对应所述第三确定子模块确定的所述第二级别时,确定与所述第二级别相对应的第二清理模式。
  10. 根据权利要求7所述的装置,其中,所述清理模块包括:
    第六确定子模块,被配置为确定内存中运行的多个应用程序各自对应的程序类型;
    第七确定子模块,被配置为根据所述第六确定子模块确定的所述各自对应的程序类型确定所述多个应用程序在所述清理模式下各自对应的处理方式;
    第一控制子模块,被配置为根据所述第七确定子模块确定的所述处理方式控制各自对应的应用程序在所述内存中的运行状态。
  11. 根据权利要求10所述的装置,其中,当所述程序类型为白名单中记录的应用程序时,所述处理方式为关闭或者停止运行应用程序,所述第一控制子模块包括:
    第八确定子模块,被配置为从所述白名单中确定需要关闭或者停止运行的应用程序在电子设备的内存容量下允许占用内存的预设内存阈值;
    第二控制子模块,被配置为当所述第八确定子模块确定所述需要关 闭或者停止运行的应用程序当前占用的内存大于所述预设内存阈值时,控制所述需要关闭或者停止运行的应用程序关闭或者停止运行。
  12. 根据权利要求11所述的装置,其中,所述装置还包括:
    获取模块,被配置为从服务器获取所述白名单,所述白名单用于记录已统计的多个应用程序在不同内存容量下对应的预设内存阈值。
  13. 一种电子设备,包括:
    处理器;
    配置为存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:
    确定检测到的卡顿状态对应的预设级别;
    确定与所述预设级别相对应的清理模式;
    根据所述清理模式对内存中运行的应用程序进行清理。
PCT/CN2016/095983 2016-04-29 2016-08-19 内存清理方法及装置、电子设备 WO2017185569A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610282786.X 2016-04-29
CN201610282786.XA CN105975301B (zh) 2016-04-29 2016-04-29 内存清理方法及装置、电子设备

Publications (1)

Publication Number Publication Date
WO2017185569A1 true WO2017185569A1 (zh) 2017-11-02

Family

ID=56994109

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095983 WO2017185569A1 (zh) 2016-04-29 2016-08-19 内存清理方法及装置、电子设备

Country Status (4)

Country Link
US (1) US10409684B2 (zh)
EP (1) EP3239846B1 (zh)
CN (1) CN105975301B (zh)
WO (1) WO2017185569A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547640A (zh) * 2016-11-23 2017-03-29 深圳市金立通信设备有限公司 一种后台清理的方法及终端
CN106559579B (zh) * 2016-11-30 2020-08-21 契科基纳(南京)科技有限公司 移动终端和cpu/gpu调度参数更新方法
CN108509350A (zh) * 2017-02-28 2018-09-07 中兴通讯股份有限公司 内存的回收方法和装置
CN107220093B (zh) * 2017-06-20 2021-01-01 北京金山安全软件有限公司 一种进程处理方法及装置
CN107391198B (zh) * 2017-07-25 2019-07-16 Oppo广东移动通信有限公司 任务调度方法和装置、计算机可读存储介质、移动终端
CN107544842B (zh) * 2017-08-25 2019-02-05 Oppo广东移动通信有限公司 应用程序处理方法和装置、计算机设备、存储介质
CN107547746B (zh) * 2017-08-31 2020-09-04 Oppo广东移动通信有限公司 资源配置方法及相关产品
CN107896273A (zh) * 2017-09-28 2018-04-10 努比亚技术有限公司 一种终端进程管理方法、终端及计算机可读存储介质
CN107678698B (zh) * 2017-10-31 2020-11-17 太仓市昊博技术服务有限公司 缓存数据清理方法、服务器、终端及计算机可读存储介质
CN108710539B (zh) * 2018-05-18 2021-03-16 珠海格力电器股份有限公司 一种信息处理方法、终端及可读存储介质
CN111813639B (zh) * 2019-04-09 2022-07-15 Oppo广东移动通信有限公司 设备运行等级的评定方法、装置、存储介质及电子设备
CN114528039A (zh) * 2021-01-08 2022-05-24 蒋耕银 一种基于大数据的后台应用清理系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984580A (zh) * 2012-11-12 2013-03-20 北京奇虎科技有限公司 内存清理方法及系统
CN104536907A (zh) * 2015-01-26 2015-04-22 联想(北京)有限公司 一种内存清理方法及电子设备
CN105242973A (zh) * 2015-11-10 2016-01-13 上海斐讯数据通信技术有限公司 一种安卓系统的内存优化方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6115703A (en) * 1998-05-11 2000-09-05 International Business Machines Corporation Two-level caching system for prepared SQL statements in a relational database management system
US7155583B2 (en) * 2004-02-25 2006-12-26 Research In Motion Limited Memory management system and method for a mobile device
US7231199B2 (en) * 2004-02-27 2007-06-12 Research In Motion Limited Data protection for applications on a mobile electronic device
US7512767B2 (en) * 2006-01-04 2009-03-31 Sony Ericsson Mobile Communications Ab Data compression method for supporting virtual memory management in a demand paging system
CN103324575B (zh) * 2012-03-23 2017-04-05 腾讯科技(深圳)有限公司 清理内存的方法和移动终端
CN103092700B (zh) * 2013-02-01 2016-09-28 华为终端有限公司 内存清理方法、装置和终端设备
CN103106093A (zh) * 2013-02-21 2013-05-15 北京奇虎科技有限公司 一种系统运行加速方法和装置
CN103677977B (zh) * 2013-12-19 2017-05-17 贝壳网际(北京)安全技术有限公司 清理移动终端中临时文件的方法、装置和移动终端
CN104199781A (zh) 2014-08-14 2014-12-10 深圳百科信息技术有限公司 一种基于共享内存的内存碎片分配方法和装置
CN104714874A (zh) * 2015-02-28 2015-06-17 深圳市中兴移动通信有限公司 一种移动终端内存智能优化的方法及移动终端
CN106293979B (zh) * 2015-06-25 2019-11-15 伊姆西公司 检测进程无响应的方法和装置
CN105094936B (zh) * 2015-09-24 2018-06-29 广东小天才科技有限公司 应用于移动终端的后台应用程序清理方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984580A (zh) * 2012-11-12 2013-03-20 北京奇虎科技有限公司 内存清理方法及系统
CN104536907A (zh) * 2015-01-26 2015-04-22 联想(北京)有限公司 一种内存清理方法及电子设备
CN105242973A (zh) * 2015-11-10 2016-01-13 上海斐讯数据通信技术有限公司 一种安卓系统的内存优化方法

Also Published As

Publication number Publication date
EP3239846A1 (en) 2017-11-01
EP3239846B1 (en) 2020-01-01
CN105975301A (zh) 2016-09-28
CN105975301B (zh) 2018-09-04
US10409684B2 (en) 2019-09-10
US20170315870A1 (en) 2017-11-02

Similar Documents

Publication Publication Date Title
WO2017185569A1 (zh) 内存清理方法及装置、电子设备
WO2017113660A1 (zh) 应用程序管理方法及装置
RU2637474C2 (ru) Способ и устройство для управления фоновым приложением и терминальным устройством
WO2017071068A1 (zh) 应用程序切换方法、装置及设备
WO2015188588A1 (zh) 应用程序的删除提示方法和装置
WO2018076323A1 (zh) 屏幕控制方法及装置
CN107943409B (zh) 触摸屏控制方法及装置
US9800666B2 (en) Method and client terminal for remote assistance
RU2667027C2 (ru) Способ и устройство категоризации видео
WO2017124773A1 (zh) 手势识别方法及装置
EP3046212B1 (en) Method and apparatus for controlling charging of terminal device
CN107943347B (zh) 触摸屏控制方法及装置
US20170060320A1 (en) Method for controlling a mobile terminal using a side touch panel
US20170055221A1 (en) Method and apparatus for starting energy saving mode
CN107193653B (zh) 带宽资源分配方法、装置及存储介质
WO2017084183A1 (zh) 信息显示方法与装置
WO2017036038A1 (zh) 视频特效处理方法、装置及终端设备
CN106919629B (zh) 在群聊中实现信息筛选的方法及装置
WO2017201891A1 (zh) 控制触控屏状态的方法及装置、电子设备
CN104202483A (zh) 移动终端的显示屏开关控制
EP3015983A1 (en) Method and device for optimizing memory
CN106547462B (zh) 拍照控制方法、装置及移动终端
WO2017101397A1 (zh) 一种信息显示方法及装置
CN105430715A (zh) 控制wifi扫描的方法及装置
US9678868B2 (en) Method and device for optimizing memory

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16900078

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16900078

Country of ref document: EP

Kind code of ref document: A1