Background process control method and device, equipment and storage medium
By obtaining the influencing factors of the background process, using the logistic regression algorithm to determine the probability of exceptions, setting the resource usage time, solving the problem of directly killing the process and causing application exceptions, and achieving effective background process resource management.
Patent Information
- Application Number
- CN202510365601.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, killing the background process directly may lead to application exceptions and cannot effectively manage the resource usage time of the background process.
By obtaining the influencing factors of the background process, using the logistic regression algorithm to determine the probability of process exceptions, and set the duration of the process occupies central processor resources based on the exception probability, control the process rather than kill it directly, and avoid application exceptions.
Effectively manage the resource usage time of background processes, avoid application exceptions, and reduce system resource usage and frequency of exceptions.
Smart Images

Figure CN120234148A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of electronic devices, and particularly relates to a background process control method, device, equipment, and storage medium. Background Art
[0002] A background process refers to a process that runs in the background without occupying the current terminal. Background processes are usually used to execute long-running tasks, server processes, and application programs that need to run persistently.
[0003] In the related art, when the running duration of a background process in the background is greater than a set duration and the utilization rate of the Central Processing Unit (CPU) resources is greater than the set CPU utilization rate, the background process will be killed. However, directly killing the background process may cause the application program corresponding to the background process to malfunction. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a background process control method, device, equipment, and storage medium, which can avoid the malfunction of the application program corresponding to the background process.
[0005] In a first aspect, the embodiments of this application provide a background process control method, including:
[0006] Obtain the influencing factor corresponding to the first background process;
[0007] Determine the probability of the first background process malfunctioning according to the influencing factor corresponding to the first background process;
[0008] Determine a first duration according to the probability of the first background process malfunctioning; the first duration is the duration for which the first background process occupies the Central Processing Unit resources;
[0009] Control the first background process according to the first duration.
[0010] In a second aspect, the embodiments of this application provide a background process control device, including:
[0011] An obtaining module, configured to obtain the influencing factor corresponding to the first background process;
[0012] A first determining module, configured to determine the probability of the first background process malfunctioning according to the influencing factor corresponding to the first background process;
[0013] A second determining module, configured to determine a first duration according to the probability of the first background process malfunctioning; the first duration is the duration for which the first background process occupies the Central Processing Unit resources;
[0014] A control module, configured to control the first background process according to the first duration.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the background process control method provided by the embodiment of the present application are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the background process control method provided by the embodiment of the present application are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the background process control method provided by the embodiment of the present application.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the steps of the background process control method provided by the embodiment of the present application.
[0019] In the embodiment of the present application, by obtaining an influence factor corresponding to a first background process; determining the probability that the first background process has an abnormality according to the influence factor corresponding to the first background process; determining a first duration according to the probability that the first background process has an abnormality; the first duration is the duration for which the first background process occupies the central processing unit resources; and controlling the first background process according to the first duration. In this way, it is possible to determine the duration for which the background process occupies the central processing unit resources based on the influence factor corresponding to the background process, and control the background process through this duration, rather than directly killing the background process, which can avoid abnormal operation of the application program corresponding to the background process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of the background process control method provided by the embodiment of the present application;
[0021] Figure 2 is a flowchart of controlling the duration of the background process provided by the embodiment of the present application;
[0022] Figure 3 is a structural diagram of the background process control device provided by the embodiment of the present application;
[0023] Figure 4 is a structural diagram of the electronic device provided by the embodiment of the present application;
[0024] Figure 5It is a schematic diagram of the hardware structure of the electronic device implementing the embodiments of the present application. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the related objects before and after are in an "or" relationship.
[0027] Next, in conjunction with the accompanying drawings, the background process control method, device, equipment, and storage medium provided by the embodiments of the present application will be described in detail through specific embodiments and their application scenarios.
[0028] Figure 1 It is a schematic flowchart of the background process control method provided by the embodiments of the present application. The background process control method may include:
[0029] Step 101: Obtain the influencing factor corresponding to the first background process;
[0030] In some possible implementations of the embodiments of the present application, the first background process in the embodiments of the present application is any one of multiple background processes; the influencing factor in the embodiments of the present application is used to determine the probability of an exception occurring in the background process, and the influencing factor includes, but is not limited to: the duration of the process occupying a high CPU resource, the process priority, whether the process occupies an audio resource, whether the process turns on the camera, whether the process is a charging process, whether the process is a system critical process, etc., whether the application program corresponding to the process is a preset type of application program, the occupancy rate of the process occupying the CPU resource, and so on.
[0031] Step 102: Determine the probability of an exception in the first background process according to the influencing factor corresponding to the first background process;
[0032] In some possible implementations of the embodiments of the present application, assuming the probability of a process having an exception is P, then the probability of the process not having an exception is 1 - P. Based on the principle of logistic regression transformation, the relationship between the probability of a process having an exception and the influencing factors corresponding to the process is as shown in the following formula (1):
[0033]
[0034] Wherein, in formula (1), P is the probability of the process having an exception, x i is the influencing factor numbered i, β i is the factor coefficient of the influencing factor numbered i, and i is a positive integer less than or equal to n, where n is the number of influencing factors corresponding to the process.
[0035] After obtaining the influencing factors corresponding to the first background process, substituting the obtained influencing factors into the above formula (1) can obtain the probability of the first background process having an exception.
[0036] In some possible implementations of the embodiments of the present application, before step 102, the background process control method provided by the embodiments of the present application may further include: using a logistic regression algorithm to determine the factor coefficient of the influencing factors corresponding to the first background process; correspondingly, step 102 may include: determining the probability of the first background process having an exception according to the influencing factors and the factor coefficient.
[0037] In some possible implementations of the embodiments of the present application, when using a logistic regression algorithm to determine the factor coefficient of the influencing factors corresponding to the first background process, multiple background processes may be statistically analyzed in advance, and the influencing factors and exception statuses of the multiple background processes may be statistically analyzed. Exemplarily, the statistical results are shown in Table 1 below:
[0038] Table 1
[0039]
[0040] Among them, Table 1 shows five influencing factors of a process, and the five influencing factors are process priority, whether the process occupies audio resources, whether the process is a charging process, the CPU resources occupied by the process, and whether the camera of the process is turned on. When the value corresponding to whether the process occupies audio resources is 1, it means the process occupies audio resources; when the value corresponding to whether the process occupies audio resources is 0, it means the process does not occupy audio resources; when the value corresponding to whether the process is a charging process is 1, it means the process is not a charging process; when the value corresponding to whether the process is a charging process is 0, it means the process is a charging process; when the value corresponding to whether the camera of the process is turned on is 1, it means the camera of the process is turned on; when the value corresponding to whether the camera of the process is turned on is 0, it means the camera of the process is not turned on. When the value corresponding to the abnormal state of the process is 1, it means the process is an abnormal process, that is, the process has an abnormality; when the value corresponding to the abnormal state of the process is 0, it means the process is a non-abnormal process, that is, the process has no abnormality. Among them, after controlling a certain process, if the application program corresponding to the process has an abnormality, for example, foreground jamming or audio frame loss, it is determined that the process is an abnormal process, otherwise it is a non-abnormal process.
[0041] Based on each influencing factor in Table 1 above, through the logistic regression algorithm, the factor coefficients of each influencing factor can be obtained.
[0042] In some possible implementations of the embodiments of the present application, the function model of the logistic regression algorithm is the sigmoid function. Based on the sigmoid function, the above formula (1) is transformed into the matrix form shown in the following formula (2):
[0043]
[0044] In formula (2), X is the matrix of influencing factors (x1, x2, ……, x n ).
[0045] The cross entropy is selected as the loss function of the logistic regression, and the loss function of the logistic regression is shown in the following formula (3):
[0046]
[0047] Among them, in formula (3), m is the total number of data in Table 1 above, y( i ) is the abnormal state value of the process corresponding to the i-th piece of data, and h β (x (i) ) is the value obtained by substituting the values of the influencing factors and the factor coefficients in the i-th piece of data into the sigmoid function.
[0048] The essence of the regression operation is to obtain the minimum value of the loss function shown in formula (3). In some possible implementations of the embodiments of the present application, the gradient descent method can be used to calculate the minimum value of the loss function shown in formula (3), and the factor coefficient of each influencing factor can be obtained. Among them, the factor coefficient of the jth influencing factor is shown in the following formula (4):
[0049] β jk =β jk-1 +η(y (i) -h β (x (i) ))x j (4)
[0050] Among them, in formula (4), β jk is the factor coefficient of the jth influencing factor x j obtained in the kth iteration, β jk-1 is the factor coefficient of the jth influencing factor obtained in the (k - 1)th iteration, η is the learning rate, and the value of η can be 0.01.
[0051] In some possible implementations of the embodiments of the present application, the number of iterations can be preset. For example, the number of iterations is 1000 times. After looping the above formula (4) 1000 times, the factor coefficient of the jth influencing factor x j can be obtained.
[0052] After obtaining the influencing factors corresponding to a certain background process and calculating the factor coefficients of each influencing factor, the probability of the background process being abnormal can be obtained through the above formula (1).
[0053] Step 103: Determine the first duration according to the probability of the first background process being abnormal; the first duration is the duration for which the first background process occupies the central processor resources;
[0054] In some possible implementations of the embodiments of the present application, the duration of occupying the central processor resources corresponding to different probabilities can be set by configuring the fair group plan (CONFIG_FAIR_GROUP_SCHED, CFS) bandwidth control (Bandwidth Control). CFS Bandwidth Control can set an upper limit on the duration for which a process group can occupy the central processor resources.
[0055] In some possible implementations of the embodiments of the present application, the higher the probability of a process being abnormal, the lower the upper limit of the duration for which the process occupies the central processor resources can be.
[0056] Exemplarily, the correspondence between the probability of a process being abnormal and the duration of occupying the central processor resources is shown in Table 2 below:
[0057] Table 2
[0058] Probability of process exception Occupation duration of central processor resources (unit: second) 60% 120 70% 90 80% 60 90% 30
[0059] Assume that the probability of an exception occurring in the first background process is determined to be 60% through step 102, then the first duration is determined to be 120 seconds according to Table 2 above.
[0060] Step 104: Control the first background process according to the first duration.
[0061] In some possible implementations of the embodiments of the present application, in step 104, it is possible to control the duration of the first background process occupying the central processing unit (CPU) resources not to exceed the first duration. When the duration of the first background process occupying the CPU resources reaches the first duration, CPU resources may not be allocated to the first background process.
[0062] In the embodiments of the present application, by obtaining the influencing factor corresponding to the first background process; determining the probability of an exception occurring in the first background process according to the influencing factor corresponding to the first background process; determining the first duration according to the probability of an exception occurring in the first background process; the first duration is the duration of the first background process occupying the CPU resources; controlling the first background process according to the first duration. In this way, it is possible to determine the duration of the background process occupying the CPU resources based on the influencing factor corresponding to the background process, and control the background process through this duration, rather than directly killing the background process, which can avoid abnormal operation of the application program corresponding to the background process.
[0063] In some possible implementations of the embodiments of the present application, when determining the first duration, the temperature of the CPU may also be considered. Based on this, step 103 may include: determining the first duration according to the probability of an exception occurring in the first background process and the temperature of the CPU.
[0064] In some possible implementations of the embodiments of the present application, the higher the probability of an exception occurring in the process, the higher the temperature of the CPU, and the lower the upper limit of the duration of the process occupying the CPU resources may be.
[0065] Exemplarily, the corresponding relationship between the probability of an exception occurring in the process, the CPU temperature, and the duration of occupying the CPU resources is shown in Table 3 below:
[0066] Table 3
[0067]
[0068] Assume that through step 102, it is determined that the probability of the first background process being abnormal is 60%, and when the temperature of the central processing unit is 20 degrees, according to Table 3 above, the first duration is determined to be 160 seconds, and then the duration for the first background process to occupy the central processing unit resources is controlled not to exceed 160 seconds; when the duration for the first background process to occupy the central processing unit resources reaches 160 seconds, the central processing unit resources may not be allocated to the first background process.
[0069] In the embodiments of the present application, the duration for the background process to occupy the central processing unit resources can be determined based on the probability of the background process being abnormal and the temperature of the central processing unit, and the background process is controlled by this duration, rather than directly killing the background process, which can avoid abnormal operation of the application program corresponding to the background process.
[0070] In some possible implementations of the embodiments of the present application, after step 104, the background process control method provided by the embodiments of the present application may further include: when an exception occurs in the application program corresponding to the first background process, releasing the control of the first background process.
[0071] Exemplarily, assume that the first duration determined through step 103 is 120 seconds; when the duration for the first background process to occupy the central processing unit resources reaches 120 seconds, the central processing unit resources are not allocated to the first background process. After the central processing unit resources are not allocated to the first background process, an exception occurs in the application program corresponding to the first background process. For example, the application program corresponding to the first background process has a frozen interface or audio frame loss, then the control of the first background process is released. After the control of the first background process is released, the central processing unit resources will always be allocated to the first background process.
[0072] In the embodiments of the present application, when an exception occurs in the application program corresponding to the background process, by releasing the control of the background process, the normal operation of the application program corresponding to the background process can be ensured.
[0073] In some possible implementations of the embodiments of the present application, after step 104, the background process control method provided by the embodiments of the present application may further include: when an exception occurs in the application program corresponding to the first background process, determining the time for determining the probability of the first background process being abnormal next time.
[0074] Exemplarily, assume that the first duration determined through step 103 is 120 seconds; when the duration for which the first background process occupies the central processing unit (CPU) resources reaches 120 seconds, no CPU resources are allocated to the first background process. After no CPU resources are allocated to the first background process, the application corresponding to the first background process encounters an exception. For example, the application corresponding to the first background process experiences interface jank or audio frame drops. The time for determining the probability of the first background process being abnormal next time is determined to be 24 hours later, that is, the first background process is not controlled within 24 hours. After 24 hours, the probability of the first background process having an abnormality is determined again.
[0075] In the embodiments of the present application, when an application corresponding to a background process encounters an exception, by determining the time for determining the probability of the first background process having an abnormality next time, the number of times of determining the probability of the first background process having an abnormality can be reduced, thereby reducing the occupation of system resources.
[0076] In some possible implementations of the embodiments of the present application, the first background process in the embodiments of the present application may be a background process among multiple background processes whose occupancy rate of CPU resources is greater than an occupancy rate threshold. Correspondingly, step 101 may include: when the occupancy rate of the first background process occupying the CPU resources is greater than the occupancy rate threshold, obtaining the influencing factor corresponding to the first background process.
[0077] Exemplarily, assume that the occupancy rate threshold is 25%. When the occupancy rate of the first background process occupying the CPU resources is greater than 25%, obtain the influencing factor corresponding to the first background process, and then determine the probability of the first background process having an abnormality based on this influencing factor. Next, determine the first duration for which the first background process occupies the CPU resources according to the probability of the first background process having an abnormality, and control the first background process based on this first duration. If the occupancy rate of the first background process occupying the CPU resources is less than or equal to 25%, then the first background process is not controlled, that is, the duration for which the first background process occupies the CPU resources is not controlled.
[0078] In some possible implementations of the embodiments of the present application, the background process control method provided in the embodiments of the present application may further include: when an application corresponding to the first background process encounters an exception, increasing the occupancy rate threshold.
[0079] Exemplarily, it is assumed that the occupancy rate of the central processing unit resources by the first background process is obtained as 30%, and this occupancy rate is greater than the occupancy rate threshold of 25%. Then, the impact factor corresponding to the first background process is obtained, and further, through step 102, the probability that the first background process is abnormal is determined to be 60%. Through step 103, the first duration is determined to be 120 seconds, and the duration for the first background process to occupy the central processing unit resources is controlled not to exceed 120 seconds. When the duration for the first background process to occupy the central processing unit resources reaches 120 seconds, no central processing unit resources are allocated to the first background process. After no central processing unit resources are allocated to the first background process, the application program corresponding to the first background process has an abnormality. For example, the application program corresponding to the first background process has a frozen interface or audio frame drop, then the occupancy rate threshold is increased from 25% to 30%.
[0080] When the occupancy rate of the central processing unit resources by the first background process is greater than 30%, the probability that the first background process is abnormal is determined, and then the duration for the first background process to occupy the central processing unit resources is determined according to the probability that the first background process is abnormal, and then the duration for the first background process to occupy the central processing unit resources is controlled based on this duration. If the occupancy rate of the central processing unit resources by the first background process is less than or equal to 30%, the duration for the first background process to occupy the central processing unit resources is not controlled.
[0081] In the embodiment of the present application, when an abnormality occurs in the application program corresponding to the background process, by increasing the occupancy rate threshold, the number of times of determining the probability that the first background process is abnormal can be reduced, and thus the occupancy of system resources can be reduced.
[0082] Figure 2 It is a schematic flowchart of the process for controlling the duration of the background process provided by the embodiment of the present application. The process for controlling the duration of the background process may include the following steps:
[0083] Step 201: Obtain the occupancy rate of the central processing unit resources by the first background process among multiple background processes;
[0084] Step 202: Determine whether the occupancy rate is greater than the occupancy rate threshold;
[0085] If yes, execute step 203; if no, end;
[0086] Step 203: Obtain the impact factor corresponding to the first background process and the statistical result obtained based on the statistical analysis of the impact factors and abnormal states of multiple background processes, and use the logistic regression algorithm to determine the factor coefficient corresponding to each impact factor;
[0087] Step 204: Determine the probability that the first background process is abnormal according to the impact factor corresponding to the first background process and the factor coefficient corresponding to each impact factor;
[0088] Step 205: Determine a first duration of the central processing unit resources occupied by the first background process according to the probability of an exception occurring in the first background process.
[0089] Step 206: Control the first background process according to the first duration.
[0090] Step 207: Determine whether an exception occurs in the application program corresponding to the first background process.
[0091] If yes, execute Step 207; if no, end.
[0092] Step 208: Increase the occupancy threshold, release the control of the first background process, and determine the time for determining the probability of an exception occurring in the first background process next time.
[0093] Wherein, when the time for determining the probability of an exception occurring in the first background process next time arrives, continue to execute Step 201.
[0094] In the background process control method provided in the embodiments of the present application, the execution subject may be a background process control device. In the embodiments of the present application, taking the background process control device executing the background process control method as an example, the background process control device provided in the embodiments of the present application is described.
[0095] Figure 3 It is a schematic structural diagram of the background process control device provided in the embodiments of the present application. The background process control device 300 may include:
[0096] An obtaining module 301, configured to obtain an influencing factor corresponding to the first background process;
[0097] A first determining module 302, configured to determine the probability of an exception occurring in the first background process according to the influencing factor corresponding to the first background process;
[0098] A second determining module 303, configured to determine a first duration according to the probability of an exception occurring in the first background process; the first duration is the duration of the first background process occupying the central processing unit resources;
[0099] A control module 304, configured to control the first background process according to the first duration.
[0100] In some possible implementations of the embodiments of the present application, the background process control device provided in the embodiments of the present application further includes:
[0101] A second determining module, configured to determine a factor coefficient of the influencing factor corresponding to the first background process by using a logistic regression algorithm;
[0102] Correspondingly, the first determining module 302 is specifically configured to:
[0103] Determine the probability of an exception occurring in the first background process based on the impact factor and factor coefficient corresponding to the first background process.
[0104] In some possible implementations of the embodiments of the present application, the second determination module 303 is specifically configured to:
[0105] Determine a first duration based on the probability of an exception occurring in the first background process and the temperature of the central processing unit.
[0106] In some possible implementations of the embodiments of the present application, the background process control device provided by the embodiments of the present application further includes:
[0107] A release module, configured to release the control of the first background process when an exception occurs in the application corresponding to the first background process.
[0108] In some possible implementations of the embodiments of the present application, the background process control device provided by the embodiments of the present application further includes:
[0109] A second determination module, configured to determine the time for determining the probability of an exception occurring in the first background process next time when an exception occurs in the application corresponding to the first background process.
[0110] In some possible implementations of the embodiments of the present application, the acquisition module 301 is specifically configured to:
[0111] When the occupancy rate of the first background process occupying the central processing unit resources is greater than the occupancy rate threshold, acquire the impact factor corresponding to the first background process.
[0112] In some possible implementations of the embodiments of the present application, the background process control device provided by the embodiments of the present application further includes:
[0113] An increase module, configured to increase the occupancy rate threshold when an exception occurs in the application corresponding to the first background process.
[0114] The background process control device in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than terminals. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0115] The background process control device in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0116] The background process control device provided in the embodiments of the present application can implement Figures 1 to 2 each process implemented by the embodiments of the background process control method. To avoid repetition, it will not be elaborated here.
[0117] Optionally, as Figure 4 shown, the embodiments of the present application further provide an electronic device 400, including a processor 401 and a memory 402. A program or instruction that can run on the processor 401 is stored on the memory 402. When the program or instruction is executed by the processor 401, it implements each step of the embodiments of the background process control method provided in the embodiments of the present application and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0118] Figure 5 is a schematic diagram of the hardware structure of the electronic device implementing the embodiments of the present application.
[0119] The electronic device 500 includes, but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, and a processor 510, etc.
[0120] Those skilled in the art can understand that the electronic device 500 may further include a power source (such as a battery) for powering each component. The power source can be logically connected to the processor 510 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 5 The structure of the electronic device shown does not limit the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0121] Among them, the processor 510 is used to: obtain the influencing factor corresponding to the first background process; determine the probability of the first background process having an abnormality according to the influencing factor corresponding to the first background process; determine the first duration according to the probability of the first background process having an abnormality; the first duration is the duration for which the first background process occupies the central processor resources; control the first background process according to the first duration.
[0122] In some possible implementations of the embodiments of the present application, the processor 510 is further used to:
[0123] Use a logistic regression algorithm to determine the factor coefficient of the influencing factor corresponding to the first background process;
[0124] Determine the probability of the first background process having an abnormality according to the influencing factor corresponding to the first background process and the factor coefficient.
[0125] In some possible implementations of the embodiments of the present application, the processor 510 is specifically used to:
[0126] Determine the first duration according to the probability of the first background process having an abnormality and the temperature of the central processor.
[0127] In some possible implementations of the embodiments of the present application, the processor 510 is further used to:
[0128] In the case where an abnormality occurs in the application corresponding to the first background process, release the control of the first background process.
[0129] In some possible implementations of the embodiments of the present application, the processor 510 is further used to:
[0130] In the case where an abnormality occurs in the application corresponding to the first background process, determine the time for determining the probability of the first background process having an abnormality next time.
[0131] In some possible implementations of the embodiments of the present application, the processor 510 is specifically used to:
[0132] In the case where the occupancy rate of the first background process occupying the central processor resources is greater than the occupancy rate threshold, obtain the influencing factor corresponding to the first background process.
[0133] In some possible implementations of the embodiments of the present application, the processor 510 is further configured to:
[0134] Increase the occupancy threshold when an exception occurs in the application corresponding to the first background process.
[0135] It should be understood that in the embodiments of the present application, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The graphics processing unit 5041 processes the image data of static pictures or videos obtained by an image capturing device (such as a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also referred to as a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. The other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0136] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 509 may include volatile memory or non-volatile memory, or the memory 509 may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 509 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0137] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 510 either.
[0138] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the embodiment of the background process control method provided by the embodiments of the present application, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0139] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium. Examples of computer-readable storage media include non-transitory computer-readable media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0140] An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions to implement each process of the embodiment of the background process control method provided by the embodiment of the present application, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0141] It should be understood that the chip mentioned in the embodiment of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0142] An embodiment of the present application further provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the embodiment of the background process control method provided by the embodiment of the present application, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0143] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0144] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0145] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A background process control method, characterized in that: The method comprises: Obtaining the impact factor corresponding to the first background process; Determining a probability that an exception occurs in the first background process according to an impact factor corresponding to the first background process; Determine a first duration according to the probability of an exception occurring in the first background process; the first duration is the duration during which the first background process occupies central processing unit resources; The first background process is controlled according to the first duration.
2. The method according to claim 1, characterized in that Before determining the probability of an abnormality occurring in the first background process according to the impact factor corresponding to the first background process, the method includes: Determine the factor coefficient of the influencing factor corresponding to the first background process by using a logistic regression algorithm; The determining, according to the impact factor corresponding to the first background process, the probability that the first background process is abnormal includes: The probability of an abnormality occurring in the first background process is determined according to the influencing factor and the factor coefficient.
3. The method according to claim 1, characterized in that The determining the first duration according to the probability of the first background process being abnormal includes: The first duration is determined according to a probability of an exception occurring in the first background process and a temperature of a central processing unit.
4. The method according to claim 1, characterized in that: After controlling the first background process according to the first duration, the method further includes: When an exception occurs in the application corresponding to the first background process, the control over the first background process is released.
5. The method according to claim 1, characterized in that: After controlling the first background process according to the first duration, the method further includes: When an exception occurs in an application corresponding to the first background process, a time for determining a probability of the first background process being abnormal next time is determined.
6. The method according to claim 1, characterized in that The obtaining of the impact factor corresponding to the first background process includes: When the occupancy rate of the central processing unit resources occupied by the first background process is greater than the occupancy rate threshold, an impact factor corresponding to the first background process is obtained.
7. The method according to claim 6, characterized in that After controlling the first background process according to the first duration, the method further includes: When an exception occurs in the application corresponding to the first background process, the occupancy rate threshold is increased.
8. A background process control device, characterized in that: The device comprises: An acquisition module, used to acquire an impact factor corresponding to the first background process; A first determining module, configured to determine a probability that an exception occurs in the first background process according to an impact factor corresponding to the first background process; The second determination module is used to determine a first duration according to the probability of an exception occurring in the first background process; the first duration is the duration of the first background process occupying the central processing unit resources. A control module is used to control the first background process according to the first duration.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the background process control method as described in any one of claims 1-7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the background process control method as described in any one of claims 1-7 are implemented.