Process operation control method, device, storage medium and electronic device

By obtaining and analyzing the status information of the Binder service client, the abnormal application process is determined and terminated, which solves the system restart problem caused by the abnormality of the system process holding the Binder service client, and improves the stability and user experience of the system.

CN113168465BActive Publication Date: 2025-01-21SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201880098425.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-21
Publication Date
2025-01-21
Estimated Expiration
2038-11-21

AI Technical Summary

Technical Problem

When an exception occurs when the Binder service client of the system process holding the application process, the system will be restarted and affect the stability of the system.

Method used

By obtaining the status information of the Binder service client of a single application process held by the system process, the abnormal application process is determined based on the preset abnormal application process determination conditions, and the abnormal application process is terminated to prevent the system from restarting.

Benefits of technology

Effectively prevent system restarts caused by global system reference overflow, improve system operation stability, and optimize user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113168465B_ABST
    Figure CN113168465B_ABST
Patent Text Reader

Abstract

A process operation control method, applied to an electronic device, comprises: obtaining status information of a Binder service client of a single application process held by a system process (101); obtaining a preset abnormal application process determination condition (102); determining an abnormal application process whose status information satisfies the abnormal application process determination condition (103); and terminating the abnormal application process (104). The method can detect and terminate the abnormal application process, thereby improving the stability of the operation of the electronic device operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic equipment, and in particular, relates to a process operation control method, device, storage medium and electronic equipment. Background Art

[0002] With the continuous advancement of technology, electronic devices based on the Android system (such as smartphones, tablets, etc.) are becoming more and more popular. Users can install various applications in electronic devices to achieve different functions. The system process of the electronic device holds many Binder service clients of application processes to achieve communication between different application processes. However, when the Binder service client of the application process held by the system process fails, it will cause the system to restart. Summary of the invention

[0003] The embodiments of the present application provide a process execution control method, device, storage medium and electronic device, which can improve the stability of the operation of the operating system of the electronic device.

[0004] In a first aspect, an embodiment of the present application provides a process operation control method, which is applied to an electronic device, including:

[0005] Get the status information of the Binder service client of a single application process held by the system process;

[0006] Obtaining preset abnormal application process determination conditions;

[0007] Determine an abnormal application process whose state information satisfies the abnormal application process determination condition;

[0008] The abnormal application process is terminated.

[0009] In a second aspect, an embodiment of the present application provides a process operation control device, which is applied to an electronic device, including:

[0010] The first acquisition module is used to obtain the status information of the Binder service client of a single application process held by the system process;

[0011] A second acquisition module is used to acquire a preset abnormal application process determination condition;

[0012] A determination module, configured to determine an abnormal application process whose state information satisfies the abnormal application process determination condition;

[0013] The execution module is used to terminate the abnormal application process.

[0014] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the process operation control method provided in the first aspect of the embodiment of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the processor is configured to execute, by calling a computer program stored in the memory:

[0016] Get the status information of the Binder service client of a single application process held by the system process;

[0017] Obtaining preset abnormal application process determination conditions;

[0018] Determine an abnormal application process whose state information satisfies the abnormal application process determination condition;

[0019] The abnormal application process is terminated.

[0020] The present application can detect the running abnormal application process according to the preset abnormal application process determination condition, terminate the abnormal application process, and prevent the system restart caused by the system global reference overflow, thereby improving the stability of the system operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The specific implementation methods of the present application will be described in detail below in conjunction with the accompanying drawings, so that the technical solution and beneficial effects of the present application will become more apparent.

[0022] Figure 1 It is a flow chart of a process operation control method provided in an embodiment of the present application.

[0023] Figure 2 This is another flowchart of the process operation control method provided in an embodiment of the present application.

[0024] Figure 3 This is an example diagram for displaying inquiry information in an embodiment of the present application.

[0025] Figure 4 This is another example diagram for displaying inquiry information in an embodiment of the present application.

[0026] Figure 5 It is a structural diagram of a process operation control device provided in an embodiment of the present application.

[0027] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0028] Figure 7 This is another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] Please refer to the drawings, where the same component symbols represent the same components. The principle of the present application is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application, which should not be considered as limiting other specific embodiments not described in detail herein.

[0030] To facilitate understanding of the technical solution of this application, the following is a brief introduction to Binder:

[0031] Binder is a way of inter-process communication (IPC) in the Android system and one of the most important features in the Android system. There are four major components in the Android system: Activity, Service, Broadcast Receiver, and Content Provider. Different applications run in different processes. Binder is a bridge for communication between these processes. As its name "adhesive" means, it glues the various components in the system together and is a bridge between the various components.

[0032] In the Android system, the underlying communication between multiple processes all relies on the Binder IPC mechanism. For example, when the Activity in process A wants to communicate with the Service in process B, it needs to rely on Binder IPC. Not only that, the entire Android system architecture uses the Binder mechanism as an IPC solution.

[0033] Of course, there are some other IPC methods, such as pipes, SystemV, Socket, etc. However, due to the following characteristics of Binder, the underlying communication between multiple processes in the Android system all relies on the Binder IPC mechanism.

[0034] 1. Performance

[0035] On mobile devices (devices with limited performance, such as those that need to save power), the extensive use of cross-process communication has strict requirements on the performance of the communication mechanism. Binder is more efficient than the traditional Socket method. Binder data copying only needs one time, while pipes, message queues, and Sockets all need two times. The shared memory method does not require any memory copying, but the implementation method is more complicated.

[0036] 2. Security

[0037] Traditional process communication methods do not strictly verify the identities of both communicating parties. For example, the IP address of Socket communication is manually filled in by the client and is very easy to forge. The Binder mechanism supports identity verification of both communicating parties from the protocol itself, thus greatly improving security.

[0038] Under normal conditions, the Android system process holds many Binder service clients of application processes. The application process can make the system process hold the agent of the Binder service client of the application process by communicating with the system process through Binder and sending the Binder service object of the application process; however, if an abnormal application process continuously sends Binder service objects to the system process, the number of Binder service clients of the application process held by the system process will continue to grow, eventually exceeding the threshold, causing the system's global reference overflow and eventually causing the system to restart. Therefore, the present application provides a process operation control method that can detect abnormal applications that have been sending Binder service objects to the system process and cause the number of Binder service clients held by the system process to continue to grow, terminate the abnormal application, and prevent the system from restarting due to the global reference overflow of the system.

[0039] See also Figure 1 , Figure 1 A schematic diagram of a process operation control method provided in an embodiment of the present application. The process operation control method can be applied to an electronic device, and the process of the process operation control method can include:

[0040] Step 101: Obtain status information of a Binder service client of a single application process held by a system process.

[0041] In an embodiment of the present application, a scanning cycle can be set. During the scanning cycle, the electronic device intermittently scans the Binder communication status of the system process at a preset time interval. Each scan obtains a set of Binder communication status data of the system process, and the status data can be stored in the memory for processor call. The status information of the Binder service client of the system process holding a single application process can be obtained from the Binder communication status data of the system process.

[0042] Step 102: Obtain preset abnormal application process determination conditions.

[0043] In the embodiment of the present application, an abnormal application process determination condition is pre-set, and the application process that may cause the system to restart can be detected according to the abnormal application process determination condition, and such an application process that may cause the system to restart is called an abnormal application process. Accordingly, after the electronic device obtains the status information of the Binder service client of the system process holding a single application process, it can further obtain the preset abnormal application process determination condition, and thus detect the abnormal application process that may cause the system to restart according to the abnormal application process determination condition.

[0044] Step 103: Determine an abnormal application process whose status information satisfies the abnormal application process determination condition.

[0045] In an embodiment of the present application, after obtaining the preset abnormal application process determination condition, the electronic device compares the status information of a single application process with the abnormal application process determination condition, determines the application process whose status information meets the abnormal application process determination condition, and records the application process whose status information meets the abnormal application process determination condition as an abnormal application process.

[0046] Step 104: terminate the abnormal application process.

[0047] According to the abnormal application process determined in step 103, the abnormal application process is forcibly terminated.

[0048] The embodiment of the present application can detect the running abnormal application process according to the preset abnormal application process determination condition, terminate the abnormal application process, and prevent the system restart caused by the system global reference overflow, thereby improving the stability of the system operation and optimizing the user experience of the electronic device.

[0049] In one embodiment, the status information includes the number of Binder service clients of a single application process held by the system process, and the abnormal application process determination conditions include:

[0050] The number of Binder service clients of the single application process held by the system process reaches a first preset value.

[0051] It should be noted that in an electronic device with an Android operating system, the system process holds many Binder service clients of application processes. The application process can make the system process hold the agent of the Binder service client of the application process by performing Binder communication with the system process and sending the Binder service object of the application process. There is a threshold for the total number of Binder service clients of the application process held by the system process, which is called the third preset value. If the total number of Binder service clients of the application process held by the system process exceeds the third preset value, it will cause a system global reference overflow, thereby causing the system to restart.

[0052] In an embodiment of the present application, a threshold value, that is, a first preset value, can be set for the number of Binder service clients of a single application process held by the system process, and the sum of all first preset values ​​is less than a third preset value. For example, the system can run 10 application processes at the same time, and the first preset value of a single application process is 50, then the third preset value of the system must be greater than 500. Therefore, the abnormal application process judgment condition can be set as: the number of Binder service clients of a single application process held by the system process reaches the first preset value. That is, when the number of Binder service clients of a single application process held by the system process reaches the corresponding threshold, the application process can be judged as an abnormal application process.

[0053] In one embodiment, the status information includes the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time period, and the abnormal application process determination conditions include:

[0054] The growth amount of the number of Binder service clients of the single application process held by the system process within the preset time period reaches a second preset value.

[0055] It should be noted that there is a situation where the number of Binder service clients held by the system process for a single application process does not exceed the corresponding threshold, but over a period of time, the number of Binder service clients held by the system process for the single application process continues to grow. For example, the first preset value of a single application process is 50, and the three scan results show that the number of Binder service clients held by the system process for the single application process is 28, 37, and 49, respectively. In this case, the number of Binder service clients held by the system process for the single application process will soon exceed the corresponding threshold. A threshold value, that is, a second preset value, can be set for the growth amount of the number of Binder service clients held by the system process for a single application process, so as to determine whether the growth amount of the number of Binder service clients held by the system process for a single application process within a preset time length is too large, and if so, the application process is determined to be an abnormal application process. Therefore, the abnormal application process determination condition can be set as: the growth amount of the number of Binder service clients held by the system process for a single application process within a preset time length reaches the second preset value. That is, when the growth amount of the number of Binder service clients of a single application process held by the system process reaches a corresponding threshold within a preset time period, the application process can be determined to be an abnormal application process.

[0056] See also Figure 2 , Figure 2 Another flowchart of a process operation control method provided in an embodiment of the present application. The process operation control method can be applied to an electronic device, and the process of the process operation control method can include:

[0057] Step 201 , determining whether the current time has reached a preset abnormal application process identification time, if yes, executing step 202 , otherwise continuing to execute step 201 .

[0058] In an embodiment of the present application, a scanning cycle can be set. The electronic device intermittently scans the Binder communication status of the system process according to the scanning cycle, thereby obtaining the status information of the Binder service client of the system process holding a single application process. Among them, each scanning cycle corresponds to an abnormal application process identification time, and the electronic device determines whether the current time reaches the preset abnormal application process identification time. If the judgment result is yes, it goes to step 202 and starts scanning the Binder communication status of the system process.

[0059] Step 202: Obtain the number of Binder service clients of a single application process held by the system process.

[0060] The electronic device scans the Binder communication status of the system process to obtain the status information of the Binder service client of the system process holding a single application process, thereby obtaining the number of the Binder service clients of the system process holding a single application process.

[0061] Step 203, determine whether the number of Binder service clients of a single application process held by the system process reaches a first preset value. If yes, execute step 205, otherwise execute step 204.

[0062] It should be noted that in an electronic device with an Android operating system, the system process holds many Binder service clients of application processes. The application process can make the system process hold the agent of the Binder service client of the application process by performing Binder communication with the system process and sending the Binder service object of the application process. There is a threshold for the total number of Binder service clients of the application process held by the system process, which is called the third preset value. If the total number of Binder service clients of the application process held by the system process exceeds the third preset value, it will cause a system global reference overflow, thereby causing the system to restart.

[0063] In addition, a threshold value, i.e., a first preset value, can be set for the number of Binder service clients of a single application process held by the system process, and the sum of all first preset values ​​is less than the third preset value. For example, the system can run 10 application processes at the same time, and the first preset value of a single application process is 50, then the third preset value of the system must be greater than 500.

[0064] In an embodiment of the present application, the electronic device can detect whether an application process is an abnormal application process based on the number of Binder service clients of a single application process held by the system process. "In an embodiment of the present application, an application process that may cause a system restart is referred to as an abnormal application process." Among them, the electronic device determines whether the number of Binder service clients of a single application process held by the system process reaches a first preset value. When the number of Binder service clients of a single application process held by the system process reaches a corresponding threshold (first preset value), the electronic device determines that the application process is an abnormal application process. If the judgment result of step 203 is yes, it indicates that the number of Binder service clients of a single application process held by the system process at this time has reached the first preset value, and the single application process is an abnormal application process; if the judgment result of step 203 is no, it indicates that the number of Binder service clients of a single application process held by the system process at this time has not reached the first preset value, and whether the single application process is an abnormal application process needs to be further judged.

[0065] Step 204 , determining whether the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time period reaches a second preset value. If yes, executing step 205 , otherwise returning to step 201 .

[0066] It should be noted that there is a situation where the number of Binder service clients held by the system process for a single application process does not exceed the corresponding threshold, but within the preset duration (i.e., the duration between two adjacent abnormal application process identification moments, or the duration between the current abnormal application process identification moment and the previous abnormal application process identification moment), the number of Binder service clients held by the system process for the single application process continues to grow. For example, the first preset value of a single application process is 50, and the three scanning results show that the number of Binder service clients held by the system process for the single application process is 28, 37, and 49, respectively. In this case, the number of Binder service clients held by the system process for the single application process will soon exceed the corresponding threshold (i.e., the first preset value). A threshold value, i.e., the second preset value, can be set for the growth amount of the number of Binder service clients held by the system process for a single application process, so as to determine whether the growth amount of the number of Binder service clients held by the system process for a single application process within the preset duration is too large, and if so, the application process is determined to be an abnormal application process.

[0067] In an embodiment of the present application, when the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time length reaches the corresponding threshold value (second preset value), the electronic device determines that the application process is an abnormal application process. This indicates that within a scanning cycle, the single application process continues to send Binder service clients to the system process, causing the number of Binder service clients held by the system process for the single application process to continue to grow within the scanning cycle. If the judgment result of step 204 is yes, it indicates that the growth amount of the number of Binder service clients held by the system process for a single application process within the preset time length reaches the second preset value, and the single application process is an abnormal application process; if the judgment result of step 204 is no, it indicates that the growth amount of the number of Binder service clients held by the system process for a single application process within the preset time length does not reach the second preset value, and whether the single application process is an abnormal application process needs to be re-judged after the next scan obtains the number of Binder service clients held by the system process for a single application process.

[0068] Step 205, determine whether the abnormal application process is a preset application process. If yes, execute step 207, otherwise execute step 206.

[0069] After the determination in step 203 and step 204, the abnormal application process has been identified. However, considering that the abnormal application process may be frequently accessed or currently accessed by the user, a step is set for the user to confirm whether to terminate the abnormal application process.

[0070] In one embodiment, the application process that the user does not frequently access and is not currently accessing can be set as the preset application process. If the judgment result of step 205 is yes, indicating that the abnormal application process is an application process that the user does not frequently access and is not currently accessing, the abnormal application process can be directly terminated; if the judgment result of step 205 is no, indicating that the abnormal application process is an application process that the user frequently accesses and / or is currently accessing, it is necessary to output a query message to ask the user whether to terminate the abnormal application process.

[0071] Step 206: output inquiry information.

[0072] In one implementation, the inquiry information may be displayed via a notification bar.

[0073] For example, see Figure 3 , Figure 3 This is an example diagram showing query information in the embodiment of the present application. Figure 3As shown, the electronic device can display an inquiry message in the notification bar: "XXX application process is an abnormal application process, click this notification to confirm termination." Where "XXX" is the name of the abnormal application process. When the user clicks the inquiry message in the notification bar, the electronic device will display detailed information of the abnormal application process and provide the user with a button to confirm termination of the abnormal application process, so that the user can confirm termination of the abnormal application process.

[0074] In one implementation, a prompt box may be generated to display the inquiry information.

[0075] For example, see Figure 4 , Figure 4 Another example diagram of displaying inquiry information in an embodiment of the present application. A prompt box 300 pops up in the display area of ​​the electronic device, and the content of the prompt box 300 may include: inquiry information 301 "XXX application process is an abnormal application process. Continuous operation will cause the system to restart. Do you want to terminate the application process?", a confirmation button 302 and a cancel button 303. The user can directly click the confirmation button 302 in the prompt box 300 to confirm the termination of the abnormal application process, or click the cancel button 303 to cancel the termination of the abnormal application process.

[0076] In addition, if the abnormal application process is the application process that the user is accessing, and the user cannot terminate the abnormal application process immediately, the user can click the cancel button 303 to cancel the termination of the abnormal application process. Because the sum of all the first preset values ​​(the threshold value of the number of Binder service clients of a single application process held by the system process) is less than the third preset value (the threshold value of the total number of Binder service clients of the application process held by the system process), even if the user chooses to cancel the termination of the abnormal application process, the system global reference will not overflow immediately, thereby causing the system to restart.

[0077] After the query information is output, if confirmation information for terminating the abnormal application process is received from the user, the process proceeds to step 207 to terminate the abnormal application process.

[0078] Step 207, terminating the abnormal application process.

[0079] Since the embodiments of the present application can effectively detect abnormal application processes that continuously send Binder service objects to the system process and cause the number of Binder service clients held by the system process to continue to grow, and actively terminate the abnormal application process, the embodiments of the present application can effectively prevent the abnormal application process from causing the system to restart due to the overflow of the system global reference, thereby reducing the occurrence of abnormal restarts during the normal use of the device by the user, thereby giving the user a better experience.

[0080] See also Figure 5 , Figure 5A schematic diagram of a process operation control device provided in an embodiment of the present application. The process operation control device can be applied to electronic devices, and the process operation control device can include: a first acquisition module 501, a second acquisition module 502, a determination module 503 and an execution module 504.

[0081] The first acquisition module 501 is used to acquire the status information of the Binder service client of a single application process held by the system process.

[0082] In an embodiment of the present application, a scanning cycle can be set. During the scanning cycle, the first acquisition module 501 intermittently scans the Binder communication status of the system process at a preset time interval. Each scan obtains a set of Binder communication status data of the system process, and the status data can be stored in the memory for processor call. The status information of the Binder service client of a single application process held by the system process can be obtained from the Binder communication status data of the system process.

[0083] The second acquisition module 502 is used to acquire a preset abnormal application process determination condition.

[0084] In the embodiment of the present application, an abnormal application process determination condition is pre-set, and the application process that may cause the system to restart can be detected according to the abnormal application process determination condition, and such an application process that may cause the system to restart is called an abnormal application process. Accordingly, after the first acquisition module 501 obtains the state information of the Binder service client of the system process holding a single application process, the second acquisition module 502 can further obtain the preset abnormal application process determination condition, so as to detect the abnormal application process that may cause the system to restart according to the abnormal application process determination condition.

[0085] The determination module 503 is used to determine the abnormal application process whose state information satisfies the abnormal application process determination condition.

[0086] In an embodiment of the present application, after the second acquisition module 502 acquires the preset abnormal application process determination condition, the determination module 503 compares the status information of a single application process with the abnormal application process determination condition, determines the application process whose status information satisfies the abnormal application process determination condition, and records the application process whose status information satisfies the abnormal application process determination condition as an abnormal application process.

[0087] The execution module 504 is used to terminate the abnormal application process.

[0088] According to the abnormal application process determined by the determination module 503 , the execution module 504 forcibly terminates the abnormal application process.

[0089] In one implementation, the status information includes the number of Binder service clients of a single application process held by the system process, and the abnormal application process determination conditions include:

[0090] The number of Binder service clients of the single application process held by the system process reaches a first preset value.

[0091] It should be noted that in an electronic device with an Android operating system, the system process holds many Binder service clients of application processes. The application process can make the system process hold the agent of the Binder service client of the application process by performing Binder communication with the system process and sending the Binder service object of the application process. There is a threshold for the total number of Binder service clients of the application process held by the system process, which is called the third preset value. If the total number of Binder service clients of the application process held by the system process exceeds the third preset value, it will cause a system global reference overflow, thereby causing the system to restart.

[0092] In an embodiment of the present application, a threshold value, that is, a first preset value, can be set for the number of Binder service clients of a single application process held by the system process, and the sum of all first preset values ​​is less than a third preset value. For example, the system can run 10 application processes at the same time, and the first preset value of a single application process is 50, then the third preset value of the system must be greater than 500. Therefore, the abnormal application process judgment condition can be set as: the number of Binder service clients of a single application process held by the system process reaches the first preset value. That is, when the number of Binder service clients of a single application process held by the system process reaches the corresponding threshold, the application process can be judged as an abnormal application process.

[0093] In one embodiment, the status information includes the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time period, and the abnormal application process determination conditions include:

[0094] The growth amount of the number of Binder service clients of the single application process held by the system process within the preset time period reaches a second preset value.

[0095] It should be noted that there is a situation where the number of Binder service clients held by the system process for a single application process does not exceed the corresponding threshold, but over a period of time, the number of Binder service clients held by the system process for the single application process continues to grow. For example, the first preset value of a single application process is 50, and the three scan results show that the number of Binder service clients held by the system process for the single application process is 28, 37, and 49, respectively. In this case, the number of Binder service clients held by the system process for the single application process will soon exceed the corresponding threshold. A threshold value, that is, a second preset value, can be set for the growth amount of the number of Binder service clients held by the system process for a single application process, so as to determine whether the growth amount of the number of Binder service clients held by the system process for a single application process within a preset time length is too large, and if so, the application process is determined to be an abnormal application process. Therefore, the abnormal application process determination condition can be set as: the growth amount of the number of Binder service clients held by the system process for a single application process within a preset time length reaches the second preset value. That is, when the growth amount of the number of Binder service clients of a single application process held by the system process reaches a corresponding threshold within a preset time period, the application process can be determined to be an abnormal application process.

[0096] In one implementation, before obtaining the status information of the Binder service client of a single application process held by the system process, the first obtaining module 501 may be used to:

[0097] Determine whether the current time has reached the preset abnormal application process identification time;

[0098] If yes, obtain the status information of the Binder service client of a single application process held by the system process.

[0099] In an embodiment of the present application, a scanning cycle can be set. The first acquisition module 501 intermittently scans the Binder communication status of the system process according to the scanning cycle, and obtains the status information of the Binder service client of the system process holding a single application process. Among them, each scanning cycle corresponds to an abnormal application process identification moment. The first acquisition module 501 determines whether the current moment reaches the preset abnormal application process identification moment. If the judgment result is yes, it starts to scan the Binder communication status of the system process to obtain the status information of the Binder service client of the system process holding a single application process.

[0100] In one implementation, before terminating the abnormal application process, the execution module 504 may be used to:

[0101] Determine whether the abnormal application process is a preset application process;

[0102] If so, terminate the abnormal application process.

[0103] Among them, a person skilled in the art may set an application process that is not frequently accessed by a user and is not currently being accessed as a preset application process according to actual needs. Thus, before terminating the abnormal application process, the execution module 504 may determine whether the determined abnormal application process is a preset application process, and if so, it indicates that the abnormal application process is an application process that is not frequently accessed by the user and is not currently being accessed, and the abnormal application process may be directly terminated.

[0104] In one implementation, after determining whether the abnormal application process is a preset application process, the execution module 504 may also be used to:

[0105] If not, then output a query message, the query message is used to ask the user whether to terminate the abnormal application process;

[0106] If confirmation information for terminating the abnormal application process input by the user is received, the abnormal application process is terminated.

[0107] If the judgment result is no, it indicates that the abnormal application process is an application process that the user frequently accesses and / or is accessing. At this time, the user can confirm whether to terminate the abnormal application process.

[0108] The execution module 504 outputs inquiry information, which is used to inquire the user whether to terminate the abnormal application process. If the confirmation information input by the user to terminate the abnormal application process is received, the execution module 504 terminates the abnormal application process.

[0109] As an optional implementation, when outputting the query information, the execution module 504 may be used to:

[0110] Display inquiry information through the notification bar.

[0111] For example, see Figure 3 , Figure 3 This is an example diagram showing query information in the embodiment of the present application. Figure 3 As shown, the execution module 504 can display an inquiry message in the notification bar: "XXX application process is an abnormal application process, click this notification to confirm termination." Where "XXX" is the name of the abnormal application process. The user clicks the inquiry message in the notification bar, and the execution module 504 will display detailed information of the abnormal application process and provide the user with a button to confirm termination of the abnormal application process, so that the user can confirm termination of the abnormal application process.

[0112] In another optional implementation, when outputting the query information, the execution module 504 may be used to:

[0113] Generate a prompt box and display the query information through the prompt box.

[0114] For example, see Figure 4 , Figure 4 Another example diagram of displaying inquiry information in an embodiment of the present application. A prompt box 300 pops up in the display area of ​​the electronic device, and the content of the prompt box 300 may include: inquiry information 301 "XXX application process is an abnormal application process. Continuous operation will cause the system to restart. Do you want to terminate the application process?", a confirmation button 302 and a cancel button 303. The user can directly click the confirmation button 302 in the prompt box 300 to confirm the termination of the abnormal application process, or click the cancel button 303 to cancel the termination of the abnormal application process.

[0115] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the steps in the process operation control method provided in the first aspect of this embodiment.

[0116] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the process in the process operation control method provided in the present embodiment by calling a computer program stored in the memory.

[0117] See also Figure 6 , Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include components such as a memory 601 and a processor 602. Those skilled in the art may understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0118] The memory 601 can be used to store applications and data. The applications stored in the memory 601 include executable codes. The applications can be composed of various functional modules. The processor 602 executes various functional applications and data processing by running the applications stored in the memory 601.

[0119] The processor 602 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in the memory 601 and calling data stored in the memory 601, thereby monitoring the electronic device as a whole.

[0120] In this embodiment, the processor 602 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 601 according to the following instructions, and the processor 602 will run the application program stored in the memory 601 to execute:

[0121] Get the status information of the Binder service client of a single application process held by the system process;

[0122] Obtaining preset abnormal application process determination conditions;

[0123] Determine the abnormal application process whose status information satisfies the abnormal application process determination condition;

[0124] Terminate the abnormal application process.

[0125] See also Figure 7 , Figure 7 Another structural diagram of an electronic device provided in an embodiment of the present application. Figure 6 The difference between the electronic device shown is that the electronic device may include components such as an input unit 603 and an output unit 604 in addition to the memory 601 and the processor 602 .

[0126] Among them, the input unit 603 can be used to receive input numbers, character information or user feature information (such as fingerprints, voiceprints, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0127] The output unit 604 may be used to output information input by a user or information provided to a user, such as a speaker.

[0128] In this embodiment, the processor 602 in the electronic device will load the executable code corresponding to the process of one or more application programs into the processor 601 according to the following instructions, and the processor 602 will run the application program stored in the processor 601 to execute:

[0129] Get the status information of the Binder service client of a single application process held by the system process;

[0130] Obtaining preset abnormal application process determination conditions;

[0131] Determine the abnormal application process whose status information satisfies the abnormal application process determination condition;

[0132] Terminate the abnormal application process.

[0133] In one embodiment, before obtaining the status information of the Binder service client of a single application process held by the system process, the processor 602 may also execute: determining whether the current moment reaches the preset abnormal application process identification moment; if so, obtaining the status information of the Binder service client of a single application process held by the system process.

[0134] In one implementation, the status information includes the number of Binder service clients of a single application process held by the system process, and the abnormal application process determination condition may include: the number of Binder service clients of a single application process held by the system process reaches a first preset value.

[0135] In one embodiment, the status information includes the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time period, and the abnormal application process determination condition may include: the growth amount of the number of Binder service clients of a single application process held by the system process within a preset time period reaches a second preset value.

[0136] In one implementation, before terminating the abnormal application process, the processor 602 may further execute: determining whether the abnormal application process is a preset application process; if so, terminating the abnormal application process.

[0137] In one embodiment, after determining whether the abnormal application process is a preset application process, the processor 602 may further execute: if not, outputting an inquiry message, the inquiry message being used to inquire the user whether to terminate the abnormal application process; if receiving confirmation information input by the user to terminate the abnormal application process, terminating the abnormal application process.

[0138] In one implementation, when outputting the inquiry information, the processor 602 may execute: displaying the inquiry information through a notification bar.

[0139] In one implementation, when outputting the inquiry information, the processor 602 may execute: generating a prompt box, and displaying the inquiry information through the prompt box.

[0140] The electronic device provided in the embodiment of the present application belongs to the same concept as the process running control method in the above embodiment. Any method provided in the process running control method embodiment can be run on the electronic device. The specific implementation process is detailed in the process running control method embodiment and will not be repeated here.

[0141] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the process operation control method above, and will not be repeated here.

[0142] It should be noted that, for the process operation control method provided in the embodiment of the present application, ordinary technicians in this field can understand that all or part of the process of implementing the process operation control method provided in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as stored in a memory, and executed by at least one processor, and the execution process may include the process of the embodiment of the process operation control method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.

[0143] For the process operation control device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.

[0144] The above is a detailed introduction to a process operation control method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A process operation control method, applied to an electronic device, characterized in that: include: Get the number of Binder service clients held by the system process for a single application process; If there is a single application process whose number of Binder service clients held by the system process reaches a first preset value, the single application process is determined as the abnormal application process that causes the system to restart; if there is no single application process whose number of Binder service clients held by the system process reaches the first preset value, it is determined that the growth amount of the number of Binder service clients held by the system process within a preset time period reaches a second preset value, and the single application process is determined as the abnormal application process that causes the system to restart; terminating the abnormal application process; Among them, the third preset value is the threshold value of the total number of Binder service clients of the application process held by the system process. If the number of Binder service clients of a single application process held by the system process increases according to the growth amount reaching the second preset value, the number of Binder service clients held by the system process for the single application process will reach the first preset value. When the total number of Binder service clients of the application process held by the system process exceeds the third preset value, the system global reference overflow will occur and restart.

2. The process operation control method according to claim 1, characterized in that: Before obtaining the number of Binder service clients of a single application process held by the system process, the method further includes: Determine whether the current time has reached the preset abnormal application process identification time; If yes, get the number of Binder service clients of a single application process held by the system process.

3. The process operation control method according to claim 1, characterized in that: Before terminating the abnormal application process, the method further includes: Determining whether the abnormal application process is a preset application process; If so, the abnormal application process is terminated.

4. The process operation control method according to claim 3, characterized in that: After determining whether the abnormal application process is a preset application process, the method further includes: If not, outputting a query message, wherein the query message is used to ask the user whether to terminate the abnormal application process; If confirmation information input by the user to terminate the abnormal application process is received, the abnormal application process is terminated.

5. The process operation control method according to claim 4, characterized in that: The output query information includes: The inquiry information is displayed through a notification bar.

6. The process operation control method according to claim 4, characterized in that: The output query information includes: A prompt box is generated, and the inquiry information is displayed through the prompt box.

7. A process operation control device, applied to electronic equipment, characterized in that: include: The first acquisition module is used to obtain the number of Binder service clients of a single application process held by the system process; A determination module, configured to determine, if there is a single application process whose number of Binder service clients held by the system process reaches a first preset value, the single application process as an abnormal application process that causes the system to restart; if there is no single application process whose number of Binder service clients held by the system process reaches the first preset value, determine a single application process whose number of Binder service clients held by the system process reaches a second preset value within a preset time period, and determine the single application process as an abnormal application process that causes the system to restart; An execution module, used for terminating the abnormal application process; Among them, the third preset value is the threshold value of the total number of Binder service clients of the application process held by the system process. If the number of Binder service clients of a single application process held by the system process increases according to the growth amount reaching the second preset value, the number of Binder service clients held by the system process for the single application process will reach the first preset value. When the total number of Binder service clients of the application process held by the system process exceeds the third preset value, the system global reference overflow will occur and restart.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.

9. An electronic device, comprising a memory and a processor, characterized in that: The processor is configured to execute the method according to any one of claims 1 to 6 by calling the computer program stored in the memory.

Citation Information

Patent Citations

  • Process protection method and device

    CN106708641A

  • Process control method and apparatus

    CN107368326A