A method, device, apparatus and storage medium for detecting device performance
By automatically locating device performance faults by acquiring device status information and log information, the high cost and low accuracy problems of existing technologies are solved, and efficient performance fault detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2023-02-20
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies for equipment performance fault detection are costly, time-consuming, and have low accuracy, resulting in low efficiency in performance fault detection.
By acquiring the device status information, initial process log information, and initial thread log information of the target device, the target process is determined based on the device status information and initial process log information, and the thread log information of the target thread is determined based on the identification information of the target process and the initial thread log information, and finally the performance fault of the target device is determined.
Equipment performance faults can be identified directly without human intervention, improving the accuracy and efficiency of fault diagnosis.
Smart Images

Figure CN118519836B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and specifically to a method, apparatus, device, and storage medium for testing equipment performance. Background Technology
[0002] Electronic devices such as mobile phones and computers typically generate various log files during operation. These log files are text files used to record the operational status of the device's system, hardware, and software. The content recorded in the log files can fully reflect the device's current performance and any existing problems.
[0003] In related technologies, logs need to be read and analyzed manually to make corresponding adjustments to optimize equipment performance. However, this method is costly, time-consuming, and has low accuracy, resulting in low efficiency and wasted time and effort in performance fault detection. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, device and storage medium for testing equipment performance, in order to solve the problems of high cost, long time and low accuracy in performance fault detection in the prior art, which leads to low efficiency in performance fault detection.
[0005] In a first aspect, embodiments of this application provide a method for testing device performance, applied to a first device, the method comprising:
[0006] The system acquires device status information, initial process log information, and initial thread log information of the target device. The device status information includes the identifier information and performance anomaly type information of the target application. The target application is the application running in the foreground on the target device when the performance anomaly occurs. The initial process log information records information about the processes running on the target device within a target time period, and the information for each process recorded in the initial process log information includes the process identifier information of that process. The target time period includes the time when the performance anomaly occurred. The initial thread log information records information about the threads running on the target device within the target time period.
[0007] Based on the device status information and the initial process log information, a target process is identified among the processes running within the target time period; the target process refers to a process that is related to the target event and meets a preset first fault condition; the target event refers to at least one event in the foreground running process of the target application that exhibits performance abnormalities.
[0008] Based on the process identifier information of the target process, the target event, and the initial thread log information, the thread log information of the target thread is determined; the target thread refers to at least one thread related to the target process that satisfies a preset second fault condition.
[0009] Based on the thread log information of the target thread, the performance failure of the target device is determined.
[0010] In one possible implementation of the first aspect,
[0011] The step of determining the target process from the processes running within the target time period based on the device status information and the initial process log information includes:
[0012] Based on the device status information, at least one first process is identified in the initial process log information; the first process refers to the process related to the target event within the target time period.
[0013] Based on the process log information of the at least one first process and the preset first fault condition, the target process is determined in the at least one first process.
[0014] In one possible implementation of the first aspect, the at least one first process includes a system process and / or an application process.
[0015] In one possible implementation of the first aspect, determining the process log information of at least one first process in the initial process log information based on the device status information and the initial process log information includes:
[0016] Based on the identification information of the target application, the process log information of the application process of the target application is determined from the initial process log information; and / or,
[0017] The target system process is determined based on the performance anomaly type information, and the process log information of the target system process is determined in the initial process log information; the target system process is a system process related to the performance anomaly type.
[0018] In one possible implementation of the first aspect, the process log information of the first process further includes a target runtime; the target runtime is the runtime of the first process in achieving the target event; the method further includes:
[0019] Obtain target foreground running log information; the target foreground running log information is used to record the identification information and foreground running time information of applications that have run in the foreground on the target device within the target time period;
[0020] Based on the identification information of the target application, determine the foreground running time of the target application within the target time period from the target foreground running log information;
[0021] Before determining the target process from the at least one first process based on the process log information of the at least one first process and the preset first fault condition, the method further includes:
[0022] Based on the foreground running time of the target application within the target time period and the target running time of the at least one first process, the first target process log information of at least one first process is determined from the process log information of the at least one first process; the first target process log information of the first process is the process log information in the process log information of the at least one first process that is related to the target running time of the target application within the target time period.
[0023] The step of determining the target process from the at least one first process based on the process log information of the at least one first process and a preset first fault condition includes:
[0024] Based on the first target process log information of the at least one first process and the preset first fault conditions, the target process is determined in the at least one first process.
[0025] In one possible implementation of the first aspect, the device status information further includes: the time information of the target event; the time information of the target event refers to the time information when the performance abnormality occurs at the target time;
[0026] Before determining the target process from the at least one first process based on the first target process log information of the at least one first process and the preset first fault condition, the method further includes:
[0027] Based on the time information of the target event and the target running time of the at least one first process, the second target process log information of at least one first process is determined from the first target process log information of the at least one first process; the second target process log information of the first process is the process log information in the first target process log information of the at least one first process that is related to the time information of the target running time and the time information of the target event.
[0028] The determination of the target process from the at least one first process based on the first target process log information of the at least one first process and the preset first fault condition includes:
[0029] Based on the second target process log information of the first process and the preset first fault conditions, the target process is determined in the at least one first process.
[0030] In one possible implementation of the first aspect, determining the target process from the at least one first process based on the second target process log information of the first process and a preset first fault condition includes:
[0031] Based on the second target process log information of each first process, the target runtime of each first process is determined; the target runtime is the runtime of the first process when it implements the target event.
[0032] Among the at least one first process, the first process that satisfies the first fault condition is determined as the target process, wherein the first fault condition includes the longest target runtime.
[0033] In one possible implementation of the first aspect, the target execution time in the second target process information includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is realized, and the second target function is the ending function that runs in the first process when the target event is realized;
[0034] The determination of the target runtime for each first process based on the second target process log information of each first process includes:
[0035] The target runtime of each first process is determined based on the execution time of the first objective function and the execution time of the second objective function of each first process.
[0036] In one possible implementation of the first aspect, the target event includes one or more of the following: application launch event, click response event, touch swipe event, and display refresh event.
[0037] In one possible implementation of the first aspect, the identification information of the target application includes the application package name information of the target application and / or the process identification information of the target application process.
[0038] In one possible implementation of the first aspect, determining the thread log information of the target thread based on the process identifier information of the target process, the target event, and the initial thread log information includes:
[0039] Based on the process identifier information of the target process and the target event, at least one thread log information of a first thread is determined in the initial thread log information; the first thread refers to the thread of the target process related to the target event;
[0040] Based on the process log information of the first thread and the preset second fault condition, the thread log information of the target thread is determined from the thread log information of the at least one first thread.
[0041] In one possible implementation of the first aspect, the thread log information includes the thread's runtime;
[0042] The step of determining the target thread's thread log information from the thread log information of at least one first thread, based on the thread log information of the first thread and a preset second fault condition, includes:
[0043] Based on the thread runtime in the thread log information of the first thread, the first thread that meets the second fault condition is determined as the target thread among the at least one first thread, and the thread log information of the target thread is obtained; the second fault condition includes: the longest runtime.
[0044] In one possible implementation of the first aspect, the thread log information of the target thread includes the duration of different states maintained during the execution of the target thread in implementing the target event;
[0045] The step of determining the performance fault of the target device based on the thread log information of the target thread includes:
[0046] Based on the duration of different states maintained during the execution of the target event by the target thread in the thread log information, the abnormal states that occurred during the execution of the target thread are determined.
[0047] Based on the abnormal state that occurs during the execution of the target thread, the performance failure of the target device is determined.
[0048] In one possible implementation of the first aspect, the method further includes, before determining the performance failure of the target device based on the thread log information of the target thread:
[0049] When a performance anomaly occurs, obtain the target resource information of the target device; the target resource information is the log information of the performance-related resources of the target device.
[0050] The step of determining the performance fault of the target device based on the thread log information of the target thread includes:
[0051] Based on the thread log information of the target thread and the target resource information of the target device, the performance fault of the target device is determined.
[0052] In one possible implementation of the first aspect, obtaining the device status information, initial process log information, and initial thread log information of the target device includes:
[0053] Receive the target device's device status information, initial process log information, and initial thread log information sent by the target device.
[0054] In one possible implementation of the first aspect, obtaining the initial process log information and the initial thread log information includes:
[0055] Retrieve stored process log information and thread log information;
[0056] Based on the time of the performance anomaly, the initial process information is determined in the process log information, and the initial thread log information is determined in the thread log information.
[0057] One possible implementation of the first aspect also includes:
[0058] Based on the identified performance faults, performance optimization information is determined;
[0059] The target device is optimized based on the performance optimization information.
[0060] Secondly, embodiments of this application provide a method for testing device performance, applied to a second device, the method comprising:
[0061] The system acquires device status information, initial process log information, and initial thread log information. The device status information includes the identifier information of the target application and the performance anomaly type information. The target application is the application running in the foreground on the second device when the performance anomaly occurs. The initial process log information records information about the processes running on the second device within a target time period, and the information for each process recorded in the initial process log information includes the process identifier information of that process. The target time period includes the time when the performance anomaly occurred. The initial thread log information records information about the threads running on the target device within the target time period.
[0062] The device status information, initial process log information, and initial thread log information are sent to the first device.
[0063] One possible implementation of the second aspect also includes:
[0064] Obtain target foreground running log information; the target foreground running log information is used to record the identification information and foreground running time information of applications that have run in the foreground on the target device within the target time period;
[0065] Send the target foreground operation log information to the first device.
[0066] In one possible implementation of the second aspect, the device status information further includes: time information of the target event; the target event refers to at least one event in the foreground operation of the target application where a performance abnormality exists; the time information of the target event refers to the time information of the performance abnormality occurring at the target time.
[0067] In one possible implementation of the second aspect, the initial process log information includes the process log information of a first process; the process log information of the first process further includes a target running time; wherein, the target running time is the running time of the first process in implementing the target event; the first process refers to the process related to the target event within the target time period;
[0068] The process log information of the first process includes the first target process log information of at least one first process; the first target process log information of the first process is the process log information of the at least one first process that is related to the target running time and the foreground running time of the target application within the target time period.
[0069] In one possible implementation of the second aspect, the at least one first process log information includes at least one second target process log information of the first process; the second target process log information of the first process is process log information related to the time information of the target running time and the target event in the first target process log information of the at least one first process.
[0070] The target execution time of the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is achieved, and the second target function is the ending function that runs in the first process when the target event is achieved.
[0071] In one possible implementation of the second aspect, the identification information of the target application includes the application package name information of the target application and / or the process identification information of the target application process.
[0072] In one possible implementation of the second aspect, the thread log information includes the thread's runtime.
[0073] In one possible implementation of the second aspect, the thread log information of the target thread includes the duration of different states maintained during the process of the target thread implementing the target event.
[0074] Thirdly, embodiments of this application provide an apparatus for testing device performance, comprising:
[0075] The acquisition unit is used to acquire device status information, initial process log information, and initial thread log information of the target device. The device status information includes the identification information and performance anomaly type information of the target application. The target application is the application running in the foreground of the target device when the performance anomaly occurs. The initial process log information is used to record information about the processes running on the target device within a target time period. The information of each process recorded in the initial process log information includes the process identification information of the process. The target time period includes the time when the performance anomaly occurred. The initial thread log information is used to record information about the threads running on the target device within the target time period.
[0076] The processing unit is configured to determine the target process from the processes running within the target time period based on the device status information and the initial process log information; the target process refers to a process that is related to the target event and meets a preset first fault condition; the target event refers to an event in which at least one event running during the foreground operation of the target application exhibits performance abnormality;
[0077] The processing unit is further configured to determine the thread log information of the target thread based on the process identifier information of the target process, the target event, and the initial thread log information; the target thread refers to at least one thread related to the target process that satisfies a preset second fault condition;
[0078] The processing unit is further configured to determine the performance fault of the target device based on the thread log information of the target thread.
[0079] Fourthly, embodiments of this application provide an apparatus for testing device performance, comprising:
[0080] The acquisition unit is used to acquire device status information, initial process log information, and initial thread log information; the device status information includes the identification information and performance anomaly type information of the target application; the target application is the application running in the foreground of the second device when the performance anomaly occurs; the initial process log information is used to record information about the processes running on the second device within a target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process; the target time period includes the time when the performance anomaly occurred; the initial thread log information is used to record information about the threads running on the target device within the target time period.
[0081] The sending unit is used to send the device status information, initial process log information and initial thread log information to the first device.
[0082] Fifthly, embodiments of this application provide an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method described in any of the first aspects above, or is used to execute the method described in any of the second aspects above.
[0083] In a sixth aspect, embodiments of this application provide a computer-readable storage medium comprising a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the method described in any of the first aspects above, or is used to perform the method described in any of the second aspects above.
[0084] The solution provided in this application obtains the device status information, initial process log information, and initial thread log information of the target device. Based on the device status information and initial process log information, the target process is identified among the processes running within the target time period. Based on the identifier information and initial thread log information of the target process, the thread log information of the target thread is identified. Based on the thread log information of the target thread, the performance fault of the target device is determined. In this way, the first device can directly determine the performance fault of the target device based on the device status information, initial process log information, and initial thread information without manual intervention, thereby reducing the cost of performance testing. Furthermore, this application locates the performance fault by pinpointing the target thread, improving the accuracy of performance fault determination and increasing the efficiency of performance testing. Attached Figure Description
[0085] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0086] Figure 1 A flowchart illustrating a method for testing device performance provided in an embodiment of this application;
[0087] Figure 2 A flowchart illustrating another method for testing device performance provided in this application embodiment;
[0088] Figure 3 A flowchart illustrating another method for testing device performance provided in this application embodiment;
[0089] Figure 4 A schematic diagram illustrating a method for testing device performance provided in an embodiment of this application;
[0090] Figure 5a A schematic diagram illustrating a scenario for another method of device performance testing provided in an embodiment of this application;
[0091] Figure 5b A schematic diagram illustrating a scenario for another method of device performance testing provided in an embodiment of this application;
[0092] Figure 6 A flowchart illustrating another method for testing device performance provided in this application embodiment;
[0093] Figure 7 A flowchart illustrating another method for testing device performance provided in this application embodiment;
[0094] Figure 8 A flowchart illustrating another method for testing device performance provided in this application embodiment;
[0095] Figure 9 This is a schematic diagram of the structure of a device for testing equipment performance provided in an embodiment of this application;
[0096] Figure 10 A schematic diagram of another device for testing equipment performance provided in this application embodiment;
[0097] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0098] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0099] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0100] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0101] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0102] Before providing a detailed description of the embodiments of this application, the terms used or possibly used in the embodiments of this application will first be explained.
[0103] A process is a running activity of a program on a certain set of data in a computer. It is the basic unit for system resource allocation and scheduling and is the foundation of the operating system structure.
[0104] A thread is the smallest unit of computation that an operating system can schedule. It is contained within a process and is the actual unit of operation within a process.
[0105] In related technologies, to ensure a good user experience with electronic devices, it is necessary to detect performance faults. Electronic devices generate various logs during operation. In some technologies, these logs are manually reviewed and analyzed to detect performance faults and allow for adjustments to optimize device performance. However, this method is labor-intensive, time-consuming, and has low accuracy, resulting in inefficient and time-consuming performance fault detection.
[0106] To address the aforementioned issues, this application provides a method, apparatus, device, and storage setup for device performance testing. It acquires device status information, initial process log information, and initial thread log information of the target device; identifies the target process among processes running within a target time period based on the device status information and initial process log information; determines the thread log information of the target thread based on the identifier information and initial thread log information of the target process; and determines the performance fault of the target device based on the thread log information of the target thread. In this way, the first device can directly determine the performance fault of the target device based on the device status information, initial process log information, and initial thread information without manual intervention, thereby reducing the cost of performance testing. Furthermore, this application locates performance faults by pinpointing the target thread, improving the accuracy of performance fault determination and increasing the efficiency of performance testing. A detailed description follows.
[0107] See Figure 1 This is a flowchart illustrating a method for testing device performance according to an embodiment of this application. The method is applied to a first device and includes:
[0108] Step S101: Obtain the device status information, initial process log information and initial thread log information of the target device.
[0109] The device status information includes the target application's identification information and performance anomaly type information; the target application is the application running in the foreground of the target device when the performance anomaly occurs; the initial process log information records information about the processes running on the target device within the target time period, and the information for each process recorded in the initial process log information includes the process identification information; the target time period includes the time when the performance anomaly occurred; the initial thread log information records information about the threads running on the target device within the target time period. The performance anomaly type information characterizes the type of performance anomaly present in the target application. Performance anomaly types include at least one of the following: application startup anomaly, click response anomaly, scrolling anomaly, and game anomaly. Application startup anomaly includes whether the application timed out, etc. Click response anomaly includes whether there is no response to clicks or whether the click response timed out, etc. Scrolling anomaly includes whether scrolling is not smooth or the page refresh is slow, etc. Game anomaly includes whether the game lags or the game page refreshes slowly, etc.
[0110] When electronic devices experience performance failures, it typically manifests as lag or timeouts when users are running applications. Therefore, an electronic device is usually considered to have a performance anomaly and requires testing only when such issues occur. Based on this, when a target device experiences a performance anomaly, such as timeouts or lag during application execution, the target device usually records relevant information about the performance anomaly. That is, the target device can record its device status information at the time the performance anomaly occurs. Device status information characterizes the information related to the performance anomaly on the target device at the time of the anomaly. For example, to facilitate the first device in determining whether a performance failure exists based on the relevant process and thread information of the application running in the foreground at the time of the performance anomaly, the device status information may include the target application's identification information and the performance anomaly type information. The target application refers to the application running in the foreground on the target device at the time of the performance anomaly. In this embodiment, when the target device is running an application in the foreground, it also needs to record information about the relevant processes of that application, such as process identification information and process runtime, which constitutes recording process log information. Simultaneously, when the target device is running an application in the foreground, it also needs to record the thread information of each running process, such as thread identifier information and thread runtime, which is called recording thread log information. In this way, when the target device experiences performance anomalies, the device state information at the time of the performance anomaly can be recorded, and based on the time of the performance anomaly, the process log information for the target time period can be obtained from the recorded process log information, which is called obtaining initial process log information based on the performance anomaly time. Similarly, based on the time of the performance anomaly, the thread log information for the target time period can be obtained from the recorded thread log information, which is called obtaining initial thread log information based on the performance anomaly time. When a performance anomaly occurs, after determining the target device's device state information, initial process log information, and initial thread log information, the first device obtains the target device's device state information, initial process log information, and initial thread log information.
[0111] The target time period is the time encompassing the occurrence of the performance anomaly, and is determined based on that occurrence time. The duration of the target time period can be preset according to actual needs; for example, if the target time period is 10 minutes, it can be a time period with the performance anomaly occurrence time as its midpoint. In this case, the initial process log information acquired by the first device can be the process log information within five minutes before and after the performance anomaly occurrence time. Of course, the target time period can also be other 10-minute time periods that include the performance anomaly occurrence time; this application does not impose any restrictions on this.
[0112] It should be understood that the detection of performance failures of the target device can be performed by the target device itself or by other devices, such as a server or other terminal devices. In other words, the first device can be the target device or other devices besides the target device, such as a server or other terminal devices.
[0113] Depending on the type of the first device, the methods by which the first device obtains the device status information, initial process log information, and initial thread log information of the target device also differ.
[0114] As one possible implementation, when the first device is a device other than the target device, the device status information, initial process log information, and initial thread log information of the target device are obtained, including:
[0115] Receive the target device's device status information, initial process log information, and initial thread log information sent by the target device.
[0116] In other words, when a performance anomaly occurs, after determining the target device's device status information, initial process log information, and initial thread log information, the target device can send these information to the first device. The first device receives the target device's device status information, initial process log information, and initial thread log information sent by the target device.
[0117] It should be noted that, in the embodiments of this application, "sending the target device's device status information, initial process log information, and initial thread log information to the first device" can be understood as the destination of the target device's device status information, initial process log information, and initial thread log information being the first device. This can include sending the target device's device status information, initial process log information, and initial thread log information to the first device directly or indirectly. Similarly, "the first device receiving the target device's device status information, initial process log information, and initial thread log information sent by the target device" can be understood as the source of the target device's device status information, initial process log information, and initial thread log information being the target device. This can include receiving the target device's device status information, initial process log information, and initial thread log information directly or indirectly from the target device. The information may undergo necessary processing between the source and destination, such as encoding, but the destination can understand the valid information from the source. Similar expressions in this application can be understood in a similar way, and will not be repeated here.
[0118] Alternatively, as a possible implementation, when the first device is also the target device, the initial process log information and initial thread log information obtained include:
[0119] Retrieve recorded process log information and thread log information;
[0120] Based on the time of the performance anomaly, the initial process information is determined from the process log information, and the initial thread log information is determined from the thread log information.
[0121] In other words, when the first device is the target device, it acquires the initial process log information and initial thread log information. At this time, when the first device is running an application in the foreground, it records the application's process log information and thread log information in real time. When the application currently running in the foreground on the first device experiences performance anomalies, the first device can obtain device status information based on the performance anomaly information of the foreground application. Based on the time of the performance anomaly occurrence, it acquires the recorded process log information and thread log information. After acquiring the process log information, it can retrieve the process log information for the target time period from the process log information based on the time of the performance anomaly occurrence; this is called acquiring the initial process log information. Similarly, it can retrieve the thread log information for the target time period from the thread log information; this is called acquiring the initial thread log information.
[0122] Step S102: Based on the device status information and initial process log information, determine the target process among the processes running within the target time period.
[0123] The target process refers to the process that is related to the target event and meets the preset first fault condition; the target event refers to at least one event in the foreground operation of the target application that has a performance abnormality.
[0124] In this embodiment, the target application on the target device may run different events when running in the foreground. The events run by the target application will differ depending on the user's actions. For example, when a user opens the target application, the application enters the application launch event. After the target application launches, if the user performs a triggering operation on the target application's activity page, such as a swipe, the target application switches to touch swipe and display refresh events. That is, different events are pre-set in the target application, and different events are run based on the user's actions, thus displaying different activity pages on the target device. If a performance anomaly occurs while the target application is running a certain event, such as a response timeout or launch timeout, this event can be referred to as the target event.
[0125] In some embodiments, the target event includes one or more of the following: application launch event, click response event, touch swipe event, and display refresh event.
[0126] After obtaining the device status information and initial process log information of the target device, the first device can determine the process log information of the target application within the target time period based on the identification information and performance anomaly type information of the target application in the device status information and the initial process log information. Thus, based on the process log information of the target application, the first device can determine the process that is related to the target event and meets the preset first fault condition among the processes of the target application running within the target time period, which is the target process.
[0127] The process corresponding to the target application refers to the application process of the target application and the system process that implements different runtime events of the target application.
[0128] As one possible implementation, based on device status information and initial process log information, the target process is identified from the processes running within the target time period, including:
[0129] Based on the device status information, at least one first process's process log information is determined from the initial process log information.
[0130] Based on the process log information of the first process and the preset first fault conditions, the target process is determined in at least one first process.
[0131] The first process refers to the process related to the target event within the target time period.
[0132] In this embodiment, the initial process log information includes the process log information of the processes running on the target device within the target time period. Therefore, the initial process log information not only includes the process log information of processes related to the target event, but also the process log information of other event-related processes of the target application that the target device ran in the foreground within the target time period, as well as the process log information of other application-related processes that the target device ran in the foreground within the target time period. Therefore, to more quickly determine the target process, the first device can determine the process log information of processes related to the target event within the target time period from the initial process log information based on the target application's identifier information and exception type information in the device status information. That is, at least one first process's process log information is determined.
[0133] The first device can determine the process that meets the first fault condition as the target process from at least one first process based on the first process log information and the preset first fault condition.
[0134] The first fault condition is pre-set according to actual needs and is used to identify at least one process that is most relevant to the performance anomaly.
[0135] As one possible implementation, at least one first process includes a system process and / or an application process.
[0136] In this embodiment, when the target device runs an application, it needs to run not only the application's own process but also the processes of the operating system on the target device to enable the application to run. For example, when starting application a, the target device needs to first call the operating system's process a to determine that application a needs to be started, and then call the operating system's process b to start the application process of application a. Since the target application needs to run not only its own application process but also system processes during runtime, the processes related to the target event running within the target time period may include the application processes of the target application or system processes. Therefore, when the first device determines at least one first process, the at least one first process includes system processes and / or application processes.
[0137] As one possible implementation, based on device status information and initial process log information, the process log information of at least one first process is determined from the initial process log information, including:
[0138] Based on the target application's identification information, determine the application process's process log information in the initial process log information; and / or, based on the performance exception type information, determine the target system process and determine its process log information in the initial process log information.
[0139] Among them, the target system process is the system process related to the type of performance anomaly.
[0140] In this embodiment, when at least one first process includes an application process and / or a system process, the first device determines the process log information of the system process and the application process related to the target event within the target time period in the initial process log information based on the target application's identifier information and performance anomaly type information in the device status information. For the target application's application process, the identifier information of the target application's application process is the same as the target application's identifier information, or the identifier information of the target application's application process contains the target application's identifier information. In this case, the first device can determine the process log information containing the target application's identifier information in the initial process log information as the process log information of the target application's application process based on the target application's identifier information in the device status information.
[0141] In the operating system of the target device, the role of each system process is defined. Therefore, different processes are invoked to implement different functions of an application. If a performance anomaly occurs during the operation of the target application, the device status information contains the type of performance anomaly. Since different performance anomaly events in the target application correspond to different performance anomaly types, the first device can determine the target event based on the performance anomaly type. For example, if the performance anomaly type includes application startup anomaly, the target event can be determined as the application startup event. If the performance anomaly is click response anomaly, the target event can be determined as the click response event and the display refresh event. If the performance anomaly is swipe anomaly, the target event can be determined as the touch swipe time and the display refresh event. If the performance anomaly is game anomaly, the target event can be determined as the display refresh event. In the first device, the system processes invoked to implement different events of the target application are pre-set. Therefore, the first device can determine the target event based on the performance anomaly type in the device status information, and then determine the system process corresponding to the target event based on the target event, and determine the process log information of the system process corresponding to the target event in the initial process log information.
[0142] Using the above method, the process log information of the target application's application process and the process log information of the system process corresponding to the target event of the target application can be determined from the initial log information.
[0143] Because the target device may be running applications other than the target application in the foreground during the target time period, or, while running the target application in the foreground, the target device may be running other events in addition to the target event, the process log information of at least one first process determined in the above manner is the process log information of all processes related to the target event during the target time period. For example, if the target event is an application launch event, then the system processes related to the target event determined by the first device are the system processes related to the application launch event during the target time period. This system process may not only be launching the target application during the target time period, but may also be launching other applications running in the foreground during the target time period, or may also be implementing other events of the target application. Therefore, in the initial process log information, the process log information of the determined system process includes not only the process log information of the system process implementing the target event during the target time period, but also the process log information of the system process implementing other applications or implementing other events. Furthermore, because the target device may also be running other events during the target time period, the process log information of the target application's application process also includes the process log information of the target application running the target event, as well as the process log information of the target application running other events. Since the first device only needs to obtain the process log information of the processes related to the target event of the target application, if the target application experiences performance anomalies during foreground runtime, it is only necessary to obtain the process log information of the system processes and application processes related to the target application during foreground runtime. In this case, it is necessary to identify the first target process log information of at least one first process related to the target event during the foreground runtime of the target application from the process log information of at least one of the aforementioned first processes.
[0144] Based on this, as a possible implementation, the process log information of the first process also includes the target runtime. For example... Figure 2 As shown, the method described in this application further includes:
[0145] Step S1021: Obtain the target front-end running log information.
[0146] Among them, the target foreground operation log information is used to record the identification information and foreground operation time information of the applications that have run in the foreground on the target device within the target time period.
[0147] In this embodiment of the application, since the first device needs to determine the time during which the target application runs in the foreground within the target time period on the target device, it needs to obtain the target foreground running log information.
[0148] At this point, the acquisition method varies depending on the first device. When the first device is the target device, since the first device records relevant information about the application running in the foreground, such as the application's identifier and running time, it forms foreground running log information. The first device can directly obtain the foreground running log information within the target time period from its recorded foreground running log information to obtain the target foreground running log information.
[0149] When the first device is a device other than the target device, the target device needs to simultaneously acquire the foreground operation log information for the target time period when a performance anomaly occurs, obtain the target foreground operation log information, and send the acquired target foreground operation log information to the first device. The first device receives the target foreground operation log information sent by the target device.
[0150] Step S1022: Based on the identification information of the target application, determine the foreground running time of the target application within the target time period from the target foreground running log information.
[0151] In this embodiment of the application, after the first device obtains the target foreground running log information, since the target foreground running log information records the identification information of the application that has been running in the foreground and the foreground running time, the first device can determine the foreground running time of the target application in the target foreground running log information based on the identification information of the target application.
[0152] Step S1023: Based on the foreground running time of the target application within the target time period, determine the first target process log information of at least one first process from the process log information of at least one first process.
[0153] Among them, the first target process log information of the first process is the process log information of at least one first process that is related to the target running time and the foreground running time of the target application within the target time period.
[0154] In other words, after the first device determines the foreground runtime of the target application, it needs to identify the process log information of the processes related to the target application running in the foreground during the target time period from the process log information of at least one first process. At this point, the first device can determine the process log information of the first process whose target runtime is within the foreground runtime range of the target application within the target time period, based on the foreground runtime of the target application within the target time period. That is, the at least one first process is a process related to the target event within the target time period. Among the at least one first process identified, the first device, based on the target runtime recorded in the process log information of each first process, determines the process log information of the first process whose target runtime is within the foreground runtime range of the target application as the first target process log information. In other words, the target device can only run one application in the foreground at a time. If the target runtime is within the foreground runtime range of the target application while it is running in the foreground, it indicates that the process is used to implement the target application, and the process log information whose target runtime is within the foreground runtime range of the target application can be determined as the first target process log information.
[0155] The above steps, based on the process log information of the first process and a preset first fault condition, determine the target process in at least one first process, including:
[0156] Step S1024: Based on the first target process log information of at least one first process and the preset first fault conditions, determine the target process in at least one first process.
[0157] That is, after the first device determines the first target process log information of at least one first process, in order to improve the accuracy of performance fault detection, the first device needs to determine the first process that meets the first fault condition as the target process in at least one first process based on the first target process log information of each first process and the preset first fault condition.
[0158] If a target application runs in the foreground within a target time period, and the application executes a certain event multiple times, with a performance anomaly occurring on the last execution of that event, then the process associated with that event can be identified as the first process. The log information of the first target process identified using the above method will then contain not only the process log information when the performance anomaly occurred, but may also include the process log information when the event did not exhibit a performance anomaly. To more accurately detect performance faults, the first device only needs to obtain the process log information when the event exhibited a performance anomaly.
[0159] Therefore, as a possible implementation, the device status information also includes: the time information of the target event. This time information refers to the time when the target event performance anomaly occurs. The time information of the target event includes the start time and duration of the target event.
[0160] At this time, as Figure 3 As shown, before determining the target process in at least one first process based on the first target process log information of at least one first process and a preset first fault condition in step S1024, the method further includes:
[0161] Step S1025: Based on the time information of the target event and the target running time of at least one first process, determine the second target process log information of at least one first process from the first target process log information of at least one first process.
[0162] Among them, the second target process log information of the first process is the process log information related to the target running time and the time information of the target event in the first target process log information of at least one first process.
[0163] In this embodiment, the first device can obtain the time information of the target event based on the device status information. After obtaining the time information of the target event, and after obtaining the first target process log information of at least one first process, the first device can determine the target running time of each first process based on each first target process log information. The first device determines the first target process log information whose target running time is related to the time information of the target event in the first target process log information of at least one first process as the second target process log information of the first process. That is, after obtaining the time information of the target event, the first device can determine the start time and duration of the target event based on the time information of the target event, which is to determine the performance anomaly time of the target event. Based on the performance anomaly time of the target event, the first device can determine the first target process log information whose target running time is within the performance anomaly time range of the target event in the first target process log information of at least one first process as the second target process log information of the first process. In other words, the first device can identify the process log information of the first process corresponding to the target event when the target application of the target device is running in the foreground within the target time period, based on the first target process log information of the first process of the first process of the first process, and filter out the process log information of the first process that is running without performance abnormalities, thereby identifying the process log information of the target application that is only related to the target event.
[0164] At this point, step S1024, based on the first target process log information of at least one first process and the preset first fault condition, determines the target process from at least one first process, including:
[0165] Based on the second target process log information of the first process and the preset first fault conditions, the target process is determined in at least one first process.
[0166] That is, after determining the second target process log information of the first process, the first device can, based on the second target process log information of each first process and the preset first fault condition, determine the first process that meets the first fault condition as the target process in at least one first process.
[0167] As one possible implementation, the first fault condition includes the target having the longest runtime. In this case, based on the second target process log information of the first process and the preset first fault condition, the target process is determined in at least one first process to include:
[0168] Based on the second target process log information of each first process, the target runtime of each first process is determined. Among at least one first process, the first process with the longest target runtime is determined as the process that satisfies the first fault condition, and the process that satisfies the first fault condition is determined as the target process.
[0169] The target runtime is the runtime of the first process when the target application is running in the foreground and the target event is implemented.
[0170] In this embodiment, if a performance anomaly occurs when the target application is running in the foreground on the target device, it manifests as lag, timeout, or startup timeout. This indicates that the relevant processes of the target application running on the target device have not completed the corresponding function scheduling within the specified time. Therefore, it is necessary to identify the abnormal processes. In some embodiments, the first process, during its operation, not only needs to implement the target event but may also implement other events of the target application or events of other applications based on user operations. Therefore, the first device needs to determine the runtime of each first process for implementing the target event based on the process log information of each first process, i.e., determine the target runtime of each first process. Based on the target runtime of each first process, the first process with the longest target runtime among at least one first process is the first process that meets the first fault condition and is identified as the target process. This target process is the first process with runtime timeout and an anomaly.
[0171] As one possible implementation, in order to determine the target runtime more quickly, the target runtime in the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is realized, and the second target function is the ending function that runs in the first process when the target event is realized.
[0172] At this point, the target runtime for each first process, determined based on the second target process log information for each first process, includes:
[0173] The target runtime of each first process is determined based on the execution time of the first objective function and the execution time of the second objective function of each first process.
[0174] In this embodiment, a first process schedules different functions to implement different events of the target application. For each first process, the initial function used to implement the target event is called the first target function, and the ending function used to implement the target event is called the second target function. The processes related to the target event in the target device during the target time period include not only the application process of the target application but also the system process used to serve the target application in implementing the target event. That is, at least one process includes both application processes and system processes. Based on this, the application process of the target application can implement the target event by calling its corresponding function related to the target event, and the system process can implement the target event by calling its corresponding function related to the target event. The first target function corresponding to the application process of the target application is different from the first target function corresponding to the system process, and the second target function corresponding to the application process of the target application is different from the second target function corresponding to the system process. To facilitate the calculation of the target runtime of each first process, the target runtime of the second target process log information of the first process includes the execution time of the initial function running when the target event is implemented, and the execution time of the ending function running when the target event is implemented. That is, the target runtime of the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function. In this way, after the first device obtains the process log information of the first process, it can calculate the target runtime of the first process based on the execution time of the first target function and the execution time of the second target function in the process log information of each first process.
[0175] It should be noted that each application needs to run at least one event during its operation, and the functions called for each event are not exactly the same for each application. Therefore, at least one first process corresponding to different target events is not exactly the same. Furthermore, the first objective function and the second objective function of each first process for each target event are not exactly the same.
[0176] As one possible implementation, the target application's identification information includes the target application's package name and / or the target application's process identification information.
[0177] For example, at time t1, the target device runs application a, and the current event of application a is the application launch event. At this time, when the target device implements the application launch event, it also needs to record the process log information of the processes in application a related to the application launch event. Assume that the processes in application a related to the application launch event are first process a, second process b, and third process c. At this time, the process log information of the processes in application a related to the application launch event recorded by the target device is the process log information of first process a, second process b, and third process c. Among them, the process log information of first process a recorded by the target device includes the process identifier of first process a, the execution time of the initial function of first process a implementing the application launch event, and the execution time of the end function of first process a implementing the application launch event, such as... Figure 4 As shown. Similarly, the process log information of the second process b includes the process identifier of the second process b, the execution time of the initial function of the second process b implementing the application startup event, and the execution time of the termination function of the second process b implementing the application startup event. The process log information of the third process c includes the process identifier of the third process c, the execution time of the initial function of the third process c implementing the application startup event, and the execution time of the termination function of the third process c implementing the application startup event.
[0178] After application a launch event is completed (i.e., after application a is launched on the target device), if the user clicks on application a at time t2, application a will initiate a click response event to respond to the user's click. At this time, the target device also needs to record the process log information of the processes related to the click response event of application a. Assume the processes related to the click response event of application a are the third process c, the fourth process d, and the fifth process f. The process log information recorded by the target device for the processes related to the click response event of application a is the process log information for the third process c, the fourth process d, and the fifth process f. Specifically, the process log information for the third process c includes the process identifier of the third process c, the execution time of the initial function of the third process c implementing the click response event of application a, and the execution time of the final function of the third process c implementing the click response event of application a. Similarly, the process log information for the fourth process d includes the process identifier of the fourth process d, the execution time of the initial function of the fourth process d implementing the click response event of application a, and the execution time of the final function of the fourth process d implementing the click response event of application a. The process log information of the fifth process f includes the process identifier of the fifth process f, the execution time of the initial function of the click response event implemented by the fifth process f in application a, and the execution time of the end function of the click response event implemented by the fifth process f in application a. Assume that the function called by the third process c in the application launch event implementation of application a is different from the function called in the click response event implementation of application a. In this case, the initial function of the application launch event implemented by the third process c is different from the initial function of the click response event implemented by the third process c in application a, and the end function of the application launch event implemented by the third process c is different from the end function of the click response event implemented by the third process c in application a. Assume that the target device triggers the click response event again in application a at time t3; the details can be found in the above process and will not be repeated here.
[0179] Suppose the target device responds to a click event of application 'a' at time t3, exhibiting a performance anomaly of response timeout. At this point, the target device needs to record device status information, specifically the identifier of application 'a', and the performance anomaly type as click response timeout and click response time information. Based on the click response start time in the click response time information, the target device can determine the initial process log information and the initial thread log information. The first device acquires the target device's device status information, initial process log information, and initial thread log information. Based on the identifier of application 'a' in the device status information, the first device identifies the application process of application 'a' in the initial process log. It then determines the target event based on the performance anomaly type, thereby identifying the system process implementing the target event in the initial process log. Assume the third process 'c' is the application process, and the fourth process 'd' and the fifth process 'f' are system processes. In this case, the first device can determine the process log information of the application process of application 'a' in the initial process log, which means determining the process log information of the third process 'c' in the initial process log information. The first device pre-configures information about system processes corresponding to different events. Therefore, after acquiring the performance anomaly type, the first device can identify the event causing the performance anomaly, i.e., the target event, and thus determine which system processes correspond to the target event. The process log information of the system processes is then determined from the initial process log information. At this point, the first device can determine that the performance anomaly event for application a is a click response event, and the system processes for the click response event are the fourth process d and the fifth process f. The first device can then determine the process log information of the fourth process d and the fifth process f from the initial process log information. Assuming that the process log information of the fourth process d and the fifth process f recorded in the initial process log information also includes process log information when the fourth process d and the fifth process f are serving other applications, then the first device, based on the performance anomaly type, determines from the initial process log information that it includes all process log information of the fourth process d and the fifth process f, i.e., process log information of the fourth process d and the fifth process f serving application a and process log information serving other applications. At this point, the process log information of the third process c, the fourth process d, and the fifth process f can be identified as the process log information of the first process.
[0180] When the target device runs application a in the foreground, it also needs to record the foreground runtime of application a in the foreground runtime log information. When a click response timeout occurs in application a, the target device can also obtain the target foreground runtime log information within the target time period based on the time of the exception. The first device can obtain the target foreground runtime log information. At this time, the first device can determine the foreground runtime of application a within the target time period based on the identification information of application a in the target foreground runtime log information. The first device can determine the foreground runtime of application a within the target time period and the target runtime in the process log information of each first process, where the target runtime is the runtime of the click response event of application a in the first process. The process log information of the first process within the range of the foreground runtime of application a within the target time period is determined as the first target process log information of the first process. At this time, the first device can determine the process log information of the application process of application a, namely the process log information of the third process c, the process log information of the fourth process d when providing foreground service of application a, and the process log information of the fifth process f when providing foreground service of application a, as the first target process log information of the first process.
[0181] When the target time period includes times t2 and t3, the first target process log information of the first process determined at this time includes the process log information of application a when running the click response event without performance anomalies. Since the device status information of the target device includes click response time information, the first device can determine the time information when the click response event caused a performance anomaly based on the click response time information. Assume the occurrence time is t3 and the duration is 2 seconds. At this time, the first device can determine the occurrence time and duration of the performance anomaly based on the click response time information, which is to determine the performance anomaly time of the click response event. Based on the performance anomaly time of the click response event and the target running time in the first target process log information of each first process, the first device can determine the first target process log information whose target running time is within the performance anomaly time range of the click response event as the second target process log information of the first process. That is, the first device can use the process log information of the third process c of application a whose target running time is within the performance anomaly time range of the click response event as the second target process log information of the third process c, and use the process log information of the fourth process d that serves the foreground application a and whose target running time is within the performance anomaly time range of the click response event as the second target process log information of the fourth process d. Similarly, the process log information of the fifth process f that serves the foreground application a and whose target runtime is within the performance anomaly time range of the click response event is taken as the second target process log information of the fifth process f.
[0182] The first device determines the target runtime of the third process c based on the execution time of the first objective function in the second target process log information, which is the execution time of the initial function of the working event that implements the click response of application a, and the execution time of the second objective function, which is the execution time of the final function of the working event that implements the click response of application a. Similarly, the first device determines the target runtime of the fourth process d based on the execution time of the first objective function in the second target process log information, which is the execution time of the initial function of the working event that implements the click response of application a, and the execution time of the second objective function, which is the execution time of the final function of the working event that implements the click response of application a. Assuming the first fault condition is the longest target runtime, the process with the longest target runtime among the third process c, the fourth process d, and the fifth process f is determined to be the process that satisfies the first fault condition, and this process that satisfies the first fault condition is determined as the target process.
[0183] Step S103: Determine the thread log information of the target thread based on the process identifier information of the target process, the target event, and the initial thread log information.
[0184] The target thread refers to at least one thread in the target process that is related to the target event and meets the preset second fault condition.
[0185] In this embodiment of the application, the information of each thread recorded in the initial thread log information includes the identification information of that thread. After determining the target process, the first device can determine the thread log information of the thread related to the target event in the initial thread log information based on the process identification information of the target process and the target event. In the thread log information of the thread related to the target event in the target process, the thread that meets the second fault condition is determined as the target thread, and the thread log information of the target thread is determined.
[0186] As one possible implementation, based on the target process's identification information, target events, and initial thread log information, the thread log information of the target thread is determined to include:
[0187] Based on the target process's identification information and the target event, at least one first thread's thread log information is identified from the initial thread log information. Based on the first thread's process log information and a preset second fault condition, the target thread's thread log information is identified from the thread log information of at least one first thread. Here, the first thread refers to the thread of the target process related to the target event.
[0188] The second fault condition is pre-set according to actual needs and is used to identify at least one of the first threads that is most relevant to the performance anomaly.
[0189] Since each process is implemented by at least one thread, and in practical applications, the thread identification information of each process is related to the process identification information, the first device, after identifying the target process, can determine the thread log information of at least one thread of the target process from the initial thread log information based on the process identification information of the target process. The thread log information of at least one thread of the target process includes not only the thread log information of the thread implementing the target event within the target time period, but also the thread log information of the thread implementing other events within the target time period. Therefore, to more accurately detect performance faults, the first device also needs to determine the thread log information of the thread related to the target event in the thread log information of at least one thread of the target process, based on the target time; this is how the first thread's thread log information is determined. Since the implementation threads for different events are pre-set in the first device, once the target event is determined, the thread required to implement that target event can be identified. Therefore, after determining at least one thread of the target process based on its process identifier information, the first device can identify the thread used to implement the target event from among the at least one thread corresponding to the target process, i.e., identify at least one first thread, and then obtain the thread log information of at least one first thread. After identifying the thread log information of at least one first thread, the first device can find the thread that meets the preset second fault condition based on the thread log information of each first thread, thereby identifying that thread as the target thread and obtaining the thread log information of the target thread.
[0190] As illustrated in the example above, suppose the first device identifies the process with abnormal performance as a third process, c. In this case, the first device can determine the thread log information related to the target event in the initial thread log information of the third process c based on the process identifier information of the third process c and the target event. Assume that the third process c has threads a, b, c, and d, and threads c and d are used to implement the click response event. In this case, the first device can determine the thread log information of the threads of the third process c based on the process identifier information of the third process c, i.e., determine the thread log information of threads a, b, c, and d. Then, based on the target event (click response event), the first device can determine the thread log information of threads c and d related to the click response event from the thread log information of threads a, b, c, and d. Based on the thread log information of threads c and d, the first device can identify the thread among threads c and d that meets the second fault condition as the target thread.
[0191] As one possible implementation, if a thread in the target process encounters an exception, that thread will not be able to complete its pre-set execution time. Therefore, the thread with the exception can be identified based on the runtime of related threads in the target process. Based on this, thread log information includes the thread's runtime.
[0192] Based on the thread log information of the first thread and the preset second fault condition, the thread log information of the target thread is determined from the thread log information of at least one first thread, including:
[0193] Based on the thread runtime information in the thread log of the first thread, the thread that meets the second fault condition in at least one first thread is identified as the target thread, and the thread log information of the target thread is obtained. The second fault condition includes: longest runtime.
[0194] That is, when the thread log information includes the thread's runtime, after determining the thread log information of the first thread, the first device needs to determine the target thread's thread log information from the first thread's thread log information. Therefore, the first device can determine the first thread whose runtime meets the second fault condition as the target thread based on the runtime recorded in the thread log information of each first thread. In some embodiments, the second fault condition can be the longest runtime. Therefore, the first device can determine the first thread with the longest runtime as the thread that meets the second fault condition, i.e., determine it as the target thread, and determine the target thread's thread log information based on the runtime recorded in the thread log information of each first thread, and determine the target thread's thread log information.
[0195] It should be understood that if at least two first threads satisfy the second fault condition, then both of these first threads will be identified as target threads. That is, if at least two first threads have the same runtime and both have a runtime longer than the other first threads, then these at least two first threads will be identified as target threads.
[0196] Step S104: Determine the performance fault of the target device based on the thread log information of the target thread.
[0197] In this embodiment of the application, after the first device determines the thread log information of the target thread, it can determine the performance fault that causes the target application to have abnormal performance based on the content recorded in the thread log information of the target thread.
[0198] As one possible implementation, since threads exist in different states during execution, to more accurately determine performance faults, the first device can determine the abnormal state based on the duration of different states maintained by the target thread during the execution of the target event. Furthermore, the performance fault of the target device can be determined based on the abnormal state. Therefore, the thread log information of the target thread also includes the duration of different states maintained by the target thread during the execution of the target event.
[0199] At this point, based on the thread log information of the target thread, the performance faults of the target device are determined to include:
[0200] Based on the duration of different states maintained during the execution of the target event in the target thread's thread log information, the abnormal states that occurred during the execution of the target thread are determined; based on the abnormal states that occurred during the execution of the target thread, the performance failure of the target device is determined.
[0201] In other words, if the target thread's thread log information includes the duration of different states maintained during the execution of the target event, then after determining the target thread's thread log information, the first device can determine the duration of each state maintained during the execution of the target event based on the thread log information. Based on the duration of each state maintained during the execution of the target thread, states whose duration meets the preset third fault condition are identified as abnormal states. Since different abnormal states during thread execution result in different performance faults, the first device can determine the performance fault of the target device based on the abnormal states.
[0202] The third fault condition can be preset according to actual needs. For example, the third fault condition can be that the duration of the fault is longer than the preset duration, or that the duration of the fault is the longest possible.
[0203] It should be noted that during the execution of the target event by the target thread, the duration of each state refers to the sum of the execution times of each state. For example, the target thread's execution of the target event includes states a, b, and a. That is, when the target thread is executing the target event, its execution state is initially state a, then switches to state b, and then switches back to state a. Assume the target thread's execution time in state a is a1 seconds, in state b is a2 seconds, and in state a is a3 seconds. In this case, the first device determines that during the execution of the target event by the target thread, the duration of state a is a1 + a3 seconds, and the duration of state b is a2 seconds.
[0204] In some embodiments, the third fault condition is the longest duration of different states maintained during thread execution. In this case, the first device can determine the state with the longest retention time as satisfying the third fault condition based on the retention time of different states of the target thread during execution, and classify it as an abnormal state.
[0205] As one possible implementation, the states during thread execution include: Running state; Runnable state; Sleep state; and Uninterrupted Sleep state.
[0206] Therefore, if the abnormal state during thread execution is Running, which means that the Running state takes too long, it indicates that the problem lies with the target application itself. It is necessary to reduce the business scale of the target application or adopt multi-threaded concurrency to reduce the load pressure on the single thread.
[0207] If a thread is in a Runnable state during execution, meaning the Runnable state takes a long time, it indicates that the target device's processor resources are insufficient, and the number of concurrently running processes needs to be reduced.
[0208] If a thread enters a Sleep state during execution, indicating a prolonged Sleep state, it may be due to excessive lock waiting time, requiring lock optimization.
[0209] If the abnormal state during thread execution is UninterSleep, it means that the UninterSleep state takes a long time, which may be due to high input / output load, and file read / write operations on the target device need to be optimized.
[0210] It should be understood that the more relevant information about performance anomalies there is, the more information the primary device can refer to when diagnosing performance faults, thus further improving the accuracy of performance fault diagnosis. Therefore, device status information can include not only application identification information and performance anomaly types, but also... Figure 5a As shown. To further improve the accuracy of the first device in determining the performance faults of the target device, such as... Figure 5b As shown, the device status information may also include other information, such as the business processes of the target application, and this application does not impose any restrictions on this. Among them, in Figure 5b In this context, the time of performance anomaly occurrence is the same as the start time of the target event. The duration of performance anomaly is the same as the duration of performance anomaly of the target event described in the above embodiments.
[0211] The first device can directly determine the performance fault of the target device based on device status information, initial process log information, and initial thread information, without manual intervention, thereby reducing the cost of performance testing. Furthermore, this application locates performance faults by pinpointing the target thread, improving the accuracy of performance fault determination and increasing the efficiency of performance testing.
[0212] See Figure 6 This is a flowchart illustrating a method for testing device performance according to an embodiment of this application. The method is applied to a second device and includes:
[0213] Step S601: Obtain device status information, initial process log information, and initial thread log information.
[0214] The process involves acquiring device status information, initial process log information, and initial thread log information. The device status information includes the identification information of the target application and the type of performance anomaly. The target application is the application running in the foreground of the second device when the performance anomaly occurs. The initial process log information records the information of the processes running on the second device within a target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process. The target time period includes the time when the performance anomaly occurred. The initial thread log information records the information of the threads running on the target device within the target time period.
[0215] In this embodiment, the second device and the first device are different devices. When the second device cannot perform performance fault detection, it needs to send relevant information about the performance anomaly to the first device. Therefore, when the application running in the foreground on the second device experiences a performance anomaly, it needs to obtain device status information, initial process log information, and initial thread log information. At this time, when the application running in the foreground on the second device experiences a performance anomaly, the second device can record the identifier information of the currently running application and the type of performance anomaly as device status information. Based on the time of the performance anomaly occurrence, it determines a target time period, searches for process log information within the target time period in the recorded process log information, and obtains the initial process log information. Similarly, it searches for thread log information within the target time period in the recorded thread log information and obtains the initial thread log information.
[0216] The target time period is the time encompassing the occurrence of the performance anomaly, and is determined based on that occurrence time. The duration of the target time period can be preset according to actual needs; for example, if the target time period is 10 minutes, it can be a time period with the performance anomaly occurrence time as its midpoint. In this case, the initial process log information acquired by the first device can be the process log information within five minutes before and after the performance anomaly occurrence time. Of course, the target time period can also be other 10-minute time periods that include the performance anomaly occurrence time; this application does not impose any restrictions on this.
[0217] Performance anomaly type information is used to characterize the type of performance anomalies occurring in the target application. Performance anomaly types include at least one of the following: application startup anomalies, click response anomalies, scrolling anomalies, and game anomalies. Application startup anomalies include whether the application times out. Click response anomalies include whether clicks are unresponsive or whether click responses time out. Scrolling anomalies include whether scrolling is choppy or the page refreshes slowly. Game anomalies include whether the game lags or the game page refreshes slowly.
[0218] As one possible implementation, the device status information also includes the time information of the target event. Here, the target event refers to at least one event occurring during the foreground operation of the target application where a performance anomaly exists. The time information of the target event refers to the time information at which the performance anomaly occurs.
[0219] As one possible implementation, the target event includes one or more of the following: application launch event, click response event, touch swipe event, and display refresh event.
[0220] As one possible implementation, the initial process log information includes the process log information of the first process; the process log information of the first process also includes the target runtime. The target runtime is the runtime of the first process in achieving the target event; the first process refers to the process related to the target event within the target time period.
[0221] The process log information of the first process includes the first target process log information of at least one first process; the first target process log information of the first process is the process log information of at least one first process that is related to the target running time and the foreground running time of the target application within the target time period.
[0222] As one possible implementation, at least one first process log information includes at least one second target process log information of the first process; the second target process log information of the first process is process log information related to the target running time and the time information of the target event in the first target process log information of at least one first process.
[0223] The target execution time of the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is achieved, and the second target function is the termination function that runs in the first process when the target event is achieved.
[0224] As one possible implementation, the target application's identification information includes the target application's package name and / or the target application's process identification information.
[0225] As one possible implementation, when the first process is the application process of the target application, and the identification information of the target application includes the process identification information of the target application process, the process identification information of the first process is the same as the process identification information of the target application process. That is, when the first process is the application process of the target application, the process identification information of the target application is the same as the process identification information of the first process. Therefore, the process identification information of the first process recorded in the process log information of the first process is the same as the process identification information of the target application process in the identification information of the target application.
[0226] As one possible implementation, thread log information includes the thread's runtime.
[0227] As one possible implementation, the target thread's thread log information includes the duration of different states maintained during the target thread's implementation of the target event.
[0228] Step S602: Send the device status information, initial process log information and initial thread log information to the first device.
[0229] In this embodiment of the application, after the second device obtains the device status information, initial process log information and initial thread log information, it sends the device status information, initial process log information and initial thread log information to the first device so that the first device can determine the performance failure of the second device based on the device status information, initial process log information and initial thread log information.
[0230] See Figure 7 This is a flowchart illustrating a method for device performance detection provided in an embodiment of this application. In this embodiment, the second device is the target device, meaning the second device acquires the target device's device status information, initial process log information, and initial thread log information, and the first device determines the performance fault. The method includes:
[0231] Step S701: The second device obtains the device status information, initial process log information and initial thread log information of the target device.
[0232] The device status information includes the identification information of the target application; the target application is the application running in the foreground of the target device when the performance anomaly occurs; the initial process log information is used to record the information of the processes running on the target device within the target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process and the identification information of the application corresponding to the process; the target time period includes the time when the performance anomaly occurs; the initial thread log information is used to record the information of the threads running on the target device within the target time period.
[0233] For details, please refer to step S401, which will not be repeated here.
[0234] Step S702: The second device sends the device status information, initial process log information and initial thread log information of the target device to the first device. The first device receives the device status information, initial process log information and initial thread log information of the target device sent by the second device.
[0235] For details, please refer to step S101, which will not be repeated here.
[0236] Step S703: The second device obtains the target front-end operation log information.
[0237] Among them, the target foreground operation log information is used to record the identification information and foreground operation time information of the applications that have run in the foreground on the target device within the target time period.
[0238] For details, please refer to step S102, which will not be repeated here.
[0239] Step S704: The second device sends the target foreground operation log information to the first device, and the first device receives the target foreground operation log information.
[0240] Step S705: The first device determines the target process from the processes running within the target time period based on the device status information, initial process log information, and target foreground running log information.
[0241] The target process refers to the process that is related to the target event and meets the preset first fault condition; the target event refers to at least one event in the foreground operation of the target application that has a performance abnormality.
[0242] For details, please refer to step S102, which will not be repeated here.
[0243] Step S706: The first setting determines the thread log information of the target thread based on the process identifier information of the target process, the target event and the initial thread log information.
[0244] The target thread refers to at least one thread in the target process that meets the preset second fault condition.
[0245] For details, please refer to step S103, which will not be repeated here.
[0246] It should be noted that, in order to more accurately determine the performance failure of the second device, the first device can further obtain the current usage of the performance-related resources of the second device when the performance anomaly occurs. In this case, steps S507-S708 can be executed.
[0247] Step S707: When a performance abnormality occurs, the second device acquires the target resource information.
[0248] Among them, the target resource information is the log information of the resources related to the performance of the second device.
[0249] In this embodiment, when a performance anomaly occurs, the second device can acquire performance-related logs so that the first device can perform a comprehensive analysis based on the performance-related log information when determining the performance fault. At this time, the second device can acquire all log information from its own database, thereby identifying the log information of performance-related resources among all the acquired log information. Specifically, it acquires the log information of performance-related hardware resources and software resources.
[0250] In some embodiments, performance-related hardware resources include processors, memory, input / output, etc. Performance-related software resources include locks, component services, displays, messages, etc.
[0251] Step S708: The second device sends the target resource information to the first device, and the first device receives the target resource information.
[0252] In this embodiment of the application, after the second device obtains the target resource information, it sends the target resource information to the first device, and the first device receives the target resource information.
[0253] Step S709: The first device determines the performance fault of the target device based on the thread log information of the target thread.
[0254] For details, please refer to step S104, which will not be repeated here.
[0255] As one possible implementation, when the first device acquires the target resource information, it determines the performance faults of the target device based on the thread log information of the target thread, including:
[0256] Based on the thread log information of the target thread and the target resource information of the second device, the performance failure of the second device is determined.
[0257] Once the first device obtains the thread log information of the target thread, it can determine the abnormal state of the target thread during its operation, and thus determine the performance failure of the target device based on the abnormal state and target resource information.
[0258] For example, if the first device determines that the Runnable state of the target thread is abnormal, the first device can initially determine that the processor resources of the second device are insufficient. Furthermore, it can determine the processor usage recorded in the target resource information by obtaining the target resource information of the second device. Assuming that the processor usage recorded in the target resource information is 85%, the first device can determine that the performance abnormality of the second device is due to insufficient processor resources.
[0259] As one possible implementation, the first device optimizes the performance of the second device based on performance optimization information, including:
[0260] The first device sends performance optimization information to the second device, which instructs the second device to optimize its performance based on the performance optimization information.
[0261] That is, the first device does not control the second device to perform performance optimization. Instead, after determining the performance optimization information, it sends the performance optimization information to the second device, which then performs the corresponding performance optimization based on the performance optimization information to eliminate performance anomalies.
[0262] refer to Figure 8 This is a flowchart illustrating a method for device performance testing provided in an embodiment of this application. In this embodiment, the first device is the target device, and the performance fault is determined by the first device itself, which is compared to... Figure 7 The embodiment shown in this application describes a single electronic device as the first and second devices. The method includes:
[0263] Step S801: The first device obtains the device status information, initial process log information and initial thread log information of the target device.
[0264] The device status information includes the identification information of the target application and the type of performance anomaly; the target application is the application running in the foreground of the target device when the performance anomaly occurs; the initial process log information is used to record the information of the processes running on the target device within the target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process; the target time period includes the time when the performance anomaly occurred; the initial thread log information is used to record the information of the threads running on the target device within the target time period.
[0265] For details, please refer to steps S101 and S401, which will not be repeated here.
[0266] Step S802: The first device determines the target process from the processes running within the target time period based on the device status information and the initial process log information.
[0267] The target process refers to the process that is related to the target event and meets the preset first fault condition; the target event refers to at least one event in the foreground operation of the target application that has a performance abnormality.
[0268] For details, please refer to step S102, which will not be repeated here.
[0269] Step S803: The first device determines the thread log information of the target thread based on the process identifier information of the target process, the target event and the initial thread log information.
[0270] The target thread refers to at least one thread in the target process that meets the preset second fault condition.
[0271] For details, please refer to step S103, which will not be repeated here.
[0272] Step S804: When the first device acquires the target resource information when a performance abnormality occurs.
[0273] Among them, the target resource information is the log information of the resources related to the performance of the first device.
[0274] The specific parameters and steps in S707 will not be repeated here.
[0275] Step S805: The first device determines the performance fault of the target device based on the thread log information of the target thread.
[0276] The specific parameters and steps in S709 will not be repeated here.
[0277] Step S806: The first device determines performance optimization information based on the identified performance fault.
[0278] In this embodiment, after determining a performance fault in the second device, the first device can determine performance optimization information to resolve the fault. In some embodiments, different correspondences between performance faults and their corresponding performance optimization information can be pre-set. This allows the first device to directly determine the performance optimization information based on the pre-set correspondences after identifying a performance fault. For example, if the performance fault in the second device is determined to be insufficient processor resources, the corresponding performance optimization information would be to reduce the number of concurrently running processes.
[0279] Step S807: The first device performs performance optimization based on the performance optimization information.
[0280] In this embodiment of the application, after determining the performance optimization information, the first device can perform corresponding performance optimization based on the performance optimization information to eliminate performance abnormalities.
[0281] refer to Figure 9 This is a schematic diagram of a device for testing equipment performance provided in an embodiment of this application. Figure 9 As shown, the device includes:
[0282] The acquisition unit 901 is used to acquire the device status information, initial process log information and initial thread log information of the target device.
[0283] The device status information includes the identification information of the target application and the type of performance anomaly; the target application is the application running in the foreground of the target device when the performance anomaly occurs; the initial process log information is used to record the information of the processes running on the target device within the target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process; the target time period includes the time when the performance anomaly occurred; the initial thread log information is used to record the information of the threads running on the target device within the target time period.
[0284] The processing unit 902 is used to determine the target process from the processes running within the target time period based on the device status information and the initial process log information.
[0285] The target process refers to the process that is related to the target event and meets the preset first fault condition; the target event refers to at least one event in the foreground operation of the target application that has a performance abnormality.
[0286] The processing unit 902 is also used to determine the thread log information of the target thread based on the process identifier information of the target process, the target event and the initial thread log information.
[0287] The target thread refers to at least one thread in the target process that meets the preset second fault condition.
[0288] The processing unit 902 is also used to determine the performance fault of the target device based on the thread log information of the target thread.
[0289] As one possible implementation, the processing unit 902 is specifically used to determine the process log information of at least one first process from the initial process log information based on the device status information. Based on the process log information of at least one first process and a preset first fault condition, a target process is determined from the at least one first process.
[0290] The first process refers to the process related to the target event within the target time period.
[0291] As one possible implementation, at least one first process includes a system process and / or an application process.
[0292] As one possible implementation, the processing unit 902 is specifically used to determine the process log information of the application process of the target application in the initial process log information based on the identification information of the target application; and / or, to determine the target system process based on the performance anomaly type information, and to determine the process log information of the target system process in the initial process log information; the target system process is a system process related to the performance anomaly type.
[0293] As one possible implementation, the process log information of the first process may also include the target runtime. The target runtime is the runtime required for the first process to achieve the target event.
[0294] As one possible implementation, the processing unit 902 is also used to obtain target foreground running log information; and to determine the foreground running time of the target application within the target time period from the target foreground running log information based on the identification information of the target application.
[0295] Based on the foreground running time of the target application within the target time period and the target running time of at least one first process, the first target process log information of at least one first process is determined from the process log information of at least one first process.
[0296] The target foreground runtime log information is used to record the identification information and foreground runtime information of applications that have run in the foreground on the target device within the target time period. The first target process log information of the first process is the process log information of at least one first process that is related to the target runtime and the foreground runtime of the target application within the target time period.
[0297] The processing unit 902 is specifically used to determine the target process in at least one first process based on the first target process log information of at least one first process and the preset first fault conditions.
[0298] As one possible implementation, the device status information also includes: the time information of the target event. The time information of the target event refers to the time when the performance abnormality occurs at the target time.
[0299] The processing unit 902 is further configured to determine the second target process log information of at least one first process from the first target process log information of at least one first process based on the time information of the target event and the running time of at least one first process.
[0300] Among them, the second target process log information of the first process is the process log information related to the target running time and the time information of the target event in the first target process log information of the at least one first process.
[0301] The processing unit 902 is specifically used to determine the target process in at least one first process based on the second target process log information of the first process and the preset first fault conditions.
[0302] As one possible implementation, processing unit 902 is specifically used to determine the target runtime of each first process based on the second target process log information of each first process. In at least one first process, the first process that meets the first fault condition is identified as the target process.
[0303] The first failure condition includes the longest target runtime. The target runtime is the runtime of the first process when it achieves the target event.
[0304] As one possible implementation, the target execution time in the second target process information includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is achieved, and the second target function is the final function that runs in the first process when the target event is achieved.
[0305] The processing unit 902 is specifically used to determine the target runtime of each first process based on the execution time of the first objective function and the execution time of the second objective function of each first process.
[0306] As one possible implementation, the target event includes one or more of the following: application launch event, click response event, touch swipe event, and display refresh event.
[0307] As one possible implementation, the target application's identification information includes the target application's package name and / or the target application's process identification information.
[0308] As one possible implementation, processing unit 902 is specifically used to determine the thread log information of at least one first thread from the initial thread log information based on the process identifier information of the target process. The first thread refers to the thread related to the target event in the target process.
[0309] Based on the process log information of the first thread and the preset second fault condition, the thread log information of the target thread is determined from the thread log information of at least one first thread.
[0310] As one possible implementation, thread log information includes the thread's runtime.
[0311] The processing unit 902 is specifically used to determine the first thread that meets the second fault condition as the target thread based on the thread runtime information of the first thread in the thread log information, and to obtain the thread log information of the target thread. The second fault condition includes: longest runtime.
[0312] As one possible implementation, the thread log information of the target thread may also include the duration of different states maintained during the execution of the target event by the target thread.
[0313] The processing unit 902 is specifically used to determine the abnormal state that occurs during the execution of the target thread based on the duration of different states maintained during the execution of the target event in the thread log information of the target thread; and to determine the performance failure of the target device based on the abnormal state that occurs during the execution of the target thread.
[0314] As one possible implementation, the acquisition unit 901 is also used to acquire target resource information of the target device when a performance abnormality occurs.
[0315] Among them, the target resource information is the log information of the resources related to the performance of the target device.
[0316] The processing unit 902 is specifically used to determine the performance fault of the target device based on the thread log information of the target thread and the target resource information of the target device.
[0317] As one possible implementation, the acquisition unit 901 is specifically used to receive the target device's device status information, initial process log information, and initial thread log information sent by the target device.
[0318] Alternatively, as a possible implementation, the acquisition unit 901 is specifically used to acquire the stored process log information and thread log information; based on the time when the performance exception occurred, the initial process information is determined in the process log information, and the initial thread log information is determined in the thread log information.
[0319] As one possible implementation, the processing unit 902 is also configured to determine performance optimization information based on the identified performance faults; and to perform performance optimization on the target device based on the performance optimization information.
[0320] refer to Figure 10 This is a schematic diagram of a device for testing equipment performance provided in an embodiment of this application. Figure 10 As shown, the device includes:
[0321] The acquisition unit 1001 is used to acquire device status information, initial process log information, and initial thread log information.
[0322] The device status information includes the identification information of the target application and the type of performance anomaly; the target application is the application running in the foreground of the second device when the performance anomaly occurs; the initial process log information is used to record the information of the processes running on the second device within the target time period, and the information of each process recorded in the initial process log information includes the process identification information of the process; the target time period includes the time when the performance anomaly occurred; the initial thread log information is used to record the information of the threads running on the target device within the target time period.
[0323] The sending unit 1002 is used to send device status information, initial process log information and initial thread log information to the first device.
[0324] As one possible implementation, the acquisition unit 1001 is also used to acquire target foreground running log information.
[0325] Among them, the target foreground operation log information is used to record the identification information and foreground operation time information of the applications that have run in the foreground on the target device within the target time period.
[0326] The sending unit 1002 is also used to send target foreground operation log information to the first device.
[0327] As one possible implementation, the backup status information also includes: the time information of the target event; the target event refers to at least one event in the foreground operation of the target application where a performance anomaly occurs. The time information of the target event refers to the time information of when the performance anomaly occurs at the target time.
[0328] As one possible implementation, the initial process log information includes the process log information of the first process; the process log information of the first process also includes the target running time; wherein, the target running time is the running time of the first process to achieve the target event; the first process refers to the process related to the target event within the target time period.
[0329] The process log information of the first process includes the first target process log information of at least one first process; the first target process log information of the first process is the process log information of at least one first process that is related to the target running time and the foreground running time of the target application within the target time period.
[0330] As one possible implementation, at least one first process log information includes at least one second target process log information of the first process; the second target process log information of the first process is process log information related to the target running time and the time information of the target event in the first target process log information of at least one first process.
[0331] The target execution time of the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function; the first target function is the initial function that runs in the first process when the target event is achieved, and the second target function is the termination function that runs in the first process when the target event is achieved.
[0332] As one possible implementation, the target application's identification information includes the target application's package name and / or the target application's process identification information.
[0333] As one possible implementation, thread log information includes the thread's runtime.
[0334] As one possible implementation, the target thread's thread log information includes the duration of different states maintained during the target thread's implementation of the target event.
[0335] Corresponding to the above embodiments, this application also provides an electronic device. Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 1100 may include a processor 1101, a memory 1102, and a communication unit 1103. These components communicate through one or more buses. Those skilled in the art will understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0336] The communication unit 1103 is used to establish a communication channel, enabling the electronic device to communicate with other devices. It receives user data from other devices or sends user data to other devices.
[0337] The processor 1101 serves as the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 1102, and calls data stored in the memory to perform various functions and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 1101 may consist only of a central processing unit (CPU). In this embodiment, the CPU may have a single processing core or include multiple processing cores.
[0338] The memory 1102 is used to store the execution instructions of the processor 1101. The memory 1102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0339] When the execution instructions in memory 1102 are executed by processor 1101, the electronic device 1100 is able to perform operations. Figure 9 Some or all of the steps in the illustrated embodiments.
[0340] In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, it may include some or all of the steps of the various embodiments of the device performance detection method provided by the present invention. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0341] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.
[0342] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the device embodiments and terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. A method for testing equipment performance, characterized in that, Applied to a first device, the method includes: The system acquires device status information, initial process log information, and initial thread log information of the target device. The device status information includes the identifier information and performance anomaly type information of the target application. The target application is the application running in the foreground on the target device when the performance anomaly occurs. The initial process log information records information about the processes running on the target device within a target time period, and the information for each process recorded in the initial process log information includes the process identifier information of that process. The target time period includes the time when the performance anomaly occurred. The initial thread log information records information about the threads running on the target device within the target time period. Based on the device status information and the initial process log information, a target process is identified among the processes running within the target time period; the target process refers to a process that is related to the target event and meets a preset first fault condition; the target event refers to at least one event in the foreground running process of the target application that exhibits performance abnormalities. Based on the process identifier information of the target process, the target event, and the initial thread log information, the thread log information of the target thread is determined; the target thread refers to at least one thread of the target process that is related to the target event and meets the preset second fault condition. Based on the thread log information of the target thread, the performance failure of the target device is determined.
2. The method according to claim 1, characterized in that, The step of determining the target process from the processes running within the target time period based on the device status information and the initial process log information includes: Based on the device status information, at least one first process is identified in the initial process log information; the first process refers to the process related to the target event within the target time period. Based on the process log information of the at least one first process and the preset first fault condition, the target process is determined in the at least one first process.
3. The method according to claim 2, characterized in that, The at least one first process includes system processes and / or application processes.
4. The method according to claim 3, characterized in that, The step of determining at least one first process's process log information from the initial process log information based on the device status information and the initial process log information includes: Based on the identification information of the target application, the process log information of the application process of the target application is determined from the initial process log information; and / or, The target system process is determined based on the performance anomaly type information, and the process log information of the target system process is determined in the initial process log information; the target system process is a system process related to the performance anomaly type.
5. The method according to claim 4, characterized in that, The process log information of the first process also includes the target runtime; The target runtime is the runtime of the first process in achieving the target event; the method further includes: Obtain target foreground running log information; the target foreground running log information is used to record the identification information and foreground running time information of applications that have run in the foreground on the target device within the target time period; Based on the identification information of the target application, determine the foreground running time of the target application within the target time period from the target foreground running log information; Before determining the target process from the at least one first process based on the process log information of the at least one first process and the preset first fault condition, the method further includes: Based on the foreground running time of the target application within the target time period and the target running time of the at least one first process, the first target process log information of at least one first process is determined from the process log information of the at least one first process; the first target process log information of the first process is the process log information in the process log information of the at least one first process that is related to the target running time of the target application within the target time period. The step of determining the target process from the at least one first process based on the process log information of the at least one first process and a preset first fault condition includes: Based on the first target process log information of the at least one first process and the preset first fault conditions, the target process is determined in the at least one first process.
6. The method according to claim 5, characterized in that, The device status information also includes: the time information of the target event; the time information of the target event refers to the time when the target event occurs due to performance abnormality. Before determining the target process from the at least one first process based on the first target process log information of the at least one first process and the preset first fault condition, the method further includes: Based on the time information of the target event and the target running time of the at least one first process, the second target process log information of at least one first process is determined from the first target process log information of the at least one first process; the second target process log information of the first process is the process log information in the first target process log information of the at least one first process that is related to the time information of the target running time and the time information of the target event. The determination of the target process from the at least one first process based on the first target process log information of the at least one first process and the preset first fault condition includes: Based on the second target process log information of the first process and the preset first fault conditions, the target process is determined in the at least one first process.
7. The method according to claim 6, characterized in that, The determination of the target process from the at least one first process based on the second target process log information of the first process and the preset first fault condition includes: Based on the second target process log information of each first process, the target runtime of each first process is determined; the target runtime is the runtime of the first process when it implements the target event. Among the at least one first process, the first process that satisfies the first fault condition is determined as the target process, wherein the first fault condition includes the longest target runtime.
8. The method according to claim 7, characterized in that, The target execution time in the second target process log information includes the execution time of the first target function and the execution time of the second target function; The first objective function is the initial function that runs in the first process when the objective event is achieved, and the second objective function is the termination function that runs in the first process when the objective event is achieved. The determination of the target runtime for each first process based on the second target process log information of each first process includes: The target runtime of each first process is determined based on the execution time of the first objective function and the execution time of the second objective function of each first process.
9. The method according to claim 1, characterized in that, The target events include one or more of the following: application launch event, click response event, touch swipe event, and display refresh event.
10. The method according to claim 1, characterized in that, The identification information of the target application includes the application package name information of the target application and / or the process identification information of the target application process.
11. The method according to claim 1, characterized in that, The step of determining the thread log information of the target thread based on the process identifier information of the target process, the target event, and the initial thread log information includes: Based on the process identifier information of the target process and the target event, at least one thread log information of a first thread is determined in the initial thread log information; the first thread refers to the thread of the target process related to the target event; Based on the thread log information of the first thread and the preset second fault condition, the thread log information of the target thread is determined from the thread log information of the at least one first thread.
12. The method according to claim 11, characterized in that, The thread log information includes the thread's runtime; The step of determining the target thread's thread log information from the thread log information of at least one first thread, based on the thread log information of the first thread and a preset second fault condition, includes: Based on the thread runtime in the thread log information of the first thread, the first thread that meets the second fault condition is determined as the target thread among the at least one first thread, and the thread log information of the target thread is obtained; the second fault condition includes: the longest runtime.
13. The method according to any one of claims 1-12, characterized in that, The thread log information of the target thread includes the duration of different states maintained during the execution of the target thread in implementing the target event; The step of determining the performance fault of the target device based on the thread log information of the target thread includes: Based on the duration of different states maintained during the execution of the target event by the target thread in the thread log information, the abnormal states that occurred during the execution of the target thread are determined. Based on the abnormal state that occurs during the execution of the target thread, the performance failure of the target device is determined.
14. The method according to any one of claims 1-12, characterized in that, Before determining the performance failure of the target device based on the thread log information of the target thread, the method further includes: When a performance anomaly occurs, obtain the target resource information of the target device; the target resource information is the log information of the performance-related resources of the target device. The step of determining the performance fault of the target device based on the thread log information of the target thread includes: Based on the thread log information of the target thread and the target resource information of the target device, the performance fault of the target device is determined.
15. The method according to any one of claims 1-12, characterized in that, The acquisition of the target device's device status information, initial process log information, and initial thread log information includes: Receive the target device's device status information, initial process log information, and initial thread log information sent by the target device.
16. The method according to any one of claims 1-12, characterized in that, Obtaining initial process log information and initial thread log information includes: Retrieve stored process log information and thread log information; Based on the time of the performance anomaly, the initial process log information is determined in the process log information, and the initial thread log information is determined in the thread log information.
17. The method according to claim 16, characterized in that, Also includes: Based on the identified performance faults, performance optimization information is determined; The target device is optimized based on the performance optimization information.
18. A method for testing equipment performance, characterized in that, Applied to a second device, the method includes: The system acquires device status information, initial process log information, and initial thread log information. The device status information includes the identifier information of the target application and the performance anomaly type information. The target application is the application running in the foreground of the second device when the performance anomaly occurs. The initial process log information records information about the processes running on the second device within a target time period, and the information for each process recorded in the initial process log information includes the process identifier information of that process. The target time period includes the time when the performance anomaly occurred. The initial thread log information records information about the threads running on the second device within the target time period. The device status information, initial process log information, and initial thread log information are sent to the first device; so that the first device can determine the target process from the processes running within the target time period based on the device status information and the initial process log information; the target process refers to a process related to the target event and satisfying a preset first fault condition; the target event refers to an event in which at least one event running during the foreground operation of the target application has a performance anomaly; the thread log information of the target thread is determined based on the process identifier information of the target process, the target event, and the initial thread log information; the target thread refers to at least one thread of the target process that is related to the target event and satisfies a preset second fault condition; the performance fault of the second device is determined based on the thread log information of the target thread.
19. The method according to claim 18, characterized in that, Also includes: Obtain the target's foreground runtime log information; The target foreground operation log information is used to record the identification information and foreground operation time information of the applications that have run in the foreground on the second device within the target time period; Send the target foreground operation log information to the first device.
20. The method according to claim 18 or 19, characterized in that, The device status information also includes: the time information of the target event; the target event refers to at least one event in the foreground operation of the target application where there is a performance abnormality; the time information of the target event refers to the time information when the performance abnormality of the target event occurs.
21. The method according to claim 20, characterized in that, The initial process log information includes the process log information of the first process; the process log information of the first process also includes the target running time; wherein, the target running time is the running time of the first process in implementing the target event; the first process refers to the process related to the target event within the target time period; The process log information of the first process includes the first target process log information of at least one first process; the first target process log information of the first process is the process log information of the at least one first process that is related to the target running time and the foreground running time of the target application within the target time period.
22. The method according to claim 21, characterized in that, The at least one first process log information includes at least one second target process log information of the first process; the second target process log information of the first process is the process log information in the at least one first process's first target process log information that is related to the time information of the target running time and the target event. The target execution time of the second target process log information of the first process includes the execution time of the first target function and the execution time of the second target function; The first objective function is the initial function that runs in the first process when the objective event is achieved, and the second objective function is the final function that runs in the first process when the objective event is achieved.
23. The method according to any one of claims 18-19 or 21-22, characterized in that, The identification information of the target application includes the application package name information of the target application and / or the process identification information of the target application process.
24. The method according to any one of claims 18-19 or 21-22, characterized in that, The thread log information includes the thread's runtime.
25. The method according to claim 24, characterized in that, The thread log information of the target thread includes the duration of different states maintained during the process of the target thread implementing the target event; the target thread refers to at least one thread of the target process that is related to the target event and meets the preset second fault condition.
26. A device for testing equipment performance, characterized in that, include: The acquisition unit is used to acquire device status information, initial process log information and initial thread log information of the target device. The device status information includes the identification information of the target application and the performance anomaly type information. The target application is the application running in the foreground of the target device when the performance anomaly occurs; the initial process log information is used to record information about the processes running on the target device within the target time period, and the information of each process recorded in the initial process log information includes the process identifier information of the process; the target time period includes the time when the performance anomaly occurred; The initial thread log information is used to record information about the threads running on the target device within the target time period; The processing unit is configured to determine the target process from the processes running within the target time period based on the device status information and the initial process log information; the target process refers to a process that is related to the target event and meets a preset first fault condition; the target event refers to an event in which at least one event running during the foreground operation of the target application exhibits performance abnormality; The processing unit is further configured to determine the thread log information of the target thread based on the process identifier information of the target process, the target event, and the initial thread log information; the target thread refers to at least one thread related to the target process that satisfies a preset second fault condition; The processing unit is further configured to determine the performance fault of the target device based on the thread log information of the target thread.
27. A device for testing equipment performance, characterized in that, include: The acquisition unit is used to acquire device status information, initial process log information, and initial thread log information; the device status information includes the identification information of the target application and the performance anomaly type information. The target application is the application running in the foreground of the second device when the performance anomaly occurs; the initial process log information is used to record information about the processes running on the second device within the target time period, and the information of each process recorded in the initial process log information includes the process identifier information of the process; the target time period includes the time when the performance anomaly occurred; The initial thread log information is used to record information about the threads running on the second device within the target time period; A sending unit is configured to send the device status information, initial process log information, and initial thread log information to a first device; so that the first device can determine the target process from the processes running within the target time period based on the device status information and the initial process log information; the target process refers to a process that is related to a target event and meets a preset first fault condition; the target event refers to an event in which at least one event running during the foreground operation of the target application exhibits performance abnormalities; Based on the process identifier information of the target process, the target event, and the initial thread log information, the thread log information of the target thread is determined; the target thread refers to at least one thread of the target process that is related to the target event and meets the preset second fault condition; based on the thread log information of the target thread, the performance fault of the second device is determined.
28. An electronic device, characterized in that, It includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to perform the method according to any one of claims 1-17, or the method according to any one of claims 18-25.
29. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method of any one of claims 1-17, or the method of any one of claims 18-25.