Process control method and device, equipment and storage medium

By computing and delaying the startup of the background process of the smart terminal, the problem of excessive resource occupation caused by frequent background processes is solved, and the stability and user experience of the terminal and application are improved.

CN119127424APending Publication Date: 2024-12-13SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411146623.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

When the smart terminal is in a high load state, frequent startup of background processes leads to excessive resource usage, resulting in unresponsive or running timeout problems for the foreground application.

Method used

By obtaining the target background process to be controlled, calculating the delay time based on its startup frequency and attribute parameters, using terminal load parameters for delayed startup control, adjusting the process queue to delay the startup of frequently started background processes to avoid excessive resource consumption.

Benefits of technology

It effectively avoids resource occupation caused by frequent startup/termination of background processes, improves the response speed of foreground applications and the operating stability of terminals, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127424A_ABST
    Figure CN119127424A_ABST
Patent Text Reader

Abstract

The invention provides a process control method and device, equipment and a storage medium, and the method comprises the steps: obtaining a to-be-controlled target background process in a first process queue in response to a process control request; updating a preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue; and performing delay start control on the target background process according to a terminal load parameter and the target process queue to obtain a process control result. According to the technical scheme provided by the invention, the situation that the application program running in the foreground has no response or crashes due to the fact that relatively high terminal resources are occupied because the background process is frequently started / terminated under the condition that the terminal load is relatively high can be avoided, so that the running stability of the terminal and the application program is improved, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At present, with the rapid development of smart terminals such as mobile phones, smart TVs and tablet computers, more and more users use various applications in smart terminals for entertainment, communication and work activities. However, during the operation of smart terminals, when the terminal is under high load, there may be frequent simultaneous startup of background processes, resulting in excessive occupation of system resources, making it impossible for foreground applications to obtain running resources in time, resulting in frequent application unresponsiveness (ANR, Application Not Responding) or running timeout problems, affecting the user's terminal usage experience. Summary of the invention

[0003] The embodiments of the present application provide a process control method, apparatus, device and storage medium, which aim to solve the technical problem in the prior art that when a smart terminal is in a high-load operating state, the foreground application becomes unresponsive or times out due to the background process occupying the terminal resources.

[0004] On the one hand, an embodiment of the present application provides a process control method, the process control method comprising the following steps:

[0005] In response to the process control request, obtain the target background process to be controlled in the first process queue;

[0006] Update the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue;

[0007] The target background process is delayed in starting and controlled according to the terminal load parameter and the target process queue to obtain a process control result.

[0008] In a possible implementation of the present application, obtaining the target background process to be controlled in the first process queue includes:

[0009] Acquire each background process to be started in the first process queue, and collect startup frequency data and process startup type of each background process;

[0010] If the startup frequency data is greater than a preset startup frequency threshold and the process startup type is a joint startup type, the background process corresponding to the startup frequency data is set as a target background process to be controlled.

[0011] In a possible implementation of the present application, the updating of the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue includes:

[0012] Calculating the process delay time of the target background process according to the process attribute parameters of the target background process and the preset weight coefficients corresponding to the process attribute parameters;

[0013] Adding the target background process to a preset second process queue to obtain an updated second process queue;

[0014] The process start sequence of each of the target background processes in the updated second process queue is adjusted according to the process delay time to obtain a target process queue.

[0015] In a possible implementation of the present application, the process delay time of the target background process is calculated according to the process attribute parameter of the target background process and the preset weight coefficient corresponding to the process attribute parameter, including:

[0016] Obtaining process attribute parameters of the target background process, and calculating a process attribute score corresponding to the process attribute parameters;

[0017] The process delay time of the target background process is calculated according to the process attribute score, the weight coefficient corresponding to the process attribute score and a preset time base.

[0018] In a possible implementation of the present application, the delayed start control of the target background process is performed according to the terminal load parameter and the target process queue to obtain a process control result, including:

[0019] Respond to the process start request for the target background process and collect terminal load parameters using the preset tracking process;

[0020] If the terminal load parameter is greater than a preset terminal load threshold, querying the target calling process corresponding to the process start request;

[0021] If the target calling process meets the preset delayed calling condition, the target background process is delayed in starting according to the process start interval and process delay time in the target process queue to obtain a process control result.

[0022] In a possible implementation of the present application, controlling the delayed start of the target background process according to the process start interval and the process delay time in the target process queue to obtain a process control result includes:

[0023] Drive a preset broadcast delay module to send a delayed start broadcast of the target background process to the target process queue according to the process delay time;

[0024] The target process queue is driven to delay starting the target background process according to the delayed start broadcast and the process start interval, and a process control result is obtained.

[0025] In a possible implementation of the present application, the collecting of terminal load parameters by using a preset tracking process includes:

[0026] Detect the terminal load state using a preset tracking process and a preset collection interval to obtain a first load parameter;

[0027] Detecting the terminal load state when the process start request is triggered to obtain a second load parameter;

[0028] The terminal load parameter is calculated according to the first load parameter and the second load parameter.

[0029] On the other hand, the present application provides a process control device, the process control device comprising:

[0030] A process acquisition module is configured to respond to a process control request and acquire a target background process to be controlled in the first process queue;

[0031] A queue updating module is configured to update a preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue;

[0032] The delayed start module is configured to perform delayed start control on the target background process according to the terminal load parameter and the process delay time in the target process queue to obtain a process control result.

[0033] On the other hand, the present application also provides a process control device, the process control device comprising:

[0034] one or more processors;

[0035] Memory; and

[0036] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps of the process control method.

[0037] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the process control method.

[0038] In the present application, by responding to a process control request, a target background process to be controlled in a first process queue is obtained; a preset second process queue is updated according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue; and a delayed start control is performed on the target background process according to the terminal load parameter and the target process queue to obtain a process control result. After determining the target background process to be controlled that is frequently started and terminated, the process delay time corresponding to the target background process to be delayed is calculated, and the target background process and the corresponding process delay time are associated and stored in a pre-set second process queue for starting and controlling the process to obtain a target process queue, and during the operation of the terminal, a start request for the target background process is responded to, and a personalized delayed start operation is performed on the target background process to be started according to the current terminal load parameter of the terminal and the target process queue, so as to avoid the situation where the application running in the foreground is unresponsive or crashes due to frequent start / termination of the background process when the terminal load is high, thereby improving the operation stability of the terminal and the application, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A schematic diagram of a process control method according to an embodiment of the present application;

[0041] Figure 2 A flowchart of an embodiment of a process control method in an embodiment of the present application;

[0042] Figure 3 A flowchart of an embodiment of delaying the start control of a target background process in a process control method provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of a scenario of an embodiment of a target process queue provided in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of a target process queue scenario provided in an embodiment of the present application;

[0045] Figure 6 A schematic diagram of a flow chart of an embodiment of collecting terminal load parameters in a process control method provided in an embodiment of the present application;

[0046] Figure 7 A schematic diagram of the structure of an embodiment of a process control device provided in an embodiment of the present application;

[0047] Figure 8 A schematic diagram of the structure of an embodiment of a process control device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0049] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0050] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.

[0051] At present, with the rapid development of smart terminals such as mobile phones, smart TVs and tablet computers, more and more users use various applications in smart terminals for entertainment, communication and work activities. However, during the operation of smart terminals, when the terminal is under high load, there are certain background processes that are frequently started or terminated, resulting in excessive occupation of terminal resources, making it impossible for foreground applications to obtain running resources in time, resulting in frequent application unresponsiveness (ANR, Application Not Responding) or running timeout problems, affecting the user's terminal usage experience.

[0052] Based on this, the present application proposes a process control method, device, equipment and computer-readable storage medium to solve the technical problem in the prior art that when the smart terminal is in a high-load operating state, the background process occupies the terminal resources, causing the foreground application to become unresponsive or timeout.

[0053] The process control method in the embodiment of the present invention is applied to a process control device, which is arranged in a process control device. The process control device is provided with one or more processors, memories, and one or more applications, wherein the one or more applications are stored in the memories and configured to be executed by the processor to implement the process control method; wherein the process control device can be an intelligent terminal, such as a mobile phone, a tablet computer, a network device, and a smart computer; optionally, the process control device can also be a server, or a service cluster consisting of multiple servers.

[0054] like Figure 1 As shown, Figure 1 This is a scenario diagram of the process control method of an embodiment of the present application. The process control scenario in the embodiment of the present invention includes a process control device 100 (a process control device is integrated in the process control device 100), and a computer-readable storage medium corresponding to the process control method is running in the process control device 100 to execute the steps of the process control method.

[0055] Understandably, Figure 1 The process control devices in the process control method scenario shown, or the devices included in the process control devices, do not constitute limitations on the embodiments of the present invention, that is, the number of devices and types of devices of the process control devices included in the process control method scenario, or the number of devices and types of devices included in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected by the embodiments of the present invention.

[0056] In the embodiment of the present invention, the process control device 100 is mainly used for: responding to a process control request, obtaining a target background process to be controlled in a first process queue; updating a preset second process queue according to the target background process and the process delay time corresponding to the target background process, to obtain a target process queue; delaying the start control of the target background process according to the terminal load parameter and the target process queue, to obtain a process control result.

[0057] The process control device 100 in the embodiment of the present invention can be an independent process control device, such as a smart terminal such as a mobile phone, a tablet computer, a network device, a smart TV, and a smart computer, or it can be a process control network or process control cluster composed of multiple process control devices.

[0058] The embodiments of the present application provide a process control method, apparatus, device, and computer-readable storage medium, which are described in detail below.

[0059] It can be understood by those skilled in the art that Figure 1 The application environment shown in is only one of the application scenarios related to the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer process control devices, or process control network connection relationships shown, such as Figure 1 Only one process control device is shown. It can be understood that the scenario of the process control method can also include one or more process control devices, which are not specifically limited here. The process control device 100 can also include a memory for storing process data and other data.

[0060] It should be noted that Figure 1 The scenario diagram of the process control method shown is only an example. The scenario of the process control method described in the embodiment of the present invention is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.

[0061] Based on the scenario of the above process control method, various embodiments of the process control method disclosed in the present invention are proposed.

[0062] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of a process control method in an embodiment of the present application. The process control method includes the following steps 201 to 203:

[0063] 201. Respond to a process control request and obtain a target background process to be controlled in a first process queue;

[0064] The process control method in this embodiment is applied to process control devices, and the type and number of process control devices are not specifically limited. That is, the process control device can be one or more intelligent terminals or servers equipped with an intelligent operating system. For example, the process control device can be a mobile phone, a tablet computer, a network device, a smart TV, and a smart computer. In a specific embodiment, the process control device is a smart computer.

[0065] Among them, the target background process is a background process to be delayed in the terminal background within a preset time period. For example, in a specific embodiment, after some background processes are terminated, they will be associated with the terminal service process or the terminal broadcast process and started in a short time, and a new non-important background process will be created in a short time. This type of background process is the target background process to be controlled. The frequent and large-scale startup of these background processes will occupy more terminal resources (such as CPU resources and memory resources, etc.), causing the terminal to freeze, and the terminal's foreground application is blocked and the application is unresponsive. Therefore, the process control device needs to delay the startup of this type of target background process, so as to improve the utilization of terminal resources and reduce the probability of foreground application unresponsiveness (ANR, Application Not Responding).

[0066] Specifically, the process control device responds to the process control request during operation, wherein the process control request is an operation request that drives the process control device to start and control the target background process and other processes that are frequently started or frequently terminated. Among them, the triggering method of the process control request is not specifically limited here, that is, the process control request can be actively triggered by the user, for example, a process control button associated with the process control request is set in the process control device (the process control button can be a virtual button or a physical button), and the user actively triggers the process control request for the target background process by clicking the process control button. Optionally, the process control request can also be automatically triggered by the process control device, for example, a process control program is set in the process control device, and when it is detected that the terminal load of the process control device is high, the process control request is automatically triggered. After receiving the process control request, the process control device responds to the process control request to start the process control mode, and performs process control on the target background process in the process control mode.

[0067] Specifically, the process control device pre-sets a first process queue in the process control mode, and the process control device also pre-sets an application monitoring service to monitor each background process, and stores the monitored background process in the first process queue. The first process queue is a process queue that stores each running process currently being run by the process control device or each terminated process that has been terminated in a pre-set bidirectional process control linked list. In a specific embodiment, the application monitoring service is AppRecordManagerService.

[0068] Optionally, in a specific embodiment, the process control device uses the application monitoring service to monitor the process status of each background process in the terminal, and when the process status of the background process is a terminated state, stores the background process with a terminated process status into the first process queue.

[0069] Specifically, after responding to the process control request, the process control device also reads each background process to be started in the first process queue, and collects the process start frequency data and process start type of each background process. Among them, the start frequency data is a characterization of the number of process starts and / or the number of process terminations of the background process within a preset time period. The process start type is a characterization of the current start mode of the background process. In a specific embodiment, the process start type includes a self-start and a joint start type. Among them, the self-start type is a process start type in which the process starts automatically or is triggered by the user to start and run. The joint start type is a process start type in which the process is triggered by other processes or services (such as service processes and broadcast processes, etc.) to start and run.

[0070] Specifically, after obtaining the startup frequency data and process startup type of each background process to be started, the process control device determines whether the background process is the target background process to be controlled based on the startup frequency data and process startup type, as well as the preset startup frequency threshold. Among them, the startup frequency threshold is a startup frequency threshold parameter that characterizes whether the background process is frequently started or frequently terminated within a preset time period. Optionally, the startup frequency threshold can be customized according to the terminal load status, which is not specifically limited in this embodiment.

[0071] Optionally, if the startup frequency data is less than a preset startup frequency threshold, or the process startup type is a self-start type, the process control device determines that the background process is a normally started background process, and the process control device determines that there is no need to delay the start of the normally started background process. The process control device executes the process startup operation of the background process after a preset sliding window.

[0072] Optionally, if the startup frequency data is greater than or equal to a preset startup frequency threshold and the process startup type is a joint startup type, the process control device determines that the background process is a background process that is affected by other processes and is frequently started or frequently terminated, affecting the terminal load. The process control device determines that it is necessary to delay the startup of the background process and sets the background process as the target background process to be controlled.

[0073] 202. Update a preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue;

[0074] Specifically, after obtaining the target background process to be controlled, the process control device also calculates the process delay time corresponding to the target background process, and updates the preset second process queue according to the target background process and the process delay time, and obtains the target process queue for starting and controlling the target background process. Among them, the target process queue is a bidirectional linked list queue that uses a broadcast mechanism to delay the start of the target background process.

[0075] Specifically, after acquiring the target background process, the process control device reads the process attribute parameters corresponding to the target background process, wherein the process attribute parameters are process status attribute parameters that characterize the startup status, system occupancy information, and other process statuses of the target background process. In a specific embodiment, the process attribute parameters include startup frequency parameters, process visibility parameters, associated application parameters, resource occupancy parameters, and usage frequency parameters.

[0076] The process visibility parameter is a property parameter that characterizes whether the process is visible. For example, in a specific embodiment, the process visibility parameter includes a foreground process type parameter (FRONT), a floating window process type parameter (FLOAT), a desktop applet type parameter (APPWIDGET), an administrative authority parameter (ADM IN), and a reactivation type parameter (ACTIVITY_RESUMED).

[0077] The associated application parameter is an attribute parameter that characterizes the type of application associated with the process. For example, the associated application parameter includes a test application parameter (CTS_APP), a navigation application parameter (US I NG_GPS), a sensor application parameter (US I NG_SENSOR), and a notification application parameter (NOT IFI CAT IONA_APP). Different associated application parameters correspond to different processes of different importance.

[0078] The resource occupancy parameter is a parameter that characterizes the CPU usage rate or other terminal resource usage rate status associated with the process. The lower the resource occupancy parameter, the higher the corresponding process startup priority. In a specific embodiment, the resource occupancy parameter can be divided into several gears according to the size of the terminal resources occupied when the process is started or running, and different gears correspond to different terminal resource usage rates.

[0079] The usage frequency parameter is a parameter that characterizes the frequency of a user's use of a process. The higher the usage frequency parameter, the more frequently the user uses the target background process, and the higher the corresponding startup priority.

[0080] Specifically, in order to determine the process delay time of each target background process, the process control device also pre-sets a corresponding preset weight coefficient for each process attribute parameter, and calculates the process delay time of the target background process based on each process attribute parameter, the corresponding preset weight coefficient and the preset time base. Among them, the process delay time is the control time for delaying the start of the target background process. For example, in a specific embodiment, if the process delay time of the target background process is 2s (unit: seconds), the process control device will perform a process start operation on the target background process after a delay of two seconds after determining that the target background process meets the delay condition.

[0081] Specifically, after obtaining the process attribute parameters of each target background process, the process control device also calculates the process attribute score corresponding to the process attribute parameter. Optionally, the process control device can convert each process attribute parameter into a numerical parameter of the same dimension, and calculate the process attribute parameter according to the numerical parameter corresponding to the process attribute parameter. For example, each process attribute parameter is converted into a parameter measured by a score, and the process attribute score corresponding to each process attribute parameter is calculated.

[0082] Specifically, after obtaining the process attribute scores corresponding to the process attribute parameters of any target background process, the process control device calculates the process delay time of the target background process according to the process attribute scores, the weight coefficients corresponding to the process attribute scores, and the preset time base. That is, the process control device calculates the sum of the products of the process attribute scores and the weight coefficients, and calculates the decimal logarithm of the sum of the products of the process attribute scores and the weight coefficients, and multiplies the decimal logarithm by the preset time base to obtain the process delay time of the target background process. Specifically, the calculation formula of the process delay time is as follows:

[0083] RunnableAT = lg[(process attribute score 1 * weight coefficient 1 + process attribute score 2 * weight coefficient 2 + process attribute score 3 * weight coefficient 3 + process attribute score 4 * weight coefficient 4)] * preset time base;

[0084] Among them, RunnableAT is the process delay time.

[0085] The preset time base is an application delay time base set based on the terminal load state. In a specific embodiment, the preset time base is set to 2s (unit: second).

[0086] Specifically, Figure 4 As shown, Figure 4A scenario diagram of an embodiment of a target process queue provided in an embodiment of the present application, wherein a bidirectional process control list is provided in a process control device, the bidirectional process control list comprising a first process queue and a second process queue, the process control device calculates the process delay time of each target background process in the first process queue, and updates the target background process to the second process queue according to the process delay time, that is, after the process control device determines the process delay time corresponding to each target background process (such as target background process A, target background process B, target background process C), the target background process is added to the preset second process queue, and the process start order of each target background process in the updated second process queue is adjusted according to the process delay time to obtain a target process queue, the target process queue comprising various broadcast queues (such as broadcast queue 1, broadcast queue 2 and broadcast queue 3), the broadcast queue being a broadcast queue for responding to a delayed start event and performing delayed start control on the target background process. That is, after the process control device adds the target background process to the second process queue to be delayed in starting the process, it also adjusts the process start order of each target background process in the second process queue according to the process delay time corresponding to each target background process to obtain the target process queue, wherein the longer the process delay time, the later the corresponding process start order.

[0087] 203. Delayed start control is performed on the target background process according to the terminal load parameter and the target process queue to obtain a process control result.

[0088] Specifically, after updating the target process queue, the process control device responds to the process start request for the target background process, performs delayed start control on the target background process according to the terminal load parameter and the target process queue, and obtains a process control result.

[0089] Specifically, when the process control device is running, it also uses the preset tracking process to detect the terminal load parameters, determines the current terminal load state of the terminal according to the terminal load parameters and the preset terminal load threshold, and determines whether to perform a process delay start operation on each target background process in the target process queue according to the terminal load state and the preset delay call condition. Among them, the terminal load threshold is a load threshold parameter that characterizes the terminal load state. In a specific embodiment, the terminal load threshold is set to 60%. Optionally, the terminal load threshold can also be customized according to the actual needs of the terminal.

[0090] Optionally, if the terminal load parameter is less than a preset terminal load threshold, the process control device determines that the current terminal load state of the terminal is a medium-low load state, and there is no need to delay the start-up control of each background process.

[0091] Optionally, if the terminal load parameter is greater than a preset terminal load threshold, the process control device determines that the current terminal load state of the terminal is a high load state, the process control device determines that the target background process needs to be delayed start control, and queries the target calling process associated with the process start request corresponding to the target background process, wherein the target calling process is the calling process that triggers the process start request and requires the target background process to be started.

[0092] Among them, if the target calling process meets the preset delayed calling conditions, the process control device determines that the target background process needs to be delayed started, and controls the delayed start of the target background process according to the process start interval and process delay time in the target process queue, and generates a process control result.

[0093] Among them, the delayed calling condition includes that the target calling process belongs to a restricted calling state in the system state, that is, when the target calling process belongs to a restricted calling process, the process control device determines that it is necessary to delay the start control of the target background process jointly called by the target calling process.

[0094] Optionally, if the process control device broadcasts a delayed start to the target process queue and the target background process, the delayed start status of the target background process is determined. If the delayed start status is a successful process start, the process control result of successful process control is output, and the target background process is removed from the target process queue.

[0095] Optionally, if the process control device determines that the delayed start state of the target background process is a process start failure, the target background process is started preferentially in the next start, and a process control result of the process start failure is output.

[0096] In this embodiment, the process control device obtains the target background process to be controlled in the first process queue by responding to the process control request; updates the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue; and performs delayed start control on the target background process according to the terminal load parameter and the target process queue to obtain the process control result. After determining the target background process to be controlled that is frequently started and terminated, the process delay time corresponding to the target background process to be delayed is calculated, and the target background process and the corresponding process delay time are associated and stored in a pre-set second process queue for starting and controlling the process to obtain the target process queue, and during the operation of the terminal, responds to the start request for the target background process, and performs a personalized delayed start operation on the target background process to be started according to the current terminal load parameter of the terminal and the target process queue, so as to avoid the situation that the application running in the foreground is unresponsive or crashes due to the frequent start / termination of the background process when the terminal load is high, thereby improving the operation stability of the terminal and the application, and improving the user experience.

[0097] like Figure 3 As shown, Figure 3 This is a flow chart of an embodiment of delaying the start control of a target background process in a process control method provided in an embodiment of the present application. Specifically, in this embodiment, the process control method further includes steps 301 to 302:

[0098] 301. Drive a preset broadcast delay module to send a delayed start broadcast of the target background process to the target process queue according to the process delay time;

[0099] 302. Drive the target process queue to delay starting the target background process according to the delayed start broadcast and the process start interval, and obtain a process control result.

[0100] Based on the above embodiments, in this embodiment, after determining that the target background process needs to be delayed in starting, the process control device controls the delayed start of the target background process according to the process start interval and process delay time in the target process queue, and generates a process control result.

[0101] Specifically, the process control device drives the preset broadcast delay module to send the delayed start broadcast of the target background process to the target process queue according to the process delay time of each target background process. That is, the process control device uses the preset broadcast delay module to set the delayed start broadcast according to the process delay time of each target background process in advance, wherein the delayed start broadcast is a process start broadcast executed according to the process delay time. The target process queue can be a broadcast queue.

[0102] Specifically, after creating each delayed start broadcast, the process control device sends the delayed start broadcast to the target process queue when the process delay time arrives, drives the target process queue to delay starting the target background process according to the delayed start broadcast and the process start interval, and obtains the process control result. Among them, the process start interval is a sliding window interval used to stagger the start time of each target background process, such as Figure 5 As shown, Figure 5 A scenario diagram of a target process queue provided in an embodiment of the present application, wherein fixed or non-fixed process start intervals are set in adjacently arranged processes in the target process queue to avoid terminal freezes caused by the simultaneous start of multiple processes.

[0103] Specifically, when the process delay time arrives, the process control device uses the broadcast delay module to send a delayed start broadcast to the target process queue, drives the target process queue to execute the process start process for the target background process pointed to by the delayed start broadcast after receiving the delayed start broadcast, starts the target background process after waiting for the process start interval, and obtains the process control result.

[0104] In this embodiment, the process control device drives the preset broadcast delay module to send the delayed start broadcast of the target background process to the target process queue according to the process delay time; drives the target process queue to delay the start of the target background process according to the delayed start broadcast and the process start interval, and obtains the process control result. The broadcast mechanism and sliding window are used to start and control the target background process that is frequently started or terminated, thereby realizing orderly start control of the target background process, avoiding terminal freeze caused by the simultaneous start of multiple processes, reducing terminal load, and improving terminal performance.

[0105] like Figure 6 As shown, Figure 6 This is a flow chart of an embodiment of collecting terminal load parameters in a process control method provided in an embodiment of the present application. Specifically, in this embodiment, the process control method further includes steps 401 to 403:

[0106] 401. Detect the terminal load state by using a preset tracking process and a preset collection interval to obtain a first load parameter;

[0107] 402. Detect the terminal load state when the process start request is triggered, and obtain a second load parameter;

[0108] 403. Calculate a terminal load parameter according to the first load parameter and the second load parameter.

[0109] Based on the above embodiment, when the process control device is running, it also uses the preset tracking process to detect the terminal load parameter, and uses the terminal load parameter as the process delay condition. That is, when the terminal load parameter is large, the target background process is controlled (i.e., delayed start or other control methods).

[0110] Specifically, the process control device uses the tracking process to detect the terminal service status mechanism according to the preset collection interval in advance, and performs tracking in the terminal service status mechanism, and then uses the tracking process to read the first load parameter of the terminal according to the preset collection interval. And uses the tracking process to update the first load parameter according to the preset collection interval.

[0111] Specifically, the process control device also reads the terminal load status collected by the preset tracking process when triggering the start of the target background process, obtains the second load parameter, and calculates the terminal load parameter based on the first load parameter and the second load parameter, that is, the process control device averages the second load parameter and the first load parameter to obtain the average value between the first load parameter and the second load parameter, and sets the average value between the first load parameter and the second load parameter as the terminal load parameter.

[0112] Optionally, in other embodiments, the process control device can also count the load parameters of each target background process when the delayed broadcast is triggered and when the delay ends, and calculate the load average between the load parameters to obtain the terminal load parameters.

[0113] Specifically, the process control device determines the current terminal load status of the terminal according to the terminal load parameters and the preset terminal load threshold, and determines whether to perform a process delay start operation on each target background process in the target process queue according to the terminal load status and the preset delay call condition.

[0114] In this embodiment, the process control device detects the terminal load state by using the preset tracking process and the preset collection interval to obtain the first load parameter; detects the terminal load state when the process start request is triggered to obtain the second load parameter; and calculates the terminal load parameter according to the first load parameter and the second load parameter. The terminal load parameter is obtained in real time, and the accuracy of the subsequent process delay control is improved.

[0115] In order to better implement the process control method in the embodiment of the present application, based on the process control method, the embodiment of the present application also provides a process control device, such as Figure 7 As shown, Figure 7 The schematic diagram of the structure of the process control device provided in the embodiment of the present application is as follows. Specifically, the process control device 500 includes:

[0116] The process acquisition module 501 is configured to respond to the process control request and acquire the target background process to be controlled in the first process queue;

[0117] The queue updating module 502 is configured to update the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue;

[0118] The delayed start module 503 is configured to perform delayed start control on the target background process according to the terminal load parameter and the process delay time in the target process queue to obtain a process control result.

[0119] In a possible implementation of this embodiment, the process control device obtains the target background process to be controlled in the first process queue, including:

[0120] Acquire each background process to be started in the first process queue, and collect startup frequency data and process startup type of each background process;

[0121] If the startup frequency data is greater than a preset startup frequency threshold and the process startup type is a joint startup type, the background process corresponding to the startup frequency data is set as a target background process to be controlled.

[0122] In a possible implementation of this embodiment, the process control device updates the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue, including:

[0123] Calculating the process delay time of the target background process according to the process attribute parameters of the target background process and the preset weight coefficients corresponding to the process attribute parameters;

[0124] Adding the target background process to a preset second process queue to obtain an updated second process queue;

[0125] The process start sequence of each of the target background processes in the updated second process queue is adjusted according to the process delay time to obtain a target process queue.

[0126] In a possible implementation of this embodiment, the process control device calculates the process delay time of the target background process according to the process attribute parameter of the target background process and the preset weight coefficient corresponding to the process attribute parameter, including:

[0127] Obtaining process attribute parameters of the target background process, and calculating a process attribute score corresponding to the process attribute parameters;

[0128] The process delay time of the target background process is calculated according to the process attribute score, the weight coefficient corresponding to the process attribute score and a preset time base.

[0129] In a possible implementation of this embodiment, the process control device performs delayed start control on the target background process according to the terminal load parameter and the target process queue to obtain a process control result, including:

[0130] Respond to the process start request for the target background process and collect terminal load parameters using the preset tracking process;

[0131] If the terminal load parameter is greater than a preset terminal load threshold, querying the target calling process corresponding to the process start request;

[0132] If the target calling process meets the preset delayed calling condition, the target background process is delayed in starting according to the process start interval and process delay time in the target process queue to obtain a process control result.

[0133] In a possible implementation of this embodiment, the process control device controls the delayed start of the target background process according to the process start interval and the process delay time in the target process queue to obtain a process control result, including:

[0134] Drive a preset broadcast delay module to send a delayed start broadcast of the target background process to the target process queue according to the process delay time;

[0135] The target process queue is driven to delay starting the target background process according to the delayed start broadcast and the process start interval, and a process control result is obtained.

[0136] In a possible implementation of this embodiment, the process control device collects terminal load parameters using a preset tracking process, including:

[0137] Detect the terminal load state using a preset tracking process and a preset collection interval to obtain a first load parameter;

[0138] Detecting the terminal load state when the process start request is triggered to obtain a second load parameter;

[0139] The terminal load parameter is calculated according to the first load parameter and the second load parameter.

[0140] In this embodiment, the process control device obtains the target background process to be controlled in the first process queue by responding to the process control request; updates the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue; and performs delayed start control on the target background process according to the terminal load parameter and the target process queue to obtain the process control result. After determining the target background process to be controlled that is frequently started and terminated, the process delay time corresponding to the target background process to be delayed is calculated, and the target background process and the corresponding process delay time are associated and stored in a pre-set second process queue for starting and controlling the process to obtain the target process queue, and during the operation of the terminal, responds to the start request for the target background process, and performs a personalized delayed start operation on the target background process to be started according to the current terminal load parameter of the terminal and the target process queue, so as to avoid the situation that the application running in the foreground is unresponsive or crashes due to the frequent start / termination of the background process when the terminal load is high, thereby improving the operation stability of the terminal and the application, and improving the user experience.

[0141] The embodiment of the present invention also provides a process control device, such as Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of an embodiment of the process control device provided in the embodiments of the present application.

[0142] The process control device integrates any one of the process control devices provided by the embodiments of the present invention, and the process control device includes:

[0143] one or more processors;

[0144] Memory; and

[0145] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the process control method described in any of the above process control method embodiments.

[0146] Specifically, the process control device may include one or more processing core processors 601, one or more computer-readable storage media memories 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will understand that Figure 8 The process control device structure shown in the figure does not constitute a limitation on the process control device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

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

[0148] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the process control device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0149] The process control device also includes a power supply 603 for supplying power to each component. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0150] The process control device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0151] Although not shown, the process control device may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 601 in the process control device will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 will run the application stored in the memory 602, thereby realizing various functions, as follows:

[0152] In response to the process control request, obtain the target background process to be controlled in the first process queue;

[0153] Update the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue;

[0154] The target background process is delayed in starting and controlled according to the terminal load parameter and the target process queue to obtain a process control result.

[0155] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any process control method provided in an embodiment of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:

[0156] In response to the process control request, obtain the target background process to be controlled in the first process queue;

[0157] Update the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue;

[0158] The target background process is delayed in starting and controlled according to the terminal load parameter and the target process queue to obtain a process control result.

[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

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

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

[0162] The above is a detailed introduction to a process control method provided in an embodiment of the present application. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A process control method, characterized in that: The process control method comprises: In response to the process control request, obtain the target background process to be controlled in the first process queue; Update the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue; The target background process is delayed in starting and controlled according to the terminal load parameter and the target process queue to obtain a process control result.

2. The process control method according to claim 1, characterized in that: The step of obtaining the target background process to be controlled in the first process queue includes: Acquire each background process to be started in the first process queue, and collect startup frequency data and process startup type of each background process; If the startup frequency data is greater than a preset startup frequency threshold and the process startup type is a joint startup type, the background process corresponding to the startup frequency data is set as a target background process to be controlled.

3. The process control method according to claim 1, characterized in that: The updating of the preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain the target process queue includes: Calculating the process delay time of the target background process according to the process attribute parameters of the target background process and a preset weight coefficient; Adding the target background process to a preset second process queue to obtain an updated second process queue; The process start sequence of each of the target background processes in the updated second process queue is adjusted according to the process delay time to obtain a target process queue.

4. The process control method according to claim 3, characterized in that: The step of calculating the process delay time of the target background process according to the process attribute parameters of the target background process and a preset weight coefficient includes: Obtaining process attribute parameters of the target background process, and calculating a process attribute score corresponding to the process attribute parameters; The process delay time of the target background process is calculated according to the process attribute score, a preset weight coefficient corresponding to the process attribute score, and a preset time base.

5. The process control method according to claim 1, characterized in that: The delaying start control of the target background process according to the terminal load parameter and the target process queue to obtain the process control result includes: In response to a process start request for a target background process, the terminal load parameters are collected using a preset tracking process; If the terminal load parameter is greater than a preset terminal load threshold, querying the target calling process corresponding to the process start request; If the target calling process meets the preset delayed calling condition, the target background process is delayed in starting according to the process start interval and process delay time in the target process queue to obtain a process control result.

6. The process control method according to claim 5, characterized in that: The step of controlling the delayed start of the target background process according to the process start interval and the process delay time in the target process queue to obtain a process control result includes: Drive a preset broadcast delay module to send a delayed start broadcast of the target background process to the target process queue according to the process delay time; The target process queue is driven to delay starting the target background process according to the delayed start broadcast and the process start interval, and a process control result is obtained.

7. The process control method according to claim 5, characterized in that: The collecting the terminal load parameters by using a preset tracking process includes: Detect the terminal load state using a preset tracking process and a preset collection interval to obtain a first load parameter; Detecting the terminal load state when the process start request is triggered to obtain a second load parameter; The terminal load parameter is calculated according to the first load parameter and the second load parameter.

8. A process control device, characterized in that: The process control device comprises: A process acquisition module is configured to respond to a process control request and acquire a target background process to be controlled in the first process queue; A queue updating module is configured to update a preset second process queue according to the target background process and the process delay time corresponding to the target background process to obtain a target process queue; The delayed start module is configured to perform delayed start control on the target background process according to the terminal load parameter and the process delay time in the target process queue to obtain a process control result.

9. A process control device, characterized in that: The process control device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the process control method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of the process control method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Task scheduling method based on coroutine and related equipment

    CN121411916A

  • A coroutine-based task scheduling method and related device

    CN121411916B