CN107766211B - Screen freezing prevention method, mobile terminal and computer readable storage medium - Google Patents

Screen freezing prevention method, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN107766211B
CN107766211B CN201711061251.0A CN201711061251A CN107766211B CN 107766211 B CN107766211 B CN 107766211B CN 201711061251 A CN201711061251 A CN 201711061251A CN 107766211 B CN107766211 B CN 107766211B
Authority
CN
China
Prior art keywords
file
scene
data
application
preset
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
CN201711061251.0A
Other languages
Chinese (zh)
Other versions
CN107766211A (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 CN201711061251.0A priority Critical patent/CN107766211B/en
Publication of CN107766211A publication Critical patent/CN107766211A/en
Application granted granted Critical
Publication of CN107766211B publication Critical patent/CN107766211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

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

Abstract

The invention discloses a screen freezing prevention method, a mobile terminal and a computer readable storage medium, wherein the screen freezing prevention method comprises the following steps: reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information; calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene; and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene. The method can effectively avoid the unlimited increase of the data of the third-party application, and prevent the screen freezing fault caused by the small disk space.

Description

Screen freezing prevention method, mobile terminal and computer readable storage medium
Technical Field
The present invention relates to the field of mobile terminal technologies, and in particular, to a screen freeze prevention method, a mobile terminal, and a computer-readable storage medium.
Background
With the development of mobile terminal technology, the hardware configuration of the mobile terminal is better and better, the functions that can be realized are more and more, and integrated APPs (applications) are more and more. At present, application programs based on different scenes of a mobile terminal are tens of thousands, and with the increasing quantity of third-party applications and service software installed on the mobile terminal by a user, people always encounter the problem of picture freezing when using the mobile terminal in daily life, namely the mobile terminal has a screen freezing fault.
At present, the mobile terminal is provided with the APP with high user frequency and belongs to the fat client side APP, rich file data is provided, generated file data are more, for example, WeChat and QQ applications and the like, and the mobile terminal runs a plurality of APPs simultaneously and needs to occupy more disk space. However, the disk space of the mobile terminal is limited, and when the disk space is small, frequent operations of the system on disk reading and writing, such as frequent jamming of the system, frequent garbage collection and the like, easily occur, so that foreground running APP or background service is blocked, and then a screen freezing fault occurs.
Therefore, how to avoid the unlimited increase of the third-party application data and prevent the screen freezing fault caused by the small disk space is a problem to be solved urgently at present.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a screen freezing prevention method, a mobile terminal and a computer readable storage medium, and aims to solve the technical problems of how to avoid the unlimited increase of third-party application data and prevent screen freezing faults caused by small disk space.
In order to achieve the above object, the present invention provides a screen freezing prevention method applied to a mobile terminal, including the steps of:
reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene.
Optionally, the step of obtaining file data generated by the currently running application in the currently running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the currently running scene includes:
acquiring a disk storage area of file data generated by the currently running application in the current running scene from the monitoring data;
extracting file data generated by the currently running application in the current running scene from the disk storage area;
and acquiring a data cleaning rule associated with the current operation scene, and cleaning the file data according to the data cleaning rule.
Optionally, before the step of obtaining the file data generated by the currently running application in the currently running scene according to the monitoring data, the freeze-screen prevention method further includes:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, executing the step of acquiring the file data generated by the currently running application in the currently running scene according to the monitoring data.
Optionally, after the step of calling an application scenario monitoring rule associated with the current operation scenario to monitor the current operation application to obtain the monitoring data of the current operation scenario, the freeze-screen prevention method further includes:
judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and when the bit number is greater than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
Optionally, after the step of cleaning the file of the file type to be cleaned from the file data generated in the preset operation scene, the freeze-screen prevention method further includes
Acquiring the cleaned file data, and compressing the cleaned file data to acquire compressed file data;
and calculating the bit number of the compressed file data, generating file cleaning prompt information when the bit number exceeds a preset threshold value, and displaying the file cleaning prompt information.
In addition, to achieve the above object, the present invention also provides a mobile terminal, including: a memory, a processor and a freeze prevention program stored on the memory and executable on the processor, the freeze prevention program when executed by the processor implementing the steps of the freeze prevention method as described above.
The present invention also provides a computer readable storage medium having a freeze prevention program stored thereon, which when executed by a processor implements the steps of the freeze prevention method as described above.
The invention provides a screen freeze prevention method, a mobile terminal and a computer readable storage medium, reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, determining a current running scene of the currently running application according to the process information, calling an application scene monitoring rule associated with the current running scene to monitor the currently running application so as to obtain monitoring data of the current running scene, finally obtaining file data generated by the currently running application in the current running scene according to the monitoring data, cleaning the file data according to a data cleaning rule associated with the current running scene, setting an application red list according to known experience data, habit of a user and the like, monitoring file data generation conditions of the application in the application red list in different running scenes in the mobile terminal, the method comprises the steps of acquiring monitoring data in corresponding operation scenes, and then cleaning file data in the corresponding operation scenes based on data cleaning rules in different operation scenes, so that temporary disk space is released, the disk space is enough, the unlimited increase of third-party application data is effectively avoided, and the screen freezing fault caused by the small disk space is prevented.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
FIG. 2 is a level diagram of an operating system of the mobile terminal according to the present invention;
FIG. 3 is a schematic flow chart of a first embodiment of the freeze prevention method of the present invention;
fig. 4 is a detailed flowchart of the step of acquiring the file data generated by the currently running application in the currently running scene according to the monitoring data and cleaning the file data according to the data cleaning rule associated with the currently running scene in fig. 3;
fig. 5 is a flowchart illustrating a third embodiment of the freeze-thaw prevention method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The 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, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal 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.
Referring to fig. 2, which is a schematic hierarchical diagram of an operating system stored in a storage program area, as shown in fig. 2, the operating system includes a Loader layer, a Kernel layer, a Native layer, a Framework layer (including a C + + Framework layer and a Java Framework layer), and an App layer, where an HAL layer (hardware abstraction layer) also exists between the Kernel layer and the Native layer, a JNI layer also exists between the C + + Framework layer and the Java Framework layer, and a SysCall layer also exists between the HAL layer and the Kernel layer.
The Loader layer comprises a Boot ROM (Boot service) and a Boot Loader (Boot initialization program), wherein the Boot ROM is mainly used for booting by pressing a Power (Boot) key for a long time when the mobile terminal is in a Power-off state, and a Boot chip starts to execute from a preset code solidified in the ROM. The Boot Loader is a Boot program before starting the operating system, and mainly has the functions of checking the RAM, initializing hardware parameters and the like.
The Kernel layer is mainly used for performing related work such as initialization process management, memory management, Display loading, Camera Driver (Camera Driver), Binder Driver (Binder Driver) and the like, and is used for creating Kernel daemon processes such as Kernel worker threads kworkder, soft interrupt threads ksofirqd and soft interrupt threads thermal.
The Native layer mainly comprises a daemon process of a user space hatched by init, a HAL layer, startup animation and the like. User daemon processes, User Daemons, such as ueven, logd, health, installd, adbd, and lmkd, can hatch out from the Init process (a User-level process started by a kernel); the init process also starts important services such as servicemanager and bootanim; the init process hatches a Zygote process, the Zygote process is the first Java process of the operating system, the Zygote process is the parent process of all the Java processes, and the Zygote process is hatched from the init process.
The Framework layer comprises a Zygote process, a System Server (System service) process and a Media Server (multimedia service) process, wherein the Zygote process is generated by an init process through analysis of an init.rc file and then fork, and mainly comprises loading Zygote init classes, registering Zygote Socket service end sockets, loading virtual machines, preloadClasses, preloadResouces and the like; the System Server process is derived from a Zygote process fork, the System Server is the first process of Zygote incubation, and the System Server is responsible for starting and managing the whole Java Framework and comprises services such as an ActivitiManager (application program component), a PowerManager (power supply management component) and a WindowManagerServer (window management component); the Media Server process, which is derived from the init process fork, is responsible for starting and managing the whole C + + frame, and includes services such as audio pointer (afofinger), Camera Service (Camera Service), and MediaPlayServer (multimedia Service).
The APP layer comprises APP processes, each APP process is generated by a Zygote process fork, the first APP process hatched by the Zygote process is a Launcher (desktop Launcher), desktop APPs seen by a user are created by the Zygote process, the App processes such as a Browser, a Phone and an Email are also created by the Zygote process, and each App runs on at least one process.
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.
Based on the above mobile terminal hardware structure, various embodiments of the mobile terminal of the present invention are provided.
Referring to fig. 1, in a first embodiment of the mobile terminal of the present invention, the mobile terminal includes: a memory, a processor, and a freeze prevention program stored on the memory and executable on the processor, the freeze prevention program when executed by the processor implementing the steps of:
reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring a disk storage area of file data generated by the currently running application in the current running scene from the monitoring data;
extracting file data generated by the currently running application in the current running scene from the disk storage area;
and acquiring a data cleaning rule associated with the current operation scene, and cleaning the file data according to the data cleaning rule.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, acquiring file data generated by the currently running application in the currently running scene according to the monitoring data.
Further, the freeze prevention program when executed by the processor further implements the steps of:
judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and when the bit number is greater than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring the cleaned file data, and compressing the cleaned file data to acquire compressed file data;
and calculating the bit number of the compressed file data, generating file cleaning prompt information when the bit number exceeds a preset threshold value, and displaying the file cleaning prompt information.
The specific embodiment of the mobile terminal of the present invention is substantially the same as the specific embodiments of the freeze-screen prevention method described below, and will not be described herein again.
Further, the present invention also provides a freeze-screen prevention method applied to the mobile terminal shown in fig. 1, referring to fig. 3, and fig. 3 is a flowchart illustrating a first embodiment of the freeze-screen prevention method according to the present invention.
In this embodiment, the freeze prevention method includes:
step S101, reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
the method for preventing the frozen screen is applied to a mobile terminal, the mobile terminal comprises a smart phone, a tablet personal computer and the like, according to experience data, applications which are issued by a plurality of application markets and third party statistics and used by a user at high frequency, an application red list which comprises third party applications with high user frequency and generated data occupying more disk space in the operation process is established, and the applications in the application red list are sorted based on the size of the disk space occupied by the data generated in the running process, the higher the sorted applications, the more disk space the application occupies for the data generated by the application during running, and the lower the ranking of the application, the less disk space the application occupies for the data generated by the application during running, after the application red list is established, the application red list is stored in a memory of the mobile terminal, namely a preset application red list is stored. In addition, the application running scene is divided into an application installation scene, a foreground running scene, a background running scene, a normal exit scene and an abnormal exit scene, and text data to be monitored of each application running scene is set respectively, namely an application scene monitoring rule is set, and a data cleaning rule of the text data of each application running scene is also set respectively.
Specifically, the application scenario monitoring rule of the application installation scenario is to monitor whether a third party application in an application red list generates a temporary data file and a system junk file in the installation process, and whether the third party application deletes an installation package file after the third party application is successfully installed, and the corresponding data cleaning rule is to clean the temporary data file, the system junk file and an undeleted installation package file; the application scene monitoring rule of the foreground operation scene is to monitor whether the residual available space of a disk is lower than a preset warning value, record the times of opening the third-party application by a user, the retention time, whether a temporary data file is generated (the size of the temporary data file is recorded when the temporary data file is generated), whether the generated temporary data file is cleared when the third-party application exits and whether the generated temporary data file is regularly cleared by the third-party application, wherein the corresponding data clearing rule is to clear the generated temporary data file at intervals of preset time, compress a text file, an image file, a video file, a configuration file which the third-party application depends on and the like when the third-party application in an application red list operates in the foreground; the application scene monitoring rule of the background operation scene is used for monitoring whether a third party application in an application red list continues to generate a temporary data file when the third party application runs in the background, recording the latest reading and writing time and the disk space occupation information of the temporary data file when the temporary data file is generated, and the corresponding data cleaning rule is used for cleaning the temporary data file based on the latest reading and writing time of the temporary data file; the scene monitoring rule of the normal exit scene is used for monitoring whether the generated temporary data text can be automatically cleaned when the third party application in the application red list exits normally, and the corresponding data cleaning rule is used for cleaning the temporary data file; the scene monitoring rule of the abnormal exit scene is used for monitoring whether a third party application in an application red list generates a system junk file and a temporary configuration file when the third party application abnormally exits, the corresponding data cleaning rule is used for cleaning the system junk file, the temporary configuration file is stored, and the temporary configuration file is cleaned after the third party application which abnormally exits successfully operates again.
When an operating application exists in a system memory of the mobile terminal, judging whether the operating application is an application in a preset application red list, if the operating application is the application in the preset application red list, reading process information of the currently operating application in the preset application red list from the system memory, and determining a current operating scene of the currently operating application according to the process information, specifically, reading mark information representing the operating scene from the process information of the currently operating application, and then determining the current operating scene of the currently operating application according to the mark information, wherein the current operating scene is an application installation scene, a foreground operating scene, a background operating scene, a normal exit scene or an abnormal exit scene.
Step S102, calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
in order to monitor the specific situation of running application, in this embodiment, the present invention creates an independent monitoring thread in the system _ server process of the Java framework layer for executing the monitoring work of running application, when the system _ server process is created and run, the monitoring thread starts to execute the normal monitoring work, in addition, the present invention also creates a daemon process in the Native layer for detecting whether the monitoring thread running in the Java framework layer is abnormal or not and recovering after the abnormality occurs, specifically, the daemon process actively initiates heartbeat communication with the monitoring thread preset in the system _ server process at regular time to determine whether the monitoring thread runs normally or not, the heartbeat communication mainly reads the state of the monitoring thread in the system _ server process through the Native layer daemon process, determines whether the monitoring thread runs normally or not according to the read state, when the daemon process reads that the state is in the blocking state, timing is carried out, the monitoring thread is forcibly closed and a monitoring thread is restarted when the blockage reaches the preset time length, and the monitoring thread is ensured to be in a normal working state all the time. It should be noted that the preset time period may be set by a person skilled in the art based on actual situations, and is not specifically limited in this embodiment.
The mobile terminal calls an application scene monitoring rule associated with the current operation scene to monitor the current operation application after determining the current operation scene of the current operation application so as to acquire monitoring data of the current operation scene, wherein the preset file type data comprises file data such as text files, image files, video files, configuration files depended by third-party applications, application residual files, system junk files, installation package files, thumbnail cache files, temporary data files and other files. The monitoring data comprises an application identifier, the type of a file generated in an operation scene, the bit number of each type of generated file, a disk storage area of each type of generated file, data cleaning authority information and the like, and the data cleaning authority information can indicate whether the file required to be cleaned can be automatically cleaned when the monitoring data is applied to each application scene.
Step S103, acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene.
After the mobile terminal acquires the monitoring data, acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene.
Specifically, referring to fig. 4, fig. 4 is a detailed flowchart of the step S103 in fig. 3, where the step S103 includes:
step S1031, obtaining the disk storage area of the file data generated by the current running application in the current running scene from the monitoring data;
step S1032, extracting the file data generated by the currently running application in the currently running scene from the disk storage area;
step S1033, a data cleaning rule associated with the current operation scene is obtained, and the file data is cleaned according to the data cleaning rule.
After the mobile terminal acquires the monitoring data, acquiring a disk storage area of file data generated by the current running application from the monitoring data, extracting the file data generated by the current running application in the current running scene from the disk storage area, then acquiring a data cleaning rule associated with the current running scene, and cleaning the file data according to the data cleaning rule.
In the embodiment, the invention reads the process information of the currently running application in the preset application red list from the system memory of the mobile terminal, determines the current running scene of the currently running application according to the process information, then calls the application scene monitoring rule associated with the current running scene to monitor the currently running application so as to obtain the monitoring data of the current running scene, finally obtains the file data generated by the currently running application in the current running scene according to the monitoring data, and cleans the file data according to the data cleaning rule associated with the current running scene, the scheme sets the application red list according to the known experience data, the user use habit and other data, and monitors the file data generation condition of the application in the application red list in different running scenes in the mobile terminal so as to obtain the monitoring data in the corresponding running scene, and then, file data under corresponding operation scenes are cleaned based on data cleaning rules under different operation scenes, so that temporary disk space is released, the disk space is enough, the unlimited increase of data of a third party application is effectively avoided, and the screen freezing fault caused by the small disk space is prevented.
Further, a second embodiment of the freeze-prevention method of the present invention is proposed based on the above-mentioned first embodiment, and is different from the foregoing embodiments in that, before step S103, the freeze-prevention method further includes:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, executing the step of acquiring the file data generated by the currently running application in the currently running scene according to the monitoring data.
The method comprises the steps that after the mobile terminal obtains monitoring data, the bit number of file data generated by a current running application in a current running scene is obtained from the monitoring data, whether the bit number of the file data is higher than a preset threshold value or not is judged, if the bit number of the file data is higher than the preset threshold value, a disk storage area of the file data generated by the current running application is obtained from the monitoring data, the file data generated by the current running application in the current running scene is extracted from the disk storage area, then a data cleaning rule related to the current running scene is obtained, and the file data is cleaned according to the data cleaning rule.
In this embodiment, the number of bits of the file data generated by running the application in the current running scene is calculated, and the file data is cleaned when the number of bits is higher than a preset threshold value, so that the cleaning times are reduced.
Further, referring to fig. 5, a third embodiment of the freeze prevention method of the present invention is proposed based on the first or second embodiment, and is different from the previous embodiments in that after the step S102, the freeze prevention method further includes:
step S104, judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
step S105, reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and S106, when the bit number is larger than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
The method comprises the steps that after monitoring data are obtained, whether a current operation scene is a preset operation scene or not is judged, when the current operation scene is the preset operation scene, the monitoring data are stored in a preset storage area, then the monitoring data are read from the preset storage area at preset intervals, the bit number of file data generated under the preset operation scene is obtained from the monitoring data, finally when the bit number is larger than or equal to the preset bit number, the type of a file to be cleaned is determined according to the preset operation scene, the file of the type of the file to be cleaned is cleaned from the file data generated under the preset operation scene, the preset operation scene is a foreground operation scene, and the corresponding types of the file to be cleaned are an application residual file, a system garbage file, an invalid installation package file, a thumbnail cache file, a temporary data file and the like.
In this embodiment, the monitoring data acquired by the monitoring running application is stored in the preset storage area in the foreground running scene, so that the text data generated in the foreground running scene in the subsequent application is conveniently cleaned when the number of the text data exceeds a certain number of bits, and the application running fault caused by cleaning the text data generated by the application in the foreground running scene is avoided.
Further, based on the third embodiment described above, a fourth embodiment of the freeze prevention method of the present invention is proposed, which is different from the foregoing embodiments in that after the step S106, the freeze prevention method further includes:
acquiring the cleaned file data, and compressing the cleaned file data to acquire compressed file data;
and calculating the bit number of the compressed file data, generating file cleaning prompt information when the bit number exceeds a preset threshold value, and displaying the file cleaning prompt information.
The mobile terminal cleans files of the type of the files to be cleaned from the file data generated in a preset operation scene, acquires the cleaned file data, compresses the cleaned file data to acquire compressed file data, calculates the bit number of the compressed file data, generates file cleaning prompt information when the bit number exceeds a preset threshold value, and displays the file cleaning prompt information.
In this embodiment, the invention compresses the cleaned file data to obtain compressed file data, and then prompts a user to manually clean the compressed file data when the compressed file data exceeds a certain bit number.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a freeze-screen prevention program is stored on the computer-readable storage medium, and when executed by a processor, the freeze-screen prevention program implements the following steps:
reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring a disk storage area of file data generated by the currently running application in the current running scene from the monitoring data;
extracting file data generated by the currently running application in the current running scene from the disk storage area;
and acquiring a data cleaning rule associated with the current operation scene, and cleaning the file data according to the data cleaning rule.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, acquiring file data generated by the currently running application in the currently running scene according to the monitoring data.
Further, the freeze prevention program when executed by the processor further implements the steps of:
judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and when the bit number is greater than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
Further, the freeze prevention program when executed by the processor further implements the steps of:
acquiring the cleaned file data, and compressing the cleaned file data to acquire compressed file data;
and calculating the bit number of the compressed file data, generating file cleaning prompt information when the bit number exceeds a preset threshold value, and displaying the file cleaning prompt information.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the specific embodiments of the freeze-screen prevention method described above, and will not be 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 system 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 system. 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 system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., 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.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A screen freezing prevention method is applied to a mobile terminal and comprises the following steps:
reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene, wherein the data cleaning rule comprises a temporary data file, a system junk file and an undeleted installation package file.
2. The freeze prevention method of claim 1, wherein the step of obtaining file data generated by the currently running application in a current running scenario according to the monitoring data and cleaning the file data according to a data cleaning rule associated with the current running scenario comprises:
acquiring a disk storage area of file data generated by the currently running application in the current running scene from the monitoring data;
extracting file data generated by the currently running application in the current running scene from the disk storage area;
and acquiring a data cleaning rule associated with the current operation scene, and cleaning the file data according to the data cleaning rule.
3. The freeze prevention method of claim 1, wherein prior to the step of obtaining the file data generated by the currently running application in the current running scenario from the monitoring data, the freeze prevention method further comprises:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, executing the step of acquiring the file data generated by the currently running application in the currently running scene according to the monitoring data.
4. The freeze prevention method of any of claims 1-3, wherein after the step of invoking the application scenario monitoring rule associated with the currently running scenario to monitor the currently running application to obtain the monitoring data of the currently running scenario, the freeze prevention method further comprises:
judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and when the bit number is greater than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
5. The freeze prevention method of claim 4, wherein after the step of cleaning the file of the type of the file to be cleaned from the file data generated under the preset operation scenario, the freeze prevention method further comprises
Acquiring the cleaned file data, and compressing the cleaned file data to acquire compressed file data;
and calculating the bit number of the compressed file data, generating file cleaning prompt information when the bit number exceeds a preset threshold value, and displaying the file cleaning prompt information.
6. A mobile terminal, characterized in that the mobile terminal comprises: a memory, a processor, and a freeze prevention program stored on the memory and executable on the processor, the freeze prevention program when executed by the processor implementing the steps of:
reading process information of a currently running application in a preset application red list from a system memory of the mobile terminal, and determining a current running scene of the currently running application according to the process information;
calling an application scene monitoring rule associated with the current operation scene to monitor the current operation application so as to acquire monitoring data of the current operation scene;
and acquiring file data generated by the current running application in the current running scene according to the monitoring data, and cleaning the file data according to a data cleaning rule associated with the current running scene, wherein the data cleaning rule comprises a temporary data file, a system junk file and an undeleted installation package file.
7. The mobile terminal of claim 6, wherein the freeze prevention program, when executed by the processor, further performs the steps of:
acquiring a disk storage area of file data generated by the currently running application in the current running scene from the monitoring data;
extracting file data generated by the currently running application in the current running scene from the disk storage area;
and acquiring a data cleaning rule associated with the current operation scene, and cleaning the file data according to the data cleaning rule.
8. The mobile terminal of claim 6, wherein the freeze prevention program, when executed by the processor, further performs the steps of:
acquiring the bit number of file data generated by the currently running application in the current running scene from the monitoring data;
and when the bit number is higher than a preset threshold value, acquiring file data generated by the currently running application in the currently running scene according to the monitoring data.
9. The mobile terminal of any of claims 6-8, wherein the freeze prevention program, when executed by the processor, further implements the steps of:
judging whether the current operation scene is a preset operation scene or not, and storing the monitoring data into a preset storage area when the current operation scene is the preset operation scene;
reading monitoring data from a preset storage area at preset interval time, and acquiring the bit number of file data generated in a preset operation scene from the monitoring data;
and when the bit number is greater than or equal to a preset bit number, determining the type of the file to be cleaned according to the preset operation scene, and cleaning the file of the type of the file to be cleaned from the file data generated in the preset operation scene.
10. A computer-readable storage medium, having a freeze prevention program stored thereon, which when executed by a processor, performs the steps of the freeze prevention method of any of claims 1 to 5.
CN201711061251.0A 2017-10-31 2017-10-31 Screen freezing prevention method, mobile terminal and computer readable storage medium Active CN107766211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711061251.0A CN107766211B (en) 2017-10-31 2017-10-31 Screen freezing prevention method, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711061251.0A CN107766211B (en) 2017-10-31 2017-10-31 Screen freezing prevention method, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107766211A CN107766211A (en) 2018-03-06
CN107766211B true CN107766211B (en) 2021-06-15

Family

ID=61272038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711061251.0A Active CN107766211B (en) 2017-10-31 2017-10-31 Screen freezing prevention method, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107766211B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108628673A (en) * 2018-05-07 2018-10-09 上海掌门科技有限公司 Data processing method, electronic equipment and computer-readable medium
CN111124668B (en) * 2019-11-28 2023-09-15 宇龙计算机通信科技(深圳)有限公司 Memory release method, memory release device, storage medium and terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699218A (en) * 2013-12-10 2015-06-10 华为终端有限公司 Task management method and equipment
CN105468416A (en) * 2015-11-30 2016-04-06 魅族科技(中国)有限公司 Application program clearing method and terminal
CN107145392A (en) * 2017-04-26 2017-09-08 努比亚技术有限公司 A kind of method and apparatus of memory optimization

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090158284A1 (en) * 2007-12-18 2009-06-18 Inventec Corporation System and method of processing sender requests for remote replication

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699218A (en) * 2013-12-10 2015-06-10 华为终端有限公司 Task management method and equipment
CN105468416A (en) * 2015-11-30 2016-04-06 魅族科技(中国)有限公司 Application program clearing method and terminal
CN107145392A (en) * 2017-04-26 2017-09-08 努比亚技术有限公司 A kind of method and apparatus of memory optimization

Also Published As

Publication number Publication date
CN107766211A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
CN107807861B (en) Screen freezing solution method, mobile terminal and computer readable storage medium
CN107678876B (en) Screen freezing monitoring and solving method, mobile terminal and computer readable storage medium
CN107704133B (en) Screen freezing monitoring and solving method, mobile terminal and computer readable storage medium
CN107846352B (en) Information display method and mobile terminal
CN107861817B (en) Thread blocking-based memory optimization method, mobile terminal and readable storage medium
CN107590057B (en) Screen freezing monitoring and solving method, mobile terminal and computer readable storage medium
CN108681498B (en) CPU occupancy rate monitoring method and device and mobile terminal
CN108073458B (en) Memory recovery method, mobile terminal and computer-readable storage medium
CN107562539B (en) Application program processing method and device, computer equipment and storage medium
CN107704363B (en) Screen freezing monitoring method, mobile terminal and computer readable storage medium
CN109471690B (en) Message display method and terminal equipment
CN108052390B (en) Thread blocking-based memory cleaning method, mobile terminal and readable storage medium
CN107885635B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN107908492B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN109976611B (en) Terminal device control method and terminal device
CN107766222B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN107967177B (en) Memory optimization method based on core process, mobile terminal and readable storage medium
CN107765922B (en) Card screen detection and solution method, mobile terminal and computer readable storage medium
CN107908491B (en) Card screen detection and solution method, mobile terminal and computer readable storage medium
CN107832191B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN107908478B (en) Memory cleaning method, mobile terminal and computer readable storage medium
CN107872367B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN107861826B (en) Screen freezing monitoring and solving method, mobile terminal and computer readable storage medium
CN107818036B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN107766211B (en) Screen freezing prevention method, mobile terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant