Application thread processing method and device and electronic equipment
By automatically updating the performance parameter threshold and anchor key thread collection, the problem of manual calibration of key threads in the prior art is solved, and higher automatic labeling accuracy and maintenance efficiency are achieved.
Patent Information
- Application Number
- CN202411593673.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art can easily lead to mislabeling and missing labels when manually calibrating key threads, and it is difficult to maintain.
By obtaining the performance indicators of the anchor key thread of the target application, the performance parameter threshold of the electronic device is automatically updated, and the first performance parameter is obtained in real time to update the anchor key thread collection, and the automated annotation of the anchor key threads is realized.
It reduces the deviation and maintenance costs caused by manual selection of performance parameters and setting thresholds, reduces the situation of wrong marks and missing marks, and improves the accuracy of automated marking.
Smart Images

Figure CN119597455A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of resource processing technology, and specifically relates to a method, device and electronic device for processing an application thread. Background Art
[0002] In today's era, cameras, as an important application in electronic devices, have been widely used and paid attention to by users. While users pursue the ultimate image quality of camera photos and videos, they are undoubtedly also increasing the demand for the use of various hardware resources when the camera is running. When users operate the camera under multiple backgrounds and heavy loads, it is easy to cause the camera application to freeze or drop frames due to lack of required resources.
[0003] The importance of the central processing unit (CPU) as an important core resource for the camera is self-evident. In order to ensure that the camera process has sufficient CPU resources, the existing adjustment methods for CPU resources are as follows:
[0004] According to the performance indicators, this type of method adjusts the CPU frequency and other operations. After calibrating the key threads of the camera, it continuously detects the performance of related threads. When the marked thread performs poorly, the CPU frequency is increased to increase the total CPU resources to improve the performance of related threads. When the related threads perform well, the CPU frequency can be appropriately reduced to improve power consumption performance and achieve a balance between the two. However, this type of method requires manual calibration of key threads, which is not only time-consuming and labor-intensive, but also difficult to maintain. It is also easy to cause problems such as mislabeling and missing labels, making later maintenance difficult. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device and electronic device for processing application threads, which can solve the problem that manual calibration of key threads in the existing method is prone to mis-calibration and omission.
[0006] In a first aspect, an embodiment of the present application provides a method for processing an application thread, including:
[0007] Acquire a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in a set of anchor point key threads corresponding to the target application;
[0008] When the performance indicator of the target anchor point key thread does not meet the preset performance indicator, updating N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, where N is a positive integer;
[0009] Acquire N first performance parameters of the electronic device, where the N first performance parameters correspond to the N performance parameter thresholds;
[0010] According to the N first performance parameters and the N performance parameter thresholds, the anchor point key thread set corresponding to the target application is updated.
[0011] In a second aspect, an embodiment of the present application provides a processing device for an application thread, including:
[0012] A first acquisition module is used to acquire a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in the anchor point key thread set corresponding to the target application;
[0013] A first updating module, configured to update N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator when the performance indicator of the key thread of the target anchor point does not meet the preset performance indicator, where N is a positive integer;
[0014] A second acquisition module, configured to acquire N first performance parameters of the electronic device, wherein the N first performance parameters correspond to the N performance parameter thresholds;
[0015] The second updating module is used to update the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0020] In the embodiment of the present application, by obtaining the performance index of the target anchor key thread in the anchor key thread set corresponding to the target application, when the performance index of the target anchor key thread does not meet the preset performance index, the N performance parameter thresholds of the electronic device are updated according to the performance index and the preset performance index, that is, when the performance index of the key thread marked by the anchor point cannot meet the preset performance index, it means that the first performance parameter of the electronic device at this moment does not meet the performance requirements of the target application, so the performance parameter threshold of the electronic device is automatically updated through the relationship between the performance index and the preset performance index, so as to reduce the deviation and maintenance cost caused by manually selecting the first performance parameter and manually setting the performance parameter threshold. In addition, the N first performance parameters of the electronic device are obtained in real time, and the N first performance parameters correspond to the N performance parameter thresholds. According to the N first performance parameters and the corresponding N performance parameter thresholds, the anchor key thread set corresponding to the target application is updated, that is, the anchor key threads in the anchor key thread set are automatically updated through the first performance parameters obtained in real time and the performance parameter thresholds corresponding to the first performance parameters, so as to realize the automatic marking of the anchor key threads, improve the situation of wrong marking and missing marking of manual marking, and reduce errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flowchart of a method for processing an application thread provided in an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a process for updating a performance parameter threshold value provided in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of updating the anchor point key thread set provided by an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of the structure of an application thread processing device provided in an embodiment of the present application;
[0025] Figure 5 is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0026] Figure 6 It is a structural block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, 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 one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The following describes the application thread processing method provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0030] like Figure 1 As shown, the embodiment of the present application provides a method for processing an application thread, which may specifically include the following steps:
[0031] Step 101, obtaining a performance indicator of a target anchor point key thread of a target application, wherein the target anchor point key thread is any one of the anchor point key threads in a set of anchor point key threads corresponding to the target application.
[0032] Specifically, the developer marks the start thread and the end thread of the target application as anchor key threads, loads them into the anchor key thread set, and formulates corresponding preset performance indicators, that is, the target application corresponds to an anchor key thread set, and the anchor key thread set includes multiple anchor key threads, and the multiple anchor key threads include a marked start thread and a marked end thread, and the multiple anchor key threads can also include other non-marked threads. For the target anchor key thread among the multiple anchor key threads, the performance indicators of the target anchor key thread are detected and obtained. The above embodiment only needs to calibrate the start thread and the end thread, and other threads can be automatically calibrated over time to improve the situations of wrong labeling and missing labeling in manual labeling and reduce errors.
[0033] Among them, performance indicators include but are not limited to: response time, number of concurrent users, throughput, click rate, error rate, resource utilization, etc.
[0034] It should be noted that the target application may be any application in the electronic device, for example, the target application is a camera application.
[0035] Step 102, when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, update N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, where N is a positive integer.
[0036] Specifically, the performance index of the target anchor point key thread is compared with the preset performance index to determine whether the performance index of the target anchor point key thread meets the preset performance index. If the performance index of the target anchor point key thread meets the preset performance index, no processing is performed; if the performance index of the target anchor point key thread does not meet the preset performance index, the N performance parameter thresholds of the electronic device are updated according to the performance index of the target anchor point key thread and the preset performance index. Furthermore, if the performance index of the target anchor point key thread does not meet the preset performance index, the judgment result that the performance index of the target anchor point key thread does not meet the preset performance index is sent to the core module of the target application, and the second performance parameter of the target application is adjusted through the core module of the target application to improve the performance index of the target anchor point key thread. Among them, the way to adjust the second performance parameter is: to adjust it through the adjustment scheme corresponding to the usage scenario of the current target application.
[0037] The second performance parameter includes, but is not limited to, the priority of the target anchor point key thread, cgroup attributes, CPU frequency, bound cores, etc.
[0038] It should be noted that cgroup is a function of the Linux operating system kernel, which is used to limit, control and separate the resources of a process group, such as CPU, memory, disk input and output, etc. The cgroup attributes include but are not limited to:
[0039] Resource limits: Limit the available resource thresholds for a group of processes, including memory usage limits and file system cache limits;
[0040] Resource monitoring: monitor the resource usage status at the cgroup level;
[0041] Process control: control (suspend or resume) all processes in the cgroup;
[0042] Priority control: Control the priorities of different cgroups. When resources are insufficient, cgroups with high priorities are given priority.
[0043] Step 103: Acquire N first performance parameters of the electronic device, where the N first performance parameters correspond to the N performance parameter thresholds.
[0044] Specifically, N first performance parameters of the electronic device are acquired in real time, each first performance parameter corresponds to a performance parameter threshold, that is, N first performance parameters correspond to N performance parameter thresholds, and the N performance parameter thresholds are the N performance parameter thresholds updated in step 102.
[0045] The N first performance parameters include but are not limited to: CPU frequency, GPU utilization, memory, etc.
[0046] Step 104: Update the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds.
[0047] Specifically, other threads are added to the anchor point key thread set, or the anchor point key thread is removed from the anchor point key thread set, through the N first performance parameters and the corresponding N performance parameter thresholds obtained in real time, so as to update the anchor point key thread set.
[0048] It should be noted that the anchor point key thread set updated in step 104 can be applied in step 101, that is, a target anchor point key thread is selected from the updated anchor point key thread set, and steps 101 to 104 are performed in sequence. In other words, the anchor point key thread set in step 101 can be the anchor point key thread set updated in step 104, and the performance parameter threshold in step 104 can be the performance parameter threshold updated in step 102.
[0049] It is understandable that, since the method of updating the performance parameter threshold in step 101 and step 102 can use the results of step 103 and step 104 (i.e., the updated anchor point key thread set); similarly, the method of updating the anchor point key thread set in step 103 and step 104 can use the results of step 101 and step 102 (i.e., the updated performance parameter threshold). Therefore, the scheme can be executed in the order of step 101, step 102, step 103, and step 104, or in the order of step 103, step 104, step 101, and step 102, which is not specifically limited here.
[0050] In the embodiment of the present application, by obtaining the performance index of the target anchor key thread in the anchor key thread set corresponding to the target application, when the performance index of the target anchor key thread does not meet the preset performance index, the N performance parameter thresholds of the electronic device are updated according to the performance index and the preset performance index, that is, when the performance index of the key thread marked by the anchor point cannot meet the preset performance index, it means that the first performance parameter of the electronic device at this moment does not meet the performance requirements of the target application, so the performance parameter threshold of the electronic device is automatically updated through the relationship between the performance index and the preset performance index, so as to reduce the deviation and maintenance cost caused by manually selecting the first performance parameter and manually setting the performance parameter threshold. In addition, the N first performance parameters of the electronic device are obtained in real time, and the N first performance parameters correspond to the N performance parameter thresholds. According to the N first performance parameters and the corresponding N performance parameter thresholds, the anchor key thread set corresponding to the target application is updated, that is, the anchor key threads in the anchor key thread set are automatically updated through the first performance parameters obtained in real time and the performance parameter thresholds corresponding to the first performance parameters, so as to realize the automatic marking of the anchor key threads, improve the situation of wrong marking and missing marking of manual marking, and reduce errors.
[0051] As an optional specific embodiment, the step 102 updates N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, specifically including:
[0052] Calculating a performance loss value according to the performance indicator and the preset performance indicator;
[0053] Obtaining a first performance weight, and calculating a second performance weight according to the first performance weight, wherein the first performance weight is a performance weight corresponding to the last time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, and the second performance weight is a performance weight corresponding to the current time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator;
[0054] The performance parameter threshold of the electronic device is updated according to the performance loss value and the second performance weight.
[0055] Specifically, after obtaining the performance index of the target anchor point key thread, the difference between the performance index and the preset performance index is calculated, and the absolute value of the difference is used as the performance loss value. In addition, it is also necessary to obtain the first performance weight corresponding to the last time the performance index of the target anchor point key thread did not meet the preset performance index, and calculate the second performance weight corresponding to the performance index of the current target anchor point key thread that does not meet the preset performance index through the first performance weight. The performance loss value is multiplied by the second performance weight to obtain the loss value of the performance parameter, and the performance parameter threshold of the electronic device is updated through the loss value of the performance parameter, for example: the sum of the performance parameter threshold before the update plus the loss value of the performance parameter is the updated performance parameter threshold. The second performance weight of this time is calculated by the first performance weight corresponding to the last time the performance index of the target anchor point key thread did not meet the preset performance index, so as to ensure that the past loss will also retain the impact on the change of the weight, so as to improve the accuracy of the updated performance parameter threshold.
[0056] It should be noted that if the first performance weight corresponding to the last time the performance indicator of the key thread of the target anchor point did not meet the preset performance indicator is not obtained, the preset performance weight will be used as the first performance weight; in other words, if the second performance weight calculated this time is the initial performance weight, then there is no first performance weight corresponding to the last time the performance indicator of the key thread of the target anchor point did not meet the preset performance indicator, and the preset performance weight will be used as the first performance weight to calculate the second performance weight.
[0057] The following formula explains the specific calculation method of the loss value of the performance parameter:
[0058] f L =|L′-L|·ω i
[0059] ω i =ω i-1 +ω i-1 *y
[0060] Among them, f L represents the loss value of the performance parameter;
[0061] L′ represents the performance index;
[0062] L represents the preset performance index;
[0063] ω i Indicates the second performance weight corresponding to the case where the performance index of the target anchor point key thread does not meet the preset performance index this time (i.e., the i-th time in a cycle), that is, indicates the case where the performance index of the target anchor point key thread does not meet the preset performance index for the i-th time in a cycle;
[0064] ω i-1Indicates the first performance weight corresponding to the last time the performance index of the target anchor point key thread did not meet the preset performance index, that is, it indicates the situation that the performance index of the target anchor point key thread does not meet the preset performance index for the i-1th time in a cycle;
[0065] y represents a fixed value, y 32 The value is 0.5.
[0066] The method for updating the performance parameter threshold is described below by using a specific example:
[0067] like Figure 2 As shown, step 201, obtaining the performance index of the key thread of the target anchor point;
[0068] Step 202: the performance index of the target anchor point key thread does not meet the preset performance index;
[0069] Step 203, the core module obtains a first result that the performance index of the target anchor point key thread does not meet the preset performance index;
[0070] Step 204, adjusting a second performance parameter of the target application through a core module of the target application;
[0071] Step 205, calculating the loss value of the performance parameter according to the performance indicator, the preset performance indicator, and the second performance weight;
[0072] Step 206: Update N performance parameter thresholds using the loss values of the performance parameters.
[0073] As another optional specific embodiment, the step 104 updates the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds, and specifically includes steps 1041 to 1044:
[0074] Step 1041: Acquire first performance parameters of the electronic device at multiple moments.
[0075] Specifically, the first performance parameter of the electronic device is acquired at a plurality of different moments, thereby obtaining the first performance parameters corresponding to the plurality of different moments.
[0076] Step 1042: Fit the first performance parameters at the multiple moments to the performance index to obtain a fitting coefficient corresponding to each of the N first performance parameters.
[0077] Specifically, the first performance parameters at multiple different moments are fitted with the performance index, thereby obtaining a fitting coefficient corresponding to each of the N first performance parameters.
[0078] The above fitting coefficient can be calculated by the following formula:
[0079] F=x1*m1+x2*m2+x3*m3+x4*m4+…+b
[0080] Among them, F represents the performance index;
[0081] b represents the preset intercept value;
[0082] x1, x2, x3, x4, …, x N represents N first performance parameters;
[0083] m1, m2, m3, m4, …, m N Represents N fitting coefficients corresponding to N first performance parameters.
[0084] Step 1043: Eliminate the first performance parameters corresponding to the fitting coefficients that do not meet the preset conditions among the N first performance parameters to obtain M first performance parameters, where M is a positive integer less than or equal to N.
[0085] Specifically, each fitting coefficient is monitored, and the first performance parameters corresponding to the fitting coefficients that continuously show correlation are retained, and the first performance parameters corresponding to the fitting coefficients that do not continuously show correlation are eliminated, thereby obtaining M first performance parameters. In other words, the first performance parameters corresponding to the fitting coefficients that reflect positive correlation and negative correlation are retained, that is, for one of the first performance parameters, the corresponding multiple fitting coefficients are obtained, and if the difference between each two fitting coefficients in the multiple fitting coefficients is stable within a preset range, it means that the stability of the first performance parameter is good and can be retained; conversely, if the difference between each two fitting coefficients in the multiple fitting coefficients cannot be stable within a preset range, it means that the stability of the first performance parameter is poor and needs to be eliminated. The above embodiment eliminates the first performance parameters with poor stability, and only updates the anchor point key thread set through the retained first performance parameters to reduce the error of thread update.
[0086] Step 1044: Update the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters.
[0087] Specifically, using M first performance parameters with relatively good stability and corresponding M performance parameter thresholds to update the anchor point key thread set can reduce thread update errors.
[0088] Further, the step 1044 updates the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, and specifically includes:
[0089] When at least one of the M first performance parameters is greater than or equal to the corresponding performance parameter threshold, the subthread being executed under the target anchor key thread is added to the anchor key thread set as an anchor key thread, and the decay times of all the anchor key threads in the anchor key thread set are initialized.
[0090] Specifically, it is determined whether each of the M first performance parameters is greater than or equal to its corresponding performance parameter threshold. If at least one of the M first performance parameters is greater than or equal to its corresponding performance parameter threshold, the adjustment scheme corresponding to the usage scenario of the current target application is updated through the core module of the target application, and the second performance parameter of the target application is adjusted according to the updated adjustment scheme to improve the performance index of the target anchor key thread. Furthermore, if the adjustment scheme is updated because at least one first performance parameter is greater than or equal to its corresponding performance parameter threshold, the sub-thread being executed under the target anchor key thread being detected is added to the anchor key thread set through the core module of the target application, and the sub-thread being executed is used as the anchor key thread in the anchor key thread set, thereby updating the anchor key thread set.
[0091] After the executing sub-thread is added to the anchor critical thread set, the decay times of all anchor critical threads in the anchor critical thread set are initialized to zero.
[0092] Further, the step 1044 updates the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, and specifically includes:
[0093] When the M first performance parameters are all less than the corresponding performance parameter threshold, increasing the decay times of all anchor point key threads in the anchor point key thread set;
[0094] When the decay times of the anchor point key thread reaches a preset number, the anchor point key threads whose decay times reach the preset number in the anchor point key thread set are removed.
[0095] Specifically, if the M first performance parameters are all smaller than their corresponding performance parameter thresholds, the attenuation times of all anchor key threads in the anchor key thread set are increased by 1 through the core module of the target application; if the increased attenuation times reach a preset number, the anchor key threads in the anchor key thread set other than the calibrated start thread and the end thread whose attenuation times reach the preset number are eliminated, that is, the anchor key threads whose attenuation times reach the preset number are eliminated from the anchor key thread set; if the attenuation times of the calibrated start thread and the end thread in the anchor key thread set reach the preset number (e.g., 3 times), they are still retained in the anchor key thread set, thereby updating the anchor key thread set.
[0096] The method for updating the anchor point key thread set is described below by a specific example:
[0097] like Figure 3 As shown, step 301, obtaining M first performance parameters of the electronic device;
[0098] Step 302: at least one of the M first performance parameters is greater than or equal to its corresponding performance parameter threshold;
[0099] Step 303, the core module obtains a second result in which at least one of the M first performance parameters is greater than or equal to its corresponding performance parameter threshold;
[0100] Step 304, adjusting the second performance parameter of the target application through the core module;
[0101] Step 305: Add the subthread being executed under the target anchor point key thread to the anchor point key thread set to update the anchor point key thread set.
[0102] In summary, in the above embodiments of the present application, when the performance index of the key thread marked by the anchor point cannot meet the preset performance index, it means that the first performance parameter of the electronic device at this moment does not meet the performance requirements of the target application. Therefore, the performance parameter threshold of the electronic device is automatically updated through the relationship between the performance index and the preset performance index to reduce the deviation and maintenance cost caused by manually selecting the first performance parameter and manually setting the performance parameter threshold. In addition, the anchor key thread in the anchor key thread set is automatically updated through the first performance parameter obtained in real time and the performance parameter threshold corresponding to the first performance parameter, so as to realize the automatic marking of the anchor key thread, improve the situation of manual marking, such as wrong marking and missing marking, and reduce errors. In addition, the method of updating the performance parameter threshold is integrated with the method of updating the anchor key thread set, and at the same time, each method plays a guiding role in another method, and is optimized synergistically to further improve the performance of the target application.
[0103] The application thread processing method provided in the embodiment of the present application can be executed by a processing device for application threads. The application thread processing method provided in the embodiment of the present application is described by taking the application thread processing device executing the application thread processing method as an example.
[0104] like Figure 4 As shown, the embodiment of the present application further provides an application thread processing device 400, which specifically includes:
[0105] A first acquisition module 401 is used to acquire a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in the anchor point key thread set corresponding to the target application;
[0106] A first updating module 402 is configured to update N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, where N is a positive integer;
[0107] A second acquisition module 403, configured to acquire N first performance parameters of the electronic device, where the N first performance parameters correspond to the N performance parameter thresholds;
[0108] The second updating module 404 is configured to update the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds.
[0109] Optionally, the first updating module 402 is specifically configured to:
[0110] Calculating a performance loss value according to the performance indicator and the preset performance indicator;
[0111] Obtaining a first performance weight, and calculating a second performance weight according to the first performance weight, wherein the first performance weight is a performance weight corresponding to the last time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, and the second performance weight is a performance weight corresponding to the current time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator;
[0112] The performance parameter threshold of the electronic device is updated according to the performance loss value and the second performance weight.
[0113] Optionally, the second updating module 404 is specifically configured to:
[0114] Acquire a first performance parameter of the electronic device at multiple times;
[0115] Fitting the first performance parameters at the multiple moments with the performance index to obtain a fitting coefficient corresponding to each of the N first performance parameters;
[0116] Eliminate the first performance parameters corresponding to the fitting coefficients that do not meet the preset conditions among the N first performance parameters to obtain M first performance parameters, where M is a positive integer less than or equal to N;
[0117] According to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, the anchor point key thread set corresponding to the target application is updated.
[0118] Optionally, when the second updating module 404 updates the anchor key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, it is specifically used to:
[0119] When at least one of the M first performance parameters is greater than or equal to the corresponding performance parameter threshold, the subthread being executed under the target anchor key thread is added to the anchor key thread set as an anchor key thread, and the decay times of all the anchor key threads in the anchor key thread set are initialized.
[0120] Optionally, when the second updating module 404 updates the anchor key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, it is further specifically used to:
[0121] When the M first performance parameters are all less than the corresponding performance parameter threshold, increasing the decay times of all anchor point key threads in the anchor point key thread set;
[0122] When the decay times of the anchor point key thread reaches a preset number, the anchor point key threads whose decay times reach the preset number in the anchor point key thread set are removed.
[0123] In summary, in the above embodiments of the present application, when the performance index of the key thread marked by the anchor point cannot meet the preset performance index, it means that the first performance parameter of the electronic device at this moment does not meet the performance requirements of the target application. Therefore, the performance parameter threshold of the electronic device is automatically updated through the relationship between the performance index and the preset performance index to reduce the deviation and maintenance cost caused by manually selecting the first performance parameter and manually setting the performance parameter threshold. In addition, the anchor key thread in the anchor key thread set is automatically updated through the first performance parameter obtained in real time and the performance parameter threshold corresponding to the first performance parameter, so as to realize the automatic marking of the anchor key thread, improve the situation of manual marking, such as wrong marking and missing marking, and reduce errors. In addition, the method of updating the performance parameter threshold is integrated with the method of updating the anchor key thread set, and at the same time, each method plays a guiding role in another method, and is optimized synergistically to further improve the performance of the target application.
[0124] The processing device of the application thread in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0125] The processing device of the application thread in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0126] The application thread processing device provided in the embodiment of the present application can realize Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0127] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned application thread processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0128] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0129] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0130] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0131] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0132] The processor 1010 is used to obtain a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in the anchor point key thread set corresponding to the target application;
[0133] When the performance indicator of the target anchor point key thread does not meet the preset performance indicator, updating N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, where N is a positive integer;
[0134] Acquire N first performance parameters of the electronic device, where the N first performance parameters correspond to the N performance parameter thresholds;
[0135] According to the N first performance parameters and the N performance parameter thresholds, the anchor point key thread set corresponding to the target application is updated.
[0136] Optionally, when the processor 1010 updates the N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, it is specifically configured to:
[0137] Calculating a performance loss value according to the performance indicator and the preset performance indicator;
[0138] Obtaining a first performance weight, and calculating a second performance weight according to the first performance weight, wherein the first performance weight is a performance weight corresponding to the last time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, and the second performance weight is a performance weight corresponding to the current time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator;
[0139] The performance parameter threshold of the electronic device is updated according to the performance loss value and the second performance weight.
[0140] Optionally, when the processor 1010 updates the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds, it is specifically configured to:
[0141] Acquire a first performance parameter of the electronic device at multiple times;
[0142] Fitting the first performance parameters at the multiple moments with the performance index to obtain a fitting coefficient corresponding to each of the N first performance parameters;
[0143] Eliminate the first performance parameters corresponding to the fitting coefficients that do not meet the preset conditions among the N first performance parameters to obtain M first performance parameters, where M is a positive integer less than or equal to N;
[0144] According to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, the anchor point key thread set corresponding to the target application is updated.
[0145] Optionally, when the processor 1010 updates the anchor key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, it is specifically configured to:
[0146] When at least one of the M first performance parameters is greater than or equal to the corresponding performance parameter threshold, the subthread being executed under the target anchor key thread is added to the anchor key thread set as an anchor key thread, and the decay times of all the anchor key threads in the anchor key thread set are initialized.
[0147] Optionally, when the processor 1010 updates the anchor key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, it is further configured to:
[0148] When the M first performance parameters are all less than the corresponding performance parameter threshold, increasing the decay times of all anchor point key threads in the anchor point key thread set;
[0149] When the decay times of the anchor point key thread reaches a preset number, the anchor point key threads whose decay times reach the preset number in the anchor point key thread set are removed.
[0150] In summary, in the above embodiments of the present application, when the performance index of the key thread marked by the anchor point cannot meet the preset performance index, it means that the first performance parameter of the electronic device at this moment does not meet the performance requirements of the target application. Therefore, the performance parameter threshold of the electronic device is automatically updated through the relationship between the performance index and the preset performance index to reduce the deviation and maintenance cost caused by manually selecting the first performance parameter and manually setting the performance parameter threshold. In addition, the anchor key thread in the anchor key thread set is automatically updated through the first performance parameter obtained in real time and the performance parameter threshold corresponding to the first performance parameter, so as to realize the automatic marking of the anchor key thread, improve the situation of manual marking, such as wrong marking and missing marking, and reduce errors. In addition, the method of updating the performance parameter threshold is integrated with the method of updating the anchor key thread set, and at the same time, each method plays a guiding role in another method, and is optimized synergistically to further improve the performance of the target application.
[0151] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0152] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. 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 (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0153] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0154] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned application thread processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0156] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned application thread processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0157] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0158] 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 various processes of the above-mentioned application thread processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0159] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other 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 reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course 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, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for processing an application thread, characterized in that: include: Acquire a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in a set of anchor point key threads corresponding to the target application; When the performance indicator of the target anchor point key thread does not meet the preset performance indicator, updating N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator, where N is a positive integer; Acquire N first performance parameters of the electronic device, where the N first performance parameters correspond to the N performance parameter thresholds; According to the N first performance parameters and the N performance parameter thresholds, the anchor point key thread set corresponding to the target application is updated.
2. The method according to claim 1, characterized in that The updating of N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator includes: Calculating a performance loss value according to the performance indicator and the preset performance indicator; Obtaining a first performance weight, and calculating a second performance weight according to the first performance weight, wherein the first performance weight is a performance weight corresponding to the last time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, and the second performance weight is a performance weight corresponding to the current time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator; The performance parameter threshold of the electronic device is updated according to the performance loss value and the second performance weight.
3. The method according to claim 1, characterized in that The updating of the anchor point key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds includes: Acquire a first performance parameter of the electronic device at multiple times; Fitting the first performance parameters at the multiple moments with the performance index to obtain a fitting coefficient corresponding to each of the N first performance parameters; Eliminate the first performance parameters corresponding to the fitting coefficients that do not meet the preset conditions among the N first performance parameters to obtain M first performance parameters, where M is a positive integer less than or equal to N; According to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, the anchor point key thread set corresponding to the target application is updated.
4. The method according to claim 3, characterized in that: The updating of the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters includes: When at least one of the M first performance parameters is greater than or equal to the corresponding performance parameter threshold, the subthread being executed under the target anchor key thread is added to the anchor key thread set as an anchor key thread, and the decay times of all the anchor key threads in the anchor key thread set are initialized.
5. The method according to claim 3, characterized in that: The updating of the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters also includes: When the M first performance parameters are all less than the corresponding performance parameter threshold, increasing the decay times of all anchor point key threads in the anchor point key thread set; When the decay times of the anchor point key thread reaches a preset number, the anchor point key threads whose decay times reach the preset number in the anchor point key thread set are removed.
6. A processing device for an application thread, characterized in that: include: A first acquisition module is used to acquire a performance indicator of a target anchor point key thread of a target application, where the target anchor point key thread is any one of the anchor point key threads in the anchor point key thread set corresponding to the target application; A first updating module, configured to update N performance parameter thresholds of the electronic device according to the performance indicator and the preset performance indicator when the performance indicator of the key thread of the target anchor point does not meet the preset performance indicator, where N is a positive integer; A second acquisition module, configured to acquire N first performance parameters of the electronic device, wherein the N first performance parameters correspond to the N performance parameter thresholds; The second updating module is used to update the anchor key thread set corresponding to the target application according to the N first performance parameters and the N performance parameter thresholds.
7. The device according to claim 6, characterized in that The first updating module is specifically used for: Calculating a performance loss value according to the performance indicator and the preset performance indicator; Obtaining a first performance weight, and calculating a second performance weight according to the first performance weight, wherein the first performance weight is a performance weight corresponding to the last time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator, and the second performance weight is a performance weight corresponding to the current time when the performance indicator of the target anchor point key thread does not meet the preset performance indicator; The performance parameter threshold of the electronic device is updated according to the performance loss value and the second performance weight.
8. The device according to claim 6, characterized in that The second updating module is specifically used for: Acquire a first performance parameter of the electronic device at multiple times; Fitting the first performance parameters at the multiple moments with the performance index to obtain a fitting coefficient corresponding to each of the N first performance parameters; Eliminate the first performance parameters corresponding to the fitting coefficients that do not meet the preset conditions among the N first performance parameters to obtain M first performance parameters, where M is a positive integer less than or equal to N; According to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, the anchor point key thread set corresponding to the target application is updated.
9. The device according to claim 8, characterized in that When the second updating module updates the anchor point key thread set corresponding to the target application according to the M first performance parameters and the M performance parameter thresholds corresponding to the M first performance parameters, it is specifically used to: When at least one of the M first performance parameters is greater than or equal to the corresponding performance parameter threshold, the subthread being executed under the target anchor key thread is added to the anchor key thread set as an anchor key thread, and the decay times of all the anchor key threads in the anchor key thread set are initialized.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for processing an application thread as described in any one of claims 1 to 5 are implemented.