Process cleaning method, device, storage medium and mobile terminal

By collecting and cleaning up the target process when the mobile terminal monitors the screen-off broadcast, the problem of malicious applications occupying system resources is solved, system security is improved and mobile phone power consumption is reduced.

CN111966425BActive Publication Date: 2024-12-31HUIZHOU TCL CLOUD INTERNET CORP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010837205.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-19
Publication Date
2024-12-31
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

Malicious applications occupy system resources through malicious keep-alive operations, destroy the system priority mechanism, resulting in normal applications being killed by mistake, affecting system security and mobile phone power consumption.

Method used

When monitoring the screen-deactivated broadcast, send information collection instructions to the preset local process to collect process information, including the current running process and its parent process, determine the target process and clean it up, intercept non-foreground applications to receive screen-deactivated broadcasts, and pass through the Linux system The kill command suspends non-default processes to ensure reasonable allocation of system resources.

Benefits of technology

Effectively avoid malicious applications occupying system resources for a long time, reduce the manslaughter of normal applications, improve terminal system security and reduce power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966425B_ABST
    Figure CN111966425B_ABST
Patent Text Reader

Abstract

The present application discloses a process cleaning method, device, storage medium and mobile terminal. The process cleaning method comprises: when a screen-off broadcast is monitored, sending an information collection instruction to a preset local process, the information collection instruction is used to instruct the preset local process to collect process information, the process information includes at least one currently running process and the parent process of each currently running process; determining a target process from at least one currently running process according to the parent process; cleaning the target process, thereby avoiding malicious applications from occupying system resources for a long time, reducing the accidental killing operation of normal applications, and being beneficial to improving the terminal system security and reducing the terminal power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a process cleaning method, device, storage medium and mobile terminal. Background Art

[0002] With the development of Android system, the functions of applications are becoming more and more diverse. Some applications need to run in the background of the system for a long time due to their own functional characteristics or other purposes.

[0003] Currently, the Android system itself provides a restart mechanism for background services. You only need to return a specific value to the system when starting the service. In this way, the life cycle of the application's background service will be properly managed by the Android system. When it starts running, the priority is relatively high. After a period of time, the priority will decrease as the background running time increases. When the system memory is insufficient, the system can kill the lower priority process to ensure the normal operation of the higher priority application. If the function of the application is very important to the user and needs to maintain a high priority, it can also be kept in the notification bar and the service process can be started as the foreground process. Through this priority mechanism, the system can reasonably allocate resources to the applications that need to run.

[0004] However, in order to maintain high priority and run in the background for a long time and occupy system resources, some applications (such as rogue applications) will take advantage of the characteristics of the Android system and perform some malicious keep-alive operations, mainly starting native daemon processes to keep alive and listening to screen-off broadcasts to keep alive. Among them, starting native daemon processes to keep alive means that the malicious application starts a single or even two native daemons, and listens to each other by sharing file descriptors between the child process and the parent process. When one of the processes is killed, a new process is quickly copied to prevent the malicious application from being killed by the system. Listening to screen-off broadcasts to keep alive means that when the phone screen is turned off, the malicious application receives the screen-off broadcast through the background, and starts an Activity component to occupy the foreground position when the screen is turned off, so that the priority of this malicious application is very high during the screen-off period. These two malicious keep-alive operations seriously disrupt the system's priority mechanism, resulting in system resources being occupied by malicious applications for a long time, normal applications being killed by mistake, and then endangering system security, bringing a bad experience to users, and affecting the power consumption indicators of the phone. Summary of the invention

[0005] The embodiments of the present application provide a process cleaning method, device, storage medium and mobile terminal, which can prevent malicious applications from occupying system resources for a long time and improve system security.

[0006] The embodiment of the present application provides a process cleaning method, which is applied to a mobile terminal, including:

[0007] When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process, wherein the information collection instruction is used to instruct the preset local process to collect process information, wherein the process information includes an identifier of at least one currently running process and an identifier of a parent process of each currently running process;

[0008] Determine a target process from the at least one currently running process according to the collected identifiers of the currently running processes and the identifiers of the corresponding parent processes;

[0009] The target process is cleaned up.

[0010] The embodiment of the present application also provides a process cleaning device, which is applied to a mobile terminal, including:

[0011] A sending module, configured to send an information collection instruction to a preset local process when a screen-off broadcast is monitored, wherein the information collection instruction is used to instruct the preset local process to collect process information, wherein the process information includes at least one currently running process and a parent process of each currently running process;

[0012] A determination module, configured to determine a target process from the at least one currently running process according to the parent process;

[0013] A cleaning module is used to clean up the target process.

[0014] Wherein, the determination module is specifically used for:

[0015] Determine whether there is a parent process that is different from the preset process;

[0016] If it exists, the parent process different from the preset process is used as the target parent process;

[0017] When the currently running process includes the target parent process, taking the target parent process and the currently running process corresponding to the target parent process as the target process;

[0018] When the currently running process does not include the target parent process, the currently running process corresponding to the target parent process is used as the target process.

[0019] The process cleaning device further includes an interception module, which is used to:

[0020] When there is a broadcast to be distributed, detecting whether the broadcast to be distributed is a screen-off broadcast;

[0021] If it is a screen-off broadcast, determining a receiving application of the screen-off broadcast, and obtaining the running status of the receiving application;

[0022] The screen-off broadcast is distributed to the receiving application according to the running status interception.

[0023] The interception module is specifically used to intercept the distribution of the screen-off broadcast to the receiving application when the running state is a non-running state or a background running state.

[0024] Wherein, when there are multiple target processes, the cleaning module is specifically used for:

[0025] Determine the service type and service status of each of the target processes;

[0026] Determine the priority of the target process according to the service type and service status;

[0027] The multiple target processes are cleaned up according to the priorities.

[0028] An embodiment of the present application also provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute any of the above-mentioned process cleaning methods.

[0029] An embodiment of the present application also provides a mobile terminal, including a processor and a memory, wherein the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in any of the above-mentioned process clearing methods.

[0030] The process cleaning method, device, storage medium and mobile terminal provided in the present application are applied to the mobile terminal. When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process. The information collection instruction is used to instruct the preset local process to collect process information. The process information includes at least one currently running process and the parent process of each currently running process, and the target process is determined from the at least one currently running process according to the parent process. Thereafter, the target process is cleaned up, thereby avoiding malicious applications from occupying system resources for a long time, reducing the accidental killing of normal applications, and being beneficial to improving the terminal system security and reducing the terminal power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0032] Figure 1 A flowchart of a process cleaning method provided in an embodiment of the present application.

[0033] Figure 2 Another flowchart diagram of the process cleaning method provided in an embodiment of the present application.

[0034] Figure 3A schematic diagram of the target process cleanup process provided in an embodiment of the present application.

[0035] Figure 4 A schematic diagram of the structure of a process cleaning device provided in an embodiment of the present application.

[0036] Figure 5 Another structural schematic diagram of the process cleaning device provided in an embodiment of the present application.

[0037] Figure 6 A schematic diagram of the structure of a mobile terminal provided in an embodiment of the present application.

[0038] Figure 7 Another structural schematic diagram of a mobile terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0040] Embodiments of the present application provide a process cleaning method, device, storage medium, and mobile terminal.

[0041] like Figure 1 and Figure 2 As shown, Figure 1 : is a flowchart of a process cleaning method provided in an embodiment of the present application. The process cleaning method is applied to a mobile terminal, which may be a smart phone, iPad or other device. The specific process may be as follows:

[0042] S101. When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process, where the information collection instruction is used to instruct the preset local process to collect process information, where the process information includes at least one currently running process and the parent process of each currently running process.

[0043] The preset local process is a newly added native process with root privileges, which can be run when the mobile terminal is turned on. The newly added native process can use the ps (process status) command provided by the Linux system to collect process information. Generally, the parent process of each process and the parent-child relationship between processes are determined by the process number, where the process number is PID and the parent process number is PPID. For example, if the PPID of a process A is 12345 and the PID of a process B is 12345, then B is considered to be the parent process of A.

[0044] The screen-off broadcast can be listened to through the newly added system service component. The calling interface of the newly added system service component can be stored in AMS (activity manage service, component management service), such as in the two files deliverToRegisteredReceiverLocked and processNextBroadcastLocked, which can be called when the terminal system distributes the broadcast, so as to execute the subsequent series of cleanup processes.

[0045] For details, see Figure 2 Before the above step S101, the process cleaning method may further include:

[0046] S104. When there is a broadcast to be distributed, detecting whether the broadcast to be distributed is a screen-off broadcast;

[0047] S105. If it is a screen-off broadcast, determine the receiving application of the screen-off broadcast and obtain the running status of the receiving application;

[0048] Among them, when it is necessary to distribute the broadcast, the newly added system service component can be triggered to execute the interception process of the screen-off broadcast of the non-foreground running application.

[0049] S106. Intercept and distribute the screen-off broadcast to the receiving application according to the running status.

[0050] Specifically, the above step S106 specifically includes:

[0051] When the running state is a non-running state or a background running state, the screen-off broadcast is intercepted and distributed to the receiving application.

[0052] Under normal circumstances, only the foreground application will be distributed with the screen-off broadcast, so that the activity component can be started to occupy the foreground when the screen is off, avoiding being cleaned up by the background during the screen off period. Once there is an application that is not running in the foreground and will be distributed with the screen-off broadcast by the system, its distribution process can be directly interrupted.

[0053] S102. Determine a target process from the at least one currently running process according to the parent process.

[0054] Specifically, the above step S102 may include:

[0055] Determine whether there is a parent process that is different from the preset process;

[0056] If it exists, the parent process that is different from the preset process will be used as the target parent process;

[0057] When the currently running process includes the target parent process, the target parent process and the currently running process corresponding to the target parent process are taken as the target process;

[0058] When the currently running process does not include the target parent process, the currently running process corresponding to the target parent process is used as the target process.

[0059] Among them, under normal circumstances, the running process is started through the system default process, that is, the parent process of the running process is usually the same default process, but for some applications, in order to keep themselves alive, they will start at least one native local daemon process. The parent process of these abnormally started daemon processes is the application itself, not the default process, so that each running process can be determined whether it is started normally according to the identifier of the parent process, and the abnormally started running process is used as the target process. It should be pointed out that some processes can be started through the default process on the one hand, and on the other hand, they can also start native processes to protect themselves. For such processes, it is not enough to only clean up the child processes they start. In order to prevent them from continuing to start other child processes, the child processes they start and themselves need to be cleaned up. That is, if the current running process is the parent process of another current running process, it also needs to be cleaned up as a target process.

[0060] S103. Clean up the target process.

[0061] Among them, you can directly use the kill command that comes with the Linux system to suspend the current running processes of all non-default parent processes, as well as the current running process that starts other running processes as the parent process (that is, the target process), to prevent new processes from being started during the cleanup process, and then clean up the suspended processes one by one.

[0062] It should be noted that this implementation scheme starts internal screen-off broadcast monitoring when distributing the broadcast, and triggers the cleanup of malicious foreground running processes when the screen-off broadcast is monitored, thereby preventing abnormal applications from occupying foreground resources for a long time, and further preventing the real foreground running applications from being cleaned up by the system because they are squeezed to the background during the screen-off period.

[0063] In addition, when there are multiple target processes, during the cleaning process, all target processes may be cleaned directly, or only some target processes may be cleaned. In this case, the above step S103 may specifically include:

[0064] Determine the service type and service status of each target process;

[0065] Determine the priority of the target process based on the service type and service status;

[0066] Clean up multiple target processes according to priority.

[0067] Among them, the first few processes with relatively high priority can be selected for cleaning, and the processes with the lowest priority can be retained. Service types can include video playback, location positioning, audio playback, shopping, etc. Service status can include foreground in progress, background suspended, background in progress, etc. Generally, the higher the user participation in the service, the less likely the corresponding process will be cleaned up, that is, the lower the cleaning priority should be. Conversely, the lower the user participation in the service, the higher the cleaning priority should be. For example, when a target process is a video playback process and is in the foreground, it means that the user may be watching a video before the screen is turned off. At this time, although the target process is not a normally started process, considering the high user participation, it can still not be cleaned up after the screen is turned off. If a target process is a shopping process and is suspended in the background, it means that the user did not use the service before the screen was turned off, and it can be cleaned up first after the screen is turned off.

[0068] For example, see Figure 3 , if the target processes running on the terminal before the screen is turned off include A, B, C, and D, and A is a video playback process terminated in the background, B is an audio playback process running in the foreground, C is a location positioning process in the background, and D is a shopping process terminated in the background, then after sorting, the order from high to low priority can be D, C, A, and B. After the screen is turned off, the first three processes can be cleaned up, that is, D, C, and A, but B can be retained.

[0069] At the same time, the system resource usage of each target process can be collected to further adjust the corresponding priority. The system resources can include data transmission rate, system running memory size, etc. Generally, the target process that occupies more system resources can be cleared with higher priority. In addition, each time after the target process is cleared, the number of times it has been cleared can be recorded. If the number of cleared times exceeds a certain number in a short period of time, the next time some applications need to restart the process, the startup operation can be prohibited.

[0070] From the above, it can be seen that the process cleaning method provided by the present application is applied to a mobile terminal. When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process. The information collection instruction is used to instruct the preset local process to collect process information. The process information includes at least one currently running process and the parent process of each currently running process, and the target process is determined from the at least one currently running process based on the parent process. Thereafter, the target process is cleaned up, thereby avoiding malicious applications from occupying system resources for a long time, reducing the accidental killing operations of normal applications, and helping to improve the terminal system security and reduce terminal power consumption.

[0071] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a process cleaning device. The process cleaning device can be implemented as an independent entity or integrated in a mobile terminal. The mobile terminal can be a smart phone, iPad or other device with a camera.

[0072] See also Figure 4 , Figure 4 The process cleaning device 100 provided in the embodiment of the present application is specifically described, which is applied to a mobile terminal. The process cleaning device may include: a sending module 10, a determining module 20 and a cleaning module 30, wherein:

[0073] (1) Sending module 10

[0074] The sending module 10 is used to send an information collection instruction to a preset local process when a screen-off broadcast is monitored. The information collection instruction is used to instruct the preset local process to collect process information, and the process information includes at least one currently running process and the parent process of each currently running process.

[0075] The preset local process is a newly added native process with root privileges, which can be run when the mobile terminal is turned on. The newly added native process can use the ps (process status) command provided by the Linux system to collect process information. Generally, the parent process of each process and the parent-child relationship between processes are determined by the process number, where the process number is PID and the parent process number is PPID. For example, if the PPID of a process A is 12345 and the PID of a process B is 12345, then B is considered to be the parent process of A.

[0076] The screen-off broadcast can be listened to through the newly added system service component. The calling interface of the newly added system service component can be stored in AMS (activity manage service, component management service), such as in the two files deliverToRegisteredReceiverLocked and processNextBroadcastLocked, which can be called when the terminal system distributes the broadcast, so as to execute the subsequent series of cleanup processes.

[0077] For details, see Figure 5 The process cleaning device further includes an interception module 40, which is used to:

[0078] When there is a broadcast to be distributed, detecting whether the broadcast to be distributed is a screen-off broadcast;

[0079] If it is a screen-off broadcast, determine the receiving application of the screen-off broadcast and obtain the running status of the receiving application;

[0080] The screen-off broadcast is distributed to the receiving application according to the operation status interception.

[0081] Furthermore, the interception module 40 is specifically used for intercepting the distribution of the screen-off broadcast to the receiving application when the running state is a non-running state or a background running state.

[0082] Among them, when broadcast distribution is needed, the newly added system service component can be triggered to execute the interception process of screen-off broadcast of non-foreground running applications. Under normal circumstances, only foreground running applications are distributed screen-off broadcasts, so that the activity component can be started to occupy the foreground when the screen is off, avoiding being cleaned up by the background during the screen off period. Once a non-foreground running application is distributed screen-off broadcast by the system, its distribution process can be directly interrupted.

[0083] (2) Determine module 20

[0084] The determination module 20 is used to determine a target process from the at least one currently running process according to the parent process.

[0085] Furthermore, the determination module 20 is specifically configured to:

[0086] Determine whether there is a parent process that is different from the preset process;

[0087] If it exists, the parent process that is different from the preset process will be used as the target parent process;

[0088] When the currently running process includes the target parent process, the target parent process and the currently running process corresponding to the target parent process are taken as the target process;

[0089] When the currently running process does not include the target parent process, the currently running process corresponding to the target parent process is used as the target process.

[0090] Among them, under normal circumstances, the running process is started through the system default process, that is, the parent process of the running process is usually the same default process, but for some applications, in order to keep themselves alive, they will start at least one native local daemon process. The parent process of these abnormally started daemon processes is the application itself, not the default process, so that each running process can be determined whether it is started normally according to the identifier of the parent process, and the abnormally started process is used as the target process. It should be pointed out that some processes can be started through the default process on the one hand, and on the other hand, they can also start native processes to protect themselves. For such processes, it is not enough to only clean up the child processes they start. In order to prevent them from continuing to start other child processes, the child processes they start and themselves need to be cleaned up. That is, if the current running process is the parent process of another current running process, it also needs to be cleaned up as a target process.

[0091] (3) Cleaning module 30

[0092] The cleaning module 30 is used to clean up the target process.

[0093] Among them, you can directly use the kill command that comes with the Linux system to suspend the current running processes of all non-default parent processes, as well as the current running process that starts other running processes as the parent process (that is, the target process), to prevent new processes from being started during the cleanup process, and then clean up the suspended processes one by one.

[0094] It should be noted that this implementation scheme starts internal screen-off broadcast monitoring when distributing the broadcast, and triggers the cleanup of malicious foreground running processes when the screen-off broadcast is monitored, thereby preventing abnormal applications from occupying foreground resources for a long time, and further preventing the real foreground running applications from being cleaned up by the system because they are squeezed to the background during the screen-off period.

[0095] In addition, when there are multiple target processes, during the cleaning process, all target processes may be cleaned directly, or only some target processes may be cleaned. In this case, the cleaning module 30 is specifically used for:

[0096] Determine the service type and service status of each target process;

[0097] Determine the priority of the target process based on the service type and service status;

[0098] Clean up multiple target processes according to priority.

[0099] Among them, the first few processes with relatively high priority can be selected for cleaning, and the processes with the lowest priority can be retained. Service types can include video playback, location positioning, audio playback, shopping, etc. Service status can include foreground in progress, background suspended, background in progress, etc. Generally, the higher the user participation in the service, the less likely the corresponding process will be cleaned up, that is, the lower the cleaning priority should be. Conversely, the lower the user participation in the service, the higher the cleaning priority should be. For example, when a target process is a video playback process and is in the foreground, it means that the user may be watching a video before the screen is turned off. At this time, although the target process is not a normally started process, considering the high user participation, it can still not be cleaned up after the screen is turned off. If a target process is a shopping process and is suspended in the background, it means that the user did not use the service before the screen was turned off, and it can be cleaned up first after the screen is turned off.

[0100] For example, see Figure 3 , if the target processes running on the terminal before the screen is turned off include A, B, C, and D, and A is a video playback process terminated in the background, B is an audio playback process running in the foreground, C is a location positioning process in the background, and D is a shopping process terminated in the background, then after sorting, the order from high to low priority can be D, C, A, and B. After the screen is turned off, the first three processes can be cleaned up, that is, D, C, and A, but B can be retained.

[0101] At the same time, the system resource usage of each target process can be collected to further adjust the corresponding priority, such as data transmission rate, system memory size, etc. Generally, the target process that occupies more system resources can be cleaned up with higher priority. In addition, each time after cleaning the target process, the number of times it has been cleaned can be recorded. If the number of times it has been cleaned exceeds a certain number in a short period of time, the next time some applications need to restart the process, the startup operation can be prohibited.

[0102] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0103] From the above, it can be seen that the process cleaning device provided in this embodiment is applied to a mobile terminal. When a screen-off broadcast is monitored, the sending module 10 sends an information collection instruction to a preset local process. The information collection instruction is used to instruct the preset local process to collect process information. The process information includes at least one currently running process and the parent process of each currently running process. The determination module 20 determines the target process from the at least one currently running process according to the parent process. Thereafter, the cleaning module 30 cleans up the target process, thereby avoiding malicious applications from occupying system resources for a long time, reducing the mistaken killing operations of normal applications, and is beneficial to improving the terminal system security and reducing terminal power consumption.

[0104] Correspondingly, an embodiment of the present invention further provides a process cleaning system, including any one of the process cleaning devices provided in the embodiments of the present invention, and the process cleaning device can be integrated in a mobile terminal.

[0105] When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process, where the information collection instruction is used to instruct the preset local process to collect process information, where the process information includes at least one currently running process and a parent process of each currently running process;

[0106] Determining a target process from the at least one currently running process according to the parent process;

[0107] Clean up the target process.

[0108] The specific implementation of each of the above devices can be found in the previous embodiments, which will not be described in detail here.

[0109] Since the process cleaning system can include any one of the process cleaning devices provided in the embodiments of the present invention, the beneficial effects that can be achieved by any one of the process cleaning devices provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0110] In addition, the embodiment of the present application also provides a mobile terminal, which can be a smart phone, a smart vehicle, or other device. Figure 6 As shown, the mobile terminal 200 includes a processor 201 and a memory 202. The processor 201 is electrically connected to the memory 202.

[0111] The processor 201 is the control center of the mobile terminal 200. It uses various interfaces and lines to connect various parts of the entire mobile terminal. It executes various functions of the mobile terminal and processes data by running or loading applications stored in the memory 202 and calling data stored in the memory 202, thereby monitoring the mobile terminal as a whole.

[0112] In this embodiment, the processor 201 in the mobile terminal 200 will load the instructions corresponding to the processes of one or more applications into the memory 202 according to the following steps, and the processor 201 will run the applications stored in the memory 202 to implement various functions.

[0113] Figure 7 The specific structural block diagram of the mobile terminal provided by the embodiment of the present invention is shown, and the mobile terminal can be used to implement the process cleaning method provided in the above embodiment. The mobile terminal 300 can be a smart phone or a tablet computer.

[0114] The RF circuit 310 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 310 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 310 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wide band Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0115] The memory 320 can be used to store software programs and modules, such as the program instructions / modules corresponding to the system and method for automatically filling light when taking photos with a front camera in the above-mentioned embodiments. The processor 380 executes various functional applications and data processing by running the software programs and modules stored in the memory 320, that is, realizing the function of automatically filling light when taking photos with a front camera. The memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 320 may further include a memory remotely arranged relative to the processor 380, and these remote memories may be connected to the mobile terminal 300 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The input unit 330 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 330 may include a touch-sensitive surface 331 and other input devices 332. The touch-sensitive surface 331, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 331), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 331 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch-sensitive surface 331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 331, the input unit 330 may further include other input devices 332. Specifically, other input devices 332 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0117] The display unit 340 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the mobile terminal 300, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 340 may include a display panel 341. Optionally, the display panel 341 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 331 may cover the display panel 341. When the touch-sensitive surface 331 detects a touch operation on or near it, it is transmitted to the processor 380 to determine the type of touch event. Subsequently, the processor 380 provides a corresponding visual output on the display panel 341 according to the type of touch event. Although in Figure 7 In the embodiment, the touch-sensitive surface 331 and the display panel 341 are implemented as two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 331 and the display panel 341 can be integrated to realize the input and output functions.

[0118] The mobile terminal 300 may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 341 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 341 and / or the backlight when the mobile terminal 300 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the mobile terminal 300, they will not be repeated here.

[0119] The audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the mobile terminal 300. The audio circuit 360 can transmit the electrical signal converted from the received audio data to the speaker 361, which is converted into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, and then the audio data is output to the processor 380 for processing, and then sent to another terminal through the RF circuit 310, or the audio data is output to the memory 320 for further processing. The audio circuit 360 may also include an earplug jack to provide communication between an external headset and the mobile terminal 300.

[0120] The mobile terminal 300 can help users send and receive emails, browse web pages, and access streaming media through the transmission module 370 (such as a Wi-Fi module), which provides users with wireless broadband Internet access. Figure 7 The transmission module 370 is shown, but it is understandable that it is not an essential component of the mobile terminal 300 and can be omitted as required without changing the essence of the invention.

[0121] The processor 380 is the control center of the mobile terminal 300. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320, it executes various functions of the mobile terminal 300 and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 380 may include one or more processing cores; in some embodiments, the processor 380 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 380.

[0122] The mobile terminal 300 also includes a power supply 390 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 380 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0123] Although not shown, the mobile terminal 300 may also include a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the display unit of the mobile terminal is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors. One or more programs include instructions for performing the following operations:

[0124] When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process, where the information collection instruction is used to instruct the preset local process to collect process information, where the process information includes at least one currently running process and a parent process of each currently running process;

[0125] Determining a target process from the at least one currently running process according to the parent process;

[0126] Clean up the target process.

[0127] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0128] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores a plurality of instructions, and the instructions can be loaded by a processor to execute the steps in any process cleaning method provided by an embodiment of the present invention.

[0129] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0130] Since the instructions stored in the storage medium can execute the steps in any process cleaning method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any process cleaning method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0131] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0132] In summary, although the present application has been disclosed as above with preferred embodiments, the above preferred embodiments are not intended to limit the present application. Ordinary technicians in this field can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined in the claims.

Claims

1. A process cleaning method, characterized in that: Applied to mobile terminals, including: When a screen-off broadcast is monitored, an information collection instruction is sent to a preset local process, wherein the information collection instruction is used to instruct the preset local process to collect process information, wherein the process information includes at least one currently running process and a parent process of each currently running process; Determining a target process from the at least one currently running process according to the parent process; Cleaning up the target process; Determining the target process from the at least one currently running process according to the parent process includes: Determine whether there is a parent process that is different from the preset process; If it exists, the parent process different from the preset process is used as the target parent process; When the currently running process includes the target parent process, taking the target parent process and the currently running process corresponding to the target parent process as the target process; When the currently running process does not include the target parent process, the currently running process corresponding to the target parent process is used as the target process.

2. The process cleaning method according to claim 1, characterized in that: Before receiving the distributed screen-off broadcast, it also includes: When there is a broadcast to be distributed, detecting whether the broadcast to be distributed is a screen-off broadcast; If it is a screen-off broadcast, determining a receiving application of the screen-off broadcast and obtaining the running status of the receiving application; The screen-off broadcast is distributed to the receiving application according to the running status interception.

3. The process cleaning method according to claim 2, characterized in that: The intercepting and distributing the screen-off broadcast to the receiving application according to the running state includes: When the running state is a non-running state or a background running state, the screen-off broadcast is intercepted and distributed to the receiving application.

4. The process cleaning method according to claim 1, characterized in that: When there are multiple target processes, the step of cleaning up the target processes includes: Determine the service type and service status of each of the target processes; Determine the priority of the target process according to the service type and service status; The multiple target processes are cleaned up according to the priorities.

5. A process cleaning device, characterized in that: Applied to mobile terminals, including: A sending module, configured to send an information collection instruction to a preset local process when a screen-off broadcast is monitored, wherein the information collection instruction is used to instruct the preset local process to collect process information, wherein the process information includes at least one currently running process and a parent process of each currently running process; A determination module, configured to determine a target process from the at least one currently running process according to the parent process; the determination module is specifically configured to: determine whether the parent process different from the preset process exists; if so, use the parent process different from the preset process as the target parent process; when the currently running process includes the target parent process, use the target parent process and the currently running process corresponding to the target parent process as the target process; when the currently running process does not include the target parent process, use the currently running process corresponding to the target parent process as the target process; A cleaning module is used to clean up the target process.

6. The process cleaning device according to claim 5, characterized in that: Also includes interception modules for: When there is a broadcast to be distributed, detecting whether the broadcast to be distributed is a screen-off broadcast; If it is a screen-off broadcast, determining a receiving application of the screen-off broadcast, and obtaining the running status of the receiving application; The screen-off broadcast is distributed to the receiving application according to the running status interception.

7. A computer-readable storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the process cleaning method described in any one of claims 1 to 4.

8. A mobile terminal, characterized in that: It includes a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the process cleaning method described in any one of claims 1 to 4.