Device performance detection method and apparatus, device and storage medium

Automatically locating equipment performance faults by obtaining device status information and log information solves the problem of low detection efficiency in the existing technology and achieves efficient and accurate fault location.

WO2024174792A1PCT designated stage expired Publication Date: 2024-08-29HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/073619
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-20
Filing Date
2024-01-23
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In the existing technology, equipment performance fault detection is costly, takes a long time, and has low accuracy, resulting in low performance fault detection efficiency.

Method used

By obtaining the device status information, initial process log information and initial thread log information of the target device, the target process and target thread are determined based on this information, performance faults are located, manual participation is reduced, and detection accuracy and efficiency are improved.

Benefits of technology

It realizes automated equipment performance fault detection, reduces costs, improves detection accuracy and efficiency, and locates performance faults directly through the target thread.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024073619_29082024_PF_FP_ABST
    Figure CN2024073619_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a device performance detection method and apparatus, a device and a storage medium. The method comprises: acquiring device state information, initial process log information and initial thread log information, wherein the device state information comprises identification information of a target application and a performance anomaly type, the initial process log information is used for recording information of processes operated by a target device within a target time period, the information of each process recorded in the initial process log information comprises process identification information of each process, and the initial thread log information is used for recording information of threads operated by the target device within the target time period; according to the identification information of the target application and the initial process log information, determining a target process from the processes operating within the target time period; determining thread log information of a target thread according to the process identification information of the target process, a target event and the initial thread log information; and determining a performance fault of the target device according to the thread log information of the target thread.
Need to check novelty before this filing date? Find Prior Art

Description

A method, device, equipment and storage medium for device performance detection

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 20, 2023, with application number 2023101734139 and application name “A method, device, equipment and storage medium for equipment performance testing”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of information processing technology, and in particular to a method, apparatus, device and storage medium for device performance detection. Background Art

[0003] Electronic devices like mobile phones and computers often generate various log files during operation. Log files are text files that record the operation of the device system, hardware, and software. The content recorded in log files can fully reflect the current performance of the device and any existing problems.

[0004] In related technologies, it is necessary to manually read logs and analyze them one by one in order to make corresponding adjustments to the equipment to optimize equipment performance. However, this method requires high labor costs, a long time and low accuracy, making performance fault detection inefficient, time-consuming and labor-intensive.

[0005] Summary of the Invention

[0006] In view of this, the present application provides a method, apparatus, device and storage medium for device performance detection, so as to solve the problem in the prior art that performance fault detection is high in cost, long in time and low in accuracy, resulting in low efficiency of performance fault detection.

[0007] In a first aspect, an embodiment of the present application provides a method for detecting device performance, which is applied to a first device, and the method includes:

[0008] Obtaining device status information, initial process log information, and initial thread log information of a target device, wherein the device status information includes identification information of a target application 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 is used to record information about processes running on the target device within a target time period, and information about each process recorded in the initial process log information includes process identification information of the process; the target time period includes the time when the performance anomaly occurred; and the initial thread log information is used to record information about threads running on the target device within the target time period;

[0009] Determining a target process from processes running within the target time period based on the device status information and the initial process log information; the target process is a process related to a target event and meeting a preset first fault condition; the target event is an event with a performance abnormality among at least one event running during foreground operation of the target application;

[0010] Determining thread log information of a target thread based on the process identification information of the target process, the target event, and the initial thread log information; the target thread is a thread that satisfies a preset second fault condition among at least one thread related to the target process;

[0011] A performance failure of the target device is determined according to the thread log information of the target thread.

[0012] In a possible implementation of the first aspect,

[0013] Determining a target process from processes running within the target time period based on the device status information and the initial process log information includes:

[0014] Determining, based on the device status information, process log information of at least one first process in the initial process log information; the first process is a process related to the target event within a target time period;

[0015] Based on the process log information of the at least one first process and a preset first fault condition, a target process is determined in the at least one first process.

[0016] In a possible implementation manner of the first aspect, the at least one first process includes a system process and / or an application process.

[0017] In a possible implementation of the first aspect, determining, based on the device status information and the initial process log information, process log information of at least one first process in the initial process log information includes:

[0018] determining, based on the identification information of the target application, process log information of the application process of the target application in the initial process log information; and / or,

[0019] A target system process is determined according to the performance anomaly type information, and 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.

[0020] In a 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 for the first process to implement a target event; and the method further includes:

[0021] 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 the application that has run in the foreground on the target device within the target time period;

[0022] Determining, based on the identification information of the target application, the foreground running time of the target application within the target time period in the target foreground running log information;

[0023] Before determining a target process in 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:

[0024] determining, from the process log information of the at least one first process, first target process log information of the at least one first process 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 the first process is process log information in which the target running time in the process log information of the at least one first process is related to the foreground running time of the target application within the target time period;

[0025] The determining of the target process in 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 includes:

[0026] Based on the first target process log information of the at least one first process and a preset first fault condition, a target process is determined in the at least one first process.

[0027] In a possible implementation of the first aspect, the device status information further includes: time information of the target event; the time information of the target event refers to time information of a performance abnormality occurring at the target time;

[0028] Before determining a target process in 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:

[0029] determining, based on the time information of the target event and the target running time of the at least one first process, second target process log information of at least one first process in the first target process log information of the at least one first process; the second target process log information of the first process is process log information in which the target running time in the first target process log information of the at least one first process is related to the time information of the target event;

[0030] The determining of the target process in 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:

[0031] Based on the second target process log information of the first process and a preset first fault condition, a target process is determined in the at least one first process.

[0032] In a possible implementation of the first aspect, determining the target process in the at least one first process based on the log information of the second target process of the first process and the preset first fault condition includes:

[0033] Determining a target runtime of each first process based on the second target process log information of each first process; the target runtime is the runtime of the first process when achieving a target event;

[0034] A first process that meets the first fault condition among the at least one first process is determined as a target process, wherein the first fault condition includes that the target running time is the longest.

[0035] In a possible implementation of the first aspect, the target running time in the second target process information includes an execution time of a first target function and an execution time of a second target function; the first target function is an initial function that runs in the first process when the target event is realized, and the second target function is an end function that runs in the first process when the target event is realized;

[0036] The determining, based on the second target process log information of each first process, the target running time of each first process includes:

[0037] The target running time of each first process is determined according to the execution time of the first objective function and the execution time of the second objective function of each first process.

[0038] In a possible implementation manner of the first aspect, the target event includes one or more of an application launch event, a click response event, a touch screen sliding event, and a display refresh event.

[0039] In a possible implementation manner of the first aspect, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0040] In a possible implementation of the first aspect, determining the thread log information of the target thread based on the process identification information of the target process, the target event, and the initial thread log information includes:

[0041] Determining thread log information of at least one first thread in the initial thread log information according to the process identification information of the target process and the target event; the first thread is a thread of the target process related to the target event;

[0042] Based on the process log information of the first thread and a preset second fault condition, thread log information of the target thread is determined from the thread log information of the at least one first thread.

[0043] In a possible implementation of the first aspect, the thread log information includes a running time of the thread;

[0044] The determining, based on the thread log information of the first thread and the preset second fault condition, the thread log information of the target thread from the thread log information of the at least one first thread includes:

[0045] Based on the thread running time in the thread log information of the first thread, the first thread that meets the second fault condition in the at least one first thread is determined as the target thread, and the thread log information of the target thread is obtained; the second fault condition includes: the running time is the longest.

[0046] In a possible implementation of the first aspect, the thread log information of the target thread includes the duration of different states during the execution of the target thread to implement the target event;

[0047] The determining, according to the thread log information of the target thread, the performance failure of the target device includes:

[0048] Determining an abnormal state during the operation of the target thread according to the duration of different states maintained during the operation of the target thread to realize the target event in the thread log information of the target thread;

[0049] Based on an abnormal state occurring during the operation of the target thread, a performance failure of the target device is determined.

[0050] In a possible implementation manner of the first aspect, before determining the performance failure of the target device according to the thread log information of the target thread, the method further includes:

[0051] Acquire target resource information of the target device when a performance anomaly occurs; the target resource information is log information of performance-related resources of the target device;

[0052] The determining, according to the thread log information of the target thread, the performance failure of the target device includes:

[0053] A performance failure of the target device is determined according to the thread log information of the target thread and the target resource information of the target device.

[0054] In a possible implementation of the first aspect, obtaining device status information, initial process log information, and initial thread log information of the target device includes:

[0055] Receive device status information, initial process log information, and initial thread log information of the target device sent by the target device.

[0056] In a possible implementation of the first aspect, obtaining the initial process log information and the initial thread log information includes:

[0057] Get stored process log information and thread log information;

[0058] Based on the time when the performance anomaly occurs, initial process information is determined in the process log information, and initial thread log information is determined in the thread log information.

[0059] In a possible implementation of the first aspect, the method further includes:

[0060] Determining performance optimization information based on the determined performance failure;

[0061] The target device is subjected to performance optimization based on the performance optimization information.

[0062] In a second aspect, an embodiment of the present application provides a method for detecting device performance, which is applied to a second device, and the method includes:

[0063] Obtaining device status information, initial process log information, and initial thread log information; the device status information includes identification information of a target application and 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 processes running on the second device within a target time period, and the information recorded in the initial process log information for each process includes process identification information of the process; the target time period includes the time when the performance anomaly occurs; and the initial thread log information is used to record information about threads running on the target device within the target time period;

[0064] The device status information, initial process log information, and initial thread log information are sent to the first device.

[0065] In a possible implementation of the second aspect, the method further includes:

[0066] 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 the application that has run in the foreground on the target device within the target time period;

[0067] Send target foreground operation log information to the first device.

[0068] In a possible implementation of the second aspect, the device status information also includes: time information of a target event; the target event refers to an event in which a performance abnormality exists in at least one event running during the foreground operation of the target application; the time information of the target event refers to the time information when a performance abnormality occurs at the target time.

[0069] In a possible implementation of the second aspect, the initial process log information includes process log information of a first process; the process log information of the first process also includes a target runtime; wherein the target runtime is the runtime for the first process to achieve the target event; and the first process refers to a process related to the target event within a target time period;

[0070] 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 in which the target running time in the process log information of the at least one first process is related to the foreground running time of the target application within the target time period.

[0071] In a 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 a target running time and time information of the target event in the first target process log information of the at least one first process;

[0072] The target running 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 running when the target event is realized in the first process, and the second target function is the end function running when the target event is realized in the first process.

[0073] In a possible implementation manner of the second aspect, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0074] In a possible implementation of the second aspect, the thread log information includes the running time of the thread.

[0075] In a possible implementation manner of the second aspect, the thread log information of the target thread includes the durations of different states during the process of the target thread implementing the target event.

[0076] In a third aspect, an embodiment of the present application provides an apparatus for detecting device performance, including:

[0077] an acquisition unit configured to acquire device status information, initial process log information, and initial thread log information of a target device, wherein the device status information includes identification information of a target application and information about a performance anomaly type; 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 configured to record information about processes running on the target device within a target time period, wherein information about each process recorded in the initial process log information includes process identification information of the process; the target time period includes the time when the performance anomaly occurs; and the initial thread log information is configured to record information about threads running on the target device within the target time period;

[0078] a processing unit, configured to determine, based on the device status information and the initial process log information, a target process from among the processes running within the target time period; the target process being a process related to a target event and satisfying a preset first fault condition; and the target event being an event having a performance abnormality among at least one event running during foreground operation of the target application;

[0079] The processing unit is further configured to determine thread log information of a target thread based on the process identification information of the target process, the target event, and the initial thread log information; the target thread is a thread that satisfies a preset second fault condition among at least one thread related to the target process;

[0080] The processing unit is further configured to determine a performance failure of the target device based on thread log information of the target thread.

[0081] In a fourth aspect, an embodiment of the present application provides an apparatus for detecting device performance, including:

[0082] An acquisition unit is configured to acquire device status information, initial process log information, and initial thread log information; the device status information includes identification information of a target application and 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 configured to record information about processes running on the second device within a target time period, and information about each process recorded in the initial process log information includes process identification information of the process; the target time period includes the time when the performance anomaly occurs; and the initial thread log information is configured to record information about threads running on the target device within the target time period.

[0083] The sending unit is used to send the device status information, the initial process log information and the initial thread log information to the first device.

[0084] In a fifth aspect, an embodiment of the present application provides an electronic device comprising 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 one of the first aspects above, or to execute the method described in any one of the second aspects above.

[0085] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method described in any one of the first aspects above, or is used to execute the method described in any one of the second aspects above.

[0086] Using the solution provided in the embodiment of the present application, the device status information, initial process log information, and initial thread log information of the target device are obtained; based on the device status information and initial process log information, the target process is determined from the processes running within the target time period; based on the identification information of the target process and the initial thread log information, the thread log information of the target thread is determined; and 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. Moreover, in the present application, performance fault location is performed by locating the target thread, which improves the accuracy of performance fault determination and the efficiency of performance testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0088] FIG1 is a schematic flow chart of a method for detecting device performance according to an embodiment of the present application;

[0089] FIG2 is a flow chart of another method for detecting device performance according to an embodiment of the present application;

[0090] FIG3 is a flow chart of another method for detecting device performance according to an embodiment of the present application;

[0091] FIG4 is a schematic diagram of a scenario of a method for device performance detection provided in an embodiment of the present application;

[0092] FIG5a is a schematic diagram of another method for detecting device performance according to an embodiment of the present application;

[0093] FIG5 b is a schematic diagram of another method for detecting device performance according to an embodiment of the present application;

[0094] FIG6 is a flow chart of another method for detecting device performance according to an embodiment of the present application;

[0095] FIG7 is a flow chart of another method for detecting device performance according to an embodiment of the present application;

[0096] FIG8 is a flow chart of another method for detecting device performance according to an embodiment of the present application;

[0097] FIG9 is a schematic structural diagram of an apparatus for detecting device performance according to an embodiment of the present application;

[0098] FIG10 is a schematic structural diagram of another device performance detection apparatus provided in an embodiment of the present application;

[0099] FIG11 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0100] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0101] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0102] The terms used in the embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "an", "the" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0103] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.

[0104] Before providing a detailed introduction to the embodiments of the present application, the terms that are applied or may be applied to the embodiments of the present application are first explained.

[0105] Process: It is an operation of a program in a computer on a certain data set. It is the basic unit for resource allocation and scheduling of the system and the foundation of the operating system structure.

[0106] Thread: The smallest unit that the operating system can schedule operations on. It is contained within a process and is the actual operating unit within the process.

[0107] To ensure a positive user experience, electronic devices require performance fault detection. Electronic devices generate a variety of logs during operation. Some technologies manually analyze these logs to detect performance faults in electronic devices, allowing for appropriate adjustments to optimize performance. However, this approach is labor-intensive, time-consuming, and inaccurate, resulting in inefficient and time-consuming performance fault detection.

[0108] In response to the above problems, the embodiments of the present application provide a method, apparatus, device and storage setting for device performance detection, which obtains the device status information, initial process log information and initial thread log information of the target device; determines the target process among the processes running in the 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 identification information and initial thread log information of the target process; and determines the performance failure 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 failure 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 detection. Moreover, in the present application, performance fault location is performed by locating the target thread, which improves the accuracy of performance fault determination and the efficiency of performance detection. The following is a detailed description.

[0109] 1 is a flow chart of a method for device performance testing provided in an embodiment of the present application. The method is applied to a first device and includes:

[0110] Step S101: Obtain device status information, initial process log information, and initial thread log information of a target device.

[0111] 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 on the target device when the performance anomaly occurs. The initial process log information records information about processes running on the target device during a target time period. Information about each process recorded in the initial process log includes the process identification information. The target time period includes the time when the performance anomaly occurs. The initial thread log information records information about threads running on the target device during the target time period. The performance anomaly type information identifies the type of performance anomaly experienced by the target application. Performance anomaly types include at least one of application startup anomaly, click response anomaly, scrolling anomaly, and game anomaly. Application startup anomaly includes information about application startup timeouts. Click response anomaly includes information about clicks being unresponsive or click response timeouts. Sliding anomaly includes information about choppy scrolling or slow page refreshes. Game anomaly includes information about game lag or slow page refreshes.

[0112] When an electronic device experiences a performance failure, it typically manifests as lag or response timeouts when the user is running an application. Therefore, only when an electronic device experiences lag or response timeouts while running an application is it considered that the electronic device has a performance anomaly and needs to be detected for a performance failure. Based on this, when a target device experiences a performance anomaly, such as a response timeout or user operation lag while running an application, the target device typically records information related to the performance anomaly. Specifically, the target device may record device status information when the performance anomaly occurs. Device status information represents information related to the performance anomaly on the target device at the time of the performance anomaly. For example, to facilitate the first device determining whether a performance anomaly 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 identification information of the target application and the type of performance anomaly. The target application refers to the application running in the foreground on the target device at the time of the performance anomaly. In embodiments of the present application, when the target device is running an application in the foreground, it also needs to record information related to the process of the foreground application, such as the process identification information and the process runtime information, thus recording process log information. At the same time, when the target device runs an application in the foreground, it is also necessary to record the thread information of each running process, such as the thread identification information of the thread, the running time of the thread, etc., which is to record the thread log information. In this way, when there is a performance anomaly on the target device, the device status information when the performance anomaly occurs can be recorded, and based on the time when the performance anomaly occurs, the process log information within the target time period is obtained from the recorded process log information, which is to obtain the initial process log information based on the time when the performance anomaly occurs. Based on the time when the performance anomaly occurs, the thread log information within the target time period is obtained from the recorded thread log information, which is to obtain the initial thread log information based on the time when the performance anomaly occurs. When a performance anomaly occurs, after the target device determines the device status information, initial process log information and initial thread log information of the target device, the first device obtains the device status information, initial process log information and initial thread log information of the target device.

[0113] The target time period is a time period that includes the time when the performance anomaly occurs and is determined based on the time when the performance anomaly occurs. The length of the target time period can be pre-set based on actual needs. For example, if the target time period is 10 minutes, the target time period can be a time period with the time when the performance anomaly occurs as the middle time. In this case, the initial process log information obtained by the first device can be the process log information within five minutes before and after the time when the performance anomaly occurs. Of course, the target time period can also be other time periods with a length of 10 minutes that include the time when the performance anomaly occurs, and this application does not impose any restrictions on this.

[0114] It should be understood that the detection of the performance failure of the target device can be performed by the target device itself, or by another device, such as a server, or another terminal device. In other words, the first device can be the target device, or can be another device other than the target device, such as a server or another terminal device.

[0115] Depending on the type of the first device, the manner in which the first device obtains the device status information, the initial process log information, and the initial thread log information of the target device is also different.

[0116] As a possible implementation, when the first device is a device other than the target device, obtaining the device status information, initial process log information, and initial thread log information of the target device includes:

[0117] Receive device status information, initial process log information, and initial thread log information of the target device sent by the target device.

[0118] That is, when a performance anomaly occurs, the target device can determine the device status information, initial process log information, and initial thread log information of the target device and then send 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 target device.

[0119] It should be noted that, in the embodiment of the present application, “sending the device status information, initial process log information and initial thread log information of the target device to the first device” can be understood as the destination end of the device status information, initial process log information and initial thread log information of the target device is the first device. It can include directly or indirectly sending the device status information, initial process log information and initial thread log information of the target device to the first device. Similarly, “the first device receives the device status information, initial process log information and initial thread log information of the target device sent by the target device” can be understood as the source end of the device status information, initial process log information and initial thread log information of the target device is the target device, which can include directly or indirectly receiving the device status information, initial process log information and initial thread log information of the target device from the target device. The information may be processed as necessary between the source end and the destination end of the information transmission, such as encoding processing, etc., but the destination end can understand the valid information from the source end. Similar expressions in this application can be understood in a similar way and will not be repeated here.

[0120] Alternatively, as a possible implementation, when the first device is the target device, obtaining the initial process log information and the initial thread log information includes:

[0121] Get the recorded process log information and thread log information;

[0122] Based on the time when the performance anomaly occurs, initial process information is determined in the process log information, and initial thread log information is determined in the thread log information.

[0123] That is, when the first device is the target device, the first device acquires the initial process log information and the initial thread log information. At this time, when the first device runs the application in the foreground, it will record the process log information and thread log information of the application in real time. When there is a performance abnormality in the application currently running in the foreground of the first device, the first device can obtain the device status information based on the performance abnormality information of the application running in the foreground. And based on the time when the performance abnormality occurs, the recorded process log information and thread log information are acquired. After acquiring the process log information, the process log information within the target time period can be acquired from the process log information based on the time when the performance abnormality occurs, that is, acquiring the initial process log information. Acquiring the thread log information within the target time period from the thread log information is to acquire the initial thread log information.

[0124] Step S102: Determine a target process from the processes running within a target time period based on the device status information and the initial process log information.

[0125] Among them, the target process refers to a process related to the target event and meeting the preset first fault condition; the target event refers to an event in which there is a performance abnormality in at least one event running during the foreground operation of the target application.

[0126] In an embodiment of the present application, the target application of the target device may run different events when running in the foreground. Based on the different operations of the user on the target application, the events of the target application's operation are also different. For example, in the target device, when the user opens the target application, the target application in the target device enters the application startup event. After the target application is started, the user triggers the activity page of the target application, such as a sliding operation, and the target application in the target device switches to a touch sliding event and a display refresh event. That is, different events are pre-set in the target application, and according to the different operations of the user on the target application, the target application runs different events, thereby displaying different activity pages in the target device. When a performance abnormality occurs when the target application runs a certain event, that is, a response timeout or a startup timeout occurs, etc. In this application, the event with a performance abnormality in the target application can be called a target event.

[0127] In some embodiments, the target event includes one or more of an application launch event, a click response event, a touch screen sliding event, and a display refresh event.

[0128] After obtaining the device status information and initial process log information of the target device, the first device can determine the process log information corresponding to the target application within the target time period in the initial process log information based on the identification information and performance abnormality type information of the target application in the device status information. Therefore, based on the process log information corresponding to the target application, the process related to the target event and meeting the preset first fault condition can be determined from the processes corresponding to the target application running within the target time period, that is, the target process is determined.

[0129] The process corresponding to the target application refers to the application process of the target application and the system process that implements different running events of the target application.

[0130] As a possible implementation method, based on device status information and initial process log information, the target process is determined from the processes running within the target time period, including:

[0131] According to the device status information, process log information of at least one first process is determined in the initial process log information.

[0132] Based on the process log information of the first process and a preset first fault condition, a target process is determined in at least one first process.

[0133] The first process refers to a process related to the target event within the target time period.

[0134] In the embodiment of the present application, since the initial process log information includes the process log information of the process running on the target device during the target time, the initial process log information not only includes the process log information of the process related to the target event, but also includes the process log information of other events related to the target application that the target device has run in the foreground during the target time period, as well as the process log information of other applications that the target device has run in the foreground during the target time period. Therefore, in order to more quickly determine the target process, the first device can determine the process log information of the process related to the target event during the target time period in the initial process log information based on the identification information and exception type information of the target application in the device status information. That is, the process log information of at least one first process is determined.

[0135] The first device may determine, according to the first process log information and the preset first fault condition, a process that meets the first fault condition in at least one first process as a target process.

[0136] The first fault condition is preset according to actual needs and is used to determine the process most relevant to the performance abnormality in the at least one first process.

[0137] As a possible implementation manner, the at least one first process includes a system process and / or an application process.

[0138] In an embodiment of the present application, when the target device runs an application, it not only needs to run the application's own application process, but also needs to run the process of the operating system in the target device to realize the operation of the application. 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 start the application process of application a by calling the operating system's process b. Since the target application needs to run not only its own application process but also the system process when running. Therefore, the processes related to the target event that are run within the target time period may include the application processes of the target application and may also include system processes. Therefore, when the first device determines at least one first process, the at least one first process includes a system process and / or an application process.

[0139] As a possible implementation manner, determining, based on the device status information and the initial process log information, process log information of at least one first process in the initial process log information includes:

[0140] Based on the identification information of the target application, the process log information of the application process of the target application is determined in the initial process log information; and / or, based on the performance anomaly type information, the target system process is determined, and the process log information of the target system process is determined in the initial process log information.

[0141] The target system process is a system process related to the performance abnormality type.

[0142] In an embodiment of the present application, 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 identification information of the target application in the device status information and the performance anomaly type information. For the application process of the target application, the identification information of the application process of the target application is the same as the identification information of the target application, or the identification information of the application process of the target application includes the identification information of the target application. At this time, the first device can determine the process log information whose process log information includes the identification information of the target application as 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 in the device status information.

[0143] In the target device's operating system, the role of each system process is defined. Therefore, different processes are invoked to implement different application functions. If a performance anomaly occurs during the operation of the target application, the device status information includes the performance anomaly type. 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 an application launch anomaly, the target event can be determined to be the application launch event. If the performance anomaly is a click response anomaly, the target events can be determined to be the click response event and the display refresh event. If the performance anomaly is a sliding anomaly, the target events can be determined to be the touch sliding time and the display refresh event. If the performance anomaly is a game anomaly, the target event can be determined to be the display refresh event. In the first device, the system processes invoked to implement different events in 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. Furthermore, the first device can determine the system process corresponding to the target event based on the target event, and then determine the process log information of the system process corresponding to the target event in the initial process log information.

[0144] By the above method, the process log information of the application process of the target application and the process log information of the system process corresponding to the target event of the target application can be determined in the initial log information.

[0145] Because the target device may be running an application other than the target application in the foreground during the target time period, or the target device may be running not only the target event but also other events while running the target application in the foreground, 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, the system process associated with the target event determined by the first device is the system process related to the application launch event during the target time period. This system process may not only launch the target application during the target time period, but may also launch other applications running in the foreground during the target time period, or may also implement other events of the target application. Therefore, the process log information of the system process determined in the initial process log information 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 other events. Furthermore, since the target device may 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 and 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 target application's process related to the target event, if the target application experiences a performance anomaly while running in the foreground, it is sufficient to obtain only the process log information of the system process and application process related to the target application while the target application is running in the foreground. In this case, the first target process log information of the at least one first process related to the target event while the target application is running in the foreground needs to be found within the process log information of the at least one first process mentioned above.

[0146] Based on this, as a possible implementation, the process log information of the first process also includes the target running time. As shown in Figure 2, the method described in this application also includes:

[0147] Step S1021: Obtain target foreground operation log information.

[0148] The target foreground running log information is used to record the identification information and foreground running time information of the application that has run in the foreground on the target device within the target time period.

[0149] In the embodiment of the present application, since the first device needs to determine the time when the target application runs in the foreground within the target time period in the target device, it is necessary to obtain the target foreground running log information.

[0150] At this time, the acquisition method varies depending on the first device. When the first device is the target device, since the first device runs an application in the foreground, it will record relevant information about the foreground application, such as the identification information of the foreground application and the foreground running time, to form foreground running log information. The first device can directly obtain the foreground running log information within the target time period from the foreground running log information it records, thereby obtaining the target foreground running log information.

[0151] When the first device is a device other than the target device, the target device needs to simultaneously obtain foreground operation log information within a target time period when a performance anomaly occurs, obtain the target foreground operation log information, and send the obtained target foreground operation log information to the first device. The first device receives the target foreground operation log information sent by the target device.

[0152] Step S1022: Determine the foreground running time of the target application within the target time period in the target foreground running log information according to the identification information of the target application.

[0153] In an embodiment of the present application, after the first device obtains the target foreground operation log information, since the target foreground operation log information records the identification information and foreground operation time of the application that has run in the foreground, the first device can determine the foreground operation time of the target application in the target foreground operation log information based on the identification information of the target application.

[0154] Step S1023: Determine first target process log information of at least one first process from the process log information of at least one first process according to the foreground running time of the target application within the target time period.

[0155] The first target process log information of the first process is process log information related to the target running time and the foreground running time of the target application within the target time period in the process log information of at least one first process.

[0156] That is, after the first device determines the foreground running time of the target application, it needs to determine, from the process log information of at least one first process, the process log information of processes related to the target application when the target application is running in the foreground within the target time period. In this case, the first device can, based on the foreground running time of the target application within the target time period, determine the process log information of the first process whose target running time is within the foreground running time range of the target application within the target time period as the first target process log information of the first process. 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 determined, the first device, based on the target running time recorded in the process log information of each first process, determines the process log information of the first process whose target running time is within the foreground running time range of the target application as the first target process log information. That is, the target device can only run one application in the foreground at a time. When the target application is running in the foreground, if the target running time is within the foreground running time range of the target application, it means that the process is used to implement the target application. Therefore, the process log information whose target running time is within the foreground running time range of the target application can be determined as the first target process log information.

[0157] The above steps of determining a target process in at least one first process based on the process log information of the first process and the preset first fault condition include:

[0158] Step S1024: Based on the first target process log information of the at least one first process and the preset first fault condition, determine a target process in the at least one first process.

[0159] That is, after the first device determines the first target process log information of at least one first process, in order to improve the detection accuracy of performance faults, 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.

[0160] When the target application is running in the foreground within the target time, if the target application runs a certain event multiple times, and the event experiences a performance anomaly during the last run, the process associated with the event can be determined as the first process. The first target process log information of the first process determined by the above method not only includes the process log information of the event when the performance anomaly occurs, but may also include the process log information of the event when no performance anomaly occurs. In order to more accurately detect performance failures, the first device only needs to obtain the process log information of the event when the performance anomaly occurs.

[0161] Therefore, as a possible implementation, the device status information also includes the time information of the target event. The time information of the target event is the time information when the target event performance anomaly occurs. The time information of the target event includes the start time of the target event and the duration of the target event.

[0162] At this time, as shown in FIG3 , before determining the target process in 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 in step S1024, the method further includes:

[0163] Step S1025 : Determine second target process log information of at least one first process from the first target process log information of at least one first process according to the time information of the target event and the target running time of at least one first process.

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

[0165] In an embodiment of the present application, 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, the first device can determine the target running time of each first process based on each first target process log information after obtaining the first target process log information of at least one first process. The first device determines the first target process log information in which the 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 of the target event and the duration of the target event based on the time information of the target event, that is, determine the performance anomaly time of the target event. The first device can determine the first target process log information in which the 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 based on the performance anomaly time of the target event. That is to say, the first device can determine the process log information of the first process corresponding to the target event with performance abnormality when the target application of the target device is running in the foreground within the target time period, and filter out the process log information of the first process running when there is no performance abnormality, so as to determine the process log information of the target application's processes that are only related to the target event.

[0166] At this time, step S1024 determines the target process in 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, including:

[0167] Based on the second target process log information of the first process and a preset first fault condition, a target process is determined in at least one first process.

[0168] That is, after determining the second target process log information of the first process, the first device can determine the first process that meets the first fault condition as the target process in at least one first process based on the second target process log information of each first process and the preset first fault condition.

[0169] As a possible implementation, the first fault condition includes the target process having the longest running time. In this case, based on the log information of the second target process of the first process and the preset first fault condition, the target process is determined to be:

[0170] Determine a target runtime for each first process based on the second target process log information of each first process. Determine a first process with the longest target runtime among at least one first process as a process that satisfies a first fault condition, and determine the process that satisfies the first fault condition as a target process.

[0171] The target running time is the running time when the first process realizes the target event when the target application is running in the foreground.

[0172] In an embodiment of the present application, if there is a performance anomaly when the target application is running in the foreground in the target device, it will manifest as a sliding freeze or response timeout or target application startup timeout in the target application running in the foreground. At this time, it means that the corresponding function scheduling has not been completed within the specified time in the relevant process of the target application running in the target device. Therefore, it is necessary to find out the process with the anomaly. In some embodiments, the first process not only needs to realize the target event during operation, but may also realize other events of the target application or events of other applications based on the user's operation. Therefore, the first device needs to determine the running time of each first process for realizing the target event based on the process log information of each first process, that is, to determine the target running time of each first process. According to the target running time of each first process, the first process with the longest target running time in at least one first process is the first process that meets the first fault condition, and it is determined as the target process. The target process is the first process with a running time timeout and an anomaly.

[0173] As a possible implementation method, in order to more quickly determine the target running time, the target running time 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 when the target event is realized in the first process, and the second target function is the end function that runs when the target event is realized in the first process.

[0174] At this time, determining the target running time of each first process based on the second target process log information of each first process includes:

[0175] The target running time of each first process is determined according to the execution time of the first objective function and the execution time of the second objective function of each first process.

[0176] In an embodiment of the present application, a first process schedules different functions to implement different events in a target application. For each first process, the initial function used to implement the target event in the first process is called the first target function, and the final function used to implement the target event is called the second target function. The processes associated with 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 and implement the target event. That is, at least one process includes both an application process and a system process. Based on this, the application process of the target application can implement the target event by calling its corresponding function associated with the target event, and the system process can implement the target event by calling its corresponding function associated with 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 run when implementing the target event and the execution time of the final function run when implementing the target event, as shown in the first process log. 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. Thus, after obtaining the process log information of the first process, the first device 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.

[0177] It should be noted that each application must run at least one event, and the functions called by each event in each application are different. Therefore, the at least one first process corresponding to different target events is different. For each first process in each target event, the first target function is different, and the second target function is also different.

[0178] As a possible implementation manner, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0179] For example, at time t1, the target device runs application a, and the current event for application a is the launch application event. At this point, when the target device implements the launch application event, it also needs to record the process log information for the processes in application a related to the launch application event. Assume that the processes in application a related to the launch application event are first process a, second process b, and third process c. At this point, the process log information for the processes in application a related to the launch application event recorded by the target device is the process log information for first process a, second process b, and third process c. The process log information for first process a recorded by the target device includes the process ID of first process a, the execution time of the initial function that implements the launch application event for first process a, and the execution time of the end function that implements the launch application event for first process a, as shown in Figure 4. Similarly, the process log information for second process b includes the process ID of second process b, the execution time of the initial function that implements the launch application event for second process b, and the execution time of the end function that implements the launch application event for second process b. 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 for starting the application event, and the execution time of the end function of the third process c for starting the application event.

[0180] After the application launch event for application a is completed, that is, after the target device launches application a, if at time t2 the user clicks on application a, application a initiates a click response event to respond to the user's click. At this point, the target device also needs to record process log information for the processes associated with the application a click response event. Assume that the processes associated with the application a click response event are the third process c, the fourth process d, and the fifth process f. At this point, the process log information for the processes associated with the application a click response event recorded on the target device includes the process log information for the third process c, the fourth process d, and the fifth process f. The process log information for the third process c recorded by the target device includes the process ID of the third process c, the execution time of the initial function of the third process c that implements the application a click response event, and the execution time of the final function of the third process c that implements the application a click response event. Similarly, the process log information for the fourth process d includes the process ID of the fourth process d, the execution time of the initial function of the fourth process d that implements the application a click response event, and the execution time of the final function of the fourth process d that implements the application a click response event. The process log information of the fifth process f includes the process ID of the fifth process f, the execution time of the initial function of the fifth process f implementing the click response event of application a, and the execution time of the end function of the fifth process f implementing the click response event of application a. Assuming that the function called by the third process c in implementing the application start event in application a is different from the function called by the event implementing the click response in application a, at this time, the initial function of the third process c implementing the application start event is different from the initial function of the third process c implementing the click response event of application a, and the end function of the third process c implementing the application start event is different from the end function of the third process c implementing the click response event of application a. Assuming that the target device triggers the click response event in application a again at time t3, please refer to the above process for details, which will not be repeated here.

[0181] Assume that the target device implements a click response event for application a at time t3, responding to the user's click operation and experiencing a performance anomaly resulting in a response timeout. At this point, the target device needs to record device status information, specifically the identification information of application a. The performance anomaly type is 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 initial thread log information. A first device obtains the target device's device status information, initial process log information, and initial thread log information. Based on the identification information of application a in the device status information, the first device identifies the application process of application a in the initial log process. Based on the performance anomaly type, the first device determines the target event, thereby identifying the system process that implemented the target event in the initial process log. Assume that the third process c is an application process, and the fourth and fifth processes d and f are system processes. At this point, the first device can identify the process log information of application a in the initial process log, specifically identifying the process log information of the third process c in the initial process log information. The first device pre-sets information between system processes corresponding to different events. Therefore, after obtaining the performance anomaly type, the first device can determine the event that caused the performance anomaly, namely the target event, and thus determine which system processes correspond to the target event. The process log information of the system processes is identified in the initial process log information. In this case, 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 identify the process log information of the fourth process d and the fifth process f in the initial process log information. Assume 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 serve other applications. In this case, based on the performance anomaly type, the first device determines in the initial process log information that the process log information includes all of the fourth process d and the fifth process f, that is, the process log information of the fourth process d and the fifth process f serving application a and the process log information of other applications. At this time, the process log information of the third process c, the process log information of the fourth process d, and the process log information of the fifth process f may be determined as the process log information of the first process.

[0182] When the target device runs application a in the foreground, it also needs to record application a's foreground running time in the foreground running log information. When a click response timeout occurs in application a, the target device can also obtain target foreground running log information within a target time period based on the time the exception occurred. The first device can obtain the target foreground running log information. In this case, the first device can determine application a's foreground running time within the target time period from the target foreground running log information based on the identification information of application a. The first device can determine the foreground running time of application a within the target time period and the target running time in the process log information of each first process, where the target running time is the running time of the first process implementing the click response event for application a. The process log information of the first process whose target running time falls within the foreground running time range of application a within the target time period is determined as the first target process log information of the first process. In this case, the first device can determine that the application process of application a is the process log information of the third process c, the process log information of the fourth process d when serving application a in the foreground, and the process log information of the fifth process f when serving application a in the foreground as the first target process log information of the first process.

[0183] 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 process log information for application a that did not experience a performance anomaly when executing a click response event. Because the device status information of the target device includes click response time information, the first device can determine the time when the performance anomaly occurred in the click response event based on the click response time information. Assume that the occurrence time is t3 and the duration is 2 seconds. In this case, the first device can determine the occurrence time and duration of the performance anomaly based on the click response time information, thereby determining the performance anomaly duration of the click response event. Based on the performance anomaly duration of the click response event and the target runtime in the first target process log information of each first process, the first device can determine the first target process log information whose target runtime falls within the performance anomaly duration range of the click response event as the second target process log information of the first process. That is, the first device can determine the process log information of the third process c of application a whose target runtime falls within the performance anomaly duration range of the click response event as the second target process log information of the third process c, and the process log information of the fourth process d serving the foreground application a whose target runtime falls within the performance anomaly duration 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 running time is within the performance abnormality time range of the click response event is used as the second target process log information of the fifth process f.

[0184] The first device can determine the target runtime of the third process c based on the first target function execution time (i.e., the execution time of the initial function for implementing the click response of application a) and the second target function execution time (i.e., the execution time of the end function for implementing the click response of application a) in the second target process log information of the third process c. Similarly, the first device can determine the target runtime of the fourth process d based on the first target function execution time (i.e., the execution time of the initial function for implementing the click response of application a) and the second target function execution time (i.e., the execution time of the end function for implementing the click response of application a) in the second target process log information of the fourth process d. The target runtime of the fifth process f can be determined based on the first target function execution time (i.e., the execution time of the initial function for implementing the click response of application a) and the second target function execution time (i.e., the execution time of the end function for implementing the click response of application a) in the second target process log information of the fifth process f. Assuming that the first fault condition is that the target running time is the longest, the process with the longest target running time among the third process c, the fourth process d and the fifth process f is determined to be the process that meets the first fault condition, and the process that meets the first fault condition is determined as the target process.

[0185] Step S103: Determine the thread log information of the target thread according to the process identification information of the target process, the target event and the initial thread log information.

[0186] The target thread refers to a thread in at least one thread of the target process that is related to the target event and meets a preset second fault condition.

[0187] In an embodiment of the present application, the information of each thread recorded in the initial thread log information includes identification information of the thread. After determining the target process, the first device can determine the thread log information of the target process's thread associated with the target event in the initial thread log information based on the target process's process identification information and the target event. From the thread log information of the target process's thread associated with the target event, determine the thread that meets the second fault condition as the target thread, and determine the thread log information of the target thread.

[0188] As a possible implementation, determining the thread log information of the target thread based on the identification information of the target process, the target event, and the initial thread log information includes:

[0189] Based on the identification information of the target process and the target event, thread log information of at least one first thread is determined from the initial thread log information; and based on the process log information of the first thread and a preset second fault condition, thread log information of the target thread is determined from the thread log information of the at least one first thread. The first thread is a thread of the target process that is related to the target event.

[0190] The second fault condition is preset according to actual needs and is used to determine a thread that is most relevant to the performance abnormality in the at least one first thread.

[0191] Since each process is implemented by at least one thread, and in actual applications, the identification information of the thread of each process is related to the identification information of the process. Therefore, after determining the target process, the first device can determine the thread log information of at least one thread of the target process in 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 not only includes the thread log information of the thread that implements the target event of the target process within the target time period, but also includes the thread log information of the thread that implements other events within the target time period. Therefore, in order to detect performance failures more accurately, the first device also needs to determine the thread log information of the thread of the target process related to the target event in the thread log information of at least one thread of the target process based on the target time, that is, to determine the thread log information of the first thread. Because the implementation threads corresponding to different events are pre-set in the first device, the thread required to implement the target event can be determined after the target event is determined. Therefore, after the first device determines at least one thread of the target process based on the process identification information of the target process, it can determine the thread used to implement the target event in the at least one thread corresponding to the target process based on the target event, that is, determine the at least one first thread, and then obtain the thread log information of the at least one first thread. After determining the thread log information of the at least one first thread, the first device can search for a thread that meets the preset second fault condition based on the thread log information of each first thread, thereby determining the thread as the target thread and obtaining the thread log information of the target thread.

[0192] As described in the above example, assume that the first device determines that the process with abnormal performance is the third process c. In this case, the first device can determine the thread log information of the third process c related to the target event from the initial thread log information based on the process identification information of the third process c and the target event. Assume that the threads of the third process c include thread a, thread b, thread c, and thread d, and that thread c and thread d are used to implement a click response event. In this case, the first device can determine the thread log information of the threads of the third process c from the initial thread log information based on the process identification information of the third process c, that is, the thread log information of thread a, thread b, thread c, and thread d. Furthermore, based on the target event, the click response event, the first device can determine the thread log information of thread c and thread d related to the click response event from the thread log information of thread a, thread b, thread c, and thread d. Based on the thread log information of thread c and thread d, the first device can determine the thread that meets the second fault condition as the target thread.

[0193] As a possible implementation, if a thread in the target process has an exception, the thread cannot complete its execution within the preset time. Therefore, the thread with the exception can be determined based on the execution time of threads related to the target process. Based on this, the thread log information includes the execution time of the thread.

[0194] Determining the thread log information of the target thread from the thread log information of at least one first thread based on the thread log information of the first thread and the preset second fault condition includes:

[0195] Based on the thread running time in the thread log information of the first thread, a thread that meets the second fault condition in at least one first thread is determined as a target thread, and the thread log information of the target thread is obtained. The second fault condition includes: the longest running time.

[0196] That is, when the thread log information includes the running time of the thread, after determining the thread log information of the first thread, the first device needs to determine the thread log information of the target thread in the thread log information of the first thread. Therefore, the first device can determine the first thread whose running time meets the second fault condition as the target thread based on the running time recorded in the thread log information of each first thread. In some embodiments, the second fault condition can be the longest running time. Therefore, the first device can determine the first thread with the longest running time as the thread that meets the second fault condition based on the running time recorded in the thread log information of each first thread, that is, determine it as the target thread, and determine the thread log information of the target thread.

[0197] It should be understood that when at least two first threads meet the second fault condition, the at least two first threads meeting the second fault condition are both determined as target threads. That is, if the running time of the at least two first threads is the same and both are greater than the running time of the other first threads, the at least two first threads are determined as target threads.

[0198] Step S104: Determine the performance failure of the target device based on the thread log information of the target thread.

[0199] In an embodiment of the present application, after the first device determines the thread log information of the target thread, it can determine the performance failure of the target device that causes the target application to have abnormal performance based on the content recorded in the thread log information of the target thread.

[0200] As one possible implementation, since threads may exist in different states during execution, to more accurately determine a performance failure, the first device can determine an abnormal state based on the duration that the target thread maintains different states during the execution of the target event, and further determine a performance failure of the target device based on the abnormal state. Therefore, the thread log information of the target thread also includes the duration that the target thread maintains different states during the execution of the target event.

[0201] At this point, based on the thread log information of the target thread, the performance failure of the target device is determined to include:

[0202] According to the duration of different states maintained during the operation of the target thread to realize the target event in the thread log information of the target thread, the abnormal state during the operation of the target thread is determined; based on the abnormal state during the operation of the target thread, the performance failure of the target device is determined.

[0203] That is, when the thread log information of the target thread includes the duration of different states during the target thread's operation to achieve the target event, the first device can determine the duration of different states during the target thread's operation to achieve the target event based on the thread log information of the target thread after determining the thread log information of the target thread. Based on the duration of different states during the target thread's operation, the state whose duration meets the preset third fault condition is determined to be an abnormal state. Since different states during the thread's operation are abnormal, different performance faults are determined. Therefore, the first device can determine the performance fault of the target device based on the abnormal state.

[0204] The third fault condition can be preset according to actual needs. For example, the third fault condition can be that the holding time is longer than a preset time, or the holding time is the longest.

[0205] It should be noted that, during the operation process of the target thread to realize the target event, the holding time of different states refers to the sum of the running time of different states. For example, the target thread includes state a, state b and state a during the operation process of realizing the target event. That is, when the target thread realizes the target event, its running state is first state a, then switches to state b, and then switches back to state a. Assume that the running time of the target thread in state a for the first time is a1 seconds, the running time in state b is a2 seconds, and the running time in state a for the second time is a3 seconds. At this time, the first device determines that during the operation process of the target thread to realize the target event, the holding time of state a is a1+a3 seconds, and the holding time of state b is a2 seconds.

[0206] In some embodiments, the third fault condition is that different states are maintained for the longest time during the thread's execution. In this case, the first device may determine the state with the longest preservation time as meeting the third fault condition based on the length of time the target thread is maintained in different states during execution, and determine the state as abnormal.

[0207] As a possible implementation, the states of a thread during execution include: Running state, Runnable state, Sleep state, and Uninterruptible Sleep state.

[0208] In this way, if the abnormal state is Running during the thread running process, that is, the Running state takes too long, it means that there is a problem 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.

[0209] If the abnormal state is Runnable during thread execution, that is, the Runnable state takes a long time, it means that the processor resources of the target device are insufficient and the number of concurrently running processes needs to be reduced.

[0210] If the abnormal state during thread running is Sleep state, that is, the Sleep state takes a long time, it may be that the lock waiting time is too long and the lock needs to be optimized.

[0211] If the abnormal state is UninterSleep during thread running, it means that the UninterSleep state takes a long time. The input and output load may be high, and the file reading and writing of the target device needs to be optimized.

[0212] It should be understood that the more relevant information about the performance anomaly, the more information the first device will refer to when making a performance fault judgment, which can further improve the accuracy of the performance fault judgment. Therefore, the device status information can not only include the identification information of the application and the type of performance anomaly, as shown in Figure 5a. In order to further improve the accuracy of the first device in determining the performance failure of the target device, as shown in Figure 5b, the device status information can also include other information, such as the business process of the target application, etc., which is not limited in this application. Among them, in Figure 5b, the time when the performance anomaly occurs is the start time of the target event. The performance anomaly duration is the performance anomaly duration of the target event described in the above embodiment.

[0213] 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. In addition, in this application, the performance fault is located by locating the target thread, which improves the accuracy of performance fault determination and the efficiency of performance testing.

[0214] See Figure 6, which is a flow chart of a method for device performance testing provided in an embodiment of the present application. The method is applied to a second device and includes:

[0215] Step S601: Obtain device status information, initial process log information, and initial thread log information.

[0216] Among them, device status information, initial process log information and initial thread log information are obtained; 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 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 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.

[0217] In an embodiment of the present application, the second device and the first device are different devices. When the second device is unable to perform performance fault detection, it is necessary to send relevant information of the performance anomaly to the first device. Therefore, when the second device has a performance anomaly in the application running in the foreground, it is necessary to obtain device status information, initial process log information, and initial thread log information. At this time, when the second device has a performance anomaly in the application running in the foreground, the second device can record the identification information and performance anomaly type of the application currently running in the foreground as device status information when the performance anomaly occurs, and determine the target time period based on the time when the performance anomaly occurs, find the process log information within the target time period in the recorded process log information, and obtain the initial process log information. Find the thread log information within the target time period in the recorded thread log information, and obtain the initial thread log information.

[0218] The target time period is a time period that includes the time when the performance anomaly occurs and is determined based on the time when the performance anomaly occurs. The length of the target time period can be pre-set based on actual needs. For example, if the target time period is 10 minutes, the target time period can be a time period with the time when the performance anomaly occurs as the middle time. In this case, the initial process log information obtained by the first device can be the process log information within five minutes before and after the time when the performance anomaly occurs. Of course, the target time period can also be other time periods with a length of 10 minutes that include the time when the performance anomaly occurs, and this application does not impose any restrictions on this.

[0219] Performance anomaly type information is used to identify the type of performance anomaly experienced by the target application. Performance anomaly types include at least one of application startup anomalies, click response anomalies, scrolling anomalies, and game anomalies. Application startup anomalies include whether the application has timed out. Click response anomalies include whether clicks are unresponsive or whether click response times out. Sliding anomalies include whether scrolling is choppy or page refreshes are slow. Game anomalies include whether the game experiences lag or page refreshes slowly.

[0220] As a possible implementation, the device status information also includes the time information of the target event. The target event refers to an event in which a performance anomaly occurs in at least one event running during the foreground of the target application. The time information of the target event refers to the time information when the performance anomaly occurs at the target event.

[0221] As a possible implementation manner, the target event includes one or more of an application start event, a click response event, a touch screen sliding event, and a display refresh event.

[0222] As a possible implementation, the initial process log information includes process log information of the first process; the process log information of the first process also includes a target runtime. The target runtime is the runtime required for the first process to achieve a target event; the first process is a process associated with the target event within a target time period.

[0223] The process log information of the first process includes at least one first target process log information of the first process; the first target process log information of the first process is process log information related to the target running time and the foreground running time of the target application within the target time period in the process log information of at least one first process.

[0224] As a possible implementation method, 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.

[0225] The target running 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 run when the target event is realized in the first process, and the second target function is the end function run when the target event is realized in the first process.

[0226] As a possible implementation manner, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0227] As a 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 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.

[0228] As a possible implementation manner, the thread log information includes the running time of the thread.

[0229] As a possible implementation manner, the thread log information of the target thread includes the duration of different states during the process of the target thread implementing the target event.

[0230] Step S602: Send the device status information, initial process log information, and initial thread log information to the first device.

[0231] In an embodiment of the present application, after obtaining the device status information, initial process log information and initial thread log information, the second device sends the device status information, initial process log information and initial thread log information to a device, so that the first device determines the performance failure of the second device based on the device status information, initial process log information and initial thread log information.

[0232] See Figure 7, which is a flow chart of a method for device performance testing provided in an embodiment of the present application. In this embodiment of the present application, the second device is the target device. Specifically, the second device obtains the device status information, initial process log information, and initial thread log information of the target device, and the first device determines a performance failure. The method includes:

[0233] Step S701: The second device obtains device status information, initial process log information, and initial thread log information of the target device.

[0234] Among them, 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.

[0235] For details, please refer to step S401 and will not be described again here.

[0236] 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, and 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.

[0237] For details, please refer to step S101 and will not be repeated here.

[0238] Step S703: The second device obtains target foreground operation log information.

[0239] The target foreground running log information is used to record the identification information and foreground running time information of the application that has run in the foreground on the target device within the target time period.

[0240] For details, please refer to step S102 and no further details will be given here.

[0241] Step S704: The second device sends target foreground operation log information to the first device, and the first device receives the target foreground operation log information.

[0242] Step S705: The first device determines a target process from processes running within a target time period according to the device status information, the initial process log information, and the target foreground running log information.

[0243] Among them, the target process refers to a process related to the target event and meeting the preset first fault condition; the target event refers to an event in which there is a performance abnormality in at least one event running during the foreground operation of the target application.

[0244] For details, please refer to step S102 and no further details will be given here.

[0245] Step S706: First, determine the thread log information of the target thread according to the process identification information of the target process, the target event, and the initial thread log information.

[0246] The target thread refers to a thread that meets a preset second fault condition among at least one thread related to the target process.

[0247] For details, please refer to step S103 and no further details will be given here.

[0248] It should be noted that, in order to more accurately determine the performance failure of the second device, the first device may further obtain the current usage of the performance-related resources of the second device when the performance anomaly occurs. In this case, the following steps S507 to S708 may be executed.

[0249] Step S707: When a performance anomaly occurs, the second device obtains target resource information.

[0250] The target resource information is log information of resources related to the performance of the second device.

[0251] In an embodiment of the present application, when a performance anomaly occurs, the second device can obtain performance-related logs so that the first device can conduct a comprehensive analysis based on the performance-related log information when determining a performance failure. In this case, the second device can obtain all log information from the second device and then find the log information of performance-related resources within all the obtained log information. Specifically, the second device can obtain log information of performance-related hardware resources and software resources.

[0252] In some embodiments, performance-related hardware resources include: processor, memory, input and output, etc. Performance-related software resources include: lock, component services, display, messages, etc.

[0253] Step S708: The second device sends the target resource information to the first device, and the first device receives the target resource information.

[0254] In an embodiment of the present 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.

[0255] Step S709: The first device determines a performance failure of the target device based on the thread log information of the target thread.

[0256] For details, please refer to step S104 and will not be described again here.

[0257] As a possible implementation, when the first device obtains the target resource information, determining the performance failure of the target device according to the thread log information of the target thread includes:

[0258] A performance failure of the second device is determined based on the thread log information of the target thread and the target resource information of the second device.

[0259] After obtaining the thread log information of the target thread, the first device can determine the abnormal state of the target thread during operation, and thus determine the performance failure of the target device according to the abnormal state and the target resource information.

[0260] For example, the first device determines that the Runnable state of the target thread is an abnormal state. At this time, the first device can preliminarily determine that the processor resources of the second device are insufficient, and can determine the usage of the processor recorded in the target resource information by obtaining the target resource information of the second device. Assuming that the processor recorded in the target resource information is used 85%, the first device can determine that the performance abnormality of the second device is due to insufficient processor resources.

[0261] As a possible implementation manner, the first device optimizing the performance of the second device based on the performance optimization information includes:

[0262] The first device sends performance optimization information to the second device, where the performance optimization information is used to instruct the second device to perform performance optimization on the second device according to the performance optimization information.

[0263] That is, the first device does not control the second device to perform performance optimization, but after determining the performance optimization information, sends the performance optimization information to the second device, and the second device itself performs corresponding performance optimization based on the performance optimization information to eliminate performance anomalies.

[0264] Referring to FIG8 , there is shown a flow chart of a method for device performance testing provided in an embodiment of the present application. In this embodiment of the present application, the first device is the target device and the first device itself determines the performance failure. That is, compared to the embodiment shown in FIG7 , in this embodiment of the present application, the first device and the second device are one electronic device. The method includes:

[0265] Step S801: The first device obtains device status information, initial process log information, and initial thread log information of the target device.

[0266] Among them, 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 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 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.

[0267] For details, please refer to step S101 and step S401 and no further details will be given here.

[0268] Step S802: The first device determines a target process from processes running within a target time period based on the device status information and the initial process log information.

[0269] Among them, the target process refers to a process related to the target event and meeting the preset first fault condition; the target event refers to an event in which there is a performance abnormality in at least one event running during the foreground operation of the target application.

[0270] For details, please refer to step S102 and no further details will be given here.

[0271] Step S803: The first device determines the thread log information of the target thread according to the process identification information of the target process, the target event, and the initial thread log information.

[0272] The target thread refers to a thread that meets a preset second fault condition among at least one thread related to the target process.

[0273] For details, please refer to step S103 and no further details will be given here.

[0274] Step S804: When a performance abnormality occurs, the first device obtains target resource information.

[0275] The target resource information is log information of resources related to the performance of the first device.

[0276] The specific parameter step S707 is not described in detail here.

[0277] Step S805: The first device determines a performance failure of the target device based on the thread log information of the target thread.

[0278] The specific parameter step S709 is not described in detail here.

[0279] Step S806: The first device determines performance optimization information based on the determined performance failure.

[0280] In an embodiment of the present application, after determining a performance failure of the second device, the first device may determine performance optimization information for resolving the performance failure based on the determined performance failure. In some embodiments, correspondence information between different performance failures and corresponding performance optimization information may be pre-set. In this way, after determining a performance failure, the first device may directly determine the performance optimization information based on the set correspondence information. For example, if it is determined that the performance failure of the second device is insufficient processor resources, the corresponding performance optimization information may be to reduce the number of concurrently running processes.

[0281] Step S807: The first device performs performance optimization based on the performance optimization information.

[0282] In an embodiment of the present application, after determining the performance optimization information, the first device can perform corresponding performance optimization on the first device according to the performance optimization information to eliminate performance abnormalities.

[0283] Referring to FIG9 , which is a schematic diagram of a device for detecting device performance according to an embodiment of the present application, the device includes:

[0284] The acquisition unit 901 is configured to acquire device status information, initial process log information, and initial thread log information of a target device.

[0285] Among them, 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 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 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.

[0286] The processing unit 902 is configured to determine a target process from processes running within a target time period according to the device status information and the initial process log information.

[0287] Among them, the target process refers to a process related to the target event and meeting the preset first fault condition; the target event refers to an event in which there is a performance abnormality in at least one event running during the foreground operation of the target application.

[0288] The processing unit 902 is further configured to determine the thread log information of the target thread according to the process identification information of the target process, the target event and the initial thread log information.

[0289] The target thread refers to a thread that meets a preset second fault condition among at least one thread related to the target process.

[0290] The processing unit 902 is further configured to determine a performance failure of the target device according to the thread log information of the target thread.

[0291] As a possible implementation, processing unit 902 is specifically configured to determine, based on the device status information, process log information of at least one first process in the initial process log information, and determine a target process in 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.

[0292] The first process refers to a process related to the target event within the target time period.

[0293] As a possible implementation manner, the at least one first process includes a system process and / or an application process.

[0294] As a possible implementation method, 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, determine the target system process based on the performance exception type information, and 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 exception type.

[0295] As a possible implementation, the process log information of the first process further includes a target running time, wherein the target running time is the running time for the first process to realize the target event.

[0296] As a possible implementation, the processing unit 902 is further configured to obtain target foreground running log information; and determine the foreground running time of the target application within the target time period in the target foreground running log information according to the identification information of the target application.

[0297] First target process log information of at least one first process is determined from the process log information of at least one first process according to the foreground running time of the target application within the target time period and the target running time of at least one first process.

[0298] 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 a target time period. The first target process log information of the first process is process log information in which the target running time in the process log information of at least one first process is related to the foreground running time of the target application within the target time period.

[0299] The processing unit 902 is specifically configured to determine a target process in the at least one first process based on the first target process log information of the at least one first process and a preset first fault condition.

[0300] As a possible implementation, the device status information further includes: time information of a target event. The time information of a target event refers to time information when the performance abnormality occurs at the target time.

[0301] The processing unit 902 is further configured to determine second target process log information of at least one first process from the first target process log information of the at least one first process according to the time information of the target event and the running time of the at least one first process.

[0302] 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 the at least one first process.

[0303] The processing unit 902 is specifically configured to determine a target process in at least one first process based on the second target process log information of the first process and a preset first fault condition.

[0304] As a possible implementation, the processing unit 902 is specifically configured to determine a target runtime of each first process based on the second target process log information of each first process, and to determine a first process that meets the first fault condition as a target process in at least one first process.

[0305] The first fault condition includes that the target running time is the longest. The target running time is the running time when the first process achieves the target event.

[0306] As a possible implementation method, the target running 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 when the target event is realized in the first process, and the second target function is the end function that runs when the target event is realized in the first process.

[0307] The processing unit 902 is specifically configured to determine a target running time of each first process according to the execution time of the first target function and the execution time of the second target function of each first process.

[0308] As a possible implementation manner, the target event includes one or more of an application start event, a click response event, a touch screen sliding event, and a display refresh event.

[0309] As a possible implementation manner, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0310] As a possible implementation, the processing unit 902 is specifically configured to determine thread log information of at least one first thread in the initial thread log information according to the process identification information of the target process. The first thread is a thread related to the target event of the target process.

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

[0312] As a possible implementation manner, the thread log information includes the running time of the thread.

[0313] The processing unit 902 is specifically configured to determine, based on the thread running time in the thread log information of the first thread, a first thread that meets a second fault condition as a target thread in at least one first thread, and obtain the thread log information of the target thread. The second fault condition includes: the longest running time.

[0314] As a possible implementation manner, the thread log information of the target thread also includes the duration of different states during the execution of the target thread to implement the target event.

[0315] The processing unit 902 is specifically used to determine an abnormal state during the operation of the target thread based on the maintenance time of different states during the operation of the target thread to realize the target event in the thread log information of the target thread; based on the abnormal state during the operation of the target thread, determine the performance failure of the target device.

[0316] As a possible implementation manner, the acquiring unit 901 is further configured to acquire target resource information of the target device when a performance anomaly occurs.

[0317] The target resource information is log information of resources related to the performance of the target device.

[0318] The processing unit 902 is specifically configured to determine a performance failure of the target device according to thread log information of the target thread and target resource information of the target device.

[0319] As a possible implementation manner, the acquiring unit 901 is specifically configured to receive device status information, initial process log information, and initial thread log information of the target device sent by the target device.

[0320] Alternatively, as a possible implementation method, the acquisition unit 901 is specifically used to obtain stored process log information and thread log information; based on the time when the performance anomaly occurs, the initial process information is determined in the process log information, and the initial thread log information is determined in the thread log information.

[0321] As a possible implementation manner, the processing unit 902 is further configured to determine performance optimization information based on the determined performance failure; and perform performance optimization on the target device based on the performance optimization information.

[0322] Referring to FIG10 , which is a schematic diagram of a device for detecting device performance according to an embodiment of the present application, the device includes:

[0323] The acquisition unit 1001 is used to acquire device status information, initial process log information and initial thread log information.

[0324] Among them, 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 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 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.

[0325] The sending unit 1002 is configured to send the device status information, the initial process log information, and the initial thread log information to the first device.

[0326] As a possible implementation manner, the acquisition unit 1001 is further configured to acquire target foreground operation log information.

[0327] The target foreground running log information is used to record the identification information and foreground running time information of the application that has run in the foreground on the target device within the target time period.

[0328] The sending unit 1002 is further configured to send target foreground operation log information to the first device.

[0329] As a possible implementation, the backup state information also includes: time information of a target event; the target event is an event in which a performance anomaly occurs in at least one event running during foreground operation of the target application. The time information of the target event is the time information when the performance anomaly occurs at the target event.

[0330] As a possible implementation method, 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 realize the target event; the first process refers to the process related to the target event within the target time period.

[0331] The process log information of the first process includes at least one first target process log information of the first process; the first target process log information of the first process is process log information related to the target running time and the foreground running time of the target application within the target time period in the process log information of at least one first process.

[0332] As a possible implementation method, 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.

[0333] The target running 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 when the target event is realized in the first process, and the second target function is the end function that runs when the target event is realized in the first process.

[0334] As a possible implementation manner, the identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

[0335] As a possible implementation manner, the thread log information includes the running time of the thread.

[0336] As a possible implementation manner, the thread log information of the target thread includes the duration of different states during the process of the target thread implementing the target event.

[0337] Corresponding to the above embodiments, the present application also provides an electronic device. Figure 11 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 embodiments of the present invention. It can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0338] The communication unit 1103 is configured to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices, or send user data to other devices.

[0339] The processor 1101 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 1102, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 1101 can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0340] 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 memory, flash memory, magnetic disk or optical disk.

[0341] When the execution instructions in the memory 1102 are executed by the processor 1101 , the electronic device 1100 is enabled to execute part or all of the steps in the embodiment shown in FIG. 9 .

[0342] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program that, when executed, may include some or all of the steps of each embodiment of the device performance testing method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0343] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes 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, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention or certain portions of the embodiments.

[0344] In this specification, reference can be made to the same or similar parts between the various embodiments. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

Claims

1. A method for detecting equipment performance, characterized in that: Applied to a first device, the method includes: Acquire device status information, initial process log information and initial thread log information of the target device, wherein the device status information includes identification information of the target application 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 is used to record information about processes running on the target device within a target time period, and information about each process recorded in the initial process log information includes process identification information of the process; the target time period includes the time when the performance anomaly occurs; the initial thread log information is used to record information about threads running on the target device within the target time period; According to the device status information and the initial process log information, a target process is determined from the processes running within the target time period; the target process refers to a process related to a target event and meeting a preset first fault condition; the target event refers to an event with performance abnormality in at least one event running during the foreground running of the target application; Determining the thread log information of the target thread according to the process identification information of the target process, the target event and the initial thread log information; the target thread refers to a thread in at least one thread of the target process that is related to the target event and satisfies a preset second fault condition; A performance failure of the target device is determined according to the thread log information of the target thread.

2. The method according to claim 1, characterized in that: Determining a target process from processes running within the target time period according to the device status information and the initial process log information includes: According to the device status information, determining process log information of at least one first process in the initial process log information; the first process refers to a process related to the target event within a target time period; Based on the process log information of the at least one first process and a preset first fault condition, a 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 a system process and / or an application process.

4. The method according to claim 3, characterized in that Determining, based on the device status information and the initial process log information, process log information of at least one first process in the initial process log information includes: According to the identification information of the target application, determining the process log information of the application process of the target application in the initial process log information; and / or, The target system process is determined according to 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 running time; The target running time is the running time of the first process to achieve the target event; the method further includes: Obtaining target foreground running log information; the target foreground running log information is used to record the identification information and foreground running time information of the application that has run in the foreground in the target device within the target time period; Determining, according to the identification information of the target application, the foreground running time of the target application within the target time period in the target foreground running log information; Before determining a target process in 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: Determine, in the process log information of at least one first process, first target process log information of at least one first process according to the foreground running time of the target application in the target time period and the target running time of the at least one first process; the first target process log information of the first process is the process log information in which the target running time in the process log information of the at least one first process is related to the foreground running time of the target application in the target time period; The determining of the target process in 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 includes: Based on the first target process log information of the at least one first process and a preset first fault condition, a 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: time information of the target event; the time information of the target event refers to the time information of the target time when the performance abnormality occurs; In the first target process log information based on the at least one first process and the preset first fault condition, in the Before determining the target process in at least one first process, the method further includes: Determine, according to 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 in 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 which the target running time in the first target process log information of the at least one first process is related to the time information of the target event; The determining of the target process in 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 comprises: Based on the second target process log information of the first process and a preset first fault condition, a target process is determined in the at least one first process.

7. The method according to claim 6, characterized in that The determining of the target process in 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: Determine a target running time of each first process based on the second target process log information of each first process; the target running time is the running time when the first process achieves a target event; A first process that meets the first fault condition is determined as a target process among the at least one first process, wherein the first fault condition includes that the target running time is the longest.

8. The method according to claim 7, characterized in that The target running 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 an initial function that is executed when the target event is realized in the first process, and the second target function is an end function that is executed when the target event is realized in the first process; The determining the target running time of each first process based on the second target process log information of each first process includes: The target running time of each first process is determined according to 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 event includes one or more of an application start event, a click response event, a touch screen sliding event, and a display refresh event.

10. The method according to claim 1, characterized in that The identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

11. The method according to claim 1, characterized in that: Determining the thread log information of the target thread according to the process identification information of the target process, the target event and the initial thread log information includes: Determining thread log information of at least one first thread in the initial thread log information according to the process identification information of the target process and the target event; the first thread refers to a thread of the target process related to the target event; Based on the process log information of the first thread and a preset second fault condition, thread log information of the target thread is determined from 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 running time of the thread; The determining, based on the thread log information of the first thread and the preset second fault condition, the thread log information of the target thread from the thread log information of the at least one first thread comprises: Based on the thread running time in the thread log information of the first thread, the first thread that meets the second fault condition is determined as the target thread in the at least one first thread, and the thread log information of the target thread is obtained; the second fault condition includes: the longest running time.

13. The method according to any one of claims 1 to 12, characterized in that: The thread log information of the target thread includes the retention time of different states during the operation of the target thread to realize the target event; The determining, according to the thread log information of the target thread, the performance failure of the target device comprises: Determine the abnormal state in the target thread running process according to the retention time of different states in the target thread running process of realizing the target event in the thread log information of the target thread; Based on an abnormal state occurring during the operation of the target thread, a performance failure of the target device is determined.

14. The method according to any one of claims 1 to 12, characterized in that: Before determining the performance failure of the target device according to the thread log information of the target thread, the method further includes: Acquire target resource information of the target device when a performance anomaly occurs; the target resource information is log information of resources related to the performance of the target device; The determining, according to the thread log information of the target thread, the performance failure of the target device comprises: A performance failure of the target device is determined according to the thread log information of the target thread and the target resource information of the target device.

15. The method according to any one of claims 1 to 12, characterized in that: The step of obtaining device status information, initial process log information, and initial thread log information of the target device includes: Receive device status information, initial process log information, and initial thread log information of the target device sent by the target device.

16. The method according to any one of claims 1 to 12, characterized in that: Obtaining the initial process log information and initial thread log information includes: Get stored process log information and thread log information; Based on the time when the performance anomaly occurs, initial process information is determined in the process log information, and initial thread log information is determined in the thread log information.

17. The method according to claim 16, characterized in that Also includes: Determining performance optimization information based on the determined performance failure; The target device is subjected to performance optimization based on the performance optimization information.

18. A method for detecting equipment performance, characterized in that: Applied to the second device, the method includes: Acquire device status information, initial process log information and initial thread log information; the device status information includes identification information of the target application and 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 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 process identification information of the process; the target time period includes the time when the performance anomaly occurs; the initial thread log information is used to record information about threads running on the target 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.

19. The method according to claim 18, characterized in that Also includes: Get the target foreground running log information; The target foreground running log information is used to record the identification information and foreground running time information of the application that has run in the foreground in the target device within the target time period; Send 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: time information of the target event; the target event refers to an event in which a performance abnormality exists in at least one event running during the foreground running of the target application; the time information of the target event refers to the time information when the performance abnormality occurs at the target time.

21. The method according to claim 20, characterized in that The initial process log information includes process log information of the first process; the process log information of the first process also includes target running time; wherein the target running time is the running time of the first process to realize 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 in which the target running time in the process log information of the at least one first process is related to 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 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; The target running 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 an initial function that is executed when the target event is realized in the first process, and the second target function is an end function that is executed when the target event is realized in the first process.

23. The method according to any one of claims 18 to 22, characterized in that: The identification information of the target application includes application package name information of the target application and / or process identification information of the target application process.

24. The method according to any one of claims 18 to 22, characterized in that: The thread log information includes the running time of the thread.

25. The method according to claim 24, characterized in that The thread log information of the target thread includes the retention time of different states in the process of the target thread realizing the target event.

26. A device for detecting equipment performance, characterized in that: include: An acquisition unit, used to acquire device status information, initial process log information and initial thread log information of a target device, wherein the device status information includes identification information of a target application and performance abnormality type information; The target application is an 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 processes running on the target device within a target time period, and the information of each process recorded in the initial process log information includes process identification information of the process; the target time period includes the time when the performance anomaly occurs; The initial thread log information is used to record information about threads running on the target device within a target time period; A processing unit, configured to determine a target process from processes running within the target time period according to the device status information and the initial process log information; the target process refers to a process related to a target event and meeting a preset first fault condition; the target event refers to an event with a performance abnormality in at least one event running during foreground operation of the target application; The processing unit is further configured to determine the thread log information of the target thread according to the process identification information of the target process, the target event and the initial thread log information; the target thread refers to a thread that satisfies a preset second fault condition among at least one thread related to the target process; The processing unit is further configured to determine a performance failure of the target device according to thread log information of the target thread.

27. A device for detecting equipment performance, characterized in that: include: An acquisition unit, used to acquire device status information, initial process log information and initial thread log information; the device status information includes identification information of the target application and performance abnormality type information; The target application is an 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 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 process identification information of the process; the target time period includes the time when the performance anomaly occurs; The initial thread log information is used to record information about threads running on the target device within a target time period; The sending unit is used to send the device status information, the initial process log information and the initial thread log information to the first device.

28. An electronic device, characterized in that: It comprises 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 one of claims 1 to 17, or the method described in any one of claims 18 to 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, the device where the computer-readable storage medium is located is controlled to execute the method described in any one of claims 1 to 17, or the method described in any one of claims 18 to 25.

Citation Information

Patent Citations

  • Log obtaining device and method and mobile terminal

    CN106201756A

  • Restarting fault location method, mobile terminal and readable storage medium of computer

    CN108052412A

  • Program exception processing method and device, equipment and storage medium

    CN113220535A

  • Log analysis method and device, equipment and storage medium

    CN114416481A

  • Log optimization method and device, equipment and storage medium

    CN115129539A