Data processing method and device, electronic equipment and storage medium
Through differentiated analysis of comparing packets and benchmark packets, the objective function associated with the degradation of the processor target parameters is determined, which solves the problem of low attribution efficiency of power consumption degradation in the prior art, and achieves efficient positioning and attribution of power consumption degradation.
Patent Information
- Application Number
- CN202311332629.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art is inefficient when detecting and attributing the power consumption deterioration of applications and requires a lot of manpower to investigate and deal with it.
By determining the target parameters of the processor running the comparison packet, in the case of target parameters deterioration, differentiated analysis is performed based on the reference packet and the comparison packet tracking file to determine the objective function associated with the target parameter deterioration, if its frequency is greater than the set threshold.
Efficient attribution of power consumption degradation is achieved, by judging whether the target parameters of the processor are degraded, and by differentiating analysis and positioning the degradation points that lead to power consumption degradation, the efficiency of power consumption degradation attribution is improved.
Smart Images

Figure CN119830887A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer technology, and more particularly to a data processing method, device, electronic device, and storage medium. Background Art
[0002] The power consumption index is a composite index. Power consumption is determined by multiple independent but interrelated factors. The factors that determine power consumption include application factors. Application factors are directly related to the performance of the developed application.
[0003] During the life cycle of an application, the power consumption of the application may change due to various reasons, such as code changes, environmental changes, etc., which may lead to power consumption degradation of the application. The existing power consumption degradation prevention solution is to directly detect the three indicators of power consumption, current and voltage. However, when determining the degradation point through the three indicators of power consumption, current and voltage, a lot of manpower is required for investigation and processing, which reduces the efficiency of power consumption degradation attribution. Summary of the invention
[0004] The present disclosure provides a data processing method, device, electronic device and storage medium, which improve the attribution efficiency of power consumption degradation.
[0005] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:
[0006] determining target parameters for a processor running the comparison package;
[0007] In the case where the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package;
[0008] Based on the difference analysis result, an objective function in the comparison package is determined, the objective function includes a function associated with the degradation of the target parameter, and a frequency associated with the objective function is greater than a set threshold.
[0009] In a second aspect, an embodiment of the present disclosure further provides a data processing device, including:
[0010] A first determination module, configured to determine target parameters of a processor running a comparison package;
[0011] an analysis module, configured to perform differential analysis on the reference package and the comparison package based on the tracking file of the reference package and the tracking file of the comparison package when the target parameter is degraded;
[0012] The second determination module is used to determine the target function in the comparison package based on the difference analysis result, wherein the target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processing devices;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method provided in the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the method provided in the embodiment of the present disclosure.
[0018] The disclosed embodiment determines the target parameters of the processor running the comparison package; in the case of degradation of the target parameters, based on the tracking file of the benchmark package and the tracking file of the comparison package, differential analysis is performed on the benchmark package and the comparison package; based on the differential analysis result, the target function in the comparison package is determined, the target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold, thereby solving the problem of low efficiency in attributing power consumption degradation, and measuring whether there is a power consumption problem by judging whether the target parameters of the processor are degraded. In the case of degradation of the target parameters, differential analysis is performed on the benchmark package and the comparison package, and the target function in the comparison package associated with the degradation of the target parameter and the frequency associated with it is greater than the set threshold is determined, thereby achieving the location of the degradation point that causes power consumption degradation and improving the efficiency of power consumption degradation attribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of another data processing method provided by an embodiment of the present disclosure;
[0022] Figure 3a is a schematic diagram of an indirect additional high-frequency method provided by the disclosed embodiment;
[0023] Figure 3bis a schematic diagram of a directly added high frequency method provided by an embodiment of the present disclosure;
[0024] Figure 3c is a schematic diagram of a high frequency function provided by an embodiment of the present disclosure;
[0025] Figure 3d is a schematic diagram of a scenario of a newly added high-frequency function provided by an embodiment of the present disclosure;
[0026] Figure 3e is a schematic diagram of an attribution process provided by an embodiment of the present disclosure;
[0027] Figure 3f is an aggregation schematic diagram of a tracking file provided by an embodiment of the present disclosure;
[0028] Figure 3g is a schematic diagram of an initial comparison tree provided by an embodiment of the present disclosure;
[0029] Figure 3h This is a schematic diagram of determining a newly added method name provided by an embodiment of the present disclosure;
[0030] Figure 3i is a schematic diagram of a comparison tree provided by an embodiment of the present disclosure;
[0031] Figure 3j is an attribution schematic diagram provided by an embodiment of the present disclosure;
[0032] Figure 3k It is a flame graph analysis schematic diagram provided by an embodiment of the present disclosure;
[0033] Figure 3l It is a schematic diagram of an overall process provided by an embodiment of the present disclosure;
[0034] Figure 4 is a structural schematic diagram of a data processing device provided by an embodiment of the present disclosure;
[0035] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0036] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0037] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0038] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0039] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0040] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0041] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0042] The power consumption index is a composite index, and the influencing factors can be divided into human factors and application factors.
[0043] Human factors are mainly affected by user behavior and settings, including screen brightness, volume, wireless connection settings, etc. Most of these are the result of user subjective operations, and the impact of human factors is difficult to intervene and change.
[0044] Application factors are closely related to application performance, such as the workload of the central processing unit (CPU) and graphics processing unit (GPU) (depending on the application's computing and graphics rendering tasks), network request frequency (i.e., the frequency of interaction between the application and the server), and special features used by the application, such as wake locks (i.e., Wakelocks) and global positioning system (GPS), which will directly affect power consumption. Application factors are what developers can directly optimize and improve.
[0045] While focusing on device power consumption, the present disclosure also focuses on application factors. During the life cycle of an application, due to various reasons, such as code iterations, environmental changes, etc., the power consumption performance of the application may change, which may lead to power consumption degradation of the application. Therefore, it is necessary to implement power consumption degradation prevention capabilities offline to prevent or mitigate power consumption degradation.
[0046] The relevant power consumption degradation prevention solutions all directly monitor the three indicators of power consumption (mW), current (mA) and voltage (V). However, during the operation of this solution, the following three key problems were found to be urgently solved:
[0047] Low accuracy: It relies on power consumption (mW), current (mA), and voltage (V) indicators to intercept degradation, but these indicators fluctuate greatly, resulting in low accuracy.
[0048] Low recall rate: The actual usage scenarios of users are extremely complex, and offline testing cannot cover all situations.
[0049] Weak attribution capability: Even if a problem is discovered, a large amount of manpower is still required to investigate and resolve it.
[0050] In order to solve the above technical problems, the present disclosure provides a data processing method to prevent power consumption degradation more accurately and systematically, and to achieve the power consumption degradation prevention capability in the offline development process, such as the testing phase before releasing the application version.
[0051] Figure 1 It is a flow chart of a data processing method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of determining the target function in the comparison package. The method can be executed by a data processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0052] like Figure 1 As shown, the method includes:
[0053] S110: Determine target parameters of a processor running a comparison package.
[0054] The comparison package is an installation package updated based on the baseline package. The comparison package and the baseline package can be considered as the installation packages of the application. The baseline package can be considered as the installation package used as the baseline. The comparison package can be considered as the installation package after the version upgrade. The processor can be the processor used to run the comparison package, such as the CPU and / or GPU. The target parameter can be considered as the parameter of the processor, such as the utilization rate of the processor.
[0055] Power consumption is a composite indicator composed of multiple factors. The content that can be optimized includes: CPU utilization, GPU utilization, network request frequency, whether the device is frequently woken up, and the use of positioning services.
[0056] Among them, CPU usage is a measure of the proportion of device processing power used, which has a direct impact on power consumption. If the application overuses the CPU, it will cause the device to heat up and may shorten the battery life.
[0057] The GPU is mainly responsible for graphics rendering. Excessive use will consume a lot of power and may cause the device to overheat. In applications that require a lot of graphics processing, such as games and image processing, the GPU usage rate is generally high. Proper optimization of the graphics rendering process can effectively reduce the GPU usage rate, thereby reducing power consumption.
[0058] Since the frequency of network requests will eventually be reflected in the CPU usage, the network request frequency is used as a reference indicator of CPU usage.
[0059] Whether the device is frequently woken up will have an impact on power consumption, but the impact is small.
[0060] Positioning services mainly involve the use of GPS, which may increase power consumption. If the update frequency of positioning information is too high or the positioning accuracy is too high, a lot of power will be consumed.
[0061] Although frequent device wake-up and location service usage will also affect power consumption, their impact is relatively small compared to CPU and GPU usage, and the optimization benefits are relatively low. Therefore, the present disclosure optimizes CPU and GPU usage when performing power consumption prevention. CPU usage and GPU usage are more stable than indicators such as power consumption (mW), current (mA) and voltage (V).
[0062] The present disclosure can determine whether to perform degradation analysis on the comparison package based on the target parameters of the processor, such as mainly based on the CPU usage rate and GPU usage rate, to achieve offline power consumption degradation prevention capability.
[0063] S120 : When the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package.
[0064] The means for determining whether the target parameter is degraded is not limited. For example, the target parameter value can be compared with the degradation threshold to determine whether the target parameter is degraded. The degradation threshold can be a threshold set to measure the degradation of the target parameter. The degradation threshold is not limited here and can be a dynamically adjusted threshold. The tracking file, also known as the Trace file, can be considered as a file determined by a tracking tool, such as a Trace tool, after tracking the corresponding installation package. For example, the tracking file of the comparison package is obtained by processing the comparison package with the tracking tool, and the tracking file of the benchmark package is obtained by processing the benchmark package with the tracking file.
[0065] The number of the tracking files is not limited here and can be at least one. In this step, the tracking files of the comparison package and the benchmark package collected by the tracking tool can be obtained.
[0066] When the number of tracking files of the comparison package is at least two, the comparison package can be collected multiple times to obtain multiple tracking files of the comparison package. When the number of tracking files of the reference package is at least two, the reference package can be collected multiple times to obtain multiple tracking files of the reference package.
[0067] Differential analysis can be considered as performing differential analysis, such as performing differential analysis on the comparison package and the benchmark package to determine the difference between the comparison package and the benchmark package. In this embodiment, when performing differential analysis, a function of the difference between the comparison package and the benchmark package can be determined, such as determining a high-frequency function newly added to the comparison package relative to the benchmark package. A high-frequency function can be considered as a function whose associated frequency is greater than a set threshold. The set threshold can be a pre-set threshold, and the specific value is not limited here.
[0068] The target parameter degradation may indicate the existence of power consumption degradation. In the case of target parameter degradation, the comparison package may be analyzed, and in the process of analyzing the comparison package, the reference package may be combined to achieve differential analysis of the comparison package and the reference package.
[0069] This embodiment can convert the power consumption degradation location into the CPU usage rate and GPU usage rate degradation location. The cause of CPU degradation can include indirectly added high-frequency functions and directly added high-frequency functions.
[0070] Among them, the indirectly added high-frequency functions are also called high-load functions. The use of high-load functions leads to higher CPU usage. The characteristics of the newly added high-load functions include: the calling frequency of the newly added method itself may not be high, but due to the high-frequency loop processing operations inside, the overall power consumption increases.
[0071] The directly added high-frequency functions have the following characteristics: a single high-frequency function may not have a significant impact on CPU usage, but because it is frequently called, it may occupy more CPU resources overall, resulting in increased power consumption.
[0072] The usage frequency of the directly added high-frequency function itself is greater than the set threshold, and the usage frequency of the function called by the indirectly added high-frequency function is greater than the set threshold.
[0073] S130: Determine the objective function in the comparison package based on the difference analysis result.
[0074] The differential analysis result can be considered as the result obtained after differential analysis. The differential analysis result can indicate the candidate function newly added to the comparison package relative to the reference package. The candidate function can be a candidate target function. The target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold. The target function can be a function that causes power consumption degradation, and the target function can be a high-frequency function newly added to the comparison package relative to the reference package.
[0075] When determining the target function based on the differential analysis result, the target function can be selected from the newly added candidate functions indicated by the differential analysis result. When selecting, the selection can be made for the directly added high-frequency function and the indirectly added high-frequency function respectively.
[0076] In this embodiment, the root function in the directly added high-frequency function may be determined as the target function, and the leaf function in the indirectly added high-frequency function may be determined as the target function.
[0077] Among them, the root function can be considered as the function as the root node in the call relationship. The leaf function can be considered as the function as the leaf node in the call relationship. The call relationship can reflect the call relationship between functions.
[0078] This operation determines that the target function achieves attribution of the power consumption degradation of the comparison package, and determines the target function as a function that causes power consumption degradation.
[0079] The technical solution of the disclosed embodiment is to determine the target parameters of the processor running the comparison package; in the case of degradation of the target parameters, based on the tracking file of the benchmark package and the tracking file of the comparison package, perform differential analysis on the benchmark package and the comparison package; based on the differential analysis result, determine the target function in the comparison package, the target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold, thereby solving the problem of low efficiency in attributing power consumption degradation, and measuring whether there is a power consumption problem by judging whether the target parameters of the processor are degraded. In the case of degradation of the target parameters, by performing differential analysis on the benchmark package and the comparison package, determine the target function in the comparison package that is associated with the degradation of the target parameter and the frequency associated with it is greater than the set threshold, thereby achieving the location of the degradation point that causes power consumption degradation and improving the efficiency of power consumption degradation attribution.
[0080] Figure 2 is a flow chart of another data processing method provided by an embodiment of the present disclosure. This embodiment specifically implements the operation of determining the objective function, such as Figure 2 As shown, the data processing method includes:
[0081] S210: Determine target parameters of a processor that runs a comparison package.
[0082] S220 : When the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package.
[0083] S230: Determine a first candidate function in the difference analysis result whose usage frequency is greater than the set threshold.
[0084] The difference analysis result may indicate a newly added candidate function of the comparison package relative to the reference package. The newly added candidate function includes a first candidate function and a second candidate function.
[0085] The usage frequency of the first candidate function is greater than the set threshold, and it can also be called a directly added high-frequency function. The usage frequency of the function called by the second candidate function is greater than the set threshold, and it can also be called an indirectly added high-frequency function.
[0086] The first candidate function and the second candidate function may be marked in the differential analysis result. This operation may determine the first candidate function in the differential analysis result whose usage frequency is greater than a set threshold by identifying the mark.
[0087] S240: Determine a root function in the first candidate functions as the target function of the comparison package.
[0088] After the first candidate function is determined, this operation can determine the root function of the first candidate function as the target function for comparison, so as to attribute the direct high-frequency function to the root node, that is, the root function. The power consumption degradation problem can be solved by optimizing the root function.
[0089] S250: Determine a second candidate function whose usage frequency of the called function in the differential analysis result is greater than the set threshold.
[0090] The means for determining the second candidate function may refer to the means for determining the first candidate function. For example, the second candidate function in the differential analysis result is determined by identifying the identifier in the differential analysis result.
[0091] The differential analysis results can be presented in the form of a tree, such as a comparison tree, where different levels correspond to the calling relationships between different functions. The first candidate function and the second candidate function can be marked in the comparison tree.
[0092] S260: Determine a leaf function in the second candidate function as the target function of the comparison package.
[0093] After the second candidate function is determined, this operation can determine the leaf function in the second candidate function as the target function, so as to attribute the indirect high-frequency function to the leaf node, that is, the leaf function. The power consumption degradation problem can be solved by optimizing the leaf function.
[0094] In this embodiment, when determining the objective function, the candidate functions are divided into a first candidate function and a second candidate function. Different attribution means are set for the first candidate function and the second candidate function respectively. The root function of the first candidate function and the leaf function of the second candidate function are respectively used as the objective function, which improves the attribution efficiency. By optimizing the objective function, the power consumption degradation problem can be solved.
[0095] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0096] In one embodiment, the processor includes one or more of a central processing unit and a graphics processing unit, and the target parameter includes a usage rate.
[0097] In this embodiment, the processor is refined into a central processing unit and a graphics processing unit, and the target parameter is refined into a usage rate.
[0098] Whether there is a power consumption degradation problem is determined by analyzing the usage rate of the central processing unit and / or the graphics processing unit.
[0099] In one embodiment, determining target parameters of a processor running a comparison package includes:
[0100] A stress test is performed on the comparison package to determine target parameters of a processor running the comparison package within a set time period.
[0101] Stress testing of the comparison package is a guarantee of the quality of the comparison package. Stress testing can determine whether the software runs stably under a certain access pressure.
[0102] Stress testing of packages is a fundamental quality assurance activity that is part of every serious software testing effort. Rather than running manual or automated tests under normal conditions, stress testing of packages involves running tests under conditions where there are fewer computers or system resources.
[0103] This embodiment solves the power consumption problem, which requires long-term stress testing to locate the degradation point. This operation performs a stress test on the comparison package, and then determines the target parameters of the processor running the comparison package within the set time during the stress test phase. The set time can be considered as the set time, and the specific time is not limited.
[0104] In one embodiment, when the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package includes:
[0105] When the value of the target parameter is less than the degradation threshold, aggregating the multiple tracking files of the benchmark package to obtain a first aggregate file of the benchmark package;
[0106] Aggregating the multiple tracking files of the comparison package to obtain a second aggregate file of the comparison package;
[0107] The first aggregated file and the second aggregated file are differentially analyzed to obtain a comparison tree of the comparison package and the benchmark package, wherein the comparison tree indicates candidate functions newly added to the comparison package relative to the benchmark package, the candidate functions are determined by a function set of the comparison package and a function set of the benchmark package, and a frequency associated with the candidate functions is greater than the set threshold.
[0108] The first aggregate file may be considered as a file obtained by aggregating multiple tracking files of the reference package. The second aggregate file may be a file obtained by aggregating the comparison package.
[0109] The comparison tree can be the result of the differential analysis obtained after the differential analysis, which represents the difference between the comparison package and the benchmark package in the form of a tree. The comparison tree can have different levels, and the execution of functions at different levels can have a calling relationship between functions at different levels. The associated frequency of the candidate function is greater than the set threshold, that is, the candidate function is a high-frequency function, such as directly added high-frequency functions and indirectly added high-frequency functions.
[0110] The function set of the comparison package may be a set of functions included in the comparison package. The function set of the benchmark package may be a set of functions included in the benchmark package. By analyzing the function set of the comparison package and the function set of the benchmark package, the newly added functions in the function set of the comparison package may be determined. The candidate function may be a function selected from the newly added functions. For example, a function whose corresponding frequency is greater than a set threshold is selected from the intersection of the newly added functions in the function set and the newly added functions indicated by the comparison tree as a candidate function. For another example, a function whose corresponding frequency is greater than a set threshold is selected from the newly added functions indicated by the comparison tree, and the selected function is intersected with the newly added functions in the function set. The functions included in the intersection are determined as candidate functions.
[0111] When the value of the target parameter is less than the degradation threshold, it can be considered that there is a power consumption problem, and this embodiment can perform differential analysis.
[0112] When performing differential analysis, multiple tracking files of the comparison package and multiple tracking files of the benchmark package can be aggregated to obtain a first aggregated file and a second aggregated file. The order of aggregation is not limited and can be performed in parallel or sequentially.
[0113] The means of aggregation is not limited. Taking the comparison package as an example, multiple tracking files of the comparison package can be aggregated to obtain a second aggregate file of the comparison package, or each tracking file of the comparison package can be aggregated within the tracking file, and then the aggregated tracking files can be aggregated between tracking files.
[0114] When the first aggregate file and the second aggregate file are obtained by aggregation, functions in the same stack may be merged together, and the time consumption of the functions may be accumulated and averaged.
[0115] In this embodiment, the first aggregate file and the second aggregate file may be subjected to differential analysis to obtain a comparison tree, such as comparing threads with the same name or comparing them in stages. The comparison tree may include comparison results in the thread dimension and the stage dimension.
[0116] Threads with the same name can be considered as threads with the same name. Generally, scenarios are divided into multiple stages. When performing differential analysis, you can perform differential comparison based on the stage dimension.
[0117] In one embodiment, performing differential analysis on the first aggregate file and the second aggregate file to obtain a comparison tree of the comparison package and the benchmark package includes:
[0118] Performing differential analysis on the first aggregated file and the second aggregated file to obtain an initial comparison tree of the comparison package and the benchmark package, wherein the initial comparison tree indicates functions newly added to the comparison package relative to the benchmark package;
[0119] Selecting a function whose associated frequency is greater than the set threshold from the newly added functions;
[0120] Determine an intersection of the function set of the comparison package and the function set of the benchmark package;
[0121] Determine a difference between the function set of the comparison package and the intersection;
[0122] Performing intersection processing on the functions included in the difference set and the selected function;
[0123] Determine the function obtained after the intersection processing as a newly added candidate function;
[0124] The initial comparison tree is updated to obtain a comparison tree indicating the newly added candidate functions.
[0125] The initial comparison tree may be a comparison tree after differential analysis. The initial comparison package indicates functions newly added to the comparison package relative to the benchmark package.
[0126] This embodiment obtains an initial comparison tree after performing differential analysis, and selects functions whose associated frequencies are greater than a set threshold from the newly added functions indicated by the comparison tree, thereby realizing the selection of newly added high-frequency functions.
[0127] In order to avoid misjudgment caused by newly added function calls or migration of function usage locations, this embodiment further filters newly added functions based on the function set of the comparison package and the function set of the benchmark package.
[0128] The intersection of the function set of the benchmark package and the function set of the comparison package can be considered as the functions shared by the combination of the two functions.
[0129] The difference between the function set of the comparison package and the intersection can be considered as the newly added functions in the comparison package.
[0130] This embodiment achieves filtering of the newly added high-frequency functions indicated by the initial comparison tree by intersecting the functions included in the difference set with the functions selected based on frequency, and uses the result of the intersection as a newly added candidate function, thereby avoiding the misjudgment of function calls and function position migration as newly added functions.
[0131] After obtaining the candidate functions, the initial comparison tree can be updated to obtain a comparison tree of the comparison package relative to the benchmark package.
[0132] In one embodiment, the frequencies associated with the objective function include one or more of the following:
[0133] frequency of use of the objective function;
[0134] The usage frequency of the function called by the target function.
[0135] Usage frequency can be thought of as the frequency of use, such as the frequency of being called.
[0136] The usage frequency of the target function is the usage frequency of the target function itself. The usage frequency of the function called by the target function can be considered as the usage frequency of the function included in the target function. The usage frequency of the target function greater than the set threshold can be considered as a direct high-frequency function. The usage frequency of the function called by the target function can be considered as an indirect high-frequency function.
[0137] In one embodiment, after determining the objective function in the comparison package based on the difference analysis result, the method further includes:
[0138] Performing flame graph aggregation analysis on the target function to determine a renamed function in the target function;
[0139] Filter the renamed functions in the target function.
[0140] A renamed function can be considered as a renamed function, such as a function in the baseline package being renamed in the comparison package. The renamed function has a different function name but the same function body.
[0141] This embodiment performs flame graph analysis on the objective function. The flame graph analysis can determine the renamed function in the objective function. After the renamed function is determined, the renamed function can be filtered from the objective function, and the filtered objective function can be optimized to solve the power consumption degradation problem.
[0142] The present disclosure is described exemplarily below. The data processing method provided by the present disclosure can be considered as a solution for preventing power consumption degradation of Android applications.
[0143] Figure 3a is a schematic diagram of an indirect additional high frequency method provided by the disclosed embodiment. Figure 3a , in a certain scenario, including methods: C and D, and a newly added method A. In this disclosure, a function can be understood as a method. Method C calls method J. The newly added method A calls method E multiple times. The newly added method A can be considered as an indirectly added high-frequency method. There are high-frequency loop processing operations inside the newly added method A.
[0144] Figure 3b It is a schematic diagram of a directly added high-frequency method provided by an embodiment of the present disclosure. Figure 3b A scenario includes a newly added method A that is used multiple times. The newly added method A calls method C and method D. Method C calls method H, and method D calls method I. Figure 3b The newly added method A can be considered as a directly added high-frequency function, and the newly added method A itself is used multiple times.
[0145] Figure 3c is a schematic diagram of a high frequency function provided by an embodiment of the present disclosure, Figure 3c The following figure shows the frequent execution of animation rendering operations in GPU-related scenarios. The functions corresponding to animations can be considered as directly added high-frequency functions. Frequent rendering of graphics and animations will increase the processing burden of the GPU. Because the GPU needs to spend more resources to process these operations, it may cause an increase in power consumption.
[0146] A single time-consuming function call may affect the performance experience of a specific scenario, but it does not directly cause power consumption issues. Therefore, preventing power consumption degradation is focused on controlling high-frequency functions.
[0147] If in a specific scenario, a new piece of repetitive function logic is added and causes a significant increase in CPU or GPU usage, then it can be determined that this is a power consumption issue.
[0148] CPU usage or GPU usage is an offline test indicator, which is bound to fluctuate. To prevent such fluctuations from causing false positives, the degradation threshold of CPU usage or GPU usage is usually set relatively high. However, after clarifying the definition of power consumption issues, the method of focusing only on CPU or GPU usage has been improved. High-frequency functions can be included in the judgment factors. Use CPU usage and GPU usage as indicators for power degradation problem discovery. Use high-frequency functions as attribution results.
[0149] The calculation method of GPU usage and CPU usage is not limited here. For example, the ratio of CPU duration and system duration in the sampling window can be determined as CPU usage. The ratio of the product of GPU raw data and GPU current frame rate to GPU maximum frame rate is determined as GPU usage.
[0150] By using high-frequency functions as an identification criterion, the problem detection sensitivity is actually improved. This means that the degradation threshold of CPU or GPU usage can be lowered to enhance the recall rate of problem detection without reducing the accuracy of detection. Such a strategy helps locate and solve power consumption problems more comprehensively and effectively.
[0151] The scenarios of power consumption degradation are different from the anti-degradation measures for common user interaction scenarios such as the first refresh. Behaviors such as the first refresh are usually short-lived, and the user experience mainly focuses on the response speed and smoothness of these operations. However, power consumption problems usually only appear after a long period of use, especially in continuous, high-intensity tasks. For example, the following problems usually only appear after high-intensity use:
[0152] Leakage of animation effects: In some complex animations, especially user interaction animation effects, improper design may cause leakage of animation effects, that is, the animation effects cannot be properly destroyed after use. If such animation effects are not properly destroyed, they will continue to occupy CPU or GPU resources, resulting in increased power consumption of the device.
[0153] In the case of power consumption degradation, long-term stress testing is needed to reveal and locate these problems. This stress test usually involves running the application at high intensity and for a long time, and obtaining the CPU usage and GPU usage within a certain period of time.
[0154] After the stress test, multiple trace files can be obtained through multiple data collections.
[0155] When the CPU and GPU indicators are abnormal, it is necessary to find new high-frequency functions to attribute the problem (that is, when the target parameter is degraded, the benchmark package and the comparison package are differentially analyzed based on the tracking files of the benchmark package and the comparison package, and then the target function is determined). Code changes between versions will introduce many new time-consuming functions. However, a key question is whether these new time-consuming functions are really the root cause of power consumption degradation.
[0156] Figure 3d is a schematic diagram of a scenario of a newly added high-frequency function provided by an embodiment of the present disclosure, Figure 3d A scenario includes a newly added method B and a newly added method A that is used multiple times. The newly added method A calls methods C and D. Method C calls method H, and method D calls method I. The newly added method B calls method K, and method K calls method G. The newly added method A is a newly added high-frequency function. Although the newly added method B is also a newly added function, it is not a high-frequency function.
[0157] There is a difference between the root cause of power consumption degradation and the attribution of performance degradation. Performance degradation attribution requires finding all newly added time-consuming functions, while finding the cause of power consumption degradation requires finding newly added high-frequency functions. Although a function may have new or increased calls, it does not mean that it is the root cause of power consumption degradation unless it operates at a high frequency, resulting in a large consumption of the CPU or GPU.
[0158] The cases of adding high-frequency functions are divided into two categories: direct addition and indirect addition.
[0159] Directly added high-frequency functions: refers to the direct increase in the frequency of function usage in a certain scenario, which leads to a significant increase in CPU or GPU usage. Figure 3bAs shown in the figure, a high-frequency method A is added to the scene, which leads to abnormal power consumption. The garbage collection operation of memory and the animation rendering of GPU are all directly added high-frequency functions.
[0160] Indirectly added high-frequency functions: For such functions, even if the calling frequency itself does not increase directly, since the functions contain a large number of high-frequency operations, when they are called in specific scenarios, the overall CPU or GPU consumption will increase. Figure 3a Therefore, although method A is added only once, method E is called a large number of times, resulting in abnormal power consumption.
[0161] The attribution nodes of directly added and indirectly added high-frequency functions are different.
[0162] For directly added high-frequency functions, the attribution nodes are usually the newly added function call points, because these newly added call points directly lead to the increase in the number of function calls, thus causing corresponding performance problems.
[0163] For the indirectly added high-frequency functions, the attribution nodes are usually inside the function, specifically, those new or changed high-frequency operations. Although the function call frequency may not change, the changes in the operations inside the function lead to overall performance or power consumption issues.
[0164] Figure 3e This is a schematic diagram of an attribution process provided by an embodiment of the present disclosure. After the attribution is started, a self-merging tree aggregation of multiple tracking files is performed with two branches, namely, the comparison package tracking file and the construction package (i.e., the benchmark package) tracking file, to determine the first aggregated file and the second aggregated file. A comparison tree is constructed based on the first aggregated file and the second aggregated file. Then, the flame graph confidence judgment of the caller and callee of the degradation point is performed, namely, the flame graph aggregation analysis of the target function is performed to determine the renamed function in the target function, and the newly added high-frequency function is determined based on the judgment result, namely, the renamed function in the target function is filtered to obtain the newly added high-frequency function, and it is output as the degradation point.
[0165] During the attribution process, we use the processor as the basis, utilize the capability of differential analysis, and generate flame graphs for attribution.
[0166] This embodiment can construct multiple trace files, such as a merged tree of trace files (such as the first aggregate file and the second aggregate file), traverse each trace file, merge the same stack functions together, accumulate the time consumption and calculate the average (the denominator is the total number of samples, such as the number of trace files N, not the number of function occurrences), and at the same time maintain the original number of nodes, minimum time consumption, maximum time consumption, and median time consumption for backup. Figure 3f1 is a schematic diagram of aggregating a tracking file provided by an embodiment of the present disclosure. Tracking file 1, tracking file 2 to tracking file N are aggregated to obtain an aggregated file. Figure 3f Method A, method B, and methods D and E called by method B belong to the same stack and are aggregated; different nodes are merged and the union is taken, for example Figure 3f Methods D and C generate a multi-trace merge tree.
[0167] The same stack can be considered to include the same functions in the stack, the order of the functions in the stack can also be the same, and the calling relationships between the functions are the same.
[0168] After obtaining the aggregate file, also known as the merged tree of multiple tracking files, the threads with the same name are compared, and the aggregated results (aggregate files) are compared. The comparison is also performed in stages, and finally a comparison tree is generated for each thread and stage. The comparison tree will record the newly added and deleted call nodes, the common method call nodes with changed time consumption, and various information of each node, such as wall / cpu time consumption and source data information, to generate a comparison tree.
[0169] Figure 3g is a schematic diagram of an initial comparison tree provided by an embodiment of the present disclosure, Figure 3g The initial comparison tree marks whether a node is a new node. For example, in phase A, method A is a non-new node, method D is a non-new node, and method E is a non-new node. In phase B, method B is a new node, and method F is a new node. New nodes can be considered as new functions.
[0170] After the initial comparison tree is determined, a threshold comparison can be set for the frequency associated with the newly added function. If the number of newly added function calls and the CPU time consumed for each call exceed the corresponding threshold, it can be considered that the associated frequency is greater than the set threshold.
[0171] By constructing the comparison tree, we get the newly added nodes and non-new nodes. However, the newly added nodes are not necessarily equal to the newly added functions. It is possible that a new call is added to the current tree node, or it is migrated from one tree node to another. Therefore, the comparison tree needs to be processed again.
[0172] Figure 3h This is a schematic diagram of determining a newly added method name provided by an embodiment of the present disclosure, see Figure 3h, perform intersection and difference processing on all function names of the base package (i.e. base) and the comparison package (i.e. compared), i.e., the function set of the comparison package (also called the comparison package method name set) and the function set of the base package (also called the base package method name set) (i.e., determine the intersection of the function set of the comparison package and the function set of the base package, and determine the difference between the function set of the comparison package and the intersection), obtain the set of common method names (determine the set formed by the functions included in the intersection of the function set of the comparison package and the function set of the base package), the set of newly added method names (i.e., the set formed by the functions included in the difference set), and only when a node belongs to both the newly added node (i.e., the newly added function in the comparison tree) and the newly added method name, the node is considered as a newly added function and is marked on the comparison tree. The method names in the base package method name set other than the common method names are deleted method names, i.e., the names corresponding to the deleted methods.
[0173] In this embodiment, the newly added functions on the initial comparison tree need to be screened by frequency to determine the high-frequency functions, and then the intersection is taken with the newly added method name set to obtain the candidate functions.
[0174] Figure 3i is a schematic diagram of a comparison tree provided by an embodiment of the present disclosure, Figure 3i The comparison tree after updating the initial comparison tree is shown, such as the main thread comparison tree, which shows the result of the intersection processing of the functions included in the difference set and the selected function, that is, marking whether each node is a candidate function. If the node is a newly added high-frequency node and is in the function included in the difference set, it can be considered a candidate function. Figure 3i It includes phase A and phase B. Phase A includes method A, which is a non-newly added function. Method D called by method A is a non-newly added node, and method E called by method A is a non-newly added function. Phase B includes method B, which is a new node but not a new function. Method F called by method B is a new function. When method F is a new node and the associated frequency is greater than the set threshold, method F is a candidate function.
[0175] Figure 3j is an attribution schematic diagram provided by an embodiment of the present disclosure, where a newly added high-frequency function is attributed to a root newly added high-frequency function, namely, a root function. Figure 3j In the figure, B is a newly added function, F and M are newly added functions, and the associated frequency is greater than the set threshold, that is, F and M are newly added high-frequency functions, so F is the root function. As long as the degradation of the F function is solved, the degradation of the M child node will disappear together.
[0176] Since the developer may simply modify the method name but not the method body, for this type of problem, flame graph aggregation analysis is performed through the function's Caller and Callee to improve the accuracy of the final degradation problem.
[0177] Figure 3k This is a flame graph analysis diagram provided by an embodiment of the present disclosure. After being aggregated into degradation points, the caller of A has a deleted function E and a newly added function F, and the callee M of the deleted function E and the newly added function F is the same; F is not degraded compared to E in terms of time consumption; it is determined to be a method rename and is filtered by confidence. Finally, the newly added high-frequency function of the confidence draft is output.
[0178] Figure 3l This is a schematic diagram of an overall process provided by an embodiment of the present disclosure, see Figure 3l After the power consumption version starts to prevent degradation, stress testing is performed on multiple scenarios of the comparison package and the benchmark package (such as the home page, search page, etc.), and degradation is attributed when the CPU indicators (such as CPU usage) degrade and / or the GPU indicators (such as GPU usage) degrade. Differential analysis is performed based on the trace file, and then a flame graph judgment is performed to show the high-frequency time-consuming functions, that is, the newly added high-frequency functions. The details are as follows: First, the power consumption problem is thoroughly exposed by using the stress testing capability between various scenarios; then, a preliminary judgment on power consumption degradation is made in combination with the degradation of CPU and GPU usage; finally, the power consumption degradation is attributed by using the differential analysis capability to find the high-frequency time-consuming functions.
[0179] Figure 4 is a structural diagram of a data processing device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the device comprises:
[0180] A first determination module 410 is used to determine target parameters of a processor running a comparison package;
[0181] An analysis module 420, configured to perform differential analysis on the reference package and the comparison package based on the tracking file of the reference package and the tracking file of the comparison package when the target parameter is degraded;
[0182] The second determination module 430 is used to determine the target function in the comparison package based on the difference analysis result, where the target function includes a function associated with the target parameter degradation, and the frequency associated with the target function is greater than a set threshold.
[0183] The technical solution provided by the embodiment of the present disclosure solves the problem of low efficiency in attributing power consumption degradation, and measures whether there is a power consumption problem by judging whether the target parameter of the processor is degraded. In the case of target parameter degradation, by performing differential analysis on the benchmark package and the comparison package, the target function associated with the degradation of the target parameter in the comparison package and the associated frequency greater than the set threshold is determined, thereby locating the degradation point that causes power consumption degradation and improving the efficiency of power consumption degradation attribution.
[0184] In one embodiment, the processor includes one or more of a central processing unit and a graphics processing unit, and the target parameter includes a usage rate.
[0185] In one embodiment, the first determining module 410 is specifically configured to:
[0186] A stress test is performed on the comparison package to determine target parameters of a processor running the comparison package within a set time period.
[0187] In one embodiment, the analysis module 420 includes:
[0188] A first aggregation unit, configured to aggregate the plurality of tracking files of the benchmark package to obtain a first aggregation file of the benchmark package when the value of the target parameter is less than a degradation threshold;
[0189] A second aggregation unit, configured to aggregate the multiple tracking files of the comparison package to obtain a second aggregation file of the comparison package;
[0190] An analysis unit is used to perform differential analysis on the first aggregate file and the second aggregate file to obtain a comparison tree between the comparison package and the benchmark package, wherein the comparison tree indicates candidate functions newly added to the comparison package relative to the benchmark package, wherein the candidate functions are determined by a function set of the comparison package and a function set of the benchmark package, and a frequency associated with the candidate functions is greater than the set threshold.
[0191] In one embodiment, the analysis unit is specifically configured to:
[0192] Performing differential analysis on the first aggregated file and the second aggregated file to obtain an initial comparison tree of the comparison package and the benchmark package, wherein the initial comparison tree indicates functions newly added to the comparison package relative to the benchmark package;
[0193] Selecting a function whose associated frequency is greater than the set threshold from the newly added functions;
[0194] Determine an intersection of the function set of the comparison package and the function set of the benchmark package;
[0195] Determine a difference between the function set of the comparison package and the intersection;
[0196] Performing intersection processing on the functions included in the difference set and the selected function;
[0197] Determine the function obtained after the intersection processing as a newly added candidate function;
[0198] The initial comparison tree is updated to obtain a comparison tree indicating the newly added candidate functions.
[0199] In one embodiment, the frequencies associated with the objective function include one or more of the following:
[0200] frequency of use of the objective function;
[0201] The usage frequency of the function called by the target function.
[0202] In one embodiment, the second determining module 430 is specifically configured to:
[0203] Determine a first candidate function in the difference analysis result whose usage frequency is greater than the set threshold;
[0204] Determine a root function in the first candidate function as the target function of the comparison package;
[0205] Determine a second candidate function whose usage frequency of the called function in the differential analysis result is greater than the set threshold;
[0206] A leaf function in the second candidate function is determined as the target function of the comparison package.
[0207] In one embodiment, the data processing device further includes a filtering module, which is used to perform flame graph aggregation analysis on the target function after determining the target function in the comparison package based on the difference analysis result, to determine the renamed function in the target function;
[0208] Filter the renamed functions in the target function.
[0209] The data processing device provided in the embodiments of the present disclosure can execute the data processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0210] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0211] Figure 5Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg, Figure 5 A schematic diagram of the structure of a terminal device or server) 500.
[0212] The electronic device 500 includes:
[0213] One or more processing devices 501;
[0214] The storage device 508 is used to store one or more programs.
[0215] When the one or more programs are executed by the one or more processing devices 501 , the one or more processing devices 501 implement the method provided in the present disclosure.
[0216] The terminal devices in the embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0217] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0218] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0219] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0220] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0221] The electronic device provided by the embodiment of the present disclosure and the data processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0222] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the data processing method provided by the above embodiments is implemented.
[0223] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
[0224] The computer storage medium may be a storage medium of computer executable instructions, which, when executed by a computer processor, are used to perform the methods provided by the present disclosure.
[0225] Computer readable storage media may be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program used by or in combination with an instruction execution system, device, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0226] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0227] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0228] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0229] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: determines target parameters of a processor running a comparison package;
[0230] In the case where the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package;
[0231] Based on the difference analysis result, an objective function in the comparison package is determined, the objective function includes a function associated with the degradation of the target parameter, and a frequency associated with the objective function is greater than a set threshold.
[0232] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0233] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0234] The modules or units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module or unit does not limit the unit itself in some cases. For example, an analysis module may also be described as a "differential analysis module".
[0235] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0236] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0237] According to one or more embodiments of the present disclosure, [Example 1] provides a data processing method, including:
[0238] determining target parameters for a processor running the comparison package;
[0239] In the case where the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package;
[0240] Based on the difference analysis result, an objective function in the comparison package is determined, the objective function includes a function associated with the degradation of the target parameter, and a frequency associated with the objective function is greater than a set threshold.
[0241] According to one or more embodiments of the present disclosure, [Example 2] provides the method described in Example 1, wherein the processor includes one or more of a central processing unit and a graphics processing unit, and the target parameter includes a usage rate.
[0242] According to one or more embodiments of the present disclosure, [Example 3] provides the method described in Example 2, wherein determining the target parameters of the processor running the comparison package includes:
[0243] A stress test is performed on the comparison package to determine target parameters of a processor running the comparison package within a set time period.
[0244] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 1, wherein, when the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package, including:
[0245] When the value of the target parameter is less than the degradation threshold, aggregating the multiple tracking files of the benchmark package to obtain a first aggregate file of the benchmark package;
[0246] Aggregating the multiple tracking files of the comparison package to obtain a second aggregate file of the comparison package;
[0247] The first aggregated file and the second aggregated file are differentially analyzed to obtain a comparison tree of the comparison package and the benchmark package, wherein the comparison tree indicates candidate functions newly added to the comparison package relative to the benchmark package, the candidate functions are determined by a function set of the comparison package and a function set of the benchmark package, and a frequency associated with the candidate functions is greater than the set threshold.
[0248] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 4, wherein the first aggregate file and the second aggregate file are differentially analyzed to obtain a comparison tree of the comparison package and the benchmark package, including:
[0249] Performing differential analysis on the first aggregated file and the second aggregated file to obtain an initial comparison tree of the comparison package and the benchmark package, wherein the initial comparison tree indicates functions newly added to the comparison package relative to the benchmark package;
[0250] Selecting a function whose associated frequency is greater than the set threshold from the newly added functions;
[0251] Determine an intersection of the function set of the comparison package and the function set of the benchmark package;
[0252] Determine a difference between the function set of the comparison package and the intersection;
[0253] Performing intersection processing on the functions included in the difference set and the selected function;
[0254] Determine the function obtained after the intersection processing as a newly added candidate function;
[0255] The initial comparison tree is updated to obtain a comparison tree indicating the newly added candidate functions.
[0256] According to one or more embodiments of the present disclosure, [Example 6] provides the method described in Example 1, wherein the frequency associated with the objective function includes one or more of the following:
[0257] frequency of use of the objective function;
[0258] The usage frequency of the function called by the target function.
[0259] According to one or more embodiments of the present disclosure, [Example 7] provides the method described in Example 1, wherein determining the objective function in the comparison package based on the difference analysis result includes:
[0260] Determine a first candidate function in the difference analysis result whose usage frequency is greater than the set threshold;
[0261] Determine a root function in the first candidate function as the target function of the comparison package;
[0262] Determine a second candidate function whose usage frequency of the called function in the differential analysis result is greater than the set threshold;
[0263] A leaf function in the second candidate function is determined as the target function of the comparison package.
[0264] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 1, which further includes, after determining the objective function in the comparison package based on the differential analysis result:
[0265] Performing flame graph aggregation analysis on the target function to determine a renamed function in the target function;
[0266] Filter the renamed functions in the target function.
[0267] According to one or more embodiments of the present disclosure, [Example 9] provides a data processing device, including:
[0268] A first determination module, configured to determine target parameters of a processor running a comparison package;
[0269] an analysis module, configured to perform differential analysis on the reference package and the comparison package based on the tracking file of the reference package and the tracking file of the comparison package when the target parameter is degraded;
[0270] The second determination module is used to determine the target function in the comparison package based on the difference analysis result, wherein the target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold.
[0271] According to one or more embodiments of the present disclosure, [Example 10] provides an electronic device, the electronic device comprising:
[0272] one or more processing devices;
[0273] a storage device for storing one or more programs,
[0274] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method described in any one of Examples 1-8.
[0275] According to one or more embodiments of the present disclosure, [Example 11] provides a storage medium containing computer-executable instructions, which are used to execute any of the methods described in Examples 1-8 when executed by a computer processor.
[0276] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0277] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0278] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A data processing method, characterized in that: include: determining target parameters for a processor running the comparison package; In the case where the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package; Based on the difference analysis result, an objective function in the comparison package is determined, the objective function includes a function associated with the degradation of the target parameter, and a frequency associated with the objective function is greater than a set threshold.
2. The method according to claim 1, characterized in that The processor includes one or more of a central processing unit and a graphics processing unit, and the target parameter includes a usage rate.
3. The method according to claim 2, characterized in that The determining of target parameters of a processor running the comparison package includes: A stress test is performed on the comparison package to determine target parameters of a processor running the comparison package within a set time period.
4. The method according to claim 1, characterized in that: In the case where the target parameter is degraded, performing differential analysis on the benchmark package and the comparison package based on the tracking file of the benchmark package and the tracking file of the comparison package, including: When the value of the target parameter is less than the degradation threshold, aggregating the multiple tracking files of the benchmark package to obtain a first aggregate file of the benchmark package; Aggregating the multiple tracking files of the comparison package to obtain a second aggregate file of the comparison package; The first aggregated file and the second aggregated file are differentially analyzed to obtain a comparison tree of the comparison package and the benchmark package, wherein the comparison tree indicates candidate functions newly added to the comparison package relative to the benchmark package, the candidate functions are determined by a function set of the comparison package and a function set of the benchmark package, and a frequency associated with the candidate functions is greater than the set threshold.
5. The method according to claim 4, characterized in that The performing differential analysis on the first aggregated file and the second aggregated file to obtain a comparison tree of the comparison package and the benchmark package includes: Performing differential analysis on the first aggregated file and the second aggregated file to obtain an initial comparison tree of the comparison package and the benchmark package, wherein the initial comparison tree indicates functions newly added to the comparison package relative to the benchmark package; Selecting a function whose associated frequency is greater than the set threshold from the newly added functions; Determine an intersection of the function set of the comparison package and the function set of the benchmark package; Determine a difference between the function set of the comparison package and the intersection; Performing intersection processing on the functions included in the difference set and the selected function; Determine the function obtained after the intersection processing as a newly added candidate function; The initial comparison tree is updated to obtain a comparison tree indicating the newly added candidate functions.
6. The method according to claim 1, characterized in that The frequencies associated with the objective function include one or more of the following: frequency of use of the objective function; The usage frequency of the function called by the target function.
7. The method according to claim 1, characterized in that The determining of the objective function in the comparison package based on the difference analysis result includes: Determine a first candidate function in the difference analysis result whose usage frequency is greater than the set threshold; Determine a root function in the first candidate function as the target function of the comparison package; Determine a second candidate function whose usage frequency of the called function in the differential analysis result is greater than the set threshold; A leaf function in the second candidate function is determined as the target function of the comparison package.
8. The method according to claim 1, characterized in that After determining the objective function in the comparison package based on the difference analysis result, the method further includes: Performing flame graph aggregation analysis on the target function to determine a renamed function in the target function; Filter the renamed functions in the target function.
9. A data processing device, characterized in that: include: A first determination module, configured to determine target parameters of a processor running a comparison package; an analysis module, configured to perform differential analysis on the reference package and the comparison package based on the tracking file of the reference package and the tracking file of the comparison package when the target parameter is degraded; The second determination module is used to determine the target function in the comparison package based on the difference analysis result, wherein the target function includes a function associated with the degradation of the target parameter, and the frequency associated with the target function is greater than a set threshold.
10. An electronic device, characterized in that: The electronic device comprises: one or more processing devices; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the method according to any one of claims 1 to 8.
11. A storage medium comprising computer executable instructions, which when executed by a computer processor are used to perform the method according to any one of claims 1 to 8.