Data processing method and device, equipment, storage medium and product

CN122733570APending Publication Date: 2026-09-11BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510287215.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

用户在使用电子设备的过程中,电子设备的发热和耗电快等问题会影响使用体验,而应用程序的与功耗相关的性能不佳的情况可能导致上述问题的发生,因此,针对应用程序的功耗相关性能进行优化可以改善上述问题

Benefits of technology

[0019]本公开实施例提供的数据处理方案,获取预设应用程序在目标时间段内的函数执行过程数据,目标时间段为预设应用程序的处理器负载水平高于预设水平的时间段,根据函数执行过程数据构建预设应用程序的线程的函数树,函数树用于表征线程的函数调用关系,函数树中的节点与函数调用关系中的函数相对应,节点关联有所对应的函数在执行过程中的时间信息,基于函数树确定函数调用关系中的异常函数,异常函数为满足第一预设条件和/或第二预设条件的函数,第一预设条件与函数的耗时情况相关,第二预设条件与函数的执行频率相关。通过采用上述技术方案,可以准确定位影响应用程序功耗相关性能的异常函数。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122733570A_ABST
    Figure CN122733570A_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method, device, equipment, storage medium and product, and relates to the technical field of computers. The method comprises: acquiring function execution process data of a preset application program in a target time period, the target time period being a time period in which the processor load level of the preset application program is higher than a preset level; constructing a function tree of a thread of the preset application program according to the function execution process data, the function tree being used to represent a function call relationship of the thread, a node in the function tree corresponding to a function in the function call relationship, the node being associated with time information of the function in an execution process; determining an abnormal function in the function call relationship based on the function tree, the abnormal function being a function that satisfies a first preset condition and / or a second preset condition, the first preset condition being related to the time consumption of the function, and the second preset condition being related to the execution frequency of the function. By using the above technical solution, an abnormal function that affects the power consumption related performance of an application program can be accurately located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to data processing methods, apparatus, devices, storage media, and products. Background Technology

[0002] With the rapid development of computer technology, applications on electronic devices are becoming increasingly feature-rich, bringing numerous conveniences to users' work and lives. However, issues such as overheating and rapid battery drain can negatively impact the user experience. Poor power-related performance of applications can also contribute to these problems. Therefore, optimizing the power-related performance of applications can alleviate these issues.

[0003] However, there is currently a lack of effective solutions for accurately locating and tracing the causes of application power consumption problems. Summary of the Invention

[0004] This disclosure provides data processing methods, apparatus, devices, storage media, and products that can accurately pinpoint the causes of abnormal performance issues affecting application power consumption.

[0005] In a first aspect, embodiments of this disclosure provide a data processing method, including:

[0006] Obtain function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level;

[0007] Based on the function execution process data, a function tree of the threads of the preset application is constructed, wherein the function tree is used to represent the function call relationship of the threads, the nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process;

[0008] Based on the function tree, abnormal functions in the function call relationship are determined, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

[0009] Secondly, embodiments of this disclosure also provide a data processing apparatus, including:

[0010] The data acquisition module is used to acquire function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level;

[0011] A function tree construction module is used to construct a function tree of the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process.

[0012] An abnormal function determination module is used to determine abnormal functions in the function call relationship based on the function tree, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0014] One or more processors;

[0015] Storage device for storing one or more programs.

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided in the embodiments of this disclosure.

[0017] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the data processing method provided in embodiments of this disclosure.

[0018] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the data processing method provided in embodiments of this disclosure.

[0019] The data processing scheme provided in this disclosure acquires function execution process data of a preset application within a target time period. The target time period is the period during which the processor load level of the preset application is higher than a preset level. Based on the function execution process data, a function tree of the threads of the preset application is constructed. The function tree represents the function call relationships of the threads. Nodes in the function tree correspond to functions in the function call relationships, and each node is associated with the time information of the corresponding function during execution. Based on the function tree, abnormal functions in the function call relationships are identified. Abnormal functions are functions that satisfy a first preset condition and / or a second preset condition. The first preset condition is related to the function's time consumption, and the second preset condition is related to the function's execution frequency. By adopting the above technical solution, abnormal functions affecting the power consumption-related performance of the application can be accurately located. Attached Figure Description

[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0021] Figure 1 This is a schematic flowchart of a data processing method provided in an embodiment of the present disclosure;

[0022] Figure 2 A schematic diagram of a function tree provided in an embodiment of this disclosure;

[0023] Figure 3 This is a schematic flowchart of another data processing method provided in an embodiment of the present disclosure;

[0024] Figure 4 A schematic flowchart illustrating yet another data processing method provided in an embodiment of this disclosure;

[0025] Figure 5 This is a schematic diagram of another function tree provided in an embodiment of this disclosure;

[0026] Figure 6 A schematic flowchart illustrating yet another data processing method provided in an embodiment of this disclosure;

[0027] Figure 7 This is a schematic diagram of a stack information processing procedure provided in an embodiment of the present disclosure;

[0028] Figure 8 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure;

[0029] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0030] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0031] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0032] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0034] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0035] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present disclosure. This embodiment is applicable to situations where the cause of abnormal problems affecting the power consumption-related performance of an application is located. The method can be executed by a data processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal like a mobile phone, smartwatch, tablet computer, or personal digital assistant, or a device like a personal computer (PC) or server.

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

[0037] Step 101: Obtain function execution process data of the preset application within a target time period, wherein the target time period is the time period during which the processor load level of the preset application is higher than a preset level.

[0038] In this embodiment of the disclosure, the preset application can be any application and can run on the device as a client. The preset application can run on the aforementioned electronic device and is applicable when the electronic device is locating power consumption-related performance anomalies in applications running on the electronic device itself. In this case, the aforementioned electronic device can be a client device, such as a mobile phone. Alternatively, the preset application can run on a terminal device (such as a client device) other than the aforementioned electronic device and is applicable when locating power consumption-related performance anomalies in applications running on one or more client devices. In this case, the aforementioned electronic device can be a server device, such as a server.

[0039] In this embodiment, function execution process data can also be referred to as trace data. This data may include time data corresponding to the function's execution and function call relationship data. Time data may include, for example, the time when the function starts execution and / or the time when it ends execution. This time may include a time point based on wall clock time and a time point based on processor time, such as Central Processing Unit (CPU) time. The function's start execution time can be denoted as StartTime, and the function's end execution time can be denoted as EndTime, corresponding to Wall Time. The function's processor start execution time can be denoted as StartCpuTime, and the function's processor end execution time can be denoted as EndCpuTime, corresponding to CPU Time. Furthermore, based on the above times, information such as function execution time and processor execution time can be further determined. The function execution process data can be collected and stored by the client device.

[0040] In this embodiment of the disclosure, the client power consumption problem is broken down into several technical indicators that can be used for problem analysis based on the user experience indicators such as heat generation and power consumption. The most important dimension, namely the processor dimension, is selected. Taking the CPU as an example, the application power consumption problem is located from the perspective of high CPU load.

[0041] For example, during the operation of a preset application, the client device can monitor the processor load level of the preset application in real time or periodically. If the processor load level of the preset application is higher than a preset level within a certain time period, it indicates that the power consumption generated by the preset application is high. This time period is then designated as the target time period for problem localization. The specific method for detecting the processor load level of the preset application is not limited and can be determined based on the operating system type of the client device. For example, using the Android operating system, the processor utilization rate within a unit of time period can be detected. If the processor utilization rate consistently exceeds a preset utilization rate threshold within that unit of time period, the processor load level of the preset application is determined to be higher than the preset level, and this unit of time period is designated as the target time period. The length of the unit of time period could be, for example, 5 seconds, and the preset utilization rate threshold could be, for example, 50%. For example, taking Apple's (iOS) operating system as an example, a sliding window can be set, with a length of, for example, m (preset length). Every x seconds (preset duration), processor usage data is added to the sliding window. The weighted sum of the time within the sliding window and the processor usage is calculated. If the weighted sum is greater than a preset value, it can be determined that the processor load level of the preset application is higher than a preset level, and the time period corresponding to the current sliding window is determined as the target time period. The processor usage of the preset application can be obtained by calling a system interface. After detecting the target time period, the function execution process data of the preset application within the target time period can be obtained. If the electronic device in this embodiment is a server device, it can receive the function execution process data of the preset application within the target time period reported by the client device and perform subsequent processing.

[0042] Step 102: Construct a function tree for the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process.

[0043] In this step, a function tree is constructed for each thread of the preset application. A function tree can include multiple nodes. The function tree represents the function call relationships of the corresponding threads. The function call relationships can be represented based on the hierarchical relationship and / or connection relationship between nodes. Since the function execution process data can include function call relationship data, the function tree can be constructed based on the function execution process data. Each node in the function tree can correspond to a function in the function call relationship, and therefore can also be called a function node. Nodes can be used to record the relevant data of the corresponding function in the function execution process data. This relevant data includes the time information of the function during execution, such as the time data mentioned above and / or information calculated based on the time data, such as the function execution time and the processor execution time. It can also be used to record the node identifier of the current node, the node identifier of the parent node, the node identifier of the child node, and the stack identifier of the stack to which it belongs.

[0044] Figure 2 This is a schematic diagram of a function tree provided in an embodiment of the present disclosure, such as... Figure 2 As shown, the function tree of a certain thread includes 6 nodes: node A (top-level node, also known as the root node), node B, node C, node D, node E, and node F, which correspond to functions a, b, c, d, e, and f, respectively. Function a calls functions b and c. Accordingly, node A is the parent node of nodes B and C, and nodes B and C are the child nodes of node A. Function a can also be called the parent function of functions b and c, and functions b and c are the child functions of function a. Taking node B as an example, it can be associated with time information during the execution of function b, such as the start time of function b's execution.

[0045] Step 103: Determine the abnormal functions in the function call relationship based on the function tree, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the time consumption of the function, and the second preset condition being related to the execution frequency of the function.

[0046] Analysis revealed that functions with long execution times or high execution frequencies may cause high processor load. Therefore, in this embodiment, conditions are set for determining whether a function in a function call relationship is an abnormal function, based on both the function's execution time and execution frequency. The function tree can determine the execution time and frequency of each function; therefore, the abnormal functions involved in the function call relationship corresponding to each thread are determined based on the function tree constructed in the aforementioned steps. The first and second preset conditions can be set according to actual needs. For example, the first preset condition could be that the function's execution time and / or the processor's execution time is greater than a corresponding threshold, and the second preset condition could be that the function's execution frequency is higher than a corresponding threshold, etc.

[0047] Optionally, functions that satisfy the first preset condition (denoted as the first type of function) and functions that satisfy the second preset condition (denoted as the second type of function) can be identified separately, and the union of the first type of function and the second type of function can be taken to obtain the abnormal function.

[0048] The data processing method provided in this disclosure acquires function execution process data of a preset application within a target time period, where the processor load level of the preset application is higher than a preset level. Based on the function execution process data, a function tree of the threads of the preset application is constructed. The function tree represents the function call relationships of the threads, with nodes in the function tree corresponding to functions in the function call relationships. Each node is associated with the time information of the corresponding function during execution. Abnormal functions in the function call relationships are identified based on the function tree. Abnormal functions are functions that satisfy a first preset condition and / or a second preset condition. The first preset condition is related to the function's time consumption, and the second preset condition is related to the function's execution frequency. By adopting the above technical solution, a function tree of threads is constructed based on function execution process data during the time period when the processor load level of the preset application is higher than a preset level. The function tree is used to identify abnormal functions whose time consumption and / or execution frequency meet certain conditions, enabling accurate location of the causes of abnormal problems affecting the power consumption-related performance of the application. Furthermore, the function information of abnormal functions can be used to determine their impact on the processor load level of the preset application.

[0049] In some embodiments, the method may further include: determining the degree of impact of the exception function on the processor load level of the preset application based on the function information of the exception function. This allows for more precise problem localization and targeted optimization.

[0050] For example, when the electronic device is a client device, the function information of one or more abnormal functions corresponding to target time periods can be used to determine the impact of each abnormal function on the processor load level of the preset application. When the electronic device is a server device, abnormal functions can be identified using function processing data corresponding to one or more target time periods reported by multiple client devices. Based on the function information of the abnormal functions, the impact of each abnormal function on the processor load level of the preset application can be determined. The function information can include parameter data that characterizes the abnormal state of the function, such as function execution time, processor execution time, function execution frequency, and function call path. The impact is quantified based on the above parameter data, such as by calculating the parameter data according to a preset calculation method to obtain a score representing the impact. Based on this score, the impact of each abnormal function on the processor load level of the preset application is determined, and then targeted optimization is performed on abnormal functions with high impact to improve the power consumption-related performance of the preset application.

[0051] Figure 3 This is a flowchart illustrating another data processing method provided in an embodiment of the present disclosure. The embodiments of the present disclosure are optimized based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:

[0052] Step 301: Obtain function execution process data of the preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level.

[0053] Step 302: Construct a function tree for the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process.

[0054] Step 303: Start from the top node of the function tree and traverse downwards until the first node that satisfies the first preset requirement is found. The function corresponding to the found node is determined as the first type of function, where the first type of function is the function that satisfies the first preset condition.

[0055] The first preset requirement includes: the processor execution time of the function corresponding to the node is greater than a first threshold, and the child nodes of the node meet a second preset requirement. The second preset requirement includes: the ratio of the processor execution time of the function corresponding to the child node to the processor execution time of the function corresponding to the node is less than a second threshold. The first preset requirement may further include: the function corresponding to the node is a function of the preset application.

[0056] For example, the top-level node of the function tree is the first function executed in the thread's function call relationship. Traversing downwards from the top-level node, and using a first preset requirement to determine the termination condition of the traversal, the function that actually has an exception can be accurately found. Here, processor execution time can represent the time that the function actually consumes processor resources (such as CPU) to execute, that is, the time the function spends in a runnable state.

[0057] For example, the currently traversed node is designated as the current node. It is necessary to determine whether the current node meets the first preset requirement. The first preset requirement includes two or three items, and the order of determination is not limited. For instance, it can first be determined whether the function corresponding to the current node is a function of a preset application, that is, whether it is a system function. During the execution of the preset application, there may be instances where system functions are called. However, in this embodiment, the focus is on finding and optimizing the functions of the preset application itself. Therefore, abnormal functions are non-system functions. Next, it is determined whether the processor execution time of the function corresponding to the current node, such as CPU execution time, is greater than the first preset threshold (which can be set according to actual needs, such as 100 milliseconds). If so, it is possible to continue determining whether the child nodes of the current node meet the second preset requirement. If the processor execution time of the function corresponding to the current node is greater than the first preset threshold, it indicates that the execution of this function has occupied a long processor execution time. If the traversal stops here and the current function is directly determined as an abnormal function, it may be impossible to identify the real cause of the high execution time. The current node may have child nodes, and it is possible that the execution of the functions corresponding to the child nodes has occupied a long processor execution time, resulting in the long processor execution time of the current node. In this embodiment, it is necessary to further traverse downwards to determine whether the child nodes of the current node meet the second preset requirement, that is, the ratio of the processor execution time of the function corresponding to the child node of the current node to the processor execution time of the function corresponding to the node is less than the second threshold. The second threshold can be set according to actual needs, generally greater than 50%, for example, 90%. The child nodes can be any child node of the current node, meaning that the ratio of the processor execution time of the function corresponding to each child node of the node to the processor execution time of the function corresponding to the node is less than the second threshold. In other words, if the current node does not have any child nodes whose processor execution time is greater than or equal to the second threshold, then it can be determined that the current node meets the first preset requirement.

[0058] like Figure 2As shown, assuming the traversal starts from node A, and the processor execution time of function a corresponding to node A is greater than a first threshold, and function a is a function of a preset application, then we determine whether the child nodes of node A, node B and node C, meet the second preset requirement. If the ratio of the processor execution time of function b corresponding to node B to the processor execution time of function a corresponding to node A is 90% (equal to the second threshold), and the ratio of the processor execution time of function c corresponding to node C to the processor execution time of function a corresponding to node A is 5%, then node A does not meet the first preset requirement. If the processor execution time of function c is less than the first threshold, then node C does not meet the first preset requirement. For node B, the processor execution time of the function corresponding to function b is greater than the first threshold. Function b is a function of the preset application. The ratio of the processor execution time of functions d, e, and f of the child nodes of node B, nodes D, E, and F respectively, to the processor execution time of function b is less than 90% (less than the second threshold). That is, there are no child nodes greater than or equal to the second threshold. Therefore, node B meets the first preset requirement, the traversal stops, and function b is determined to be a first type of function.

[0059] Step 304: Determine the abnormal functions in the function call relationship based on the first type of functions.

[0060] For example, if only high-time-consuming functions are to be located, the first type of function can be directly identified as the abnormal function in the function call relationship. If there is a need to locate other abnormal functions, the functions located by different types can be summarized to obtain the abnormal functions in the function call relationship.

[0061] The data processing method provided in this disclosure constructs a thread function tree based on function execution data during time periods when the processor load level of a preset application is higher than a preset level. It traverses downwards from the top node of the function tree until the first node that meets a first preset requirement is found. Based on the function corresponding to the found node, it determines the abnormal function in the function call relationship. The first preset requirement is that the function corresponding to the node is a non-system function, and its processor execution time is greater than a first threshold, and the ratio of the processor execution time of the function corresponding to the child node to the processor execution time of the function corresponding to that node is less than a second threshold. This method can more accurately find the abnormal function that truly causes high processor load, rather than functions belonging to the code encapsulation layer, thus improving the accuracy of abnormal function location.

[0062] Figure 4 This is a flowchart illustrating another data processing method provided in this disclosure, which is an optimization based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:

[0063] Step 401: Obtain function execution process data of the preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level.

[0064] Step 402: Construct a function tree for the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process.

[0065] The function tree is constructed based on a timeline. The starting position of each node on the timeline is determined by the start execution time of its corresponding function, and the ending position of each node is determined by the end execution time of its corresponding function. By employing this special function tree construction method, the execution of each function and the distribution of its execution time over time can be determined more accurately, thus facilitating the subsequent identification of the second type of functions.

[0066] Step 403: Based on the function tree, determine the execution frequency and time consumption data of the function corresponding to the node located within the preset sliding time window. The time consumption data includes the function execution time and the processor time of the function itself.

[0067] For example, the length of the preset sliding time window can be set according to actual needs, such as 1 second. The sliding distance of the preset sliding time window is not limited, such as a preset time length for each slide, such as 0.5 seconds, and the sliding direction is along the time axis.

[0068] Figure 5 This is a schematic diagram of another function tree provided in an embodiment of the present disclosure, such as... Figure 5 As shown, the function tree is constructed based on a timeline. The starting position of each node on the timeline is determined by the start execution time of its corresponding function, and the ending position is determined by the end execution time of its corresponding function. A dashed box represents a preset sliding time window.

[0069] Step 404: Based on the execution frequency and time consumption data, determine the nodes that meet the third preset requirements among the nodes located within the preset sliding time window, and determine the functions corresponding to the determined nodes as second-class functions, wherein the second-class functions are functions that meet the second preset conditions.

[0070] For example, if a function is called a high number of times within a unit of time (corresponding to the length of a preset sliding time window), i.e., has a high execution frequency, it may affect the CPU load. However, research has found that functions with high execution frequency but short individual execution times, such as idle timers, while having some impact on the CPU during long-term execution, manifest as an overall increase in CPU utilization, which is insufficient to constitute a short-term CPU load anomaly. Therefore, for high-frequency functions, the focus should be on high-frequency functions with medium to high loads. Thus, combining execution frequency and execution time data allows for a more accurate identification of the second type of function.

[0071] Optionally, the third preset requirement includes: the execution frequency of the function corresponding to the node is greater than a third threshold, and the average processor utilization of the function corresponding to the node is greater than a fourth threshold. Wherein, the average processor utilization is the ratio of a first value to a second value, where the first value is the sum of the processor times of each execution of the function within the preset sliding time window, and the second value is the sum of the execution times of each execution of the function within the preset sliding time window.

[0072] The third threshold can be set according to actual needs, such as once per second. Function execution time represents the overall execution time of the function, including the time spent in the running, runnable, and waiting states. The function's own processor time is the time obtained by subtracting the processor execution times of all its sub-functions from the current function's own processor execution time. The fourth threshold can be set according to actual needs, such as 5%. Assuming a function executes 3 times within a preset sliding time window, the sum of the function's own processor time for each of the 3 executions, and the sum of the function's overall execution time for each of the 3 executions, are calculated. The ratio of these two sums is then compared with the fourth threshold.

[0073] Step 405: Determine the abnormal functions in the function call relationship based on the second type of functions.

[0074] For example, if only the second type of function is located, the second type of function can be directly identified as the abnormal function in the function call relationship. If there is a need to locate other abnormal functions, such as the first type of function mentioned above, the functions located by different types can be summarized to obtain the abnormal functions in the function call relationship.

[0075] The data processing method provided in this disclosure constructs a thread function tree based on a time axis according to the function execution process data during a time period when the processor load level of a preset application is higher than a preset level. Based on the function tree, the execution frequency and time consumption data of the function corresponding to the node located within a preset sliding time window are determined. Combining the execution frequency and time consumption data, the abnormal function corresponding to the node that meets the third preset requirement among the nodes located within the preset sliding time window is more accurately determined, thereby improving the accuracy of abnormal function location.

[0076] For example, after identifying the exception function, further analysis of the cause of the exception requires determining the call path information of the exception function. For asynchronous tasks, such as the thread pool and asynchronous message handling (Handler) mechanism in Android operating systems, and the Grand Central Dispatch (GCD) and multi-threaded operation queue (NSOperationQueue) mechanism in Apple operating systems, asynchronous tasks can be initiated. The caller and executor of asynchronous tasks are in different threads. Unlike synchronous tasks, where the caller of the exception function can be found by tracing back the stack, the above analysis of exception functions is performed independently on a single thread. Therefore, in the case of exception tasks, it is difficult to determine the true initiator of the exception function.

[0077] In this embodiment of the disclosure, the method may further include: acquiring first stack information of the calling thread and second stack information of the called thread in the preset application; concatenating the first stack information and the second stack information to obtain target stack information; and determining the call path information of the exception function based on the target stack information. This allows for accurate identification of the true initiator of the exception function, thereby more precisely locating the direct cause of the exception problem.

[0078] Figure 6 This is a flowchart illustrating another data processing method provided in this disclosure, which is an optimization based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:

[0079] Step 601: Obtain function execution process data of the preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level.

[0080] Step 602: Construct a function tree for the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship. The nodes are associated with the time information of the corresponding functions during the execution process. The function tree is constructed based on the time axis. The starting position of the node in the time axis is determined according to the start execution time of the corresponding function, and the ending position of the node in the time axis is determined according to the end execution time of the corresponding function.

[0081] Step 603: Start from the top node of the function tree and traverse downwards until the first node that satisfies the first preset requirement is found. The function corresponding to the found node is determined as the first type of function, where the first type of function is the function that satisfies the first preset condition.

[0082] Step 604: Based on the function tree, determine the execution frequency and time consumption data of the functions corresponding to the nodes located within the preset sliding time window. Based on the execution frequency and time consumption data, determine the nodes that meet the third preset requirement among the nodes located within the preset sliding time window. Determine the functions corresponding to the determined nodes as the second type of functions, where the second type of functions are functions that meet the second preset condition.

[0083] Step 605: Determine the abnormal functions in the function call relationship based on the first type of functions and the second type of functions.

[0084] For example, the union of the first type of functions and the second type of functions is determined, and the functions in the union are identified as the abnormal functions in the function call relationship.

[0085] Step 606: Obtain the first stack information of the calling thread and the second stack information of the called thread in the preset application, concatenate the first stack information and the second stack information to obtain the target stack information, and determine the call path information of the exception function based on the target stack information.

[0086] Optionally, the first and second stack information can be collected on the client device. For example, collection can be performed as follows: In response to the triggering of the asynchronous task initiation entry point, the registration information is used to obtain the task; the first stack information (which may include thread ID and stack trace) of the calling thread (Source thread) that initiated the asynchronous task is obtained; the execution of the asynchronous task is triggered by obtaining the task through execution information; and the second stack information (which may include thread ID and stack trace) of the called thread (Target thread) used to execute the asynchronous task is obtained; the first and second stack information are then merged and reported to the server device. The initiation entry point can be, for example, the execution of a task allocation function, such as the `dispatch_async` function.

[0087] Figure 7This is a schematic diagram of a stack information processing procedure provided in an embodiment of the present disclosure, as shown below. Figure 7 As shown, the asynchronous task dispatch function is detected on the client device. If the function is triggered, the execution of the asynchronous task is paused, the task is registered, and the calling thread information (including the first stack information) is obtained during registration. When the task is executed, the called thread information (including the second stack information) is obtained, and the actual execution of the asynchronous task is triggered. After obtaining the first and second stack information, they are merged and reported to the server device. The server device then concatenates the first and second stack information to obtain the target stack information.

[0088] Step 607: For the function information of the exception function from multiple different clients of the preset application, the multiple function information of the exception function is statistically analyzed using the exception function as the statistical dimension to obtain statistical values ​​of multiple preset dimensions. The preset dimensions include at least one of the following: the number of function information of the exception function, the number of clients, the average function execution time of the exception function, and the average processor execution time of the exception function.

[0089] For example, by processing the function execution process data reported at least once by each client, the corresponding abnormal function for that client can be obtained. To more comprehensively and accurately locate the problem, the function information of abnormal functions corresponding to multiple clients can be statistically analyzed to obtain statistical values ​​for multiple preset dimensions used to assess the impact of abnormal functions on the processor load level of a preset application. The preset dimensions include the number of abnormal function information entries, which can be understood as the number of times each function is identified as an abnormal function; the number of clients, which can be understood as the number of users affected by each abnormal function; and the average function execution time and average processor execution time of abnormal functions, which can be calculated based on the function execution process data.

[0090] Step 608: Determine the degree of impact of the abnormal function on the processor load level of the preset application based on the statistical values ​​of multiple preset dimensions.

[0091] For example, after obtaining the statistical values ​​of multiple preset dimensions corresponding to each abnormal function, a weighted sum of the statistical values ​​of multiple preset dimensions can be performed for each abnormal function to obtain a score that characterizes the degree of influence of the abnormal function on the processor load level of the preset application, which is conducive to further accurate analysis.

[0092] Optionally, in step 606, the execution of determining the call path information of the abnormal function based on the target stack information can be temporarily suspended. Alternatively, after step 608 is completed, the target abnormal function with a score higher than the preset score threshold can be determined based on the above scoring. The call path information of the target abnormal function can be determined based on the above target stack information, which can improve the efficiency of locating abnormal problems and their causes.

[0093] The data processing method provided in this disclosure constructs a thread function tree based on a timeline based on function execution process data during periods when the processor load level of a preset application is higher than a preset level. Functions satisfying different preset conditions are identified based on the function tree, and abnormal functions are determined by combining the two types of functions. For asynchronous tasks, the stack information of the calling thread and the called thread is merged, which helps to locate the true caller of the abnormal function. After identifying the abnormal functions corresponding to multiple client devices, statistical analysis is performed using the function information to quantify the degree of impact. Based on the score, the degree of impact of each abnormal function on the processor load level of the preset application is determined. Targeted optimization can then be performed on abnormal functions with high impact levels to improve the power consumption-related performance of the preset application.

[0094] Figure 8 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure, as shown below. Figure 8 As shown, the device includes:

[0095] The data acquisition module 801 is used to acquire function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level;

[0096] The function tree construction module 802 is used to construct a function tree of the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship. The nodes are associated with the time information of the corresponding functions during the execution process.

[0097] The abnormal function determination module 803 is used to determine the abnormal functions in the function call relationship based on the function tree, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the time consumption of the function, and the second preset condition being related to the execution frequency of the function.

[0098] The data processing apparatus provided in this embodiment constructs a function tree of threads based on function execution process data during a time period when the processor load level of a preset application is higher than a preset level. The function tree is used to determine abnormal functions that meet certain conditions in terms of time consumption and / or execution frequency. This enables accurate location of the causes of abnormal problems affecting the power consumption-related performance of the application. It also facilitates the determination of the degree of impact of the abnormal functions on the processor load level of the preset application using the function information of the abnormal functions.

[0099] Optionally, the exception function determination module includes:

[0100] The node search unit is used to traverse downwards from the top-level node of the function tree until the first node that satisfies the first preset requirement is found, and the function corresponding to the found node is determined as a first type of function, wherein the first type of function is a function that satisfies the first preset condition.

[0101] An exception function determination unit is used to determine the exception function in the function call relationship based on the first type of function;

[0102] The first preset requirement includes: the processor execution time of the function corresponding to the node is greater than a first threshold, the function corresponding to the node is a function of the preset application, and the child nodes of the node meet the second preset requirement.

[0103] The second preset requirement includes: the ratio of the processor execution time of the function corresponding to the child node to the processor execution time of the function corresponding to the node is less than a second threshold.

[0104] Optionally, the function tree is constructed based on a timeline, and the starting position of the node in the timeline is determined according to the start execution time of the corresponding function, and the ending position of the node in the timeline is determined according to the end execution time of the corresponding function.

[0105] The exception function determination module includes:

[0106] The data determination unit is used to determine the execution frequency and time consumption data of the function corresponding to the node located within a preset sliding time window based on the function tree, wherein the time consumption data includes the function execution time and the processor time of the function itself;

[0107] The node positioning unit is used to determine, based on the execution frequency and the time consumption data, the nodes that meet the third preset requirements among the nodes located within the preset sliding time window, and to determine the function corresponding to the determined node as a second type of function, wherein the second type of function is a function that meets the second preset condition;

[0108] An exception function determination unit is used to determine the exception function in the function call relationship based on the second type of function.

[0109] Optionally, the third preset requirement includes: the execution frequency of the function corresponding to the node is greater than a third threshold, and the average processor utilization rate of the function corresponding to the node is greater than a fourth threshold; wherein, the average processor utilization rate is the ratio of a first value to a second value, the first value is the sum of the processor time of each execution of the function within the preset sliding time window, and the second value is the sum of the function execution time of each execution of the function within the preset sliding time window.

[0110] Optionally, the device may also include:

[0111] The stack information acquisition module is used to acquire the first stack information of the calling thread and the second stack information of the called thread in the preset application.

[0112] The stack information splicing module is used to splice the first stack information and the second stack information to obtain the target stack information;

[0113] The path determination module is used to determine the call path information of the exception function based on the target stack information.

[0114] Optionally, the device may also include:

[0115] The statistics module is used to perform statistics on the function information of the abnormal function from multiple different clients of the preset application, taking the abnormal function as the statistical dimension, and obtain statistical values ​​for multiple preset dimensions. The preset dimensions include at least one of the following: the number of function information of the abnormal function, the number of clients, the average function execution time of the abnormal function, and the average processor execution time of the abnormal function.

[0116] The impact determination module is used to determine the degree of impact of the abnormal function on the processor load level of the preset application based on the statistical values ​​of the multiple preset dimensions.

[0117] The data processing apparatus provided in this disclosure can execute the data processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0118] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0119] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Refer to the following... Figure 9 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 9 The diagram below shows the structure of the terminal device or server 900. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0120] like Figure 9 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An edit / output (I / O) interface 905 is also connected to the bus 904.

[0121] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0122] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0123] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0124] The electronic device provided in this embodiment and the data processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0125] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the data processing method provided in the above embodiments.

[0126] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method provided in the above embodiments.

[0127] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0128] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0129] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0130] The aforementioned computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device causes the following: It acquires function execution process data of a preset application within a target time period, wherein the target time period is a time period during which the processor load level of the preset application is higher than a preset level; it constructs a function tree of the threads of the preset application based on the function execution process data, wherein the function tree is used to represent the function call relationship of the threads, the nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during execution; it determines abnormal functions in the function call relationship based on the function tree, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

[0131] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0133] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a module does not necessarily limit the module itself; for example, a data acquisition module can also be described as "a module that acquires function execution process data of a preset application within a target time period".

[0134] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0135] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0136] According to one or more embodiments of this disclosure, a data processing method is provided, comprising:

[0137] Obtain function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level;

[0138] Based on the function execution process data, a function tree of the threads of the preset application is constructed, wherein the function tree is used to represent the function call relationship of the threads, the nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process;

[0139] Based on the function tree, abnormal functions in the function call relationship are determined, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

[0140] According to one or more embodiments of this disclosure, determining the abnormal function in the function call relationship based on the function tree includes:

[0141] Starting from the top node of the function tree, traverse downwards until the first node that satisfies the first preset requirement is found. The function corresponding to the found node is determined as the first type of function, wherein the first type of function is the function that satisfies the first preset condition.

[0142] Based on the first type of function, determine the abnormal functions in the function call relationship;

[0143] The first preset requirement includes: the processor execution time of the function corresponding to the node is greater than a first threshold, and the child nodes of the node meet the second preset requirement;

[0144] The second preset requirement includes: the ratio of the processor execution time of the function corresponding to the child node to the processor execution time of the function corresponding to the node is less than a second threshold.

[0145] According to one or more embodiments of this disclosure, the function tree is constructed based on a timeline, the starting position of the node in the timeline is determined according to the start execution time of the corresponding function, and the ending position of the node in the timeline is determined according to the end execution time of the corresponding function.

[0146] The step of determining the abnormal functions in the function call relationship based on the function tree includes:

[0147] Based on the function tree, the execution frequency and time consumption data of the function corresponding to the node located within the preset sliding time window are determined, wherein the time consumption data includes the function execution time and the processor time of the function itself;

[0148] Based on the execution frequency and the time consumption data, determine the nodes that meet the third preset requirement among the nodes located within the preset sliding time window, and determine the function corresponding to the determined node as the second type of function, wherein the second type of function is a function that meets the second preset condition;

[0149] The abnormal functions in the function call relationship are determined based on the second type of function.

[0150] According to one or more embodiments of this disclosure, the third preset requirement includes: the execution frequency of the function corresponding to the node is greater than a third threshold, and the average processor utilization rate of the function corresponding to the node is greater than a fourth threshold; wherein, the average processor utilization rate is the ratio of a first value to a second value, the first value is the sum of the processor time of each execution of the function within the preset sliding time window, and the second value is the sum of the function execution time of each execution of the function within the preset sliding time window.

[0151] According to one or more embodiments of this disclosure, it further includes:

[0152] Obtain the first stack information of the calling thread and the second stack information of the called thread in the preset application;

[0153] The first stack information and the second stack information are concatenated to obtain the target stack information;

[0154] The call path information of the exception function is determined based on the target stack information.

[0155] According to one or more embodiments of this disclosure, it further includes:

[0156] For the function information of the abnormal function from multiple different clients of the preset application, the multiple function information of the abnormal function is statistically analyzed using the abnormal function as a statistical dimension to obtain statistical values ​​of multiple preset dimensions. The preset dimensions include at least one of the following: the number of function information of the abnormal function, the number of clients, the average function execution time of the abnormal function, and the average processor execution time of the abnormal function.

[0157] Based on the statistical values ​​of the multiple preset dimensions, the degree of influence of the abnormal function on the processor load level of the preset application is determined.

[0158] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0159] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0160] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A data processing method, characterized by, include: Obtain function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level; Based on the function execution process data, a function tree of the threads of the preset application is constructed, wherein the function tree is used to represent the function call relationship of the threads, the nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process; Based on the function tree, abnormal functions in the function call relationship are determined, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

2. The method according to claim 1, characterized in that, The step of determining the abnormal functions in the function call relationship based on the function tree includes: Starting from the top node of the function tree, traverse downwards until the first node that satisfies the first preset requirement is found. The function corresponding to the found node is determined as the first type of function, wherein the first type of function is the function that satisfies the first preset condition. Based on the first type of function, determine the abnormal functions in the function call relationship; The first preset requirement includes: the processor execution time of the function corresponding to the node is greater than a first threshold, and the child nodes of the node meet the second preset requirement; The second preset requirement includes: the ratio of the processor execution time of the function corresponding to the child node to the processor execution time of the function corresponding to the node is less than a second threshold.

3. The method according to claim 1, characterized in that, The function tree is constructed based on a timeline. The starting position of a node on the timeline is determined by the start execution time of the corresponding function, and the ending position of a node on the timeline is determined by the end execution time of the corresponding function. The step of determining the abnormal functions in the function call relationship based on the function tree includes: Based on the function tree, the execution frequency and time consumption data of the functions corresponding to the nodes located within the preset sliding time window are determined, wherein the time consumption data includes the function execution time and the processor time consumption of the function itself; Based on the execution frequency and the time consumption data, determine the nodes that meet the third preset requirements among the nodes located within the preset sliding time window, and determine the functions corresponding to the determined nodes as second type functions, wherein the second type functions are functions that meet the second preset conditions; The abnormal functions in the function call relationship are determined based on the second type of function.

4. The method according to claim 3, characterized in that, The third preset requirement includes: the execution frequency of the function corresponding to the node is greater than the third threshold, and the average processor utilization rate of the function corresponding to the node is greater than the fourth threshold; wherein, the average processor utilization rate is the ratio of the first value to the second value, the first value is the sum of the processor time of the function itself corresponding to each execution of the function within the preset sliding time window, and the second value is the sum of the function execution time of the function corresponding to each execution of the function within the preset sliding time window.

5. The method according to claim 1, characterized in that, Also includes: Obtain the first stack information of the calling thread and the second stack information of the called thread in the preset application; The first stack information and the second stack information are concatenated to obtain the target stack information; The call path information of the exception function is determined based on the target stack information.

6. The method according to claim 1, characterized in that, Also includes: For the function information of the abnormal function from multiple different clients of the preset application, the multiple function information of the abnormal function is statistically analyzed using the abnormal function as a statistical dimension to obtain statistical values ​​of multiple preset dimensions. The preset dimensions include at least one of the following: the number of function information of the abnormal function, the number of clients, the average function execution time of the abnormal function, and the average processor execution time of the abnormal function. Based on the statistical values ​​of the multiple preset dimensions, the degree of influence of the abnormal function on the processor load level of the preset application is determined.

7. A data processing apparatus, characterized in that, include: The data acquisition module is used to acquire function execution process data of a preset application within a target time period, wherein the target time period is the period during which the processor load level of the preset application is higher than a preset level; A function tree construction module is used to construct a function tree of the threads of the preset application based on the function execution process data. The function tree is used to represent the function call relationship of the threads. The nodes in the function tree correspond to the functions in the function call relationship, and the nodes are associated with the time information of the corresponding functions during the execution process. An abnormal function determination module is used to determine abnormal functions in the function call relationship based on the function tree, wherein the abnormal functions include functions that satisfy a first preset condition and / or a second preset condition, the first preset condition being related to the function's time consumption, and the second preset condition being related to the function's execution frequency.

8. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method as described in any one of claims 1-6.

9. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the data processing method as described in any one of claims 1-6.

10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data processing method as described in any one of claims 1-6.