Program data processing method, device, electronic device, and storage medium
By comparing the differences in tree structure nodes in the Systrace information, automatic analysis is performed to obtain the target node set, which solves the problem of low efficiency of analyzing program running data in the existing technology and achieves efficient and time-consuming exception analysis.
Patent Information
- Application Number
- CN202210611277.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-05-31
AI Technical Summary
In the existing technology, the efficiency of data analysis program operation is low, mainly due to the large amount of information in Systrace, which makes manual analysis time-consuming and laborious.
By obtaining at least two sets of device activity data pairs, storing the benchmark data and the target data in the first tree structure and the second tree structure respectively, comparing the node differences between the two, and automatically analyzing to obtain the target node set, and then obtaining the time-consuming exception analysis result.
It improves the efficiency of program data analysis, reduces errors, and obtains accurate time-consuming anomaly analysis results.
Smart Images

Figure CN114936040B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a program data processing method, device, electronic device, storage medium and computer program product. Background Art
[0002] Systrace is a tool used to record short-term device activities. The Systrace information generated by the tool summarizes device-related data information, such as CPU scheduler, disk activity, and application threads. Developers can analyze device performance by capturing the device's Systrace information.
[0003] The traditional method is to analyze the performance of the device by manually comparing Systrace information. However, due to the huge number of methods involved in Systrace information, it causes a huge analysis workload, and manual analysis is time-consuming and laborious.
[0004] Therefore, there is a problem in the related art that the efficiency of analyzing program running data is low. Summary of the invention
[0005] The present disclosure provides a program data processing method, device, electronic device, storage medium and computer program product to at least solve the problem of low efficiency in analyzing program running data in the related art. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a program data processing method is provided, including:
[0007] Acquire at least two groups of device activity data pairs; the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used to characterize the stack relationship and time consumption of each method in the benchmark application called by the target device, the second tree structure is used to characterize the stack relationship and time consumption of each method in the target application called by the target device, the benchmark application and the target application are different versions of the same application, and the target devices corresponding to different groups of the device activity data pairs are devices of different models;
[0008] For any set of the device activity data pairs, the node differences between the first tree structure and the second tree structure are compared to obtain a target node set corresponding to each of the device activity data pairs; the nodes in the target node set are used to represent the methods that are called by the target device during the execution of the target application and have time-consuming exceptions;
[0009] The intersection between the target node sets corresponding to the device activity data pairs is obtained to obtain a time-consuming anomaly analysis result for the target application.
[0010] In a possible implementation, obtaining at least two sets of device activity data pairs includes:
[0011] Acquire benchmark data and target data corresponding to the target device; the benchmark data is device activity data generated when the target device runs the benchmark application, and the target data is device activity data generated when the target device runs the target application;
[0012] Constructing the first tree structure using the benchmark data according to the execution stack of each method in the benchmark application called by the target device;
[0013] According to the execution stack of each method in the target application program called by the target device, the second tree structure is constructed using the target data;
[0014] Each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for characterizing node positions and stack relationships, and method information for characterizing the running status and time consumption of the called method.
[0015] In a possible implementation, for any group of the device activity data pairs, comparing the node differences between the first tree structure and the second tree structure to obtain a target node set corresponding to each of the device activity data pairs includes:
[0016] For any group of the device activity data pairs, compare the node information corresponding to each node in the first tree structure and the second tree structure to obtain the difference in identification information and method information between the first tree structure and the second tree structure;
[0017] Determining a newly added method node from the second tree structure according to a difference in identification information between the first tree structure and the second tree structure;
[0018] determining a method abnormal node from the second tree structure according to a method information difference between the first tree structure and the second tree structure;
[0019] According to the newly added method nodes and the method exception nodes, a target node set corresponding to each of the device activity data pairs is obtained.
[0020] In a possible implementation, determining a newly added method node from the second tree structure according to a difference in identification information between the first tree structure and the second tree structure includes:
[0021] For any node in the second tree structure, if it is detected that there is no node identical to the any node in the first tree structure, the any node is used as a newly added method node.
[0022] In a possible implementation, the method abnormal node includes a time-consuming abnormal node and a call abnormal node, and the determining the method abnormal node from the second tree structure according to the method information difference between the first tree structure and the second tree structure includes:
[0023] Determine the same nodes between the first tree structure and the second tree structure;
[0024] In the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, compare the time consumption of the certain same node in the first tree structure and the second tree structure, and use a certain same node that meets the first preset condition in the second tree structure as the abnormal time consumption node;
[0025] In the first tree structure and the second tree structure, if there are multiple nodes of the same node, the number of calls and / or time consumption of the same node in the first tree structure and the second tree structure are compared, and the same node that meets the second preset condition in the second tree structure is used as the time-consuming abnormal node, and the same node that meets the third preset condition in the second tree structure is used as the call abnormal node.
[0026] In a possible implementation, obtaining a target node set corresponding to each of the device activity data pairs according to the newly added method node and the method exception node includes:
[0027] The redundant nodes in the newly added method nodes and the method abnormal nodes are filtered, and the filtered nodes are used as the target node set corresponding to each of the device activity data pairs.
[0028] In a possible implementation, the method abnormal nodes include time-consuming abnormal nodes and call abnormal nodes, and filtering the newly added method nodes and redundant nodes in the method abnormal nodes includes:
[0029] According to the preset first filtering information, the redundant nodes in the abnormal time-consuming nodes are filtered to obtain a first filtering result;
[0030] According to the preset second filtering information, the newly added method node and the redundant nodes in the call abnormal node are filtered to obtain a second filtering result;
[0031] According to the preset third filtering information, the redundant nodes in the first filtering result and the second filtering result are filtered to obtain the filtered nodes.
[0032] In a possible implementation, the obtaining the intersection between the target node sets corresponding to the device activity data pairs to obtain the time consumption anomaly analysis result for the target application includes:
[0033] Acquire the target node sets obtained by using devices of different models as target devices, and determine the intersection nodes between the target node sets;
[0034] The intersection node is used as a time-consuming exception analysis result for the target application.
[0035] According to a second aspect of an embodiment of the present disclosure, there is provided a program data processing device, including:
[0036] The device activity data pair acquisition unit is configured to execute acquisition of at least two groups of device activity data pairs; the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used to characterize the stack relationship and time consumption of each method in the benchmark application called by the target device, the second tree structure is used to characterize the stack relationship and time consumption of each method in the target application called by the target device, the benchmark application and the target application are different versions of the same application, and the target devices corresponding to different groups of the device activity data pairs are devices of different models;
[0037] a target node set obtaining unit configured to compare the node differences between the first tree structure and the second tree structure for any set of the device activity data pairs, and obtain a target node set corresponding to each of the device activity data pairs; the nodes in the target node set are used to represent the methods that are called by the target device during the execution of the target application and have time-consuming anomalies;
[0038] The intersection determination unit is configured to execute the acquisition of the intersection between the target node sets corresponding to each of the device activity data pairs, and obtain the time consumption anomaly analysis result for the target application.
[0039] In one possible implementation, the device activity data pair acquisition unit is specifically configured to execute acquisition of benchmark data and target data corresponding to the target device; the benchmark data is the device activity data generated when the target device runs the benchmark application, and the target data is the device activity data generated when the target device runs the target application; the first tree structure is constructed using the benchmark data according to the execution stack of each method in the benchmark application called by the target device; the second tree structure is constructed using the target data according to the execution stack of each method in the target application called by the target device; wherein each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for characterizing the node position and stack relationship, and method information for characterizing the running status and time consumption of the called method.
[0040] In one possible implementation, the target node set obtaining unit is specifically configured to perform a comparison for any group of the device activity data pairs according to the node information corresponding to each node in the first tree structure and the second tree structure, to obtain the identification information difference and method information difference between the first tree structure and the second tree structure; determine a newly added method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure; determine a method abnormal node from the second tree structure according to the method information difference between the first tree structure and the second tree structure; and obtain a target node set corresponding to each of the device activity data pairs according to the newly added method node and the method abnormal node.
[0041] In a possible implementation, the target node set obtaining unit is specifically configured to execute for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, then use the any node as a newly added method node.
[0042] In a possible implementation, the method abnormal nodes include time-consuming abnormal nodes and call abnormal nodes, and the target node set obtaining unit is specifically configured to execute determination of the same nodes between the first tree structure and the second tree structure; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, the time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the first preset condition in the second tree structure is used as the time-consuming abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, the number of calls and / or time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the second preset condition in the second tree structure is used as the time-consuming abnormal node, and a certain same node that meets the third preset condition in the second tree structure is used as the call abnormal node.
[0043] In a possible implementation, the target node set obtaining unit is specifically configured to perform filtering on redundant nodes in the newly added method nodes and the method abnormal nodes, and use the filtered nodes as the target node set corresponding to each of the device activity data pairs.
[0044] In a possible implementation, the method abnormal node includes a time-consuming abnormal node and a call abnormal node, and the target node set obtaining unit is specifically configured to perform filtering on redundant nodes in the time-consuming abnormal node according to preset first filtering information to obtain a first filtering result; filter on redundant nodes in the newly added method node and the call abnormal node according to preset second filtering information to obtain a second filtering result; filter on redundant nodes in the first filtering result and the second filtering result according to preset third filtering information to obtain the filtered node.
[0045] In one possible implementation, the intersection determination unit is specifically configured to execute acquisition of each target node set obtained by using devices of different models as target devices, determine the intersection node between each target node set; and use the intersection node as a time-consuming anomaly analysis result for the target application.
[0046] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0047] processor;
[0048] a memory for storing instructions executable by the processor;
[0049] The processor is configured to execute the instructions to implement the program data processing method as described in any one of the above items.
[0050] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the program data processing method as described in any one of the above items.
[0051] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the program data processing method as described in any one of the above items.
[0052] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0053] The scheme disclosed in the present invention obtains at least two groups of device activity data pairs, the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used to characterize the stack relationship and time consumption of each method in the benchmark application called by the target device, and the second tree structure is used to characterize the stack relationship and time consumption of each method in the target application called by the target device, the benchmark application and the target application are different versions of the same application, and the target devices corresponding to different groups of device activity data pairs are devices of different models, and then for any group of device activity data pairs, the node differences between the first tree structure and the second tree structure are compared to obtain the target node set corresponding to each device activity data pair, the nodes in the target node set are used to characterize the methods with time consumption exceptions called by the target device during the execution of the target application, and then the intersection between the target node sets corresponding to each device activity data pair is obtained to obtain the time consumption exception analysis result for the target application. In this way, based on the benchmark data stored in the first tree structure and the target data stored in the second tree structure in the device activity data pair, the node differences between the first tree structure and the second tree structure can be automatically analyzed and compared to obtain a target node set, thereby improving the efficiency of program data analysis. The time-consuming abnormal analysis results can be determined based on the intersection between different device activity data pairs, thereby avoiding errors and obtaining accurate analysis results.
[0054] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0056] Figure 1The present invention is a flowchart of a method for processing program data according to an exemplary embodiment.
[0057] Figure 2a The diagram is a schematic diagram showing a program data analysis process according to an exemplary embodiment.
[0058] Figure 2b is a schematic diagram showing a tree structure according to an exemplary embodiment.
[0059] Figure 3 The present invention is a flowchart showing steps of obtaining a target node set according to an exemplary embodiment.
[0060] Figure 4 The figure is a flowchart of another method for processing program data according to an exemplary embodiment.
[0061] Figure 5 The invention is a block diagram of a program data processing device according to an exemplary embodiment.
[0062] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure.
[0065] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0066] Figure 1 is a flowchart of a program data processing method according to an exemplary embodiment. Figure 1As shown, this embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps.
[0067] In step S110, at least two sets of device activity data pairs are acquired; the device activity data pairs include reference data stored in a first tree structure and target data stored in a second tree structure;
[0068] Among them, the benchmark data and target data can be obtained based on the collected Systrace information, the first tree structure can be used to characterize the stack relationship and time consumption of the target device calling each method in the benchmark application, and the second tree structure can be used to characterize the stack relationship and time consumption of the target device calling each method in the target application; the first tree structure can be composed of multiple multi-branch tree structures, which can be constructed based on the execution stack of the target device calling each method in the benchmark application, and similarly, the second tree structure can also be composed of multiple multi-branch tree structures, which can be constructed based on the execution stack of the target device calling each method in the target application.
[0069] For example, a multi-tree structure can be a data storage structure, which can include multiple layers of nodes, and there is a parent-child node relationship between the upper and lower layers of nodes, and a calling relationship between the methods corresponding to the nodes. Taking a multi-tree structure including three layers of data as an example, the multi-tree structure can be a first-layer root node, a second-layer node, and a third-layer node in sequence, wherein the second-layer node is the parent node of the third-layer node, and the third-layer node data is the child node of the second-layer node. The parent node can have relevant information of all its child nodes, and the method corresponding to the parent node can call the method corresponding to the child node.
[0070] As an example, the benchmark application and the target application are different versions of the same application; the target devices corresponding to different groups of device activity data pairs may be devices of different models, or multiple groups of device activity data pairs may be obtained for devices of different models.
[0071] In actual applications, at least two groups of device activity data pairs can be obtained through the collected Systrace information of different types of equipment. Each group of device activity data pairs can include benchmark data stored in a first tree structure and target data stored in a second tree structure, so as to further perform analysis and comparison based on the first tree structure and the second tree structure.
[0072] Specifically, based on Systrace, a tool used to record short-term device activities, Systrace information can be obtained. The Systrace information includes data information related to the device, such as CPU scheduler, disk activity, and application threads. By capturing the Systrace information of the device, device performance can be analyzed, such as application startup events, application running status, etc.
[0073] In one example, as the functions of applications in terminal devices become increasingly rich, the tasks that applications need to complete during the startup phase also increase. The increase in the number of tasks will cause the startup speed of applications in terminal devices to slow down and take more time. In order to analyze the reasons for the slowdown in application startup events, the startup performance of applications can be compared based on Systrace information to determine the reasons for the abnormal time consumption of application startup, such as longer execution time of called methods, new methods, etc.
[0074] For example, Figure 2a As shown, taking the application startup event as an example, a device of the same model can be used as the target device, and a set of device activity data pairs (such as the benchmark application (such as application A with normal startup time consumption) and the target application (such as application A with abnormal startup time consumption) can be obtained. Figure 2a Group A), which may include benchmark data obtained according to benchmark Systrace information and target data obtained according to target Systrace information, and further may be constructed based on the data storage structure to obtain benchmark data stored in a first tree structure and target data stored in a second tree structure.
[0075] In an optional embodiment, by preprocessing the obtained Systrace information file, device activity data that is not in the startup phase of application A can be excluded, and then subsequent application startup performance analysis can be performed based on the preprocessed data, thereby improving the efficiency of program data analysis. Figure 2a As shown, the pre-processed data may include all process and thread information of the application A startup event, the root node mapping corresponding to each thread, the node mapping corresponding to each stage of the startup event, all thread information of the main process, a set of recurring slice nodes (such as a set of recurring methods), and may also include other relevant information of the device, which is not specifically limited in this embodiment.
[0076] In step S120, for any set of device activity data pairs, the node differences between the first tree structure and the second tree structure are compared to obtain a target node set corresponding to each device activity data pair;
[0077] Among them, the nodes in the target node set can be used to characterize the methods that are called by the target device during the execution of the target application and have abnormal time consumption. For example, the methods corresponding to the nodes in the target node set can be methods with longer execution time, new methods, etc., so that the target application has abnormal startup time consumption.
[0078] In a specific implementation, for any group of device activity data pairs, by comparing the node differences between the first tree structure and the second tree structure, the nodes corresponding to the methods with time-consuming exceptions in the execution of the target application can be found, and then the target node set corresponding to each device activity data pair can be obtained based on the found nodes.
[0079] In one example, if Figure 2a As shown, taking the application startup event as an example, a set of device activity data pairs (such as the benchmark application (such as application A with normal startup time consumption) and the target application (such as application A with abnormal startup time consumption) are obtained. Figure 2a In group A), that is, the reference data stored in the first tree structure and the target data stored in the second tree structure, by comparing the node differences between the first tree structure and the second tree structure, the target node set corresponding to each device activity data pair can be obtained (such as Figure 2a (Analysis results of Group A).
[0080] In an optional embodiment, the same tree nodes can be compared to find the nodes corresponding to the methods with time-consuming exceptions in the execution of the target application, and then the redundant nodes in the nodes can be filtered out and used as the target node set corresponding to each device activity data pair, so as to obtain accurate and concise analysis results.
[0081] For example, Figure 2a As shown, for the analysis results of Group A, that is, the target node set corresponding to the device activity data of Group A, it may include method information with increased time consumption (such as thread analysis results), new method information (such as thread analysis results), etc. It may also include thread analysis results corresponding to the start events based on the methods with increased time consumption and / or the new methods, repeated method analysis results, etc.
[0082] In step S130, the intersection between the target node sets corresponding to the device activity data pairs is obtained to obtain the time consumption anomaly analysis result for the target application.
[0083] In actual applications, the target node set corresponding to the activity data of each device can be obtained, and then the intersection of multiple target node sets can be taken to obtain the intersection result as the time-consuming exception analysis result for the target application. For example, by taking the intersection of multiple groups of comparison results (i.e., target node sets), the intersection of analysis results based on the analysis results of multiple Systrace information can be obtained, thereby reducing the occurrence of errors.
[0084] For example, Figure 2a As shown, taking the startup event of an application as an example, by analyzing multiple Systrace information (such as Figure 2a A group, B group, C group), an intersection operation can be performed based on multiple groups of analysis results to obtain the intersection of the analysis results (such as an intersection node).
[0085] Compared with the traditional method of manually comparing Systrace information and manually counting the time-consuming analysis results, which is inefficient and time-consuming and labor-intensive to perform manual analysis, the technical solution of this embodiment can automatically analyze and compare Systrace information based on the benchmark data stored in the first tree structure and the target data stored in the second tree structure in the device activity data, and obtain the time-consuming anomaly analysis results for the target application, which can improve the analysis efficiency and obtain accurate results. And compared with the traditional method of only analyzing a single set of Systrace information, due to different application running environments, the results of a single set of Systrace information are biased, resulting in inaccurate analysis results; the technical solution of this embodiment, by analyzing multiple sets of Systrace information and taking the intersection operation of the analysis results, can determine the time-consuming anomaly analysis results based on the intersection between different device activity data pairs, reducing errors and improving the accuracy of analysis results.
[0086] In the above-mentioned program data processing method, by obtaining at least two groups of device activity data pairs, the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure, the benchmark application and the target application are different versions of the same application, and the target devices corresponding to different groups of device activity data pairs are devices of different models, and then for any group of device activity data pairs, the node differences between the first tree structure and the second tree structure are compared to obtain the target node set corresponding to each device activity data pair, and then the intersection between the target node sets corresponding to each device activity data pair is obtained to obtain the time-consuming anomaly analysis result for the target application. In this way, the node differences between the first tree structure and the second tree structure can be automatically analyzed and compared based on the benchmark data stored in the first tree structure and the target data stored in the second tree structure in the device activity data pair to obtain the target node set, thereby improving the efficiency of program data analysis, and the time-consuming anomaly analysis result can be determined based on the intersection between different device activity data pairs, which can avoid errors and obtain accurate analysis results.
[0087] In an exemplary embodiment, at least two sets of device activity data pairs are obtained, including: obtaining baseline data and target data corresponding to a target device; constructing a first tree structure using the baseline data according to an execution stack of each method in a benchmark application called by the target device; and constructing a second tree structure using the target data according to an execution stack of each method in a target application called by the target device.
[0088] Among them, the benchmark data can be the device activity data generated when the target device runs the benchmark application, and the target data can be the device activity data generated when the target device runs the target application. For example, the benchmark application can be application A with normal startup time, and the target application can be application A with abnormal startup time.
[0089] As an example, each node in the first tree structure and the second tree structure has corresponding node information, and the node information may include identification information for characterizing the node position and stack relationship, and method information for characterizing the running state and time consumption of the called method.
[0090] In actual applications, taking the startup event of an application as an example, a device of the same model can be used as the target device to obtain the baseline Systrace information file and the target Systrace information file corresponding to the target device. For example, the Systrace information can be an HTML file, which can contain the running status (such as start and end), time duration, timestamp and other information of all methods called by the device. Then, the preset Systrace information file processing tool can be used to convert the HTML file into a database, and then the unrelated data in the database can be converted into slice tree structures, that is, the execution stack of the method. In this tree structure, each method has a corresponding slice node, and each node of each tree structure has a slice node id and a parent node id, that is, identification information, which can be used to determine the node position and stack relationship.
[0091] In one example, if Figure 2b As shown, taking a multi-tree structure including three layers of data as an example, the slice node ID can be increased in sequence from the first layer root node to the second layer node from left to right, and then to the third layer node from left to right. When performing comparison, the nodes can also be traversed in this increasing order, such as Figure 2b In the traversal order of 1-7, when the parent node id is null, it is the root node of each tree structure, and then you can use the slice node id and parent node id of each node, such as Figure 2b Here, method A calls method C, method D, method E, and method F. Node C, node D, node E, and node F are child nodes of node A, and node A is the parent node of node C, node D, node E, and node F. A multi-branch tree structure is constructed, thereby forming a whole tree structure "forest", that is, the benchmark data stored in the first tree structure and the target data stored in the second tree structure.
[0092] For example, taking the startup event of an application as an example, devices A and device B of the same model can be used. Application A with normal startup time is run in device A, and application A with abnormal startup time is run in device B. By simultaneously capturing the Systrace information corresponding to the startup event of application A, a set of device activity data pairs can be obtained, including baseline data with normal startup time and target data with abnormal startup time, so as to further perform startup performance comparison and analysis; different groups of device activity data pairs can be obtained for devices of different models, or can be obtained using devices of the same model. Each group of device activity data pairs is independent, and the baseline data and target data contained therein are collected at the same time, while different groups of device activity data pairs have different collection times; the code corresponding to the baseline data collected in each group of device activity data pairs is the same (e.g., both run application A with normal startup time), and the code corresponding to the target data collected in each group of device activity data pairs is also the same (e.g., both run application A with abnormal startup time).
[0093] The technical solution of this embodiment obtains the benchmark data and target data corresponding to the target device, and then constructs the first tree structure using the benchmark data according to the execution stack of each method in the benchmark application called by the target device, and constructs the second tree structure using the target data according to the execution stack of each method in the target application called by the target device. The first tree structure and the second tree structure can be constructed, providing data support for the subsequent automated analysis and comparison of the node differences between the tree structures.
[0094] In an exemplary embodiment, if Figure 3 As shown, for any set of device activity data pairs, comparing the node differences between the first tree structure and the second tree structure to obtain the target node set corresponding to each device activity data pair may also include the following steps:
[0095] In step S310, for any set of device activity data pairs, node information corresponding to each node in the first tree structure and the second tree structure is compared to obtain identification information differences and method information differences between the first tree structure and the second tree structure;
[0096] As an example, node information may include identification information and method information. The identification information may include the node ID, parent node ID, and node level depth of the node to which it belongs. The method information may include the running status, time consumed, timestamp and other information of the method corresponding to the node to which it belongs. If the node to which it belongs has child nodes, it may also include the association information of each child node.
[0097] In actual applications, for the first tree structure and the second tree structure in any group of device activity data pairs, the same tree nodes can be compared to find out the differences in identification information and method information between the first tree structure and the second tree structure based on the node information corresponding to each node in the first tree structure and the second tree structure. For example, the difference in identification information can indicate that the same node as the second tree structure is not found in the first tree structure, and the difference in method information can indicate the difference in method time consumption and number of method calls corresponding to the same node between the first tree structure and the second tree structure.
[0098] For example, after constructing the method "forest", the same nodes between the first tree structure and the second tree structure can be found to further perform node comparison analysis. The same nodes have the same method name and the same node depth.
[0099] In step S320, according to the difference in identification information between the first tree structure and the second tree structure, a newly added method node is determined from the second tree structure;
[0100] In one example, if no node identical to any node in the second tree structure is found in the first tree structure, then the any node in the second tree structure can be determined as a newly added method node. For example, based on the newly added method node, for an application program that takes a long time to start, it can be determined that the cause of the abnormal time consumption includes a newly added method.
[0101] In step S330, according to the method information difference between the first tree structure and the second tree structure, a method abnormal node is determined from the second tree structure;
[0102] Among them, method abnormal nodes may include time-consuming abnormal nodes (such as increased time consumption) and call abnormal nodes (such as increased method calls).
[0103] In one example, for the same node found between the first tree structure and the second tree structure, if the same node is not repeated in the first tree structure and the second tree structure, that is, the number of nodes of the same node in the first tree structure and the second tree structure is 1, the time-consuming duration can be compared based on the method information corresponding to the same node in the first tree structure and the method information corresponding to the same node in the second tree structure. Then, when it is determined that the time-consuming duration of the same node in the second tree structure increases, it can be determined as a time-consuming abnormal node. For example, based on the time-consuming abnormal node, for an application that starts a time-consuming abnormality, it can be determined that the cause of the time-consuming abnormality includes a longer execution time of the method.
[0104] In another example, if the same node is repeated in the first tree structure and the second tree structure, that is, the number of nodes of the same node in the first tree structure and the second tree structure is multiple, it can be determined whether the number of calls to the same node in the first tree structure is the same as the number of calls to the same node in the second tree structure. Then, when the number of calls is the same, the overall time consumption can be calculated. If the overall time consumption increases, it is a time-consuming abnormal node. When the number of calls to the same node in the second tree structure increases, it is determined to be a call abnormal node.
[0105] In step S340, a target node set corresponding to each device activity data pair is obtained according to the newly added method node and the method exception node.
[0106] After obtaining the newly added method nodes and the method abnormal nodes, the redundant nodes in the newly added method nodes and the method abnormal nodes may be filtered, and then the filtered nodes may be obtained as the target node set corresponding to each device activity data pair.
[0107] The technical solution of this embodiment is to compare the node information corresponding to each node in the first tree structure and the second tree structure for any group of device activity data pairs, to obtain the identification information difference and method information difference between the first tree structure and the second tree structure, and then determine the newly added method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure, and determine the method abnormal node from the second tree structure according to the method information difference between the first tree structure and the second tree structure, and then obtain the target node set corresponding to each device activity data pair according to the newly added method node and the method abnormal node, thereby improving the efficiency of program data analysis and obtaining accurate analysis results.
[0108] In an exemplary embodiment, based on the difference in identification information between the first tree structure and the second tree structure, a new method node is determined from the second tree structure, including: for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, then any node is used as a new method node.
[0109] In a specific implementation, for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, such as no node identical to any node in the second tree structure is found in the first tree structure, then the any node in the second tree structure can be determined as a newly added method node.
[0110] The technical solution of this embodiment, by targeting any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, any node will be used as a new method node, which can effectively find out the new method nodes that affect the time consumption, thereby improving the efficiency of program data analysis.
[0111] In an exemplary embodiment, the method abnormal node may include a time-consuming abnormal node and a call abnormal node. According to the difference in method information between the first tree structure and the second tree structure, the method abnormal node is determined from the second tree structure, including: determining the same node between the first tree structure and the second tree structure; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, compare the time consumption of a certain same node in the first tree structure and the second tree structure, and use a certain same node that meets the first preset condition in the second tree structure as a time-consuming abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, compare the number of calls and / or time consumption of a certain same node in the first tree structure and the second tree structure, use a certain same node that meets the second preset condition in the second tree structure as a time-consuming abnormal node, and use a certain same node that meets the third preset condition in the second tree structure as a call abnormal node.
[0112] In practical applications, the same nodes between the first tree structure and the second tree structure can be determined by comparing the same tree nodes. Then, for the same nodes between the first tree structure and the second tree structure found, if the same node is not repeated in the first tree structure and the second tree structure, that is, the number of nodes of the same node in the first tree structure and the second tree structure is 1, the time consumption can be compared based on the method information corresponding to the same node in the first tree structure and the method information corresponding to the same node in the second tree structure. When it is determined that the time consumption of the same node in the second tree structure increases (that is, the first preset condition), it can be determined as a time-consuming abnormal node.
[0113] If the same node is repeated in the first tree structure and the second tree structure, that is, the number of nodes of the same node in the first tree structure and the second tree structure is multiple, it can be determined whether the number of calls to the same node in the first tree structure is the same as the number of calls to the same node in the second tree structure. Then, when the number of calls is the same, the overall time consumption can be calculated. If the overall time consumption increases (that is, the second preset condition), it is a time-consuming abnormal node. When the number of calls to the same node in the second tree structure increases (that is, the third preset condition), it is determined to be a call abnormal node.
[0114] The technical solution of this embodiment, by determining the same nodes between the first tree structure and the second tree structure, and then obtaining time-consuming abnormal nodes and call abnormal nodes for the situation where the same nodes meet different preset conditions, can effectively find the method abnormal nodes that affect the time consumption, thereby improving the efficiency of program data analysis.
[0115] In an exemplary embodiment, a target node set corresponding to each device activity data pair is obtained based on the newly added method nodes and method abnormal nodes, including: filtering redundant nodes in the newly added method nodes and method abnormal nodes, and using the filtered nodes as the target node set corresponding to each device activity data pair.
[0116] In one example, since the amount of data of the found valid nodes (i.e., newly added method nodes and method exception nodes) is large, the redundant nodes in the found nodes can be filtered to obtain accurate and refined analysis results, i.e., the target node set. For example, the redundant nodes in the newly added method nodes, time-consuming exception nodes, and call exception nodes can be filtered according to the preset filtering information.
[0117] The technical solution of this embodiment can obtain accurate and concise analysis results by filtering the redundant nodes in the newly added method nodes and the method abnormal nodes, and then using the filtered nodes as the target node set corresponding to each device activity data pair.
[0118] In an exemplary embodiment, the method abnormal node may include a time-consuming abnormal node and a call abnormal node, and the redundant nodes in the newly added method node and the method abnormal node are filtered, including: filtering the redundant nodes in the time-consuming abnormal node according to the preset first filtering information to obtain a first filtering result; filtering the redundant nodes in the newly added method node and the call abnormal node according to the preset second filtering information to obtain a second filtering result; filtering the redundant nodes in the first filtering result and the second filtering result according to the preset third filtering information to obtain a filtered node.
[0119] In the specific implementation, for abnormal nodes, if the increase in the parent node's time consumption is caused by the increase in the time consumption of a single child node, it means that the parent node is a redundant node, and only the child node needs to be retained; if the increase in the time consumption of multiple child nodes causes the increase in the parent node's time consumption, the increase in the time consumption of each child node can be determined by the proportion of the total increase in the time consumption. If it is greater than 50%, it means that the increase in the time consumption of the child node accounts for a large proportion, and the child node is retained. Consider the increase in the time consumption of the remaining child nodes, and filter out the child nodes with an increase in the time consumption of less than 5ms; if the increase in the time consumption of multiple child nodes is relatively even, the parent node will continue to be retained. For newly added method nodes and call abnormal nodes, only the root nodes corresponding to the newly added method nodes and call abnormal nodes can be retained, and the child nodes do not need to be retained.
[0120] After obtaining the first filtering result for time-consuming abnormal nodes and the second filtering result for new method nodes and calling abnormal nodes, it is also possible to determine whether there are nodes corresponding to preset system methods in the first filtering result and the second filtering result, as well as nodes whose time consumption is less than a preset threshold. For example, if an ultra-small method takes less than 5ms to execute, the nodes corresponding to the preset system methods and the nodes whose time consumption is less than the preset threshold can be filtered, and the filtered nodes can be obtained.
[0121] The technical solution of this embodiment obtains a first filtering result by filtering redundant nodes in time-consuming abnormal nodes according to a preset first filtering information, and obtains a second filtering result by filtering redundant nodes in newly added method nodes and calling abnormal nodes according to a preset second filtering information, and then obtains filtered nodes by filtering redundant nodes in the first filtering result and the second filtering result according to a preset third filtering information, thereby obtaining accurate and concise analysis results.
[0122] In an exemplary embodiment, the intersection between the target node sets corresponding to the activity data of each device is obtained to obtain the time consumption anomaly analysis result for the target application, including: obtaining each target node set obtained by using devices of different models as the target device, and determining the intersection node between each target node set; and using the intersection node as the time consumption anomaly analysis result for the target application.
[0123] In one example, by taking the intersection of multiple sets of comparison results (i.e., obtaining the sets of target nodes obtained by obtaining devices of different models as target devices), the intersection of analysis results, such as the intersection node, can be obtained based on the analysis results of multiple Systrace information, and the intersection node can then be used as a time-consuming anomaly analysis result for the target application.
[0124] For example, if three target node sets are obtained, namely target node set A, target node set B, and target node set C, an intersection set D can be defined. Then, with target node set A as the basic data, by traversing any node in target node set A, if the target node set B and target node set C have the same node data as the target node set A, the same nodes can be added to the intersection set D. Then, based on the intersection set D, the time-consuming exception analysis results of taking the intersection can be obtained, thereby eliminating the impact of different models of equipment and accurately finding out the cause of the time-consuming exception when starting the application.
[0125] The technical solution of this embodiment, by obtaining the target node sets obtained by using devices of different models as target devices, determines the intersection nodes between the target node sets, and then uses the intersection nodes as the time-consuming anomaly analysis results for the target application, can eliminate the influence of different models of devices and obtain accurate and effective analysis results.
[0126] Figure 4 is a flowchart of another method for processing program data according to an exemplary embodiment. Figure 4 As shown, the method is used in a computer device such as a terminal, and includes the following steps.
[0127] In step S410, at least two sets of device activity data pairs are obtained; the device activity data pairs include reference data stored in a first tree structure and target data stored in a second tree structure, the reference application and the target application are the same application of different versions, and the target devices corresponding to different sets of device activity data pairs are devices of different models. In step S420, for any set of device activity data pairs, the node information corresponding to each node in the first tree structure and the second tree structure is compared to obtain the difference in identification information and method information between the first tree structure and the second tree structure. In step S430, for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, any node is used as a newly added method node. In step S440, the identical nodes between the first tree structure and the second tree structure are determined. In step S450, in the first tree structure and the second tree structure, if the number of nodes of a certain identical node is both 1, the time consumption of a certain identical node in the first tree structure and the second tree structure is compared, and a certain identical node in the second tree structure that meets the first preset condition is used as a time-consuming abnormal node. In step S460, in the first tree structure and the second tree structure, if there are multiple nodes of the same node, the number of calls and / or time consumption of the same node in the first tree structure and the second tree structure are compared, and the same node that meets the second preset condition in the second tree structure is used as a time-consuming abnormal node, and the same node that meets the third preset condition in the second tree structure is used as a call abnormal node. In step S470, the redundant nodes in the newly added method nodes and the method abnormal nodes are filtered, and the filtered nodes are used as the target node set corresponding to each device activity data pair. In step S480, the intersection between the target node sets corresponding to each device activity data pair is obtained to obtain the time-consuming abnormal analysis results for the target application. It should be noted that the specific limitations of the above steps can be found in the specific limitations of a program data processing method above, which will not be repeated here.
[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0129] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0130] Based on the same inventive concept, an embodiment of the present disclosure also provides a program data processing device for implementing the program data processing method involved above.
[0131] Figure 5 is a block diagram of a program data processing device according to an exemplary embodiment. Figure 5 , the device comprises:
[0132] The device activity data pair acquisition unit 501 is configured to execute acquisition of at least two groups of device activity data pairs; the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used to characterize the stack relationship and time consumption of each method in the benchmark application called by the target device, the second tree structure is used to characterize the stack relationship and time consumption of each method in the target application called by the target device, the benchmark application and the target application are different versions of the same application, and the target devices corresponding to different groups of the device activity data pairs are devices of different models;
[0133] The target node set obtaining unit 502 is configured to compare the node differences between the first tree structure and the second tree structure for any set of the device activity data pairs, and obtain the target node set corresponding to each of the device activity data pairs; the nodes in the target node set are used to represent the methods that are called by the target device during the execution of the target application and have time-consuming anomalies;
[0134] The intersection determination unit 503 is configured to execute the acquisition of the intersection between the target node sets corresponding to the device activity data pairs, and obtain the time consumption anomaly analysis result for the target application.
[0135] In one possible implementation, the device activity data pair acquisition unit 501 is specifically configured to execute acquisition of benchmark data and target data corresponding to the target device; the benchmark data is the device activity data generated when the target device runs the benchmark application, and the target data is the device activity data generated when the target device runs the target application; the first tree structure is constructed using the benchmark data according to the execution stack of each method in the benchmark application called by the target device; the second tree structure is constructed using the target data according to the execution stack of each method in the target application called by the target device; wherein each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for characterizing the node position and stack relationship, and method information for characterizing the running status and time consumption of the called method.
[0136] In one possible implementation, the target node set obtaining unit 502 is specifically configured to perform a comparison for any group of the device activity data pairs, based on the node information corresponding to each node in the first tree structure and the second tree structure, to obtain the identification information difference and method information difference between the first tree structure and the second tree structure; determine a newly added method node from the second tree structure based on the identification information difference between the first tree structure and the second tree structure; determine a method abnormal node from the second tree structure based on the method information difference between the first tree structure and the second tree structure; and obtain a target node set corresponding to each of the device activity data pairs based on the newly added method node and the method abnormal node.
[0137] In a possible implementation, the target node set obtaining unit 502 is specifically configured to execute, for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, then use the any node as a newly added method node.
[0138] In a possible implementation, the abnormal nodes of the method include time-consuming abnormal nodes and call abnormal nodes, and the target node set obtaining unit 502 is specifically configured to execute determination of the same nodes between the first tree structure and the second tree structure; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, the time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the first preset condition in the second tree structure is used as the time-consuming abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, the number of calls and / or time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the second preset condition in the second tree structure is used as the time-consuming abnormal node, and a certain same node that meets the third preset condition in the second tree structure is used as the call abnormal node.
[0139] In a possible implementation, the target node set obtaining unit 502 is specifically configured to filter the redundant nodes in the newly added method nodes and the method abnormal nodes, and use the filtered nodes as the target node set corresponding to each of the device activity data pairs.
[0140] In a possible implementation, the method abnormal node includes a time-consuming abnormal node and a call abnormal node, and the target node set obtaining unit 502 is specifically configured to perform filtering of redundant nodes in the time-consuming abnormal node according to a preset first filtering information to obtain a first filtering result; filter the redundant nodes in the newly added method node and the call abnormal node according to a preset second filtering information to obtain a second filtering result; filter the redundant nodes in the first filtering result and the second filtering result according to a preset third filtering information to obtain the filtered node.
[0141] In one possible implementation, the intersection determination unit 503 is specifically configured to execute the acquisition of each target node set obtained by using devices of different models as target devices, determine the intersection node between each target node set; and use the intersection node as a time-consuming anomaly analysis result for the target application.
[0142] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0143] Each module in the above program data processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0144] Figure 6 1 is a block diagram of an electronic device 600 for implementing a program data processing method according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0145] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0146] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0147] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.
[0148] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0149] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0150] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting an audio signal.
[0151] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0152] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or the electronic device 600 component, the presence or absence of contact between the user and the electronic device 600, the device 600 orientation or acceleration / deceleration and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0153] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0154] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0155] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the above instructions can be executed by the processor 620 of the electronic device 600 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0156] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by the processor 620 of the electronic device 600 to complete the above method.
[0157] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.
[0158] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0159] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A program data processing method, characterized in that: The method comprises: Acquire at least two groups of device activity data pairs; the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure; including: acquiring benchmark data and target data corresponding to a target device, the benchmark data being device activity data generated when the target device runs a benchmark application, the target data being device activity data generated when the target device runs a target application, constructing a first tree structure using the benchmark data according to the execution stack of each method in the benchmark application called by the target device, and constructing a second tree structure using the target data according to the execution stack of each method in the target application called by the target device; each node in the first tree structure and the second tree structure has corresponding node information, the node information includes identification information for characterizing node positions and stack relationships, and method information for characterizing the running status and time consumption of the called method; the benchmark application and the target application are the same application of different versions, and the target devices corresponding to different groups of the device activity data pairs are devices of different models; For any group of the device activity data pairs, node information corresponding to each node in the first tree structure and the second tree structure is compared to obtain identification information differences and method information differences between the first tree structure and the second tree structure; a newly added method node is determined from the second tree structure according to the identification information differences between the first tree structure and the second tree structure; a method abnormality node is determined from the second tree structure according to the method information differences between the first tree structure and the second tree structure; a target node set corresponding to each of the device activity data pairs is obtained according to the newly added method node and the method abnormality node; the nodes in the target node set are used to characterize methods with time-consuming abnormalities that are called by the target device during the execution of the target application; The intersection between the target node sets corresponding to the device activity data pairs is obtained to obtain the time consumption anomaly analysis result for the target application.
2. The method according to claim 1, characterized in that The determining a newly added method node from the second tree structure according to a difference in identification information between the first tree structure and the second tree structure includes: For any node in the second tree structure, if it is detected that there is no node identical to the any node in the first tree structure, the any node is used as a newly added method node.
3. The method according to claim 1, characterized in that The method abnormal node includes a time-consuming abnormal node and a call abnormal node, and the determining the method abnormal node from the second tree structure according to the method information difference between the first tree structure and the second tree structure includes: Determine the same nodes between the first tree structure and the second tree structure; In the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, compare the time consumption of the certain same node in the first tree structure and the second tree structure, and use a certain same node that meets the first preset condition in the second tree structure as the abnormal time consumption node; In the first tree structure and the second tree structure, if there are multiple nodes of the same node, the number of calls and / or time consumption of the same node in the first tree structure and the second tree structure are compared, and the same node that meets the second preset condition in the second tree structure is used as the time-consuming abnormal node, and the same node that meets the third preset condition in the second tree structure is used as the call abnormal node.
4. The method according to claim 1, characterized in that: The obtaining, according to the newly added method node and the method abnormality node, a target node set corresponding to each of the device activity data pairs includes: The redundant nodes in the newly added method nodes and the method abnormal nodes are filtered, and the filtered nodes are used as the target node set corresponding to each of the device activity data pairs.
5. The method according to claim 4, characterized in that The method abnormal nodes include time-consuming abnormal nodes and call abnormal nodes, and filtering the newly added method nodes and redundant nodes in the method abnormal nodes includes: According to the preset first filtering information, the redundant nodes in the abnormal time-consuming nodes are filtered to obtain a first filtering result; According to the preset second filtering information, the newly added method node and the redundant nodes in the call abnormal node are filtered to obtain a second filtering result; According to the preset third filtering information, the redundant nodes in the first filtering result and the second filtering result are filtered to obtain the filtered nodes.
6. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining the intersection of the target node sets corresponding to the device activity data pairs to obtain the time consumption anomaly analysis result for the target application program includes: Acquire the target node sets obtained by using devices of different models as target devices, and determine the intersection nodes between the target node sets; The intersection node is used as a time-consuming exception analysis result for the target application.
7. A program data processing device, characterized in that: The device comprises: A device activity data pair acquisition unit is configured to execute acquisition of at least two groups of device activity data pairs; the device activity data pairs include benchmark data stored in a first tree structure and target data stored in a second tree structure; specifically configured to execute acquisition of benchmark data and target data corresponding to a target device, the benchmark data being device activity data generated when the target device runs a benchmark application, the target data being device activity data generated when the target device runs a target application, the first tree structure is constructed using the benchmark data according to the execution stack of each method in the benchmark application called by the target device, the second tree structure is constructed using the target data according to the execution stack of each method in the target application called by the target device, each node in the first tree structure and the second tree structure has corresponding node information, the node information includes identification information for characterizing node positions and stack relationships, and method information for characterizing the running status and time consumption of the called method; the benchmark application and the target application are the same application of different versions, and the target devices corresponding to different groups of device activity data pairs are devices of different models; a target node set obtaining unit configured to perform, for any group of the device activity data pairs, a comparison based on the node information corresponding to each node in the first tree structure and the second tree structure, to obtain the difference in identification information and method information between the first tree structure and the second tree structure, to determine a newly added method node from the second tree structure based on the difference in identification information between the first tree structure and the second tree structure, to determine a method abnormality node from the second tree structure based on the method information difference between the first tree structure and the second tree structure, and to obtain a target node set corresponding to each of the device activity data pairs based on the newly added method node and the method abnormality node; the nodes in the target node set are used to characterize the method with time-consuming abnormality that is called by the target device during the execution of the target application; The intersection determination unit is configured to execute the acquisition of the intersection between the target node sets corresponding to each of the device activity data pairs, and obtain the time consumption anomaly analysis result for the target application.
8. The device according to claim 7, characterized in that The target node set obtaining unit is specifically configured to execute, for any node in the second tree structure, if it is detected that there is no node identical to any node in the first tree structure, then use any node as a newly added method node.
9. The device according to claim 7, characterized in that The abnormal nodes of the method include time-consuming abnormal nodes and call abnormal nodes, and the target node set obtaining unit is specifically configured to execute determination of the same nodes between the first tree structure and the second tree structure; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is 1, the time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the first preset condition in the second tree structure is used as the time-consuming abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, the number of calls and / or time consumption of the certain same node in the first tree structure and the second tree structure is compared, and a certain same node that meets the second preset condition in the second tree structure is used as the time-consuming abnormal node, and a certain same node that meets the third preset condition in the second tree structure is used as the call abnormal node.
10. The device according to claim 7, characterized in that The target node set obtaining unit is specifically configured to filter the redundant nodes in the newly added method nodes and the method abnormal nodes, and use the filtered nodes as the target node set corresponding to each of the device activity data pairs.
11. The device according to claim 10, characterized in that The method abnormal node includes a time-consuming abnormal node and a call abnormal node, and the target node set obtaining unit is specifically configured to perform filtering on redundant nodes in the time-consuming abnormal node according to the preset first filtering information to obtain a first filtering result; and filter on redundant nodes in the newly added method node and the call abnormal node according to the preset second filtering information to obtain a second filtering result; According to the preset third filtering information, the redundant nodes in the first filtering result and the second filtering result are filtered to obtain the filtered nodes.
12. The device according to any one of claims 7 to 11, characterized in that The intersection determination unit is specifically configured to execute the acquisition of each target node set obtained by using devices of different models as target devices, determine the intersection node between each target node set; and use the intersection node as a time-consuming anomaly analysis result for the target application.
13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the program data processing method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the program data processing method according to any one of claims 1 to 6.
15. A computer program product, comprising instructions, characterized in that: When the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the program data processing method according to any one of claims 1 to 6.
