Process control method and apparatus

The process control method addresses the issue of important user applications being terminated due to low memory by implementing intelligent control of individual processes, optimizing memory usage while preserving critical user experiences.

JP7647006B2Active Publication Date: 2025-03-18HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023518240
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-09-21
Filing Date
2021-09-16
Publication Date
2025-03-18
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

Existing process control methods in Android systems often result in important user applications being terminated when memory is low, leading to a poor user experience due to the need for repeated application restarts.

Method used

A process control method that allows for intelligent control of individual processes within applications, determining which processes are critical to the user and marking them for retention or termination, thereby optimizing memory usage without affecting essential user experiences.

Benefits of technology

This approach effectively balances memory management and user experience by allowing non-essential processes to be terminated while keeping critical processes running, reducing the need for repeated application restarts and enhancing overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007647006000003
    Figure 0007647006000003
  • Figure 0007647006000004
    Figure 0007647006000004
  • Figure 0007647006000005
    Figure 0007647006000005
Patent Text Reader

Abstract

A process control method and apparatus are provided for implementing intelligent control for each process in a terminal device and preventing processes important to a user from being killed while memory is being released, thereby improving user experience. The method includes: obtaining information, a package name, and a process name of a first process of a first application running on the terminal device; determining to kill the first process based on the information about the first process; marking the package name and the process name of the first process; and controlling a second process based on the marking result of the package name and the process name of the second process.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to Chinese Patent Application No. 202010993180.3, entitled “PROCESS CONTROL METHOD AND APPARATUS,” filed with the State Intellectual Property Office of the People's Republic of China on September 21, 2020, the entire contents of which are incorporated herein by reference.

[0002] This application relates to the terminal field, and more particularly to a process control method and apparatus. [Background technology]

[0003] When the native low memory killer (LMK) is triggered in Android systems, user-critical applications may be killed accordingly. Therefore, original equipment manufacturer (OEM) application controls proactively kill applications when the device is low on memory, reducing the frequency of LMK triggers.

[0004] When the system is upgraded, memory bloat occurs in the system and applications. Therefore, more applications need to be killed when the device is low on memory. In the conventional technology, the entire application is killed, so the next time the application is launched by the user through a cold start, which affects the user experience. For example, when playing a game, the user switches to the WeChat application to respond to a message. Even if the time is very short, the game application will be killed by the system. As a result, the user needs to restart the game, which greatly deteriorates the user experience.

[0005] Therefore, how you balance memory and application keep-alive is particularly important. Summary of the Invention

[0006] This application provides a process control method and apparatus to implement intelligent control for each process in a terminal device and prevent processes important to the user from being killed while memory is being freed, improving the user experience.

[0007] According to a first aspect, there is provided a process control method including obtaining information, a package name, and a process name regarding a first process of a first application running on a terminal device, determining to kill the first process based on the information regarding the first process, marking the package name and process name of the first process, and controlling a second process based on a marking result of the package name and process name of the second process.

[0008] Existing control methods may only perform application-level control. However, the process control method in the embodiment of this application may implement process-level control. Whether a process is important to a user is determined based on multiple determination results of one or more characteristics of the process, so as to decide whether to keep or kill the process. In this way, for multiple processes in an application, some processes may be kept and some processes may be killed, instead of keeping the entire application and occupying excessive memory, or instead of killing the entire application that is important to the user because of memory, affecting the user experience. When a process is killed, the process control method in the embodiment of this application further includes marking the package name and process name of the process, so as to subsequently control the process based on the marking result.

[0009] In some possible implementations of the first aspect, the information about the first process includes a main process, a foreground process or a background process, an audio interaction process, a navigation process, an upload or download process, a step count process, adj information, and adjType information.

[0010] According to the process control method in the embodiment of this application, the decision tree obtained by training is used to determine whether a process should be killed or kept based on the process information including the above. Whether a process is important to a user is determined based on the above process information to determine whether to kill the process.

[0011] In some possible implementations of the first aspect, the duration of the control is a first time.

[0012] According to the process control method in the embodiment of this application, the process is controlled for a continuous period of time, for example, until the application of the process is uninstalled by the terminal device.

[0013] In some possible implementations of the first aspect, marking the package name and process name of the first process further includes marking a first moment at which the first process is killed.

[0014] In some possible implementations of the first aspect, controlling the second process based on the marking result of the package name and process name of the second process includes launching the second process; determining that the second process is a killed process based on the package name and process name of the second process; and prohibiting the second process from being launched.

[0015] In some possible implementations of the first aspect, the second process Package name andControlling the second process based on the process name marking result includes launching the second process; determining that the second process is a killed process based on the package name and the process name marking result of the second process; determining whether the second process is a user-perceptible process, where a user-perceptible process includes a foreground process and / or a process visible on an interface and / or an alert process; and allowing the second process to be launched if the second process is a user-perceptible process or prohibiting the second process from being launched if the second process is not a user-perceptible process.

[0016] Many processes are inevitably restarted automatically after being killed. If the process is not controlled, the previous kill operation will be disappointing. Therefore, the process control method in the embodiment of this application further includes controlling the process that is automatically restarted after being killed. According to the process control method in the embodiment of this application, whether a process is a process that is restarted after being killed is determined based on the marking result of the package name of the process and the process name. If the process is a process that is restarted after being killed, the process is prohibited from being started. Alternatively, the process control method in the embodiment of this application may determine whether the process to be restarted is a user-perceptible process to determine whether the process to be restarted is a user-perceptible process. If the process is a user-perceptible process, the process restart is deemed to be necessary. If the process is a user-inperceptible process, the process restart is deemed to be unnecessary.

[0017] In some possible implementations of the first aspect, allowing the first process to be restarted further includes obtaining a second instant at which the first process is started, and if an interval between the second instant and the first instant is less than a first threshold, increasing an effective restart count of the first process by one.

[0018] In some possible implementations of the first aspect, before killing the first process, the method further includes obtaining a valid restart count of the first process and, if the valid restart count is greater than a second threshold, retaining the first process.

[0019] Since the characteristics of a process determined by the intelligent decision engine are limited, in order to prevent a process important to a user from being killed by mistake, the process control method in the embodiment of this application further includes a fault tolerance mechanism of the intelligent decision engine, that is, when the control decision result is to kill, the effective restart count of the process is obtained, and whether the process really needs to be killed is determined based on the effective restart count.

[0020] According to a second aspect, there is provided a process control device including an acquisition module configured to acquire information, a package name and a process name of a first process of a first application running on a terminal device, a determination module configured to determine to kill the first process based on the information about the first process, and an execution module configured to mark the package name and the process name of the first process, The execution module is further configured to control the second process based on the marking result of the package name and the process name of the second process.

[0021] In some possible implementations of the second aspect, the information about the first process includes a main process, a foreground process or a background process, an audio interaction process, a navigation process, an upload or download process, a step count process, adj information, and adjType information.

[0022] In some possible implementations of the second aspect, the duration of the control is the first period of time.

[0023] In some possible implementations of the second aspect, the execution module's marking of the package name and process name of the first process further includes marking a first moment at which the first process is killed.

[0024] In some possible implementations of the first aspect, the execution module controlling the second process based on the marking result of the package name and process name of the second process includes launching the second process; determining that the second process is a killed process based on the package name and process name of the second process; and prohibiting the second process from being launched.

[0025] In some possible implementations of the second aspect, the execution module controlling the second process based on the marking result of the package name and process name of the second process includes launching the second process; determining that the second process is a killed process based on the marking result of the package name and process name of the second process; determining whether the second process is a user-perceptible process, where a user-perceptible process includes a foreground process and / or a process visible on an interface and / or an alert process; and allowing the second process to be launched if the second process is a user-perceptible process or prohibiting the second process from being launched if the second process is not a user-perceptible process.

[0026] In some possible implementations of the second aspect, the execution module allowing the first process to be restarted further includes obtaining a second instant at which the first process is started, and if an interval between the second instant and the first instant is less than a first threshold, increasing an effective restart count of the first process by one.

[0027] In some possible implementations of the second aspect, before the execution module kills the first process, the method further includes obtaining a valid restart count of the first process and, if the valid restart count is greater than a second threshold, retaining the first process.

[0028] According to a third aspect, an electronic device includes a memory configured to store a program and a processor configured to execute the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to perform the method of the first aspect and possible implementations of the first aspect, and the method of the second aspect and possible implementations of the second aspect.

[0029] According to a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing program code comprising instructions for performing some or all of the steps of the method of the first aspect and possible implementations of the first aspect, and the method of the second aspect and possible implementations of the second aspect.

[0030] According to a fifth aspect, the technical solution provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the process control method in the first aspect and possible implementations of the first aspect, and the method in the second aspect and possible implementations of the second aspect.

[0031] According to a sixth aspect, the technical solution provides a chip system, the chip system including at least one processor, when program instructions are executed in the at least one processor, functions of the first aspect and possible methods in the possible implementations of the first aspect, and functions of the second aspect and possible methods in the possible implementations of the second aspect are implemented on an electronic device. [Brief description of the drawings]

[0032] [Figure 1] FIG. 1 is a schematic diagram of a structure of an electronic device according to an embodiment of the present application.

[0033] [Diagram 2] FIG. 2 is a schematic block diagram of a user interface according to an embodiment of the present application.

[0034] [Diagram 3] 1 is a schematic diagram of a system architecture to which a process control method according to an embodiment of the present application is applied.

[0035] [Figure 4] 1 is a schematic flow chart of a process control method according to an embodiment of the present application.

[0036] [Diagram 5] FIG. 1 is a schematic block diagram of an intelligent decision engine according to an embodiment of the present application.

[0037] [Figure 6] FIG. 2 is a schematic block diagram of the control of the restart process and modification of the intelligent decision engine according to an embodiment of the present application.

[0038] [Figure 7] 1 is a schematic block diagram of a process control device according to an embodiment of the present application.

[0039] [Figure 8]1 is a schematic diagram of the structure of a process control device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0040] Hereinafter, the technical solutions in the embodiments of this application will be briefly described with reference to the accompanying drawings in the embodiments of this application. Honestly It is clear that the described embodiments are only a part, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative efforts shall fall within the scope of protection of this application.

[0041] The terms used in the following embodiments are merely intended to describe certain embodiments and are not intended to limit this application. When used in the specification of this application and the appended claims, the singular expressions "a", "an", "the", "the foregoing", "such a" and "this" are intended to include expressions such as "one or more", unless the context clearly indicates otherwise. In the following embodiments of this application, "at least one" or "one or more" is further understood to mean one, two or more. "And / or" describes a related relationship between related objects and indicates that three relationships may exist. For example, A and / or B may indicate the case where only A exists, the case where both A and B exist, the case where only B exists, and A and B may be singular or plural. The character " / " generally indicates an "or" relationship between related objects.

[0042] References to "one embodiment," "some embodiments," etc. described in this specification of this application mean that a particular feature, structure, or characteristic described with reference to an embodiment is included in one or more embodiments. Thus, the phrases "in one embodiment," "some embodiments," "some other embodiments," "other embodiments," etc. appearing in different places in this specification are not necessarily meant to refer to the same embodiment. Instead, the phrase means "one or more, but not all, embodiments," unless specifically emphasized otherwise. The terms "including," "having," and variations thereof all mean "including, but not limited to," unless specifically emphasized otherwise.

[0043] The process control method provided in the embodiments of this application may be applied to an electronic device. The electronic device may be a terminal device, which may also be referred to as User Equipment (UE), Mobile Station (MS), Mobile Terminal, etc. Optionally, the terminal device (referred to as a terminal) may have the ability to communicate with one or more core networks using a Radio Access Network (RAN). For example, the terminal may be a mobile phone (also referred to as a "cellular"), a set-top box, a wearable device, an Internet of Things (IOT) device, a computer of a mobile nature, etc. For example, the terminal may alternatively be a portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile device. In addition to the terminal device, it should be understood that the process control method provided in the embodiments of this application may also be applicable to another type of computer system.

[0044] Please refer to FIG. 1. FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of this application. As shown in FIG. 1, the electronic device 100 includes a memory 180, a processor 150, and a display device 140. The memory 180 stores computer programs, including an operating system program 182, an application 181, etc. The processor 150 is configured to read the computer programs in the memory 180 and execute the method defined by the computer programs. For example, the processor 150 reads the operating system program 182 to execute an operating system on the electronic device 100 and execute various functions of the operating system, or reads one or more applications 181 to execute the applications on the electronic device, or process broadcast messages of the applications, etc.

[0045] The processor 150 may include one or more processors. For example, the processor 150 may include one or more central processing units, or may include one or more central processing units and one or more application processors. When the processor 150 includes multiple processors, the multiple processors may be integrated into the same chip, or each of the multiple processors may be an independent chip. A processor may include one or more processor cores (also called processing cores). The following embodiments are described taking a multi-core as an example. However, the process control method provided in the embodiments of this application may also be applied to a single-core processor. The time-sharing working principle of a single-core processor is used to execute multiple applications in parallel.

[0046] Additionally, in addition to computer programs, memory 180 further stores other data 183. Other data 183 may include data generated after operating system 182 or applications 181 are executed, etc. The data includes system data (e.g., operating system configuration parameters) and user data, for example, resource usage information about each application is a typical user data.

[0047] The memory 180 generally includes an internal memory and an external memory. The internal memory may be a random access memory, a read-only memory, a cache, etc. The external memory may be a hard disk, an optical disk, a Universal Serial Bus (USB) disk, a floppy disk, a tape drive, etc. Computer programs are generally stored in the external memory, and the processor loads the computer programs from the external memory into the internal memory before processing the computer programs.

[0048] An operating system program 182 is provided in the embodiment of this application. process The operating system program 182 includes a computer program that can implement the control method. Thus, after the processor 150 reads the operating system program 182 and executes the operating system, the operating system can be provided with the process control method provided in the embodiments of this application.

[0049] The electronic device 100 may include an input device 130 for receiving input digital information, text information, or contact touch operations / non-contact gestures and generating signal inputs related to user settings and function control of the electronic device 100. Specifically, in an embodiment of this application, the input device 130 may include a touch panel 131. The touch panel 131, also called a touch screen, may collect touch operations performed by a user on or near the touch panel 131 (e.g., operations performed by a user on the touch panel 131 or on the touch panel 131 using any suitable object or accessory such as a finger or a stylus) and drive a corresponding connected device based on a preset program. Optionally, the touch panel 131 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the user's touch direction, detects signals caused by the touch operations, and transmits the signals to the touch controller. The touch controller can receive touch information from the touch detection device, convert the touch information into touch point coordinates, send the touch point coordinates to the processor 150, and receive and execute commands sent by the processor 150. For example, a user uses a finger to double-tap an icon of an application on the touch panel 131. The touch detection device detects a signal caused by the double tap and transmits the signal to the touch controller. The touch controller then converts the signal into coordinates and sends the coordinates to the processor 150. The processor 150 performs an operation, such as launching an application, based on the coordinates and type of the signal (e.g., double tap). Finally, the operation interface of the application is displayed on the display panel 141, causing the application to be "opened."

[0050] The touch panel 131 may be implemented in multiple types, such as a resistive type, a capacitive type, an infrared type, a surface acoustic wave type, etc. In addition to the touch panel 131, the input device 130 may further include another input device 132. The another input device 132 may include one or more of, but is not limited to, a physical keyboard, function keys (such as a volume control key, a power on / off key, etc.), a trackball, a mouse, a joystick, etc.

[0051] The display device 140 included in the electronic device 100 includes a display panel 141 and is configured to display information input by or provided to a user, various menu interfaces of the electronic device 100, etc., and in the embodiment of this application, is mainly configured to display information such as a user operation interface of an application. Optionally, the display panel 141 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), etc. In some other embodiments, the touch panel 131 may cover the display panel 141 to form a touch display screen.

[0052] In addition to the above, the electronic device 100 may further include a power supply 190 for powering other modules, and a camera 160 for taking pictures or videos. The electronic device 100 may further include one or more sensors 120, such as a gravity sensor, an acceleration sensor, a light sensor, etc. The electronic device 100 may further include a Radio Frequency (RF) circuit 110 configured to perform network communication with a wireless network device, and may further include a Wi-Fi module 170 configured to perform Wi-Fi communication with another device.

[0053] In the following embodiment, the process control method provided in the embodiment of the present application will be described using an electronic device as an execution body. The process control method provided in the embodiment of the present application may be implemented in the operating system program 182 shown in FIG.

[0054] In the running process of an application in an electronic device, the running application occupies a relatively large number of resources, resulting in problems such as excessive slowdown in running speed or slowdown or stuck running of the operating system program. The development of applications adopts a multi-process mechanism. After an application is launched, there are usually multiple active processes, and each process occupies some memory. For example, after WeChat is launched, there are six active processes, occupying a total of more than 600MB of memory. Because applications are complex, problems such as cross-launching of processes within an application, breakdown of the main process, etc. may occur after the application is killed. Therefore, the OEM's current application control (application kill, automatic launch control, etc.) is a control based on the dimensions of the application. That is, the application process meets the protection requirements, and in this case, the entire application is protected. Even if the LMK is triggered, the application is not killed and the application memory cannot be released. As a result, more applications need to be killed to make up for the insufficient memory.

[0055] For example, when a user performs price comparison by switching between Taobao, JD.com, and Pindeuoduo applications, and the memory of the mobile phone is relatively low, the applications running on the mobile phone will be killed. Assuming that the browser has a background downloading process, in order to ensure smooth downloading, the conventional technology may protect the entire browser application process and kill the memory of only Taobao, Jingdong, or Pindeuoduo applications. As a result, the user cannot implement application switching for price comparison, which deteriorates the user experience.

[0056] Existing application control is based on the size of the application, and cannot reclaim the memory of part of the application. In addition, it cannot solve the problem of an application being automatically launched after being killed. Therefore, an embodiment of this application provides a process control method, which may implement the control based on the process size, so that the control is more refined. In addition, it can solve the problem of a single process being repeatedly launched after being killed, improving the user experience.

[0057] FIG. 2 is a schematic block diagram of a user interface according to an embodiment of this application. The electronic device of FIG. 2 may be the electronic device 100 of FIG. 1, and the user interface shown in FIG. 2 is displayed using a display device 140. As shown in FIG. 2, a user may use a process display to view a process status in the electronic device. The process display may display one or more applications running in the electronic device. For example, health, camera, album, settings, etc. The status of a running process of an application may be specifically viewed by tapping on a specified application. For example, tapping on health to view that three processes of the application are running, each process occupying a different CPU and memory. According to the process control method in the embodiment of this application, an application process may be automatically controlled. After a process is killed, the process is not displayed in the process display.

[0058] FIG. 3 is a schematic diagram of a system architecture to which a process control method according to an embodiment of the present application is applied.

[0059] The identification module is configured to identify information regarding application states and process states.

[0060] The execution module is configured to kill a single process.

[0061] The decision module is configured to determine whether to kill the single process or to intercept the startup of the single process.

[0062] The interception module is configured to intercept the auto-start of a killed process.

[0063] The memory state machine checks the current memory state of the terminal device at intervals, which may be a manually preset time value. For example, when the memory of the terminal device reaches low memory, e.g., a preset low memory value, the execution module obtains all processes currently running on the terminal device and puts these processes into the decision module separately for decision making. When making a process decision, the decision module queries the application state identification result and the process state identification result of the identification module, and determines whether to kill a single process based on the system state and user settings, and returns the decision result to the execution module. The execution module determines whether to perform the kill based on the decision result. If the single process needs to be killed, the execution module kills the single process. If the single process does not need to be killed, the execution module performs the decision for the next process. If the single process is automatically started again after killing the single process, the startup of the Android process depends on four major components (activity, service, content provider, and broadcast receiver). Thus, the interception points where each of the four large components are launched are marked and a decision is made as each of the four large components are launched whether interception should be performed. If a process needs to be intercepted, it returns directly from where each of the four large components are launched. The decision is to determine whether to intercept the auto-launch of a single process based on whether the process is a user-perceptible process. If the single process is a user-perceptible process, the single process is allowed to be launched. If the single process is not a user-perceptible process, the interception module intercepts the process and prohibits the single process from being launched.

[0064] 4 is a schematic flow chart of a process control method according to an embodiment of the present application. As shown in FIG 4, it includes steps 401 to 403, which are described in detail as follows.

[0065] S401. Obtain information, a package name, and a process name of a first process of a first application running on a terminal device.

[0066] According to the process control method in the embodiment of this application, all running processes in a terminal device can be controlled. Here, a process in an application is taken as an example for illustration. For the control process of another process, refer to the control process of that process. The package name is a unique identifier of an Android application package. When the Android system manages applications, the package name is also used for indexing. The package name is determined at the beginning of the creation of an Android application project. When an Android application is launched, the process name of the corresponding process is generally the package name.

[0067] S402. Based on the information about the first process, it is determined to kill the first process.

[0068] Specifically, the feature information on the first process includes whether the first process is a foreground / background process, whether the first process is a main process, whether the adj, whether the adjType, whether the first process is a voice dialogue process, whether the first process is a health step count process, whether the first process is a process using GPS, the traffic usage status of the first process, etc. It should be understood that the above is only one example of the feature information on the process in the process control method in the embodiment of this application, and does not constitute a limitation on the embodiment of this application. In addition to the above example, the feature information in the embodiment of this application may further include feature information on another possible process.

[0069] Based on the information about the first process, it is determined to kill the first process. Specifically, the information about the first process may be input to an intelligent decision engine. The intelligent decision engine outputs a control decision result of the first process based on the information about the first process, and the control decision result includes kill and keep. The intelligent decision engine is obtained by pre-training based on sample data, and the sample data includes information about the sample process and a control decision result of the sample process. For example, the intelligent decision engine may be obtained based on a decision tree algorithm. The information about the sample process may be the process information in the above example. The control decision result of the sample process may be determined manually. For example, if the sample process is a foreground process, the control decision result is to keep the sample process, and if the sample process is a background process, other characteristic information about the sample process is determined. Based on the information about the first process, the intelligent decision engine outputs a control decision result of the first process, which is specifically, see the description of the decision tree of the intelligent decision engine in FIG. 5. For brevity, details are not described here in the embodiments of this application. Specifically, the intelligent decision engine may sequentially determine multiple features of the first process, and output a control decision result after sequentially determining the multiple features. If the control decision result is to kill, the first process is killed, and if the control decision result is to keep, the first process is kept. In particular, here, the control decision result of the first process is to kill the first process, and then the following steps are executed:

[0070] S403: The package name and process name of the first process are marked.

[0071] Specifically, after a first process is killed, the package name and process name of the first process are marked, and the process is marked as a killed process.

[0072] S404: The second process is controlled based on the marking result of the package name and the process name of the second process.

[0073] The second process may be the first process that was killed and then restarted, or it may be another process that was not killed. Whether the second process was killed may be determined using the package name and process name of the second process.

[0074] Existing control methods can only perform application-level control. However, the process control method in the embodiment of this application can implement process-level control. Whether a process is important to a user is determined based on multiple determination results of one or more characteristics of the process, so as to determine whether to keep or kill the process. In this way, for multiple processes in an application, some processes may be kept and some processes may be killed, instead of keeping the entire application and taking up excessive memory, or instead of killing the entire application that is important to the user because of memory, which affects the user experience.

[0075] Optionally, the duration of the control of the second process is a first period of time, for example, the first period of time may be from a time when the package name and process name of the second process are marked to a time when the second process is uninstalled from the electronic device.

[0076] Optionally, if the control decision result of the first process is to kill, the package name and process name of the first process are marked after determining to kill the first process. The method in the embodiment of this application includes marking the moment when the first process is killed, and the moment is marked as a first moment, so that the first process is determined when the first process is subsequently launched again.

[0077] Optionally, controlling the second process based on the package name and the process name marking result of the second process includes determining whether the second process is a killed process based on the package name and the process name marking result of the second process when the second process is launched. If the second process is a killed process, the second process is directly prohibited from being launched.

[0078] Optionally, the method in the embodiment of this application further includes, when the second process is launched, determining whether the second process is a killed process based on the marking result of the package name and the process name of the second process. If the second process is a killed process, it is further determined whether the second process is a user-perceptible process. The user-perceptible process includes, but is not limited to, the process being a foreground process, the process having a visible interface, the process being a type of alert process, and the like. If the second process to be launched is not a user-perceptible process, the second process is prohibited from being launched, and if the second process is a user-perceptible process, the second process is allowed to be launched, and the launch moment of the second process is recorded and recorded as the second moment.

[0079] Optionally, when the second process is allowed to be launched, the method in the embodiment of this application further includes: comparing the second instant with the first instant, and if the interval between the second instant and the first instant is less than a first threshold, increasing the effective restart count of the first process by 1. The first threshold may be a manually specified time value.

[0080] Many processes are inevitably restarted automatically after being killed. If the process is not controlled, the previous kill operation will be disappointing. Therefore, the process control method in the embodiment of this application further includes controlling the process that is automatically restarted after being killed. Decide to prohibit or perform the restart of the process by determining whether the process to be restarted is a user-perceptible process. If the process is a user-perceptible process, the restart of the process is deemed necessary. If the process is a user-inperceptible process, the restart of the process is deemed unnecessary.

[0081] Optionally, in S402, when it is determined that the control decision result of the first process is to kill, before killing the first process, the method in the embodiment of this application obtains the effective restart count of the first process, and if the effective restart count of the first process is greater than a second threshold, then the first process is considered important to the user, and the first process is kept. The second threshold may be a manually specified number.

[0082] Since the characteristics of a process determined by the intelligent decision engine are limited, in order to prevent a process important to a user from being killed by mistake, the process control method in the embodiment of this application further includes a fault tolerance mechanism of the intelligent decision engine, that is, when the control decision result is to kill, the effective restart count of the process is obtained, and whether the process really needs to be killed is determined based on the effective restart count.

[0083] Therefore, the process control method according to an embodiment of this application includes control of running processes, control of restarted processes, and modification of process control, so that intelligent control of each process in a terminal device can be implemented, and processes important to the user can be prevented from being killed while memory is being freed, improving the user experience.

[0084] The process control method in the embodiment of this application includes process kill and process restart intercept. Hereinafter, the process control method in the embodiment of this application will be described in detail with reference to FIG.

[0085] In the process control method in the embodiment of this application, an intelligent decision engine is first obtained by training based on a decision tree algorithm. The method for training the intelligent decision engine includes the following steps:

[0086] (1) Decision tree feature selection

[0087] The beta logs in the recent period are analyzed, and based on the information gain, decision tree features are selected, including ongoing foreground and background processes and main process states, adj, adjType, audio interaction, health steps, traffic usage state, etc. The recent period may be a manually specified period, e.g., 3 months. adj is a flag indicating the importance of the process in the Android system, and a smaller value of adj indicates a lower importance of the process. adjType is also used to define the importance of the process, and is used to distinguish different scenarios under the same adj condition. For example, a value of 0 for adj indicates a higher importance of the process. In this case, if the adjType is top-activity, it indicates that the process is a foreground process, and if the adjtype is exec-service, it indicates that the process is a process being called back by the foreground.

[0088] (2) Decision tree generation

[0089] In the process control method in the embodiment of this application, the information gain rate is calculated using the C4.5 algorithm, and the information gain rate is used as the node splitting rule. The information gain rate is calculated as follows:

number

[0090] D represents the training dataset, a represents the decision tree features, V represents the number of features, and D v Let denote the number of features a in the training dataset, and Ent() denotes the information entropy.

[0091] (3) Pruning

[0092] The complete decision tree generated based on the C4.5 algorithm is overfitting to the training samples. The complete decision tree describes the features of the training samples too accurately to perform a reasonable analysis of new samples, so the decision tree needs to be pruned. In the process control method in the embodiment of this application, a pessimistic error pruning (PEP) algorithm in the postpruning method is used. The postpruning method first builds a complete decision tree and runs the decision tree to overfit the training data, and then replaces the node subtrees with low confidence with leaf nodes. In the pruning method, it is difficult to accurately estimate when to stop growing the decision tree, so the postpruning method is more convenient. The PEP algorithm determines the pruning of subtrees based on the error rate before and after pruning. This algorithm uses a top-down method. If the non-leaf node satisfies the following inequality, the leaf node is pruned.

number

[0093] t represents a node in the decision tree, and T t Let denote the subtree containing node t, e() denote ...e′(), and S e ( ) indicates standard deviation.

[0094] The intelligent decision engine tree shown in FIG. 5 may be obtained by the training described above. Whether a single process in an application needs to be killed may be determined based on the intelligent decision engine tree. For example, for a single process in a specified application, it is first determined based on the intelligent decision engine tree whether the process runs in the foreground or background. If the process runs in the foreground, the process is kept (not killed), and if the process runs in the background, it is determined whether the process is a main process. If the process is a main process, the process is kept, and if the process is not a main process, the adj value of the process is determined. If the adj value of the process is less than 900, the process is kept, and if the adj value of the process is greater than 1000, the process is killed. If the adj value of the process is within the interval [900,1000], the adjType of the process is determined. If the adjType of the process is another process, the process is kept. If the adjtType of the process is cch-empty, which indicates that the process is empty, the process is killed. If the process's adjType is cch-bound-services, indicating a foreground bound service, or if the process's adjType is cch-client-act, indicating a process associated with a foreground interface, then it is determined whether the process is for audio interaction. If the process is for audio interaction, e.g., for audio recording or playback, then the process is retained. If the process is not for audio interaction, then it is further determined whether the process is for health walking. If the process is for health walking, then the process is retained. If the process is not for health walking, then the traffic usage state of the process is determined. If the traffic usage state indicates a high flow rate, then the process is retained, and if the traffic usage state indicates a low flow rate, then the process is killed.

[0095] Therefore, whether to kill a process of an application can be determined based on the trained intelligent decision engine tree.Compared with the prior art, the process control method in the embodiment of this application may implement the control of a single process of an application.

[0096] After a process is killed, the process may be automatically restarted. If the process is not intercepted, the process will occupy memory. Therefore, the process control method in the embodiment of this application further includes intercepting the process restart.

[0097] As shown in FIG. 6, when a killed process is ready to be restarted, the process control method in the embodiment of this application determines whether the process is a user-perceivable process. A user-perceivable process includes, but is not limited to, the process being a foreground process, the process having a visible interface, the process being a type of alert process, etc. If the process is not a user-perceivable process, the restart of the process is intercepted. If the process is a user-perceivable process, the restart of the process is allowed, and restart information about the process is recorded.

[0098] The process control method in the embodiment of this application further includes a correction mechanism of the intelligent decision engine. When the intelligent decision engine shown in FIG. 5 determines that the process is not retained, before killing the process, a timestamp for the process is marked to indicate the moment the process is killed. If the process is to be restarted, the process is terminated. If the process is automatically restarted and it is determined as a user-perceptible process as described above, the process is allowed to be restarted. The time interval between the restart time of the process and the marked timestamp is determined. If the time interval is less than 10 seconds, the restart count of the process is increased by 1, otherwise the process is terminated. If the effective restart count of the process is greater than 3, the process is determined to be a process that should not be killed, and the determination result is updated to the learning result corrected by the engine, otherwise the process is terminated. When the next determination result of the intelligent decision engine indicates that the specified process is not retained, before killing the process, the intelligent decision engine determines whether the process is a process that should not be killed and is in the learning result. If the process is a process that should not be killed and is in the learning result, the process is retained. If the process should not be killed and is not in the learning result, the process is still killed. To avoid logic changes due to application upgrades, the duration of the learning result and marking is from the time the marking is performed until the application is uninstalled.

[0099] The intercept mechanism in the process control method in the embodiment of this application may solve the problem of processes occupying memory because the process is automatically restarted after it is killed. The correction mechanism of the intelligent decision engine makes the intelligent decision engine more intelligent and prevents it from killing processes important to users due to erroneous judgments and degrading the user experience.

[0100] According to the process control method in the embodiment of this application, the number of keep-alive applications of the terminal device on 6G increases by 0.6, increasing by 8.5%. The keep-alive rate of the application used last time increases from 95.85% to 98.50%. The application used in the last two times Keep Alive Rate increased from 87.15% to 94.12%. Beta big data shows that the number of times that triggered the original kill has been significantly reduced. The number of times WeChat is killed has decreased by about 40%.

[0101] 7 is a schematic block diagram of a process control device according to an embodiment of the present application. As shown in FIG. 7, the process control device includes an acquisition module 701, a determination module 702, and an execution module 703.

[0102] The obtaining module 701 is configured to obtain information, a package name, and a process name of a first process of a first application running on the terminal device.

[0103] The determination module 702 is configured to determine to kill the first process based on the information about the first process.

[0104] The execution module 703 is configured to mark the package name and the process name of the first process.

[0105] The execution module 703 is further configured to control the second process based on the marking result of the package name and the process name of the second process.

[0106] Optionally, the information about the first process includes a main process, a foreground process or a background process, an audio interaction process, a navigation process, an upload or download process, a step count process, adj information, and adjType information.

[0107] Optionally, the duration for which the execution module 703 controls the second process is a first period of time. For example, the first period of time may be a period of time from when the package name and process name of the second process are marked to when the second process is uninstalled from the electronic device.

[0108] Optionally, the execution module 703 marking the package name and the process name of the first process further comprises marking a first moment at which the first process is killed.

[0109] Optionally, the execution module 703 controlling the second process based on the marking result of the package name and process name of the second process includes launching the second process, determining that the second process is a killed process based on the marking result of the package name and process name of the second process, and prohibiting the second process from being launched.

[0110] Optionally, the execution module 703 controlling the second process based on the marking result of the package name and the process name of the second process includes launching the second process; determining that the second process is a killed process based on the marking result of the package name and the process name of the second process; determining whether the second process is a user-perceptible process, where a user-perceptible process includes a foreground process and / or a process visible on an interface and / or an alert process; and allowing the second process to be launched if the second process is a user-perceptible process, or prohibiting the second process from being launched if the second process is not a user-perceptible process.

[0111] Optionally, allowing the second process to be launched further includes obtaining a second instant at which the first process is launched, and if an interval between the second instant and the first instant is less than a first threshold, increasing an effective restart count of the first process by one.

[0112] Optionally, a determination module 702 is provided.

[0113] Before the determination module kills the first process, the method further includes obtaining a valid restart count of the first process, and if the valid restart count is greater than a second threshold, retaining the first process.

[0114] 8 is a schematic diagram of the structure of a process control device according to an embodiment of this application. The process control device 800 shown in FIG. 8 includes a memory 801, a processor 802, a communication interface 803, and a bus 804. The intercommunication connections of the memory 801, the processor 802, and the communication interface 803 are implemented using the bus 804.

[0115] The communication interface 803 is equivalent to the acquisition module 701 in the process control device 700, and the processor 802 is equivalent to the determination module 702 and the execution module 703 in the process control device 700. The modules and units in the process control device 800 are described in detail below.

[0116] The memory 801 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 801 may store a program. When the program stored in the memory 801 is executed by the processor 802, the processor 802 and the communication interface 803 are configured to execute steps of a process control method in an embodiment of this application. Specifically, the communication interface 803 may obtain information of a process, a package name, and a process name from the memory or another device, and the processor 802 executes process control on the process.

[0117] The processor 802 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits, and is configured to execute related programs to implement functions that need to be performed by units in the process control device in an embodiment of this application (e.g., the processor 802 may execute functions that need to be performed by the determination module 702 and execution module 703 in the process control device 700 described above) or to execute the process control method in an embodiment of this application.

[0118] The processor 802 may be an integrated circuit chip and has a signal processing capability. In the implementation process, the steps of the process control method in the embodiment of this application may be implemented by using a hardware integrated logic circuit in the processor 802 or by using instructions in the form of software.

[0119] The processor 802 may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general purpose processor may be a microprocessor, the processor may be any conventional processor, and the like. The steps of the method disclosed with reference to the embodiments of this application may be directly performed and accomplished by a hardware decode processor, or may be performed and accomplished by a combination of hardware and software modules in the decode processor. The software modules may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, and the like. The storage medium may be located in the memory 801. The processor 802 reads information from the memory 801 and, in combination with the hardware of the processor 802, performs functions that need to be performed by units included in the process control device in an embodiment of this application, or performs a process control method in a method embodiment of this application.

[0120] A transceiver device, such as, but not limited to, a transceiver, is used in the communication interface 803 to implement communication between the apparatus 800 and another device or a communication network. For example, information about the process, package name, and process name may be obtained by the communication interface 803.

[0121] The bus 804 may include a channel for transmitting information between various components of the device 800 (eg, the memory 801, the processor 802, and the communication interface 803).

[0122] Only memory, processor, and communication interface are shown in the above device 800, however, in a specific implementation process, a person skilled in the art should understand that the device 800 may further include other components required for normal operation. Additionally, according to specific requirements, a person skilled in the art should understand that the device 800 may further include hardware components for implementing other additional functions. Additionally, a person skilled in the art should understand that the device 800 may only include components required to implement the embodiments of this application, but does not necessarily need to include all components shown in FIG. 8.

[0123] In one embodiment, when the processing module is a processor 1602 and the storage module is a memory, the electronic device in this embodiment may be a device having the structure shown in FIG.

[0124] This embodiment further provides a computer storage medium, which stores computer instructions, which, when executed on an electronic device, enable the electronic device to perform steps of the related methods described above to implement the process control method in the above embodiment.

[0125] This embodiment further provides a computer program product, which, when executed on a computer, enables the computer to execute the relevant steps described above to implement the process control method in the above embodiment.

[0126] Additionally, an embodiment of this application further provides an apparatus. The apparatus may be, inter alia, a chip, a component, or a module, and the apparatus may include a processor and a memory connected thereto. The memory is configured to store computer-executable instructions. When the apparatus is executed, the processor may execute the computer-executable instructions stored in the memory, so that the chip executes the process control method in the above-mentioned method embodiment.

[0127] The electronic device, computer storage medium, computer program product, or chip provided in the embodiments is configured to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved by the electronic device, computer storage medium, or computer program product, please refer to the beneficial effects of the corresponding method provided above. Details will not be described again here.

[0128] Those skilled in the art will recognize with reference to the embodiments disclosed herein that the units and algorithm steps in the described examples can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether a function is performed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but the implementation should not be considered to go beyond the scope of this application.

[0129] For convenient and simple description, the detailed work processes of the above-mentioned systems, apparatuses, and units may be referred to the corresponding processes of the above-mentioned method embodiments, and it will be obviously understood by those skilled in the art that the details will not be described again here.

[0130] In some embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other manners. For example, the described device embodiment is only an example. For example, the unit division is only a logical service division, and may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system, and some features may be ignored or not implemented. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be implemented by using some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electronic, mechanical, or other forms.

[0131] The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, may be located in one location, or may be distributed across multiple network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.

[0132] Additionally, the functional units in the embodiments of this application may be integrated into one processing unit, and each of the units may exist physically alone, or two or more units may be integrated into one unit.

[0133] When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of this application may be essentially implemented in the form of a software product, a part contributing to the prior art may be implemented in the form of a software product, or a part of the technical solution may be implemented in the form of a software product. The software product is stored in a storage medium and includes a plurality of instructions for instructing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of this application. The aforementioned storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0134] The above description is merely a specific implementation of this application, but is not intended to limit the scope of protection of this application. Any modifications or replacements that can be easily understood by those skilled in the art within the technical scope disclosed in this application shall be included in the scope of protection of this application. Therefore, the scope of protection of this application shall be subject to the scope of protection of the claims.

Claims

1. 1. A process control method comprising: Obtaining information regarding a first process and a third process of a first application running on a terminal device; killing the first process and keeping the third process based on information of the first process and the third process; controlling a second process of the first application, the second process having been killed; Controlling a second process of the first application includes: determining whether the second process is a user-perceptible process; and if the second process is a user-perceptible process, allowing the second process to be launched.

2. 2. The method of claim 1, wherein the information about the first process includes one of a main process, a foreground or background process, an audio interaction process, a navigation process, an upload or download process, a step count process, adj information, or adjType information.

3. The method comprises: marking a package name and a process name of the second process; Controlling a second process of the first application includes: The method according to claim 1 or 2, further comprising controlling the second process based on the marking result of the second process.

4. A method according to any one of claims 1 to 3, wherein the duration of the controlling is a first period.

5. Controlling a second process of the first application includes: determining that the second process is a once-killed process; and prohibiting the second process from being launched.

6. Controlling the second process of the first application includes: The method of any one of claims 1 to 4, comprising prohibiting the second process from being launched if the second process is not a user-perceptible process.

7. 7. The method of claim 6, wherein the user-perceptible process comprises one of a foreground process, a process visible on an interface, an alert process, an upload process, a download process, or a process related to a foreground process.

8. The method comprises: marking the first moment that the second process was killed; Allowing the second process to be launched includes: obtaining a second instant at which the second process is initiated; and 8. The method of claim 6 or 7, further comprising: if the interval between the second instant and the first instant is less than a first threshold, increasing a valid restart count of the second process by one.

9. The method comprises: obtaining the valid restart count of the second process; The method of claim 8 , further comprising: determining to retain the second process if the effective restart count is greater than a second threshold.

10. 1. An electronic device comprising: a memory configured to store a program; A processor configured to execute the program stored in the memory, the processor being capable of executing the method according to any one of claims 1 to 9, when the program stored in the memory is executed.

11. A computer readable storage medium storing program code, which, when executed by a processor, enables the processor to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Application freezing method and device, terminal and computer readable storage medium

    CN109992376A

  • Process freezing method and device, terminal and storage medium

    CN111381952A

  • Process management device, process management method, and process management program

    JP2014160295A

  • Search program, search device and search method

    JP2017097462A