Degradation function determination method and device, electronic equipment and storage medium

By comparing the trace files of the comparison package and the benchmark package in software development or testing environments for function stack aggregation and differentiation analysis, the degradation function in the comparison package is determined, which solves the problem of repeated reporting of the degradation method and improves the accuracy of the analysis.

CN119645801APending Publication Date: 2025-03-18BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311199466.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In software development or testing environments, when comparing the changes in functions in any two versions of the installation package through tracking tools, there is a problem of repeated reporting of deterioration methods caused by inter-functional calls.

Method used

By obtaining the tracking file of the target package, function aggregation is performed based on the function stack, the aggregate file is obtained, and the aggregate files of the benchmark package and the comparison package are differentiated to determine the degradation function in the comparison package.

Benefits of technology

It solves the problem of repeated reporting caused by directly comparing method names, reduces the repetition rate of deterioration points, and improves the accuracy of function change analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645801A_ABST
    Figure CN119645801A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a degradation function determination method and device, electronic equipment and a storage medium. The degradation function determination method comprises the steps that a tracking file of a target package is acquired, the target package comprises a reference package and a comparison package, and the comparison package is an installation package updated on the basis of the reference package; in the tracking file of the target packet, performing function aggregation based on a stack of functions to obtain an aggregation file; and performing differential analysis on the aggregation file corresponding to the reference packet and the aggregation file corresponding to the comparison packet, and determining a degradation function in the comparison packet. The technical problem of repeated reporting caused by direct use of the method name for comparison is solved, and the repetition rate of the degradation point is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to computer technology, and in particular to a method, device, electronic device and storage medium for determining a degradation function. Background Art

[0002] In the software development or testing environment, you can use the tracking tool to compare the changes in functions in any two versions of the installation package. Android can collect method information during the application operation through the tracking tool, that is, the tracking file, or Trace file. By comparing any two versions of the Trace file, you can get the function changes between the two versions, including the addition and deletion of functions. However, if you only compare by function name, there is a problem of repeated reporting of degraded methods due to calls between functions. Summary of the invention

[0003] The present disclosure provides a degradation function determination method, device, electronic device and storage medium to solve the problem of repeated reporting of degradation points.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for determining a degradation function, comprising:

[0005] Obtaining a tracking file of a target package, wherein the target package includes a base package and a comparison package, wherein the comparison package is an installation package updated based on the base package;

[0006] In the tracking file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file;

[0007] A differential analysis is performed on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

[0008] In a second aspect, the embodiment of the present disclosure further provides a degradation function determination device, including:

[0009] An acquisition module, used to acquire a tracking file of a target package, wherein the target package includes a reference package and a comparison package, wherein the comparison package is an installation package updated based on the reference package;

[0010] An aggregation module is used to aggregate functions based on the function stack in the trace file of the target package to obtain an aggregation file;

[0011] The analysis module is used to perform differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0013] one or more processing devices;

[0014] a storage device for storing one or more programs,

[0015] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the degradation function determination method provided in the embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the degradation function determination method provided in the embodiment of the present disclosure.

[0017] In the disclosed embodiment, the tracking files of the benchmark package and the comparison package are first obtained; then the tracking files are aggregated based on the stack to obtain the aggregation files corresponding to the benchmark package and the comparison package respectively; finally, the aggregation files of the benchmark package and the aggregation files of the comparison package are differentially analyzed to obtain the degraded functions in the comparison package. In the process of performing the degradation analysis, the functions are first aggregated based on the stack, and then the differential analysis is performed based on the aggregated files after aggregation, which solves the technical problem of repeated reporting caused by directly using the method name for comparison and reduces the duplication rate of degradation points. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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.

[0019] Figure 1 is a flow chart of a method for determining a degradation function provided by an embodiment of the present disclosure;

[0020] Figure 2 is a flow chart of another method for determining a degradation function provided by an embodiment of the present disclosure;

[0021] Figure 3a It is a schematic diagram of an attribution process provided by an embodiment of the present disclosure;

[0022] Figure 3b is a schematic diagram of function merging provided by an embodiment of the present disclosure;

[0023] Figure 3c is a schematic diagram of a virtual stage provided by an embodiment of the present disclosure;

[0024] Figure 3d It is a schematic diagram of merging background threads provided by an embodiment of the present disclosure;

[0025] Figure 3e is a schematic diagram of a function across multiple stages provided by an embodiment of the present disclosure;

[0026] Figure 3f is a schematic diagram of a cross-multithread function provided by an embodiment of the present disclosure;

[0027] Figure 3g It is a schematic diagram of a multi-Trace merging provided by an embodiment of the present disclosure;

[0028] Figure 3h is a schematic diagram of a main thread comparison tree provided by an embodiment of the present disclosure;

[0029] Figure 3i This is a schematic diagram of determining a newly added method name provided by an embodiment of the present disclosure;

[0030] Figure 3j is a schematic diagram of a marked comparison tree provided by an embodiment of the present disclosure;

[0031] Figure 3k is an attribution schematic diagram of a newly added function provided in an embodiment of the present disclosure;

[0032] Figure 3l is an attribution schematic diagram of a non-newly added function provided by an embodiment of the present disclosure;

[0033] Figure 3m is a schematic diagram for comparing newly added functions provided in an embodiment of the present disclosure;

[0034] Figure 3n It is a newly added function flame graph provided by the embodiment of the present disclosure;

[0035] Figure 3o is a schematic diagram for comparing non-newly added functions provided by an embodiment of the present disclosure;

[0036] Figure 3p It is a non-newly added function flame graph provided by the embodiment of the present disclosure;

[0037] Figure 4 is a schematic diagram of the structure of a degradation function determination device provided by an embodiment of the present disclosure;

[0038] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] 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.

[0040] 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.

[0041] As used herein, the term “including” and its variations are open inclusions, ie, “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.”

[0042] 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.

[0043] 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".

[0044] 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.

[0045] Figure 1 It is a flow chart of a degradation function determination method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of determining the degradation function in a comparison package. The method can be executed by a degradation function determination device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.

[0046] like Figure 1 As shown, the method includes:

[0047] S110: Obtain the tracking file of the target package.

[0048] The target package includes a baseline package and a comparison package, and the comparison package is an installation package updated based on the baseline package. The baseline package and the comparison package can be considered as installation packages of the application. The baseline package can be considered as an installation package used as a baseline. The comparison package can be considered as an installation package after the version is upgraded. The tracking file, also known as the Trace file, can be considered as a file determined after tracking the target package through a tracking tool, such as the Trace tool.

[0049] The number of the tracking files is not limited here and can be at least one. In this step, the tracking file of the target package collected by the tracking tool can be obtained.

[0050] In one embodiment, obtaining the tracking file of the target package includes:

[0051] Collecting the benchmark package multiple times to obtain multiple tracking files of the benchmark package;

[0052] The comparison package is collected multiple times to obtain multiple tracking files of the comparison package.

[0053] In this embodiment, there are multiple tracking files for the target package. The multiple tracking files for the benchmark package can be obtained by collecting the benchmark package multiple times. The multiple tracking files for the comparison package can be obtained by collecting the comparison package multiple times.

[0054] S120 . In the tracking file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file.

[0055] The aggregate file can be considered as a file obtained by performing function aggregation on the trace file of the target package. The benchmark package and the comparison package can each have their own corresponding aggregate file.

[0056] After obtaining the trace file, this step can aggregate the functions of the trace file. In the process of function aggregation, the functions can be aggregated according to the stack, such as aggregating the functions with the same name in the same stack. 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.

[0057] The installation package of an application can be collected multiple times. Assuming that the collection is performed 10 times and there are 10 trace files, then each of the 10 trace files is aggregated from 1 to 10 to generate a self-aggregated file, and a total of 10 self-aggregated files are generated. Then these 10 self-aggregated files are aggregated to generate an overall aggregate file for the package. 10 is only an example, and the number can be N, where N is a positive integer.

[0058] For example, the benchmark package is collected 10 times to obtain 10 trace files of the benchmark package, and the 10 trace files are aggregated to obtain 10 self-aggregated files. Then, the 10 self-aggregated files are aggregated to obtain the aggregate file of the benchmark package. The process of obtaining the aggregate file of the comparison package is similar, and is not limited here.

[0059] This step can be performed based on multiple Trace files in the process of obtaining the aggregate file to avoid errors caused by fluctuations in the collection of a single Trace file.

[0060] S130: Perform differential analysis on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

[0061] After the aggregate file is determined, this step can perform differential analysis on the aggregate files of the baseline package and the comparison package to determine the difference between the comparison package and the baseline package, and then analyze the degradation function in the comparison package.

[0062] During the differential analysis, the new functions and non-new functions in the comparison package can be determined compared to the baseline package. Then, the degraded functions can be determined from the two dimensions of new functions and non-new functions.

[0063] New functions can be considered as functions that are added to the comparison package relative to the base package. Non-new functions can be considered as functions that are not added to the comparison package relative to the base package, and can also be called shared functions.

[0064] The aggregate file can be shown in the form of a call graph, and the degraded function can be determined by comparing the aggregate files shown in the form of call graphs of the benchmark package and the comparison package. The call graph can show the calling relationship between functions.

[0065] The technical solution of the disclosed embodiment first obtains the tracking files of the baseline package and the comparison package; then performs function aggregation on the tracking files based on the stack to obtain the aggregation files corresponding to the baseline package and the comparison package respectively; finally, the aggregation files of the baseline package and the aggregation files of the comparison package are differentially analyzed to obtain the degraded functions in the comparison package. In the process of performing degradation analysis, function aggregation is first performed based on the stack, and then differential analysis is performed based on the aggregated files after aggregation, which solves the technical problem of repeated reporting caused by directly using method names for comparison and reduces the duplication rate of degradation points.

[0066] Figure 2 is a flow chart of another method for determining a degradation function provided by an embodiment of the present disclosure. This embodiment further illustrates a scheme for determining an aggregated file. Figure 2 , the degradation function determination method includes:

[0067] S210: Obtain the tracking file of the target package.

[0068] S220 . For each of the multiple tracking files of the target package, merge the functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file.

[0069] The self-merging tree can be considered as a self-aggregated file obtained by merging single trace files. The self-aggregated file can show the relationship between functions in the form of a tree. This step can be considered as a single trace merge method. Single trace merge is to merge the same-name methods in the same stack of a single trace file to generate a self-merging tree.

[0070] The means of obtaining the self-merging tree include one or more of the following:

[0071] 1. When performing aggregation, divide the aggregation by stage. Merge the methods with the same name in the same stack in the same stage. There can be multiple scenes in the target package, and multiple stages can be obtained after dividing the scenes by stages. In this operation, you can aggregate by stage, and each stage can be aggregated separately.

[0072] 2. Aggregate the methods that do not belong to any stage and encapsulate them into a new stage. For example, merge all the methods in the uncovered stage into the virtual stage other_stage for merging.

[0073] 3. Background thread aggregation is to aggregate all background threads uniformly and aggregate all background threads in the same stage.

[0074] 4. For methods that span multiple stages, each stage has a portion of the method's time consumption. The method consumption in a single stage will be calculated separately.

[0075] 5. The stage belongs to a cross-thread stage. There is a stage in different threads, and the start time and end time of the stage are the same.

[0076] S230: Aggregate each of the self-merging trees to obtain an aggregate file.

[0077] After each trace file is aggregated separately to obtain a self-merging tree, this step can aggregate the self-merging tree of the target package to obtain an aggregate file to achieve multi-Trace aggregation. Multi-Trace aggregation is to aggregate multiple single Trace self-merging trees into one tree. For example, when traversing each self-merging tree, the same stack functions are merged together, and different nodes are merged and then the union is taken.

[0078] S240: Perform differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

[0079] This embodiment further describes the process of determining the aggregated file. First, the aggregated file is obtained by merging multiple self-merging trees through self-aggregation, and then the degradation function is determined, which improves the efficiency of determining the degradation function and avoids the duplication of the degradation function.

[0080] 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.

[0081] In one embodiment, for each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file includes:

[0082] For each tracking file in the multiple tracking files of the target package, the functions with the same name in the same stack in all background threads and all stages in the tracking file are merged to obtain a self-merging tree in the tracking file.

[0083] In the process of aggregating background threads, all methods with the same name in the same stack in the background threads are merged, and all background threads are merged into one thread.

[0084] When merging background threads, you can merge them from the thread dimension and the stage dimension. You can first merge all background threads, and then merge all stages. You can also first aggregate the stages, and then aggregate the thread dimension.

[0085] When background threads are aggregated, background threads belonging to the same stage can be aggregated, such as merging methods with the same name in the same stack, and then all stages are merged.

[0086] In one embodiment, for each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file includes:

[0087] For each of the multiple tracking files of the target package, functions with the same name in the same stack are merged according to the stage to obtain a self-merging tree of the tracking file.

[0088] In this embodiment, when merging the self-merging trees, the merging is performed in the stage dimension, and the functions with the same name in the same stack are merged separately in each stage. The contents included in the merging process may not change, and the time consumption may be accumulated.

[0089] In one embodiment, functions with the same name in the same stack are merged according to stages, including one or more of the following:

[0090] Merge functions with the same name in the same stack in the same stage;

[0091] Merge functions with the same name in the same stack outside the stage;

[0092] Splitting functions belonging to multiple stages, where the split functions belong to corresponding stages among the multiple stages, and merging functions with the same name in the same stack among the multiple stages;

[0093] The stage across multiple threads is split into stages, and the stages after the splitting belong to the corresponding threads in the multiple threads, and the functions with the same name in the same stack are merged according to the stages after the splitting.

[0094] In the process of merging functions by stage, functions with the same name in the same stack in the same stage are merged. Functions with the same name in the same stack outside the stage are merged. In the process of merging, functions with the same name in the same stack between two stages can be merged, and all functions not in the stage can be merged together.

[0095] When a function belongs to different stages, you can divide the function into different stages and treat the functions in each stage as the functions in that stage, and perform separate time consumption statistics. After the functions are divided, any function in the function has a corresponding stage in multiple stages.

[0096] After the splitting, any stage in the stage belongs to one thread among multiple threads, and each stage performs function merging separately.

[0097] Generally, scenarios are divided into multiple stages. When collecting a trace file, you can slice it. For example, if a trace file is collected for 10 seconds, you can slice it into 10 parts according to some defined stages, and then each of the 10 parts can be understood as an independent stage. Scenarios such as startup / first refresh can be divided into different sub-stages.

[0098] This disclosure divides degradation dimensions into two types: key threads and background threads. Key thread degradation means that the thread function degradation value is equivalent to the index degradation. Background thread degradation means that the background thread frequently seizes the central processing unit (CPU), thereby causing key thread degradation. Background thread degradation is not equivalent to index degradation. Key thread degradation is classified into two types of problems: one is the degradation of newly added functions; the other is the degradation of non-newly added functions. Clarifying the degradation dimension can help with function aggregation.

[0099] For newly added degradation, as long as it can be clearly shown that the degradation is caused by the newly added code, it can be considered as an attributed degradation problem. For non-newly added functions, the time consumption increases but no new degradation is introduced.

[0100] If the time consumption of background threads increases, it will also cause the degradation of indicators, including new and non-new functions in the background: new functions in the background refer to functions that directly use a large amount of CPU resources and indirectly use a large amount of system input / output (IO), inter-process communication (such as Binder) and other resources; non-new functions in the background are basically the same as new businesses, but the focus is on "surge".

[0101] In one embodiment, aggregating each of the self-merging trees to obtain an aggregate file includes:

[0102] Merge the functions of the same stack in each self-merging tree;

[0103] Take the union of different functions to get the aggregate file.

[0104] This embodiment can merge functions of the same stack in all self-merging trees, and take the union of different functions in all self-merging data to obtain an aggregate file.

[0105] In one embodiment, performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package includes:

[0106] Performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package in terms of thread dimension and / or phase dimension to determine a comparison tree in terms of thread dimension and / or phase dimension, wherein the comparison tree indicates nodes added and / or deleted in the comparison package relative to the benchmark package, and the comparison tree further indicates functions added in the comparison package relative to the benchmark package, wherein the added functions are determined by a function set of the comparison package and a function set of the benchmark package;

[0107] Based on the time consumption parameters of the stages in the comparison tree, a degradation function in the comparison package is determined.

[0108] During the differential analysis, key threads and background threads are compared, as well as phase comparisons, and a comparison tree is generated for each thread and phase.

[0109] The newly added function may be a function set of the comparison package, and a difference set of the intersection of the function set of the comparison package and the function set of the benchmark package.

[0110] The comparison tree can identify nodes added and / or deleted in the comparison package compared to the baseline package, as well as newly added functions and non-newly added functions. A node is considered a newly added function only when it is both a newly added node and a newly added function.

[0111] The comparison tree can have thread dimensions and phase dimensions. Based on the comparison tree, the degradation points in the comparison package can be determined. The comparison tree can also refer to the time consumption of the function. The degraded function can be determined by determining the time consumption. For example, if the function in the background thread has CPU time consumption, it can be considered as a degraded function.

[0112] In one embodiment, determining the degradation function in the comparison package based on the time-consuming parameters of the stages in the comparison tree includes:

[0113] When a time-consuming parameter of a first function in a key thread in the comparison tree is greater than a time-consuming threshold, determining the first function as a degraded function in the comparison package;

[0114] In the case that the second function in the background thread in the comparison tree consumes CPU time, the second function is determined as a degraded function in the comparison package.

[0115] The first function can be considered as a function in a key thread. The second function can be considered as a function in a background thread. The time-consuming threshold can be considered as a pre-set threshold. The CPU time-consuming can be considered as the CPU time-consuming. The time-consuming parameter can be considered as a parameter that characterizes the time-consuming duration.

[0116] In the process of determining whether a function in a critical thread is a degraded function, it may be determined whether a time-consuming parameter of a first function is greater than a time-consuming threshold. If so, the first function is determined to be a degraded function.

[0117] When the second function in the background thread consumes CPU time, the second function is determined as a degraded function in the comparison package.

[0118] In one embodiment, a hit rate of the degradation function in a plurality of tracking files is greater than a set value.

[0119] In the process of determining the degradation function, in addition to the time-consuming judgment, the hit rate can be further judged. The hit rate can be considered as the probability that the degradation function appears in multiple tracking files. The more tracking files the degradation function is located in, the higher the hit rate of the degradation function. For example, if there are 10 tracking files and the degradation function is located in 8 tracking files, the hit rate is 8 / 10.

[0120] When determining the hit rate, the degraded function appears in the trace file, and the time consumption of the degraded function in the comparison package is required to be greater than the time consumption in the benchmark package to indicate that the degraded function is more time-consuming in the comparison package relative to the benchmark package.

[0121] In one embodiment, after performing differential analysis on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package, the method further includes:

[0122] Performing flame graph aggregation analysis on the degraded function to determine whether the newly added function in the degraded function is a function rename, and if not, attributing the newly added function to the root newly added function of the newly added function;

[0123] Determine whether the non-newly added function in the degraded function is a newly added call, and if so, attribute the non-newly added function to a leaf function.

[0124] Function renaming can be considered as the function in the baseline package being renamed in the comparison package. The renamed function has a different function name but the same function body. Added calls can be considered as adding a function call in the comparison package.

[0125] In this embodiment, a flame graph analysis can be performed on the degraded function. When the newly added function in the degraded function is not a renamed function, it can be considered that the newly added function is attributed to the root newly added function. The root newly added function can be considered as the root node in the newly added function.

[0126] When the degraded function is a non-newly added function, determine whether the non-newly added function is a newly added call. If it can be considered that the degradation is caused by a newly added call point, it can be attributed to the leaf node of the degraded function. If the <virtual> node time consumption of the node increases by more than the threshold, no screening is required, and the node is directly a degraded non-newly added function.

[0127] The present disclosure is described exemplarily below. The method for determining a degraded function provided by the present disclosure can be considered as a function degradation attribution solution based on stack aggregation. The overall aggregation is divided into three steps:

[0128] 1. Aggregate the tracing (i.e., Trace) files of the benchmark group and the comparison group separately (i.e., in the tracing file of the target package, perform function aggregation based on the function stack to obtain an aggregate file), and aggregate them according to the dimensions of key threads and background threads respectively. At the same time, indicators such as startup / first refresh will also be split into different sub-stages, so it is also necessary to support aggregation by sub-stage splitting.

[0129] 2. Based on the aggregated files of the baseline group and the comparison group, Diff analysis is performed according to the degradation rules in the two dimensions of new and non-new. That is, differential analysis is performed on the aggregated files corresponding to the baseline package and the aggregated files corresponding to the comparison package. Several degradation points are preliminarily located first, and a trace file after Diff is obtained.

[0130] 3. Based on the degradation points obtained in the second step, flame graph aggregation is performed on the degradation points (i.e., flame graph aggregation analysis is performed on the degradation function) to obtain the aggregation traces of its caller and callee. The flame graph aggregation form can more conveniently determine whether the number of function calls has increased, and can more conveniently aggregate the degradation types of high-frequency functions.

[0131] Figure 3a is a flowchart of an attribution provided by an embodiment of the present disclosure, see Figure 3a After the differential analysis starts, a single tracing file is merged first, that is, for each of the multiple tracing files of the target package, the functions with the same name in the same stack in the tracing file are merged to obtain a self-merged tree of the tracing file; then multiple tracing files are merged, that is, each self-merged tree is aggregated to obtain an aggregated file; then a comparison tree is constructed; new functions and non-new functions are attributed based on the comparison tree; flame graph confidence analysis is performed based on the results of the attribution of new functions and non-new functions to determine the degraded functions in the comparison package, and the differential analysis ends here.

[0132] During the differential analysis, both the comparison package and the baseline package will generate several trace files. During the single trace file merging process, each trace file of the baseline package is merged, and then multiple merged files are aggregated to obtain an aggregate file of the baseline package. Each trace file of the comparison package is merged, and then multiple merged files are aggregated to obtain an aggregate file of the comparison package. The two aggregate files are subjected to differential analysis, and then degradation analysis is performed.

[0133] First, we describe the single trace merge:

[0134] Generally, scenarios are divided into multiple stages. Based on the configuration of the stages, the trace files of the scenarios are divided and aggregated according to the stages. The advantage of dividing by stages is that, for example, when indicators are found to be degraded offline or online, the stages are generally split and finally the degradation is located in one or some stages. Then, only the specific stages can be analyzed and the degradation can be attributed within the stage.

[0135] Figure 3b This is a schematic diagram of function merging provided by an embodiment of the present disclosure, see Figure 3b Each rectangular block represents a function. The top rectangular block represents the outermost function, and the lower rectangular block is the function called by the upper rectangular block. The rectangular blocks arranged up and down represent the upper function calling the lower function. The rectangular blocks arranged left and right represent two functions executed one after another.

[0136] Each method, also known as a function, has its own stage. The methods (i.e., functions) with the same name in the same stack in the same stage are merged, and the waiting stage (i.e., Wall Duration), central processing unit stage (i.e., Cpu Duration), inter-process communication stage (i.e., Binder Duration), lock stage (i.e., LockDuration), input and output stage (i.e., IO Duration), and times of each node are calculated for the subsequent data analysis. Figure 3b For the cold start scenario sub-stage, before the merge, function B and function C under the cold start scenario sub-stage are merged, and the execution order of the cold start scenario sub-node functions before the merge is function B, function C, function C, function B and function D. Among them, the stack formed by function B, function D and function E is the same stack. Therefore, in the embodiment, the methods with the same name in the stack are merged, such as merging function D under the first executed function B with function D under the fourth executed function B, and merging function E under the first executed function B with function E under the fourth executed function B. The time consumption after the merge can be accumulated. The hierarchical relationship of the stack remains unchanged after the merge, and the child nodes of function B include child nodes composed of function E and function D.

[0137] The multiple stages divided into scenes may not cover the entire scene. Some functions between adjacent stages may not belong to any stage. In this case, functions that do not belong to any stage are aggregated and encapsulated into a new stage. For example, there is an uncovered stage between the cold start scene sub-stage and the video interaction stage, that is, the feed_ui_duration stage. This stage is processed and all methods in the uncovered stage are merged into the virtual stage other_stage for merging.

[0138] Figure 3c is a schematic diagram of a virtual stage provided by an embodiment of the present disclosure, see Figure 3c , the cold start scenario sub-stage and the video interaction sub-stage are determined as virtual stages, and the functions included in the virtual stages are merged. The cold start scenario sub-stage includes functions B, C, and D, as well as function B's child node function E. The video interaction sub-stage includes functions B, C, and D, as well as function B's child nodes function E and function D. The virtual stage includes function M and function N. The functions outside the stage in Figure 3 are function M and function N, corresponding to the virtualized virtual stage. The functions in the virtual stage are merged.

[0139] At the same time, threads are divided into key threads and background threads. Key threads refer to threads belonging to the user configuration stage, and background threads refer to all background threads except key threads. The aggregation schemes for key threads and background threads are also different. Key thread aggregation is based on the stage dimension, which is performed according to the above-mentioned stage dimension aggregation steps. Background thread aggregation is to aggregate all background threads uniformly. The background thread aggregation scheme is introduced below.

[0140] Background thread aggregation is to aggregate all background threads uniformly, distinguish the stages according to the key thread stages configured by the user, and finally aggregate all the stages into an overall stage (that is, for each tracking file in the multiple tracking files of the target package, all background threads in the tracking file and the functions with the same name in the same stack in all stages are merged to obtain a self-merging tree in the tracking file) to prevent some methods from being degraded and having unclear observation effects after being split due to spanning multiple stages.

[0141] Figure 3d is a schematic diagram of merging background threads provided by an embodiment of the present disclosure, see Figure 3d , aggregate all background threads in the same stage, such as Figure 3d : After being split according to phase A and phase B, they are aggregated separately. Before merging, they include background thread 1 and background thread 2. After merging, background thread 1 and background thread 2 are merged into a merged thread. Both before and after merging, they include phase A and phase B.

[0142] The functions included in the merged thread are functions merged based on the functions included in background thread 1 and background thread 2. The stack formed by function B and function G in background thread 1 is retained in the merged thread. The stack formed by function E and function N1 in the background thread is merged with the stack formed by function E and function N2 in the acquired thread to obtain the stack formed by function E, function N1 and function N2 in the merged thread. In stage B of the merged thread, the stack formed by function E and function N1 in background thread 1 and the stack formed by function Q and function F in background thread 2 are respectively retained in the merged thread.

[0143] Some methods may span multiple stages, and each stage may consume part of the method's time. In this case, the method is split into multiple methods according to the stages. Each method belongs to its own stage, and the method time is calculated separately for each method. Figure 3e is a schematic diagram of a function across multiple stages provided by an embodiment of the present disclosure, such as Figure 3eFunction M in the program spans two stages, namely, stage C and stage D, and is split into function M1 and function M2 according to the stages. That is, functions belonging to multiple stages are split, and after the split, the functions belong to the corresponding stages in the multiple stages, and the functions with the same name in the same stack in the multiple stages are merged. Thus, stage C includes function B, function D, function E and function M1. Stage D includes function C, function D and function M2. After the split, function M1 belongs to stage C, that is, it corresponds to stage C. After the split, function M2 belongs to stage D, that is, it corresponds to stage D.

[0144] Some stages are cross-thread stages. For such stages, they are split into two stages, which exist in both the start thread and the end thread. For example, in stage f, the start thread is the child thread and the end thread is the main thread. After the split, stage f exists in both the start thread and the end thread, and the start time and end time of the stage are the same.

[0145] Figure 3f is a schematic diagram of a cross-multithreaded function provided by an embodiment of the present disclosure, see Figure 3f , stage f spans multiple threads. After stage splitting, each thread has its own stage f. For example, stage f in the main thread includes function A and function B, and stage f in the child thread includes function m and function n. Stage f is split into stage f corresponding to the main thread and stage f corresponding to the child thread, and the two stages f are merged separately.

[0146] Figure 3g is a schematic diagram of a multi-Trace merging provided by an embodiment of the present disclosure, see Figure 3g , all tracking files are merged as a whole. Each tracking file is traversed, the same stack functions are merged together, and the time consumption is accumulated and averaged (the denominator is the total number of samples, such as the number of tracking files N, not the number of function occurrences). At the same time, the number of original nodes, minimum time consumption, maximum time consumption, and median time consumption are maintained for backup, such as Figure 3g The stack formed by function D, function E and function B; different nodes are merged and the union is taken, such as function D and function C in the figure below. Figure 3g There are also virtual stages in the ,corresponding to the function time. For example, the time consumed by function A is equal to the sum of the time consumed by function B, function C and the virtual stage. Figure 3g In the example, the functions in the same stack are merged, such as merging the stacks formed by function B, function D and function E, and taking the union of different functions C and function D.

[0147] After obtaining the aggregated file, a comparison tree can be constructed to compare each call tree obtained in the previous order. For key threads, threads with the same name are compared, and the aggregated results are compared. The comparison is also performed in stages, and finally a comparison tree for each thread and stage is generated. 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.

[0148] Figure 3h is a schematic diagram of a main thread comparison tree provided by an embodiment of the present disclosure, see Figure 3h The main thread comparison tree includes stage g and stage h. In each stage, the function adds the attribute of whether it is a newly added node. For example, in stage g, function A is not a newly added node, function D is not a newly added node under function A, and function E is not a newly added node under function A. In stage h, function B is a newly added node, and function F is a newly added node under function B. Figure 3h The comparison tree of the thread dimension shown indicates whether a node is a newly added node.

[0149] Table 1 is a schematic table of detailed information contained in a node in a comparison tree provided by an embodiment of the present disclosure.

[0150] A newly added node is a node that is added to the test package call tree relative to the base package call tree. A non-newly added node is a tree node that exists in the test package call tree relative to the base package call tree, and the position of the node does not change.

[0151] Table 1 Schematic diagram of detailed information included in a node in a comparison tree provided by an embodiment of the present disclosure

[0152]

[0153] 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.

[0154] Figure 3i This is a schematic diagram of determining a newly added method name provided by an embodiment of the present disclosure, see Figure 3i , perform intersection and difference processing on all function names of the benchmark 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 benchmark package (also called the benchmark package method name set), obtain the common method name set and the newly added method name set. Only when a node belongs to both the newly added node and the newly added method name, the node is considered a newly added function. The same applies to non-newly added functions, and they are marked on the comparison tree.

[0155] Figure 3j is a schematic diagram of a marked comparison tree provided by an embodiment of the present disclosure, see Figure 3j , after comparing the function sets, Figure 3h Based on the above, the attribute of whether it is a newly added function can be added. In stage g, function A, function D and function E can be non-newly added nodes and non-newly added functions. In stage h, function B is a non-newly added function of a new node, and function F can be a new function of a new node. In stage h, function h can be finally determined as a newly added function. In stage g, function A, function D and function E can be considered as non-newly added functions. Figure 3j The comparison tree shown shows whether the function is a newly added function.

[0156] New functions and non-new functions are obtained, but there may be many new functions and non-new functions, which is not conducive to further attribution judgment. Through the attribution rules, the degraded new functions and non-new functions are further screened out.

[0157] Newly added functions are attributed to the root newly added function. Figure 3k is a schematic diagram of attribution of a newly added function provided in an embodiment of the present disclosure, see Figure 3k , there are multiple newly added functions in stage i: newly added function B, newly added function E, newly added function F and newly added function M. B is the parent function of other newly added functions, so B is the root newly added function. As long as the degradation of node B is resolved, the degradation of all child nodes will disappear together. When determining the degradation of the newly added function, determine whether the newly added function in the degraded function is a function rename. If not, attribute the newly added function to the root newly added function of the newly added function.

[0158] Non-new functions are attributed to leaf nodes. Figure 3l This is an attribution diagram of a non-newly added function provided by an embodiment of the present disclosure. There are multiple non-newly added functions in stage j: non-newly added function A, non-newly added function D and non-newly added function E. Non-newly added function D and non-newly added function E are leaf nodes, so non-newly added function D and non-newly added function E are leaf node non-newly added functions. As long as the degradation of non-newly added function D and non-newly added function E nodes is resolved, the degradation of non-newly added function A node will also disappear. However, there is a situation that requires additional consideration. If the <virtual> node time consumption of the node increases by more than a threshold, no screening is required, and the node is directly a degraded non-newly added function. When determining the degradation of a non-newly added function, determine whether the non-newly added function in the degraded function is a newly added call. If so, attribute the non-newly added function to a leaf function.

[0159] There can be corresponding degradation dimensions for newly added functions and non-new functions. After determining the newly added functions and non-new functions, whether a degradation point needs to be reported needs to meet certain thresholds:

[0160] For key threads, it is determined that the time consumption of Wall, CPU, self, Lock, Binder, IO, rendering, etc. reaches the threshold and then screening is performed. For example, if the time consumption parameter of the first function in the key thread in the comparison tree is greater than the time consumption threshold, the first function is determined as the degraded function in the comparison package.

[0161] For background threads, only the cases where CPU resources are used in large quantities, that is, only the CPU time consumption is screened. For example, when the second function in the background thread in the comparison tree consumes CPU time, the second function is determined as the degraded function in the comparison package.

[0162] In addition to the time consumption threshold, the hit rate is also judged. Only when the hit rate is greater than 80% and the time consumption in any comparison package cannot be lower than the time consumption in the baseline package, that is, when the compared time consumption - base time consumption is a non-negative number, will it be judged as a valid degradation point.

[0163] After the above screening, the degraded new functions and non-new functions are obtained.

[0164] Through the above steps, we get the newly added functions & non-new functions. However, the newly added functions & non-new functions are not necessarily all effective degradation issues. In actual development, the developer may simply modify the method name, but the method body is not changed. In this case, it will also be reported as a newly added method. For such problems, we perform flame graph aggregation analysis through the function's calling node Caller and the called node Callee to improve the accuracy of the final degradation problem.

[0165] Figure 3m is a schematic diagram for comparing newly added functions provided in an embodiment of the present disclosure. Figure 3n is a new function flame graph provided by an embodiment of the present disclosure. Figure 3m The benchmark package includes nodes A and K. Node A has child nodes B, D, and E. Node K has child node L. The next node of child node B is F, and the subordinate node of child node L is M. The test package, also known as the comparison package, includes nodes A and K. The calling relationship under node K is the same as the calling relationship of node K in the benchmark package. A new child node G is added under node A, and child node G calls subordinate node F. Figure 3n After being aggregated into degradation points, the caller of A has deleted function B, and the callee is the same; G is not degraded compared to B in terms of time consumption; it is determined to be a method rename, which is a low-accuracy degradation point. For newly added functions, as long as it can be clearly stated that the degradation is caused by the newly added code, it can be considered an attributed function.

[0166] Figure 3o is a schematic diagram of a non-newly added function comparison provided by an embodiment of the present disclosure, Figure 3p It is a non-newly added function flame graph provided by an embodiment of the present disclosure. Figure 3o The benchmark package includes node A, which includes child nodes B, D, and E. Child node E includes subordinate node B. In the test package, node N is added under node E. See Figure 3p After being aggregated into degradation points, a new node N is added to the callee of E, which can be attributed to the degradation caused by the newly added call point. For non-new functions, if it can be clearly seen that the degradation is caused by cpu, Lock, Binder, IO, rendering (accurate to View), network, etc., it can also be considered as an attributed function. If the cause of the degradation cannot be clearly identified, it is considered as an unattributed function.

[0167] The degraded function determination method provided by the present disclosure realizes the function degradation attribution based on stack aggregation, and the comparison idea based on stack aggregation, rather than method level, can perceive the "code logic" in the process of differential analysis. It solves the problem of false positives caused by developers rewriting method names but not actually changing the logic in the actual development process.

[0168] Figure 4 is a schematic diagram of a degradation function determination device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the device comprises:

[0169] An acquisition module 410 is used to acquire a tracking file of a target package, wherein the target package includes a reference package and a comparison package, wherein the comparison package is an installation package updated based on the reference package;

[0170] Aggregation module 420, used for performing function aggregation based on the function stack in the trace file of the target package to obtain an aggregate file;

[0171] The analysis module 430 is used to perform differential analysis on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package.

[0172] The technical solution provided by the embodiment of the present disclosure solves the technical problem of repeated reporting caused by directly using method names for comparison, and reduces the duplication rate of degradation points.

[0173] The degradation function determination device provided in the embodiments of the present disclosure can execute the degradation function determination method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0174] In one embodiment, the acquisition module 410 is used to:

[0175] Collecting the benchmark package multiple times to obtain multiple tracking files of the benchmark package;

[0176] The comparison package is collected multiple times to obtain multiple tracking files of the comparison package.

[0177] In one embodiment, the aggregation module 420 includes:

[0178] a merging unit, configured to merge, for each of the multiple tracing files of the target package, functions with the same name in the same stack in the tracing file, to obtain a self-merging tree of the tracing file;

[0179] The aggregation unit is used to aggregate each of the self-merging trees to obtain an aggregate file.

[0180] In one embodiment, the merging unit is specifically configured to:

[0181] For each tracking file in the multiple tracking files of the target package, the functions with the same name in the same stack in all background threads and all stages in the tracking file are merged to obtain a self-merging tree in the tracking file.

[0182] In one embodiment, the merging unit is specifically configured to:

[0183] For each of the multiple tracking files of the target package, functions with the same name in the same stack are merged according to the stage to obtain a self-merging tree of the tracking file.

[0184] In one embodiment, the merging unit merges functions with the same name in the same stack according to the stages, including one or more of the following:

[0185] Merge functions with the same name in the same stack in the same stage;

[0186] Merge functions with the same name in the same stack outside the stage;

[0187] Splitting functions belonging to multiple stages, where the split functions belong to corresponding stages among the multiple stages, and merging functions with the same name in the same stack among the multiple stages;

[0188] The stage across multiple threads is split into stages, and the stages after the splitting belong to the corresponding threads in the multiple threads, and the functions with the same name in the same stack are merged according to the stages after the splitting.

[0189] In one embodiment, the polymerizing unit is specifically used for:

[0190] Merge the functions of the same stack in each self-merging tree;

[0191] Take the union of different functions to get the aggregate file.

[0192] In one embodiment, the analysis module 430 includes:

[0193] an analyzing unit, configured to perform differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package in terms of thread dimension and / or phase dimension, and determine a comparison tree in terms of thread dimension and / or phase dimension, wherein the comparison tree indicates nodes added and / or deleted in the comparison package relative to the benchmark package, and the comparison tree further indicates functions added in the comparison package relative to the benchmark package, wherein the added functions are determined by a function set of the comparison package and a function set of the benchmark package;

[0194] A determination unit is used to determine the degradation function in the comparison package based on the time consumption parameters of the stages in the comparison tree.

[0195] In one embodiment, the determining unit is specifically configured to:

[0196] When a time-consuming parameter of a first function in a key thread in the comparison tree is greater than a time-consuming threshold, determining the first function as a degraded function in the comparison package;

[0197] In the case that the second function in the background thread in the comparison tree consumes CPU time, the second function is determined as a degraded function in the comparison package.

[0198] In one embodiment, a hit rate of the degradation function in a plurality of tracking files is greater than a set value.

[0199] In one embodiment, the device further includes a determination module, which is used to perform a differential analysis on the aggregate file corresponding to the benchmark package and the aggregate file corresponding to the comparison package to determine the degraded function in the comparison package, and then perform a flame graph aggregation analysis on the degraded function to determine whether the newly added function in the degraded function is a function rename, and if not, attribute the newly added function to the root newly added function of the newly added function;

[0200] Determine whether the non-newly added function in the degraded function is a newly added call, and if so, attribute the non-newly added function to a leaf function.

[0201] 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.

[0202] Figure 5 Schematic 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.

[0203] One or more processing devices 501;

[0204] The storage device 508 is used to store one or more programs.

[0205] 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 degradation function determination method provided by the present disclosure.

[0206] 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 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0207] 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.

[0208] 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 5 The 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.

[0209] 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.

[0210] 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.

[0211] The electronic device provided in the embodiment of the present disclosure and the degradation function determination method provided in 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.

[0212] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the degradation function determination method provided by the above embodiment is implemented.

[0213] 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.

[0214] 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.

[0215] 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.

[0216] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HyperText Transfer Protocol (HTTP), 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.

[0217] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0218] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0219] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a tracking file of a target package, wherein the target package includes a baseline package and a comparison package, wherein the comparison package is an installation package updated based on the baseline package;

[0220] In the tracking file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file;

[0221] A differential analysis is performed on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

[0222] 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).

[0223] 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.

[0224] 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".

[0225] 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.

[0226] 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.

[0227] According to one or more embodiments of the present disclosure, [Example 1] provides a degradation function determination method, including:

[0228] Obtaining a tracking file of a target package, wherein the target package includes a base package and a comparison package, wherein the comparison package is an installation package updated based on the base package;

[0229] In the trace file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file;

[0230] A differential analysis is performed on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

[0231] According to one or more embodiments of the present disclosure, [Example 2] provides the method described in Example 1, wherein obtaining the tracking file of the target package includes:

[0232] Collecting the benchmark package multiple times to obtain multiple tracking files of the benchmark package;

[0233] The comparison package is collected multiple times to obtain multiple tracking files of the comparison package.

[0234] According to one or more embodiments of the present disclosure, [Example 3] provides the method described in Example 1, wherein in the trace file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file, including:

[0235] For each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file;

[0236] Aggregate each of the self-merging trees to obtain an aggregate file.

[0237] According to one or more embodiments of the present disclosure, [Example 4] provides the method described in Example 3, wherein for each of the multiple trace files of the target package, functions with the same name in the same stack in the trace file are merged to obtain a self-merging tree of the trace file, including:

[0238] For each tracking file in the multiple tracking files of the target package, the functions with the same name in the same stack in all background threads and all stages in the tracking file are merged to obtain a self-merging tree in the tracking file.

[0239] According to one or more embodiments of the present disclosure, [Example 5] provides the method described in Example 3, wherein for each of the multiple trace files of the target package, functions with the same name in the same stack in the trace file are merged to obtain a self-merging tree of the trace file, including:

[0240] For each of the multiple tracking files of the target package, functions with the same name in the same stack are merged according to the stage to obtain a self-merging tree of the tracking file.

[0241] According to one or more embodiments of the present disclosure, [Example 6] provides the method described in Example 5, merging functions with the same name in the same stack according to stages, including one or more of the following:

[0242] Merge functions with the same name in the same stack in the same stage;

[0243] Merge functions with the same name in the same stack outside the stage;

[0244] Splitting functions belonging to multiple stages, where the split functions belong to corresponding stages among the multiple stages, and merging functions with the same name in the same stack among the multiple stages;

[0245] The stage across multiple threads is split into stages, and the stages after the splitting belong to the corresponding threads in the multiple threads, and the functions with the same name in the same stack are merged according to the stages after the splitting.

[0246] According to one or more embodiments of the present disclosure, [Example 7] provides the method described in Example 3, wherein aggregating each of the self-merging trees to obtain an aggregate file includes:

[0247] Merge the functions of the same stack in each self-merging tree;

[0248] Take the union of different functions to get the aggregate file.

[0249] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 1, wherein performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package includes:

[0250] Performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package in terms of thread dimension and / or phase dimension to determine a comparison tree in terms of thread dimension and / or phase dimension, wherein the comparison tree indicates nodes added and / or deleted in the comparison package relative to the benchmark package, and the comparison tree further indicates functions added in the comparison package relative to the benchmark package, wherein the added functions are determined by a function set of the comparison package and a function set of the benchmark package;

[0251] Based on the time consumption parameters of the stages in the comparison tree, a degradation function in the comparison package is determined.

[0252] According to one or more embodiments of the present disclosure, [Example 9] provides the method of Example 8, wherein determining the degradation function in the comparison package based on the time-consuming parameters of the stages in the comparison tree includes:

[0253] When a time-consuming parameter of a first function in a key thread in the comparison tree is greater than a time-consuming threshold, determining the first function as a degraded function in the comparison package;

[0254] In the case that the second function in the background thread in the comparison tree consumes CPU time, the second function is determined as a degraded function in the comparison package.

[0255] According to one or more embodiments of the present disclosure, [Example 10] provides the method described in Example 8, wherein the hit rate of the degradation function in multiple tracking files is greater than a set value.

[0256] According to one or more embodiments of the present disclosure, [Example 11] provides the method of Example 1, which further includes: after performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package:

[0257] Performing flame graph aggregation analysis on the degraded function to determine whether the newly added function in the degraded function is a function rename, and if not, attributing the newly added function to the root newly added function of the newly added function;

[0258] Determine whether the non-newly added function in the degraded function is a newly added call, and if so, attribute the non-newly added function to a leaf function.

[0259] According to one or more embodiments of the present disclosure, [Example 12] provides a degradation function determination device, including:

[0260] An acquisition module, used to acquire a tracking file of a target package, wherein the target package includes a reference package and a comparison package, wherein the comparison package is an installation package updated based on the reference package;

[0261] An aggregation module is used to aggregate functions based on the function stack in the trace file of the target package to obtain an aggregation file;

[0262] The analysis module is used to perform differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package.

[0263] According to one or more embodiments of the present disclosure, [Example 13] provides an electronic device, the electronic device comprising:

[0264] one or more processing devices;

[0265] a storage device for storing one or more programs,

[0266] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the degradation function determination method as described in any one of Examples 1-11.

[0267] According to one or more embodiments of the present disclosure, [Example 14] provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the degradation function determination method as described in any one of Examples 1-11.

[0268] 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.

[0269] 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.

[0270] 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 method for determining a degradation function, characterized in that: include: Obtaining a tracking file of a target package, wherein the target package includes a base package and a comparison package, wherein the comparison package is an installation package updated based on the base package; In the tracking file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file; A differential analysis is performed on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine a degradation function in the comparison package.

2. The method according to claim 1, characterized in that The step of obtaining the tracking file of the target package includes: Collecting the benchmark package multiple times to obtain multiple tracking files of the benchmark package; The comparison package is collected multiple times to obtain multiple tracking files of the comparison package.

3. The method according to claim 1, characterized in that In the tracking file of the target package, function aggregation is performed based on the function stack to obtain an aggregate file, including: For each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file; Aggregate each of the self-merging trees to obtain an aggregate file.

4. The method according to claim 3, characterized in that: For each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file includes: For each tracking file in the multiple tracking files of the target package, all background threads and functions with the same name in the same stack in all stages in the tracking file are merged to obtain a self-merging tree in the tracking file.

5. The method according to claim 3, characterized in that: For each of the multiple tracking files of the target package, merging functions with the same name in the same stack in the tracking file to obtain a self-merging tree of the tracking file includes: For each of the multiple tracking files of the target package, functions with the same name in the same stack are merged according to the stage to obtain a self-merging tree of the tracking file.

6. The method according to claim 5, characterized in that Functions with the same name in the same stack are merged according to the stage, including one or more of the following: Merge functions with the same name in the same stack in the same stage; Merge functions with the same name in the same stack outside the stage; Splitting functions belonging to multiple stages, where the split functions belong to corresponding stages among the multiple stages, and merging functions with the same name in the same stack among the multiple stages; The stage across multiple threads is split into stages, and the stages after the splitting belong to the corresponding threads in the multiple threads, and the functions with the same name in the same stack are merged according to the stages after the splitting.

7. The method according to claim 3, characterized in that The step of aggregating each of the self-merging trees to obtain an aggregate file includes: Merge the functions of the same stack in each self-merging tree; Take the union of different functions to get the aggregate file.

8. The method according to claim 1, characterized in that The performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package includes: Performing differential analysis on the aggregated file corresponding to the benchmark package and the aggregated file corresponding to the comparison package in terms of thread dimension and / or phase dimension to determine a comparison tree in terms of thread dimension and / or phase dimension, wherein the comparison tree indicates nodes added and / or deleted in the comparison package relative to the benchmark package, and the comparison tree further indicates functions added in the comparison package relative to the benchmark package, wherein the added functions are determined by a function set of the comparison package and a function set of the benchmark package; Based on the time consumption parameters of the stages in the comparison tree, a degradation function in the comparison package is determined.

9. The method according to claim 8, characterized in that The step of determining the degradation function in the comparison package based on the time-consuming parameters of the stages in the comparison tree includes: When a time-consuming parameter of a first function in a key thread in the comparison tree is greater than a time-consuming threshold, determining the first function as a degraded function in the comparison package; In the case that the second function in the background thread in the comparison tree consumes CPU time, the second function is determined as a degraded function in the comparison package.

10. The method according to claim 8, characterized in that The hit rate of the degradation function in multiple tracking files is greater than a set value.

11. The method according to claim 1, characterized in that: After performing differential analysis on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package, the method further includes: Perform flame graph aggregation analysis on the degraded function to determine whether the newly added function in the degraded function is a function rename; if not, attribute the newly added function to the root newly added function of the newly added function.

12. A degradation function determination device, characterized in that: include: An acquisition module, used to acquire a tracking file of a target package, wherein the target package includes a reference package and a comparison package, wherein the comparison package is an installation package updated based on the reference package; An aggregation module is used to aggregate functions based on the function stack in the trace file of the target package to obtain an aggregation file; The analysis module is used to perform differential analysis on the aggregated file corresponding to the reference package and the aggregated file corresponding to the comparison package to determine the degradation function in the comparison package.

13. 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 degradation function determination method as described in any one of claims 1-11.

14. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the degradation function determination method according to any one of claims 1 to 11 when executed by a computer processor.