CN114936040A - Program data processing method, program data processing device, electronic device, and storage medium - Google Patents

Program data processing method, program data processing device, electronic device, and storage medium Download PDF

Info

Publication number
CN114936040A
CN114936040A CN202210611277.2A CN202210611277A CN114936040A CN 114936040 A CN114936040 A CN 114936040A CN 202210611277 A CN202210611277 A CN 202210611277A CN 114936040 A CN114936040 A CN 114936040A
Authority
CN
China
Prior art keywords
tree structure
node
target
activity data
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210611277.2A
Other languages
Chinese (zh)
Inventor
张炜雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210611277.2A priority Critical patent/CN114936040A/en
Publication of CN114936040A publication Critical patent/CN114936040A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure relates to a program data processing method, apparatus, electronic device, storage medium and computer program product, the method comprising: acquiring at least two sets of equipment activity data pairs; the equipment activity data pairs comprise reference data stored in a first tree structure and target data stored in a second tree structure, and the target equipment corresponding to the equipment activity data pairs in different groups is equipment of different models; comparing the node difference between the first tree structure and the second tree structure aiming at any group of equipment activity data pairs to obtain a target node set corresponding to each equipment activity data pair; the nodes in the target node set are used for representing a method which is called by target equipment and has time-consuming abnormity in the process of executing the target application program; and acquiring the intersection of the activity data of each device to the corresponding target node set to obtain a time-consuming abnormity analysis result for the target application program. By adopting the method, the program data analysis efficiency can be improved, and errors are avoided to obtain accurate analysis results.

Description

Program data processing method, program data processing device, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a program data processing method and apparatus, an electronic device, a storage medium, and a computer program product.
Background
Systrace is a tool for recording equipment activities in a short term, data information related to equipment, such as information of a CPU (central processing unit) scheduler, disk activities and application threads, is summarized in Systrace information generated by the tool, and a developer can analyze the performance of the equipment by grabbing the Systrace information of the equipment.
In the traditional method, the performance of the equipment is analyzed in a mode of manually comparing Systrace information, but huge analysis workload is caused due to huge method amount involved in the Systrace information, and time and labor are consumed for manual analysis.
Therefore, there is a problem in the related art that it is inefficient to analyze the program operation data.
Disclosure of Invention
The present disclosure provides a program data processing method, apparatus, electronic device, storage medium, and computer program product, to at least solve the problem of inefficient analysis of program operation data in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a program data processing method including:
acquiring at least two sets of equipment activity data pairs; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target devices, the second tree structure is used for representing the stack relation and the time consumption situation of each method in the target application program called by the target devices, the reference application program and the target application program are the same application program with different versions, and target devices corresponding to different groups of device activity data pairs are devices with different models;
comparing the node difference between the first tree structure and the second tree structure aiming at any group of equipment activity data pairs to obtain a target node set corresponding to each equipment activity data pair; the nodes in the target node set are used for representing a method with time-consuming exception called by the target device in the process of executing the target application program;
and acquiring the intersection of the corresponding target node sets of the equipment activity data pairs to obtain a time-consuming abnormity analysis result aiming at the target application program.
In one possible implementation, the obtaining at least two sets of device activity data pairs includes:
acquiring reference data and target data corresponding to target equipment; the benchmark data is device activity data generated when the target device runs the benchmark application program, and the target data is device activity data generated when the target device runs the target application program;
calling an execution stack of each method in the reference application program according to the target equipment, and constructing the first tree structure by adopting the reference data;
calling an execution stack of each method in the target application program according to the target equipment, and constructing the second tree structure by adopting the target data;
each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for representing a node position and a stack relation, and method information for representing a running state and a time-consuming situation of the called method.
In one possible implementation manner, the comparing, for any group of the device activity data pairs, node differences between the first tree structure and the second tree structure to obtain a target node set corresponding to each device activity data pair includes:
for any group of equipment activity data pairs, comparing node information corresponding to each node in the first tree structure and the second tree structure to obtain identification information difference and method information difference between the first tree structure and the second tree structure;
determining a new method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure;
determining method abnormal nodes from the second tree structure according to the method information difference between the first tree structure and the second tree structure;
and obtaining a target node set corresponding to each equipment activity data pair according to the newly added method node and the method abnormal node.
In one possible implementation manner, the determining, according to the identification information difference between the first tree structure and the second tree structure, a new method node from the second tree structure includes:
and aiming at any node in the second tree structure, if the fact that the same node as the any node does not exist in the first tree structure is detected, taking the any node as a new method node.
In one possible implementation manner, the determining a method exception node from the second tree structure according to the method information difference between the first tree structure and the second tree structure includes:
determining a 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 the nodes of a same node is 1, comparing the time consumption situations of the same node in the first tree structure and the second tree structure, and taking the same node meeting a first preset condition in the second tree structure as the time consumption abnormal node;
in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, comparing the number of times of calling and/or the time consumption of the certain same node in the first tree structure and the second tree structure, using the certain same node meeting a second preset condition in the second tree structure as the time consumption abnormal node, and using the certain same node meeting a third preset condition in the second tree structure as the calling abnormal node.
In a possible implementation manner, the obtaining, according to the newly-added method node and the method abnormal node, a target node set corresponding to each device activity data pair includes:
and filtering redundant nodes in the newly-added method nodes and the method abnormal nodes, and taking the filtered nodes as a target node set corresponding to each equipment activity data pair.
In one possible implementation manner, the method exception node includes a time-consuming exception node and a calling exception node, and the filtering the redundant node in the newly-added method node and the method exception node includes:
filtering redundant nodes in the time-consuming abnormal nodes according to preset first filtering information to obtain a first filtering result;
filtering the redundant nodes in the newly added method node and the calling abnormal node according to preset second filtering information to obtain a second filtering result;
and filtering redundant nodes in the first filtering result and the second filtering result according to preset third filtering information to obtain the filtered nodes.
In a possible implementation manner, the obtaining an intersection between target node sets corresponding to each device activity data pair to obtain a time-consuming exception analysis result for the target application includes:
acquiring each target node set obtained by taking equipment of different models as target equipment, and determining intersection nodes among the target node sets;
and taking the intersection node as a time-consuming abnormity analysis result aiming at the target application program.
According to a second aspect of the embodiments of the present disclosure, there is provided a program data processing apparatus including:
a device activity data pair acquisition unit configured to perform acquisition of at least two sets of device activity data pairs; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target devices, the second tree structure is used for representing the stack relation and the time consumption situation of each method in the target application program called by the target devices, the reference application program and the target application program are the same application program with different versions, and target devices corresponding to different groups of device activity data pairs are devices with different models;
a target node set obtaining unit configured to perform comparison of node differences between the first tree structure and the second tree structure for any group of the device activity data pairs to obtain a target node set corresponding to each device activity data pair; the nodes in the target node set are used for representing a method with time-consuming exception called by the target device in the process of executing the target application program;
and the intersection determining unit is configured to perform acquisition of an intersection between target node sets corresponding to the equipment activity data pairs to obtain a time-consuming abnormity analysis result for the target application program.
In one possible implementation manner, the device activity data pair obtaining unit is specifically configured to perform obtaining of reference data and target data corresponding to a target device; the benchmark data is device activity data generated when the target device runs the benchmark application program, and the target data is device activity data generated when the target device runs the target application program; calling an execution stack of each method in the reference application program according to the target equipment, and constructing the first tree structure by adopting the reference data; calling an execution stack of each method in the target application program according to the target equipment, and constructing the second tree structure by adopting the target data; each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for representing a node position and a stack relation, and method information for representing a running state and a time-consuming situation of the called method.
In a possible implementation manner, the target node set obtaining unit is specifically configured to execute comparison between node information corresponding to each node in the first tree structure and the second tree structure, and obtain an identification information difference and a method information difference between the first tree structure and the second tree structure, for any group of the device activity data pairs; determining a new method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure; determining 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 obtaining a target node set corresponding to each equipment activity data pair according to the newly added method node and the method abnormal node.
In a possible implementation manner, the target node set obtaining unit is specifically configured to execute, with respect to any node in the second tree structure, if it is detected that a node identical to the any node does not exist in the first tree structure, taking the any node as a new method node.
In a possible implementation manner, the method exception node includes a time-consuming exception node and a calling exception node, and the target node set obtaining unit is specifically configured to perform 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 the nodes of a certain same node is 1, comparing the time consumption situation of the certain same node in the first tree structure and the second tree structure, and taking the certain same node meeting a first preset condition in the second tree structure as the time consumption abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, comparing the number of times of calling and/or the time consumption of the certain same node in the first tree structure and the second tree structure, using the certain same node meeting a second preset condition in the second tree structure as the time consumption abnormal node, and using the certain same node meeting a third preset condition in the second tree structure as the calling abnormal node.
In a possible implementation manner, the target node set obtaining unit is specifically configured to perform filtering on redundant nodes in the newly-added method node and the method abnormal node, and use the filtered nodes as a target node set corresponding to each device activity data pair.
In a possible implementation manner, the method includes a time-consuming exception node and a calling exception node, and the target node set obtaining unit is specifically configured to perform filtering on a redundant node in the time-consuming exception node according to preset first filtering information to obtain a first filtering result; filtering the redundant nodes in the newly added method node and the calling abnormal node according to preset second filtering information to obtain a second filtering result; and filtering redundant nodes in the first filtering result and the second filtering result according to preset third filtering information to obtain the filtered nodes.
In a possible implementation manner, the intersection determining unit is specifically configured to perform acquiring each target node set obtained by using devices of different models as target devices, and determine an intersection node between each target node set; and taking the intersection node as a time-consuming abnormity analysis result aiming at the target application program.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the program data processing method according to any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the program data processing method according to any one of the above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the program data processing method according to any one of the above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the scheme includes that at least two groups of equipment activity data pairs are obtained, the equipment activity data pairs comprise reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target equipment, the second tree structure is used for representing the stack relation and the time consumption situation of each method in a target application program called by the target equipment, the reference application program and the target application program are the same application program with different versions, the target equipment corresponding to the equipment activity data pairs with different groups are equipment of different models, then node differences between the first tree structure and the second tree structure are compared aiming at any group of equipment activity data pairs, a target node set corresponding to each equipment activity data pair is obtained, and nodes in the target node set are used for representing the method with time consumption abnormity called by the target equipment in the process of executing the target application program, and further acquiring the intersection of the activity data of each device to the corresponding target node set to obtain a time-consuming abnormity analysis result for the target application program. Therefore, the node difference between the first tree structure and the second tree structure can be automatically analyzed and compared according to the reference data stored in the equipment activity data pairs and the target data stored in the second tree structure to obtain a target node set, the program data analysis efficiency is improved, time-consuming abnormal analysis results can be determined according to the intersection between different equipment activity data pairs, and errors can be avoided to obtain accurate analysis results.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating a method of program data processing according to an exemplary embodiment.
FIG. 2a is a schematic diagram illustrating a program data analysis flow according to an exemplary embodiment.
FIG. 2b is a diagram illustrating a tree structure in accordance with an exemplary embodiment.
FIG. 3 is a flowchart illustrating a target node set derivation step in accordance with an exemplary embodiment.
FIG. 4 is a flowchart illustrating another method of program data processing according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating a program data processing apparatus according to an example embodiment.
FIG. 6 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure.
It should be further 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 for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Fig. 1 is a flowchart illustrating a program data processing method according to an exemplary embodiment, and as shown in fig. 1, this embodiment is illustrated by applying the method to a terminal, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the following steps.
In step S110, at least two sets of device activity data pairs are obtained; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure;
the reference data and the target data can be obtained according to the collected Systrace information, the first tree structure can be used for representing the stack relation and the time consumption situation of each method in the target device calling reference application program, and the second tree structure can be used for representing the stack relation and the time consumption situation of each method in the target device calling target application program; the first tree structure may be composed of a plurality of multi-way tree structures, which may be obtained according to the execution stack structures of the methods in the target device call reference application program, and similarly, the second tree structure may be composed of a plurality of multi-way tree structures, which may be obtained according to the execution stack structures of the methods in the target device call target application program.
For example, the multi-way tree structure may be a data storage structure, which may include multiple layers of nodes, where a parent-child relationship exists between two layers of nodes, and a call relationship exists between methods corresponding to the nodes. Taking a multi-branch tree structure including three layers of data as an example, the multi-branch tree structure may sequentially be a first layer root node, a second layer node and a third layer node, where the second layer node is a parent node of the third layer node, the third layer node data is a child node of the second layer node, the parent node may have related information of all child nodes to which the parent node belongs, and a method corresponding to the parent node may invoke a method corresponding to the child node to which the parent node belongs.
As an example, the benchmark application and the target application are different versions of the same application; the target devices corresponding to the different sets of device activity data pairs may be devices of different models, or may obtain multiple sets of device activity data pairs for the devices of different models.
In practical application, at least two groups of equipment activity data pairs can be acquired through the collected Systrace information of different types of equipment, and each group of equipment activity data pair can comprise reference data stored in a first tree structure and target data stored in a second tree structure so as to further perform analysis and comparison according to the first tree structure and the second tree structure.
Specifically, the systlace information including data information related to the device, such as information of a CPU scheduler, disk activity, and application threads, may be acquired based on a systlace tool used to record device activities in a short period, and device performance, such as an application start event, an application running condition, and the like, may be analyzed by capturing the systlace information of the device.
In an example, as functions of an application program in a terminal device become richer, more and more tasks need to be completed by the application program in a starting stage, an increase in the number of tasks may cause a slow starting speed and an increased time consumption of the application program in the terminal device, and in order to analyze a reason that an application program starting event is slow, a comparison may be performed on starting performance of the application program based on sysstrace information to determine a reason for an abnormal time consumption of the application program starting, such as that an execution time of a called method becomes longer, a method is newly added, and the like.
For example, as shown in fig. 2a, taking a start event of an application as an example, a device of the same model may be used as a target device, and a set of device activity data pairs (e.g., group a in fig. 2 a) may be obtained for a reference application (e.g., application a that consumes normal time when started) and a target application (e.g., application a that consumes abnormal time when started), which may include reference data obtained according to reference sysstrace information and target data obtained according to target sysstrace information, and may be further structured based on a data storage structure to obtain reference data stored in a first tree structure and target data stored in a second tree structure.
In an optional embodiment, by preprocessing the obtained sysstrace information file, the device activity data in the non-application program a start stage may be excluded, and further, subsequent application program start performance analysis may be performed based on the preprocessed data, so that program data analysis efficiency may be improved, as shown in fig. 2a, the preprocessed data may include all processes and thread information of an application program a start event, root node mapping corresponding to each thread, node mapping corresponding to each stage of the start event, all thread information of a main process, a repeatedly occurring slice node set (e.g., a repeatedly occurring method set), and may also include other related information of the device, which is not limited in this embodiment.
In step S120, comparing node differences between the first tree structure and the second tree structure for any group of device activity data pairs to obtain a target node set corresponding to each device activity data pair;
the nodes in the target node set may be used to represent a method called by the target device during execution of the target application program, where the method is a method in which the execution time is lengthened, a method in which the nodes in the target node set are newly added, and the like, so that the target application program is started in an abnormal time-consuming manner.
In a specific implementation, for any group of device activity data pairs, by comparing the node difference between the first tree structure and the second tree structure, the node corresponding to the method that consumes time and is abnormal in the process of executing the target application program can be found, and then the target node set corresponding to each device activity data pair can be obtained according to the found node.
In an example, as shown in fig. 2a, taking a start event of an application as an example, for a set of device activity data pairs (e.g., group a in fig. 2 a) obtained by a reference application (e.g., application a that consumes normal time for starting) and a target application (e.g., application a that consumes abnormal time for starting), that is, reference data stored in a first tree structure and target data stored in a second tree structure, a target node set (e.g., group a analysis result in fig. 2 a) corresponding to each device activity data pair may be obtained by comparing node differences between the first tree structure and the second tree structure.
In an optional embodiment, a node corresponding to a method with time-consuming abnormity in the process of executing a target application program can be found by adopting a mode of comparing the same tree nodes, so that redundant nodes in the node can be filtered and found, and the filtered node is used as a target node set corresponding to each equipment activity data pair, so that an accurate and refined analysis result can be obtained.
For example, as shown in fig. 2a, for the group a analysis result, that is, the group a device activity data pair corresponding target node set, it may include method information (including a thread analysis result) that consumes an increased amount of time (e.g., including a thread analysis result), newly-added method information (including a thread analysis result), and the like, and may also include a thread analysis result, a repeat method analysis result, and the like corresponding to a start event based on the method that consumes an increased amount of time and/or the newly-added method.
In step S130, an intersection between the target node sets corresponding to the device activity data pairs is obtained, so as to obtain a time-consuming anomaly analysis result for the target application program.
In practical application, the target node sets corresponding to the active data pairs of each device can be obtained, intersection sets can be further collected for the target node sets to obtain intersection collecting results, the intersection collecting results are used as time-consuming abnormity analysis results for a target application program, and if intersection sets are collected through multiple sets of comparison results (namely the target node sets), analysis result intersection sets can be obtained based on analysis results of multiple sets of Systrace information, and therefore errors can be reduced.
For example, as shown in fig. 2a, taking a start event of an application as an example, by analyzing multiple sets of sysstrace information (e.g., the a set, the B set, and the C set in fig. 2 a), an intersection operation may be performed according to multiple sets of analysis results, so as to obtain an intersection of the analysis results (e.g., an intersection node).
Compared with the traditional method, the Systrace information is manually compared, time-consuming analysis results are manually counted, the efficiency is low, and manual analysis consumes time and labor; according to the technical scheme, the time-consuming abnormity analysis result aiming at the target application program can be obtained by automatically analyzing and comparing Systrace information according to the reference data stored in the first tree structure and the target data stored in the second tree structure in the equipment activity data pair, so that the analysis efficiency can be improved, and the accurate result can be obtained. Compared with the traditional method that only one group of Systrace information is analyzed, due to the fact that the operating environments of application programs are different, the result of a single group of Systrace information has deviation, and the analysis result is inaccurate; according to the technical scheme, by analyzing the multiple sets of Systrace information and performing intersection operation on the analysis result, the time-consuming abnormal analysis result can be determined according to the intersection between different equipment activity data pairs, error generation is reduced, and the accuracy of the analysis result is improved.
In the program data processing method, at least two groups of equipment activity data pairs are obtained, the equipment activity data pairs comprise reference data stored in a first tree structure and target data stored in a second tree structure, the reference application program and the target application program are the same application program with different versions, target equipment corresponding to equipment activity data pairs in different groups are equipment of different models, then node differences between the first tree structure and the second tree structure are compared for any group of equipment activity data pairs to obtain a target node set corresponding to each equipment activity data pair, intersection between the target node sets corresponding to each equipment activity data pair is further obtained, and a time-consuming abnormity analysis result for the target application program is obtained. Therefore, the node difference between the first tree structure and the second tree structure can be automatically analyzed and compared according to the reference data stored in the equipment activity data pairs and the target data stored in the second tree structure to obtain a target node set, the program data analysis efficiency is improved, time-consuming abnormal analysis results can be determined according to the intersection between different equipment activity data pairs, and errors can be avoided to obtain accurate analysis results.
In an exemplary embodiment, obtaining at least two sets of device activity data pairs comprises: acquiring reference data and target data corresponding to target equipment; calling an execution stack of each method in a reference application program according to target equipment, and constructing a first tree structure by adopting reference data; and constructing a second tree structure by adopting the target data according to the execution stack of each method in the target application program called by the target equipment.
The reference data may be device activity data generated when the target device runs the reference application, and the target data may be device activity data generated when the target device runs the target application, for example, the reference application may be an application a that consumes normal time when started, and the target application may be an application a that consumes abnormal time when started.
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 a node position and a stack relationship, and method information for characterizing a running state and a time-consuming situation of the called method.
In practical application, taking a start event of an application program as an example, a device of the same model may be used as a target device, a reference sysstrace information file and a target sysstrace information file corresponding to the target device are obtained, for example, the sysstrace information may be an HTML file, which may include information such as running states (such as start and end), time duration, and a timestamp of all methods called by the device, and then, a preset sysstrace information file processing tool may be used to convert the HTML file into a database, so that unrelated data in the database may be converted into a slice tree structure, that is, an execution stack of methods, where each method in the tree structure 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 may be used to determine a node position and a stack relationship.
In an example, as shown in fig. 2b, taking a multi-branch tree structure including three layers of data as an example, the slice node ids may sequentially increase from the first-layer root node to the second-layer node and then to the third-layer node from left to right, during comparison, node traversal may also be performed according to the increasing order, for example, as shown in the traversal order 1-7 in fig. 2b, when parent node id is null, it is the root node of each tree structure, then based on the slice node id and parent node id of each node, as shown in fig. 2b, 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, node a is a parent node of node C, node D, node E, and node F, and a multi-branch tree structure is constructed, thereby forming a whole tree structure "forest", i.e. the reference data stored in the first tree structure and the target data stored in the second tree structure.
For example, taking a start event of an application as an example, an apparatus a and an apparatus B of the same model may be adopted, the application a consuming normal time is started and run in the apparatus a, the application a consuming abnormal time is started and run in the apparatus B, and a group of apparatus activity data pairs including reference data consuming normal time and target data consuming abnormal time can be acquired by capturing sysstrace information corresponding to the start event of the application a at the same time, so as to further perform comparative analysis on start performance; the device activity data pairs of different groups can be acquired aiming at devices of different types, or can be acquired by devices of the same type, each group of device activity data pairs is independent, the acquisition time of the reference data and the target data contained in each group of device activity data pairs is the same, and the acquisition time of the device activity data pairs of different groups is different; codes corresponding to the reference data collected in each group of equipment activity data pairs are the same (for example, the application A consuming normal starting time is operated), and codes corresponding to the target data collected in each group of equipment activity data pairs are also the same (for example, the application A consuming abnormal starting time is operated).
According to the technical scheme of the embodiment, the reference data and the target data corresponding to the target device are obtained, the execution stacks of the methods in the reference application program are called according to the target device, the first tree structure is constructed by adopting the reference data, the execution stacks of the methods in the target application program are called according to the target device, the second tree structure is constructed by adopting the target data, the first tree structure and the second tree structure can be constructed, and data support is provided for subsequent automatic analysis and comparison of node differences among the tree structures.
In an exemplary embodiment, as shown in fig. 3, for any group of device activity data pairs, comparing node differences between the first tree structure and the second tree structure to obtain a target node set corresponding to each device activity data pair, which may further include the following steps:
in step S310, for any group of device activity data pairs, comparing node information corresponding to each node in the first tree structure and the second tree structure to obtain an identification information difference and a method information difference between the first tree structure and the second tree structure;
as an example, the node information may include identification information and method information, the identification information may include a node id of the node to which the node belongs, a parent node id, and a node hierarchy depth, the method information may include information such as an operating state, a time duration, a timestamp, and the like of the method to which the node belongs, and if the node to which the node belongs has a child node, the method information may further include association information of each child node.
In practical application, for a first tree structure and a second tree structure in any group of device activity data pairs, a same tree node may be used for comparison, and according to node information corresponding to each node in the first tree structure and the second tree structure, an identification information difference and a method information difference between the first tree structure and the second tree structure are found out, for example, the identification information difference may represent that a node which is the same as the second tree structure is not found in the first tree structure, and the method information difference may represent a method time consumption duration difference, a method calling frequency difference, and the like corresponding to the same node between the first tree structure and the second tree structure.
For example, after constructing a method "forest", the same nodes between the first tree structure and the second tree structure can be found out for further node comparison analysis, and the same nodes have the same method name and the same node depth.
In step S320, determining a new method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure;
in an example, if a node identical to any node in the second tree structure is not found in the first tree structure, the node in the second tree structure may be determined as a new method node, for example, based on the new method node, and for starting an application program with time consumption abnormality, the reason for the time consumption abnormality may be determined to include a new method.
In step S330, determining 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;
the method exception node may include a time-consuming exception node (e.g., the time-consuming duration increases) and a call exception node (e.g., the number of method calls increases).
In an example, for a same node between the first tree structure and the second tree structure that is found out, if the same node is not repeated in both the first tree structure and the second tree structure, that is, the number of nodes of the same node in both the first tree structure and the second tree structure is 1, time-consuming duration comparison may be performed according to method information corresponding to the same node in the first tree structure and method information corresponding to the same node in the second tree structure, and then when it is determined that the time-consuming duration of the same node in the second tree structure increases, it may be determined that the node is a time-consuming abnormal node, for example, based on the time-consuming abnormal node, for starting the time-consuming abnormal application program, it may be determined that the time-consuming abnormal cause includes that the execution time of the method increases.
In another example, if the same node is duplicated in the first tree structure and the second tree structure, that is, the number of the same node in the first tree structure and the second tree structure is multiple, it may be determined whether the number of calls of the same node in the first tree structure is the same as the number of calls of the same node in the second tree structure, and then the entire time consumption condition may be calculated when the number of calls is the same, if the entire time consumption duration increases, the node is a time-consuming abnormal node, and when the number of calls of the same node in the second tree structure increases, the node is determined to be a call abnormal node.
In step S340, a target node set corresponding to each device activity data pair is obtained according to the new method node and the method abnormal node.
After the new method nodes and the method abnormal nodes are obtained, redundant nodes in the new method nodes and the method abnormal nodes can be filtered, and then the filtered nodes can be obtained and used as a target node set corresponding to each equipment activity data pair.
According to the technical scheme of the embodiment, for any group of equipment activity data pairs, the identification information difference and the method information difference between the first tree structure and the second tree structure are obtained by comparing the node information corresponding to each node in the first tree structure and the second tree structure, then the newly added method node is determined from the second tree structure according to the identification information difference between the first tree structure and the second tree structure, the method abnormal node is determined from the second tree structure according to the method information difference between the first tree structure and the second tree structure, and further the target node set corresponding to each equipment activity data pair is obtained according to the newly added method node and the method abnormal node, so that the program data analysis efficiency is improved, and accurate analysis results can be obtained.
In an exemplary embodiment, determining a new method node from the second tree structure according to the difference of the identification information between the first tree structure and the second tree structure includes: and aiming at any node in the second tree structure, if the fact that the same node as any node does not exist in the first tree structure is detected, taking any node as a new method node.
In a specific implementation, for any node in the second tree structure, if it is detected that there is no node in the first tree structure that is the same as any node in the second tree structure, if there is no node in the first tree structure that is the same as any node in the second tree structure found, the any node in the second tree structure may be determined as a new method node.
According to the technical scheme of the embodiment, by aiming at any node in the second tree structure, if the fact that the node identical to the node does not exist in the first tree structure is detected, the node is taken as the new method node, the new method node which influences time consumption can be effectively found, and the program data analysis efficiency is improved.
In an exemplary embodiment, the method exception node may include a time-consuming exception node and a calling exception node, and the determining the method exception node from the second tree structure according to the method information difference between the first tree structure and the second tree structure includes: determining identical 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 the nodes of a certain same node is 1, comparing the time consumption situations of the certain same node in the first tree structure and the second tree structure, and taking the certain same node meeting a first preset condition in the second tree structure as a time consumption abnormal node; in the first tree structure and the second tree structure, if the number of the nodes of a same node is multiple, comparing the calling times and/or the time consumption of the same node in the first tree structure and the second tree structure, using the same node meeting a second preset condition in the second tree structure as a time consumption abnormal node, and using the same node meeting a third preset condition in the second tree structure as a calling abnormal node.
In practical application, the same node between the first tree structure and the second tree structure can be determined by comparing the same tree nodes, and then for the found same node 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 comparison can be performed according to 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, and when the time-consuming duration of the same node in the second tree structure is determined to be increased (i.e., a first preset condition), the time-consuming abnormal node can be determined.
If the same node is duplicated in the first tree structure and the second tree structure, that is, the number of the same node in the first tree structure and the second tree structure is multiple, it may be determined whether the number of calls of the same node in the first tree structure is the same as the number of calls of the same node in the second tree structure, and then the entire time consumption condition may be calculated when the number of calls is the same, if the entire time consumption duration increases (that is, the second preset condition), the same node is a time-consuming abnormal node, and when the number of calls of the same node in the second tree structure increases (that is, the third preset condition), the same node is determined as a call abnormal node.
According to the technical scheme, the time-consuming abnormal nodes and the calling abnormal nodes are obtained by determining the same nodes between the first tree structure and the second tree structure according to the condition that the same nodes meet different preset conditions, the time-consuming abnormal nodes can be effectively found out, and the efficiency of program data analysis is improved.
In an exemplary embodiment, obtaining a target node set corresponding to each device activity data pair according to the newly added method node and the method abnormal node includes: and filtering redundant nodes in the newly added method nodes and the method abnormal nodes, and taking the filtered nodes as a target node set corresponding to each equipment activity data pair.
In an example, since the found valid nodes (i.e., the new method nodes and the method abnormal nodes) have a large data volume, the redundant nodes in the found nodes can be filtered to obtain an accurate and refined analysis result, i.e., the target node set, for example, the redundant nodes in the new method nodes, the time-consuming abnormal nodes, and the calling abnormal nodes can be filtered according to the preset filtering information.
According to the technical scheme, the redundant nodes in the newly added method nodes and the method abnormal nodes are filtered, and then the filtered nodes are used as the target node set corresponding to the activity data of each device, so that accurate and refined analysis results can be obtained.
In an exemplary embodiment, the method exception node may include a time-consuming exception node and a calling exception node, and the filtering is performed on redundant nodes in the newly added method node and the method exception node, including: filtering redundant nodes in the time-consuming abnormal nodes according to preset first filtering information to obtain a first filtering result; filtering the redundant nodes in the newly added method node and the calling abnormal node according to preset second filtering information to obtain a second filtering result; and filtering redundant nodes in the first filtering result and the second filtering result according to preset third filtering information to obtain filtered nodes.
In a specific implementation, for a time-consuming abnormal node, if the time-consuming duration of a parent node is increased due to the increase of the time-consuming duration of a single child node, it is indicated that the parent node is a redundant node, and only the child node may be required to be reserved; if the parent node time-consuming duration is increased due to the increase of the time-consuming durations of the plurality of child nodes, the child nodes are retained by judging the respective ratios of the time-consuming durations increased by the child nodes in the total increased time-consuming duration, if the ratio is more than 50%, the ratio of the time-consuming increase of the child nodes is large, and the child nodes with the increased time-consuming duration being less than 5ms are filtered and removed by considering the time-consuming increase condition of the other child nodes; and if the time consumption duration increased by the plurality of child nodes is more average, continuing to reserve the parent node. For the newly added method node and the calling abnormal node, only the root nodes corresponding to the newly added method node and the calling abnormal node can be reserved, and the child nodes do not need to be reserved.
After a first filtering result for the time-consuming abnormal node and a second filtering result for the newly added method node and the calling abnormal node are obtained, whether a node corresponding to a preset system method exists in the first filtering result and the second filtering result or not and a node with the time-consuming duration smaller than a preset threshold value can be judged, if an ultra-small method with the time-consuming duration smaller than 5ms is executed, the node corresponding to the preset system method can be filtered, and the node with the time-consuming duration smaller than the preset threshold value can be filtered, so that the filtered node can be obtained.
According to the technical scheme, the redundant nodes in the time-consuming abnormal nodes are filtered according to the preset first filtering information to obtain a first filtering result, the redundant nodes in the newly added method nodes and the calling abnormal nodes are filtered according to the preset second filtering information to obtain a second filtering result, the redundant nodes in the first filtering result and the second filtering result are filtered according to the preset third filtering information to obtain filtered nodes, and accurate and refined analysis results can be obtained.
In an exemplary embodiment, obtaining an intersection between target node sets corresponding to device activity data pairs to obtain a time-consuming exception analysis result for a target application includes: acquiring target node sets obtained by using different types of equipment as target equipment, and determining intersection nodes among the target node sets; and taking the intersection nodes as time-consuming abnormity analysis results for the target application program.
In an example, an intersection is taken from multiple sets of comparison results (that is, sets of target nodes obtained by obtaining devices of different models as target devices), an analysis result intersection, such as an intersection node, can be obtained based on analysis results of multiple sets of sysstrace information, and the intersection node can be used as a time-consuming anomaly analysis result for a target application program.
For example, if three target node sets are obtained, which are a target node set a, a target node set B, and a target node set C, respectively, an intersection set D may be defined, and then, with the target node set a as a basic data, by traversing any node in the target node set a, if node data identical to that of the target node set a exists in the target node set B and the target node set C, the same node may be added to the intersection set D, and then, a time-consuming exception analysis result of taking the intersection may be obtained according to the intersection set D, so that an influence generated by different machine type devices may be eliminated, and a reason for the time-consuming exception of starting an application program may be accurately found.
According to the technical scheme of the embodiment, the intersection nodes among the target node sets are determined by acquiring the target node sets obtained by using the devices of different machine types as the target devices, and then the intersection nodes are used as the time-consuming abnormity analysis results of the target application program, so that the influence caused by the devices of different machine types can be eliminated, and accurate and effective analysis results can be obtained.
Fig. 4 is a flowchart illustrating another program data processing method according to an exemplary embodiment, which is used in a computer device such as a terminal, as shown in fig. 4, and includes the following steps.
In step S410, at least two sets of device activity data pairs are obtained; the device activity data pairs comprise reference data stored in a first tree structure and target data stored in a second tree structure, the reference application program and the target application program are the same application program in different versions, and the target devices corresponding to different groups of device activity data pairs are devices of different models. In step S420, for any group of device activity data pairs, comparing node information corresponding to each node in the first tree structure and the second tree structure to obtain an identification information difference and a method information difference between the first tree structure and the second tree structure. In step S430, regarding any node in the second tree structure, if it is detected that no node identical to any node exists in the first tree structure, any node is taken as a new method node. In step S440, the same node between the first tree structure and the second tree structure is determined. In step S450, in the first tree structure and the second tree structure, if the number of nodes of a same node is 1, comparing the time consumption of the same node in the first tree structure and the second tree structure, and regarding the same node satisfying the first preset condition in the second tree structure as a time consumption abnormal node. In step S460, in the first tree structure and the second tree structure, if the number of the same node is multiple, comparing the number of times of calling and/or the time consumption of the same node in the first tree structure and the second tree structure, using the same node satisfying the second preset condition in the second tree structure as a time consumption abnormal node, and using the same node satisfying the third preset condition in the second tree structure as a calling abnormal node. In step S470, redundant nodes in the newly added method nodes and the method abnormal nodes are filtered, and the filtered nodes are used as a target node set corresponding to each device activity data pair. In step S480, an intersection between the target node sets corresponding to the device activity data pairs is obtained, so as to obtain a time-consuming anomaly analysis result for the target application program. It should be noted that, for the specific limitations of the above steps, reference may be made to the above specific limitations of a program data processing method, which is not described herein again.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
It is understood that the same/similar parts between the embodiments of the method described above in this specification can be referred to each other, and each embodiment focuses on the differences from the other embodiments, and it is sufficient that the relevant points are referred to the descriptions of the other method embodiments.
Based on the same inventive concept, the embodiment of the present disclosure further provides a program data processing apparatus for implementing the above related program data processing method.
FIG. 5 is a block diagram illustrating a program data processing apparatus according to an example embodiment. Referring to fig. 5, the apparatus includes:
a device activity data pair acquisition unit 501 configured to perform acquisition of at least two sets of device activity data pairs; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target devices, the second tree structure is used for representing the stack relation and the time consumption situation of each method in the target application program called by the target devices, the reference application program and the target application program are the same application program with different versions, and target devices corresponding to different groups of device activity data pairs are devices with different models;
a target node set obtaining unit 502 configured to perform comparison of node differences between the first tree structure and the second tree structure for any group of the device activity data pairs to obtain a target node set corresponding to each device activity data pair; the nodes in the target node set are used for representing a method with time-consuming exception called by the target device in the process of executing the target application program;
an intersection determining unit 503 is configured to perform acquiring an intersection between target node sets corresponding to the device activity data pairs, so as to obtain a time-consuming anomaly analysis result for the target application program.
In a possible implementation manner, the device activity data pair obtaining unit 501 is specifically configured to perform obtaining of reference data and target data corresponding to a target device; the benchmark data is device activity data generated when the target device runs the benchmark application program, and the target data is device activity data generated when the target device runs the target application program; calling an execution stack of each method in the reference application program according to the target equipment, and constructing the first tree structure by adopting the reference data; calling an execution stack of each method in the target application program according to the target equipment, and constructing the second tree structure by adopting the target data; each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for representing a node position and a stack relation, and method information for representing a running state and a time-consuming situation of the called method.
In a possible implementation manner, the target node set obtaining unit 502 is specifically configured to execute comparison according to node information corresponding to each node in the first tree structure and the second tree structure, for any group of the device activity data pairs, so as to obtain an identification information difference and a method information difference between the first tree structure and the second tree structure; determining a new method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure; determining 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 obtaining a target node set corresponding to each equipment activity data pair according to the newly added method node and the method abnormal node.
In a possible implementation manner, the target node set obtaining unit 502 is specifically configured to execute, with respect to any node in the second tree structure, if it is detected that a node identical to the any node does not exist in the first tree structure, taking the any node as a new method node.
In a possible implementation manner, the method exception node includes a time-consuming exception node and a calling exception node, and the target node set obtaining unit 502 is specifically configured to perform 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 the nodes of a certain same node is 1, comparing the time consumption situation of the certain same node in the first tree structure and the second tree structure, and taking the certain same node meeting a first preset condition in the second tree structure as the time consumption abnormal node; in the first tree structure and the second tree structure, if the number of nodes of a certain same node is multiple, comparing the number of times of calling and/or the time consumption of the certain same node in the first tree structure and the second tree structure, using the certain same node meeting a second preset condition in the second tree structure as the time consumption abnormal node, and using the certain same node meeting a third preset condition in the second tree structure as the calling abnormal node.
In a possible implementation manner, the target node set obtaining unit 502 is specifically configured to perform filtering on redundant nodes in the newly-added method node and the method abnormal node, and use the filtered nodes as the target node sets corresponding to the device activity data pairs.
In a possible implementation manner, the method includes a time-consuming exception node and a calling exception node, and the target node set obtaining unit 502 is specifically configured to perform filtering on a redundant node in the time-consuming exception node according to preset first filtering information to obtain a first filtering result; filtering the redundant nodes in the newly added method node and the calling abnormal node according to preset second filtering information to obtain a second filtering result; and filtering redundant nodes in the first filtering result and the second filtering result according to preset third filtering information to obtain the filtered nodes.
In a possible implementation manner, the intersection determining unit 503 is specifically configured to perform acquiring each target node set obtained by using devices of different models as target devices, and determine an intersection node between each target node set; and taking the intersection node as a time-consuming abnormity analysis result aiming at the target application program.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The respective modules in the above program data processing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 6 is a block diagram illustrating an electronic device 600 for implementing a program data processing method according to an example embodiment. For example, the electronic device 600 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 6, electronic device 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, interface to input/output (I/O) 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the electronic device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile storage devices, 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.
Power supply component 606 provides power to the various components of electronic device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 600.
The multimedia component 608 includes a screen providing an output interface between the electronic device 600 and a 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 an input signal from a 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 boundary of a 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 facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 600 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be 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.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the electronic device 600. For example, the sensor component 614 may detect an open/closed state of the electronic device 600, the relative positioning of components, such as a display and keypad of the electronic device 600, the sensor component 614 may also detect a change in the position of the electronic device 600 or components of the electronic device 600, the presence or absence of user contact with the electronic device 600, orientation or acceleration/deceleration of the device 600, and a change in the temperature of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object 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.
The communication component 616 is configured to facilitate communications between the electronic device 600 and other devices in a wired or wireless manner. The electronic device 600 may 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 broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
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, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the electronic device 600 to perform the above-described method is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided that includes instructions executable by the processor 620 of the electronic device 600 to perform the above-described method.
It should be noted that the descriptions of the above-mentioned apparatus, the electronic device, the computer-readable storage medium, the computer program product, and the like according to the method embodiments may also include other embodiments, and specific implementations may refer to the descriptions of the related method embodiments, which are not described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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 (10)

1. A program data processing method, characterized in that the method comprises:
acquiring at least two groups of equipment activity data pairs; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target devices, the second tree structure is used for representing the stack relation and the time consumption situation of each method in the target application program called by the target devices, the reference application program and the target application program are the same application program with different versions, and target devices corresponding to different groups of device activity data pairs are devices with different models;
comparing the node difference between the first tree structure and the second tree structure aiming at any group of equipment activity data pairs to obtain a target node set corresponding to each equipment activity data pair; the nodes in the target node set are used for representing a method with time-consuming exception called by the target device in the process of executing the target application program;
and acquiring the intersection of the corresponding target node sets of the equipment activity data pairs to obtain a time-consuming abnormity analysis result aiming at the target application program.
2. The method of claim 1, wherein obtaining at least two sets of device activity data pairs comprises:
acquiring reference data and target data corresponding to target equipment; the benchmark data is device activity data generated when the target device runs the benchmark application program, and the target data is device activity data generated when the target device runs the target application program;
calling an execution stack of each method in the reference application program according to the target equipment, and constructing the first tree structure by adopting the reference data;
calling an execution stack of each method in the target application program according to the target equipment, and constructing the second tree structure by adopting the target data;
each node in the first tree structure and the second tree structure has corresponding node information, and the node information includes identification information for representing a node position and a stack relation, and method information for representing a running state and a time-consuming situation of the called method.
3. The method of claim 1, wherein comparing, for any group of the device activity data pairs, node differences between the first tree structure and the second tree structure to obtain a target node set corresponding to each device activity data pair comprises:
for any group of equipment activity data pairs, comparing node information corresponding to each node in the first tree structure and the second tree structure to obtain identification information difference and method information difference between the first tree structure and the second tree structure;
determining a new method node from the second tree structure according to the identification information difference between the first tree structure and the second tree structure;
determining method abnormal nodes from the second tree structure according to the method information difference between the first tree structure and the second tree structure;
and obtaining a target node set corresponding to each equipment activity data pair according to the newly added method node and the method abnormal node.
4. The method of claim 3, wherein determining 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 comprises:
and aiming at any node in the second tree structure, if the fact that the same node as the any node does not exist in the first tree structure is detected, taking the any node as a new method node.
5. The method of claim 3, wherein the method exception nodes include a time-consuming exception node and a calling exception node, and wherein determining a method exception node from the second tree structure based on a method information difference between the first tree structure and the second tree structure comprises:
determining a 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 the nodes of a certain same node is 1, comparing the time consumption situation of the certain same node in the first tree structure and the second tree structure, and taking the certain same node meeting a first preset condition in the second tree structure as the time consumption abnormal node;
in the first tree structure and the second tree structure, if the number of the nodes of a same node is multiple, comparing the number of times of calling and/or the time consumption of the same node in the first tree structure and the second tree structure, using the same node meeting a second preset condition in the second tree structure as the time consumption abnormal node, and using the same node meeting a third preset condition in the second tree structure as the calling abnormal node.
6. The method of claim 3, wherein obtaining a set of target nodes corresponding to each of the device activity data pairs according to the newly added method node and the method exception node comprises:
and filtering the redundant nodes in the newly added method nodes and the method abnormal nodes, and taking the filtered nodes as target node sets corresponding to the equipment activity data pairs.
7. A program data processing apparatus, characterized in that the apparatus comprises:
a device activity data pair acquisition unit configured to perform acquisition of at least two sets of device activity data pairs; the device activity data pair comprises reference data stored in a first tree structure and target data stored in a second tree structure, the first tree structure is used for representing the stack relation and the time consumption situation of each method in a reference application program called by target devices, the second tree structure is used for representing the stack relation and the time consumption situation of each method in the target application program called by the target devices, the reference application program and the target application program are the same application program with different versions, and target devices corresponding to different groups of device activity data pairs are devices with different models;
a target node set obtaining unit configured to perform comparison of node differences between the first tree structure and the second tree structure for any group of the device activity data pairs to obtain a target node set corresponding to each device activity data pair; the nodes in the target node set are used for representing a method with time-consuming exception called by the target device in the process of executing the target application program;
and the intersection determining unit is configured to perform acquisition of an intersection between target node sets corresponding to the equipment activity data pairs to obtain a time-consuming abnormity analysis result for the target application program.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the program data processing method of any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the program data processing method of any one of claims 1 to 6.
10. A computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to carry out the program data processing method of any one of claims 1 to 6.
CN202210611277.2A 2022-05-31 2022-05-31 Program data processing method, program data processing device, electronic device, and storage medium Pending CN114936040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210611277.2A CN114936040A (en) 2022-05-31 2022-05-31 Program data processing method, program data processing device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210611277.2A CN114936040A (en) 2022-05-31 2022-05-31 Program data processing method, program data processing device, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN114936040A true CN114936040A (en) 2022-08-23

Family

ID=82866157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210611277.2A Pending CN114936040A (en) 2022-05-31 2022-05-31 Program data processing method, program data processing device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN114936040A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190303270A1 (en) * 2018-03-30 2019-10-03 Oracle International Corporation Scalable Execution Tracing For Large Program Codebases
US20190370141A1 (en) * 2018-06-03 2019-12-05 Apple Inc. Detection and analysis of energy consumption of software applications
CN110990403A (en) * 2019-11-26 2020-04-10 深圳壹账通智能科技有限公司 Business data storage method, system, computer equipment and storage medium
US10628079B1 (en) * 2016-05-27 2020-04-21 EMC IP Holding Company LLC Data caching for time-series analysis application
CA3127266A1 (en) * 2019-01-30 2020-08-06 Kyle MacLean SMITH Hierarchical script database and database applications
CN112489746A (en) * 2020-12-08 2021-03-12 平安国际智慧城市科技股份有限公司 Task pushing method and device for data management, electronic equipment and storage medium
CN112667317A (en) * 2020-12-28 2021-04-16 北京达佳互联信息技术有限公司 Abnormal time consumption detection method and device, electronic equipment and storage medium
CN113448815A (en) * 2020-03-26 2021-09-28 华为技术有限公司 Method for collecting and tracking trace call chain and electronic equipment
CN113886193A (en) * 2021-10-26 2022-01-04 Oppo广东移动通信有限公司 Log data processing method and device, electronic equipment and storage medium
CN114936039A (en) * 2022-05-31 2022-08-23 北京达佳互联信息技术有限公司 Program data processing method, program data processing device, electronic device, and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10628079B1 (en) * 2016-05-27 2020-04-21 EMC IP Holding Company LLC Data caching for time-series analysis application
US20190303270A1 (en) * 2018-03-30 2019-10-03 Oracle International Corporation Scalable Execution Tracing For Large Program Codebases
US20190370141A1 (en) * 2018-06-03 2019-12-05 Apple Inc. Detection and analysis of energy consumption of software applications
CA3127266A1 (en) * 2019-01-30 2020-08-06 Kyle MacLean SMITH Hierarchical script database and database applications
CN110990403A (en) * 2019-11-26 2020-04-10 深圳壹账通智能科技有限公司 Business data storage method, system, computer equipment and storage medium
CN113448815A (en) * 2020-03-26 2021-09-28 华为技术有限公司 Method for collecting and tracking trace call chain and electronic equipment
CN112489746A (en) * 2020-12-08 2021-03-12 平安国际智慧城市科技股份有限公司 Task pushing method and device for data management, electronic equipment and storage medium
CN112667317A (en) * 2020-12-28 2021-04-16 北京达佳互联信息技术有限公司 Abnormal time consumption detection method and device, electronic equipment and storage medium
CN113886193A (en) * 2021-10-26 2022-01-04 Oppo广东移动通信有限公司 Log data processing method and device, electronic equipment and storage medium
CN114936039A (en) * 2022-05-31 2022-08-23 北京达佳互联信息技术有限公司 Program data processing method, program data processing device, electronic device, and storage medium

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
BAOPING CAIF等: "A real-time fault diagnosis methodology of complex systems using object-oriented Bayesian networks", 《MECHANICAL SYSTEMS AND SIGNAL PROCESSING》, vol. 80, 1 December 2016 (2016-12-01), pages 31 - 44, XP029593710, DOI: 10.1016/j.ymssp.2016.04.019 *
HBXZTC: "应用程序执行周期性时快时慢问题解决一例", pages 1 - 3, Retrieved from the Internet <URL:https://blog.51cto.com/hbxztc/2326753> *
I加加: "(四十三)统计应用具体方法执行时长-Android Profiler CPU", pages 1 - 12, Retrieved from the Internet <URL:https://blog.csdn.net/sinat_20059415/article/details/80584621> *
乌旭东: "基于日志数据的异常检测算法研究与实现", 《中国优秀硕士学位论文全文数据库(工程科技Ⅱ辑)》, no. 02, 15 February 2022 (2022-02-15), pages 032 - 38 *
孙海丽等: "工业物联网异常检测技术综述", 《通信学报》, no. 03, 31 March 2022 (2022-03-31), pages 196 - 210 *
沈大川: "基于统计模型检验的并发程序自动生成", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, no. 07, 15 July 2019 (2019-07-15), pages 138 - 438 *
章荪: "面向数据流的异常检测技术研究", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, no. 01, 15 January 2019 (2019-01-15), pages 138 - 1892 *
魏萌萌: "面向循环并行化的软件重构方法研究与实现", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, no. 02, 15 February 2019 (2019-02-15), pages 137 - 39 *

Similar Documents

Publication Publication Date Title
CN105224462B (en) The recognition methods of control element and device
CN114936039A (en) Program data processing method, program data processing device, electronic device, and storage medium
CN112182295A (en) Business processing method and device based on behavior prediction and electronic equipment
CN115129573A (en) Program operation monitoring method and device, electronic equipment and storage medium
CN112486658A (en) Task scheduling method and device for task scheduling
CN112783779A (en) Test case generation method and device, electronic equipment and storage medium
CN114936040A (en) Program data processing method, program data processing device, electronic device, and storage medium
CN111913850A (en) Data anomaly detection method, device, equipment and storage medium
CN113094225A (en) Abnormal log monitoring method and device and electronic equipment
CN116048757A (en) Task processing method, device, electronic equipment and storage medium
CN111382161A (en) State data processing method and device, electronic equipment and storage medium
CN115314426A (en) Data acquisition method, system, electronic device and storage medium
CN115811463A (en) Data analysis method and device, electronic equipment and storage medium
CN110928750A (en) Data processing method, device and equipment
CN113590605B (en) Data processing method, device, electronic equipment and storage medium
CN115526952A (en) View drawing method and device, electronic equipment and storage medium
CN109086116B (en) Communication tool speech real-time monitoring method and device based on auxiliary function service
CN112231132A (en) Application program jamming positioning method and device, electronic equipment and medium
CN111898100A (en) Code leakage tracing method and device and terminal equipment
CN111782508A (en) Automatic test method, device, electronic equipment and storage medium
CN112667474B (en) Data monitoring method and device, electronic equipment and storage medium
WO2023245396A1 (en) Database connection pool monitoring method and apparatus, electronic device and storage medium
CN115114029A (en) Abnormal file positioning method and device, electronic equipment and storage medium
CN115981601A (en) Task flow processing method and device, electronic equipment and storage medium
CN114281581A (en) Data display method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination