Application program lagging detection method and device, medium, product and equipment

By fitting data grouping and relational functions of the application client, the problems of insufficient coverage of all scenarios and neglecting low-probability lag events in the prior art are solved, and a higher accuracy lag detection is achieved.

CN120276986APending Publication Date: 2025-07-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510346677.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

When the existing technology detects application stuttering, it cannot fully cover the entire scene, and it is easy to ignore small probability but has a large impact of lag events, resulting in low detection accuracy.

Method used

By grouping the data reported by the application client, fitting the relationship function between execution time and reporting quantity, and determining the lag situation based on the changes in the relationship function.

Benefits of technology

It improves the accuracy and scope of application lag detection, can capture low-probability lag events, and is suitable for lag detection in all scenes or any scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276986A_ABST
    Figure CN120276986A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides an application lag detection method and device, a medium, a product and equipment. The method comprises the steps that first data reported by an application client side are grouped, the report amount of the first data in each group is determined, and the first data comprise execution time consumption of a method called by the application client side in the running process; fitting a relation function between the execution time consumption and the report quantity according to the report quantity of the first data in each group; and according to the change condition of the relation function, determining the lagging condition of the application program corresponding to the application program client. According to the scheme, on the basis of the fitted relation function between the execution time consumption and the report amount, the small-probability event influencing the application program jamming can be captured, and the jamming detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method for detecting application lags, an apparatus for detecting application lags, a computer-readable storage medium, a program product, and an electronic device. Background Art

[0002] In the development of applications, the user experience is a key factor in evaluating the performance of an application. However, applications sometimes have lag problems, which seriously affect the user experience. Therefore, detecting the lag situation of an application in a timely manner to discover and improve the lag situation is crucial for enhancing the user experience.

[0003] In the related art, the fluency of an application is mainly measured by indicators such as frame rate, number of lag frames, startup time, memory occupancy, CPU (Central Processing Unit) and GPU (Graphics Processing Unit) occupancy, network request latency, and ANR (Application Not Responding) to determine whether there is a lag situation.

[0004] However, these indicators are usually suitable for detection in a single business scenario. For example, lag detection is performed separately on the live page, home page, etc. of an application, and cannot be applied to the lag detection of the entire scenario of an application. At the same time, these indicators are likely to ignore small-probability events that have a greater impact on lags and cannot accurately detect extreme lag situations encountered by a small number of users, resulting in low accuracy in detecting application lags.

[0005] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0006] The purpose of the present disclosure is to provide a method for detecting application lags, an apparatus for detecting application lags, a computer-readable storage medium, a computer program product, and an electronic device, so as to at least to a certain extent improve the accuracy of detecting application lags.

[0007] Other features and advantages of the present disclosure will become apparent through the following detailed description, or will be partially learned through the practice of the present disclosure.

[0008] According to a first aspect of the present disclosure, there is provided a method for detecting application program lags, including: grouping first data reported by an application program client, and determining the reporting amount of the first data in each group, where the first data includes the execution time of methods called during the operation of the application program client; fitting a relationship function between the execution time and the reporting amount according to the reporting amount of the first data in each group; and determining the lag situation of the application program corresponding to the application program client according to the change situation of the relationship function.

[0009] According to a second aspect of the present disclosure, there is provided an application program lag detection device, including: a grouping module configured to group first data reported by an application program client and determine the reporting amount of the first data in each group, where the first data includes the execution time of methods called during the operation of the application program client; a fitting module configured to fit a relationship function between the execution time and the reporting amount according to the reporting amount of the first data in each group; and a lag determination module configured to determine the lag situation of the application program corresponding to the application program client according to the change situation of the relationship function.

[0010] According to a third aspect of the present disclosure, there is provided a computer program product containing instructions, which when running on a computer, causes the computer to execute the steps of the application program lag detection method as described in the first aspect.

[0011] According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the application program lag detection method in the first aspect of the above-mentioned embodiments.

[0012] According to a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; and a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the application program lag detection method as described in the first aspect of the above-mentioned embodiments.

[0013] As can be seen from the above technical solutions, the application program lag detection method, application program lag detection device, computer-readable storage medium, computer program product, and electronic device in the exemplary embodiments of the present disclosure at least have the following advantages and positive effects:

[0014] In the technical solutions provided by some embodiments of the present disclosure, the execution time consumption of the methods called by the application client during operation is grouped, the number of execution time consumptions in each group is determined, and by fitting the relationship function between the execution time consumption and the number, according to the change of the relationship function, it can be determined whether the application corresponding to the application client has a lag situation. Compared with the related art, on the one hand, by fitting the relationship function between the execution time consumption of the methods called by each client and the number of methods corresponding to different execution time consumptions, the present disclosure can consider the execution situations of all clients' methods, thereby capturing small probability events affecting application lag and improving the accuracy of application lag detection; on the other hand, the present disclosure can fit the relationship function between the execution time consumption of the methods called in the full scenario or any scenario of the application and the number of methods with different execution time consumptions according to requirements, so as to perform lag detection on any scenario or the full scenario and improve the applicable range of lag detection.

[0015] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0017] Figure 1 A schematic diagram showing an exemplary system architecture to which the embodiments of the present disclosure can be applied;

[0018] Figure 2 A flowchart showing a method for detecting application lag in an exemplary embodiment of the present disclosure;

[0019] Figure 3 A flowchart showing a method for grouping first data in an exemplary embodiment of the present disclosure;

[0020] Figure 4 A schematic diagram showing a fitted relationship function in an exemplary embodiment of the present disclosure;

[0021] Figure 5 A flowchart showing a method for detecting lag according to the change of the relationship function in an exemplary embodiment of the present disclosure;

[0022] Figure 6A schematic flowchart showing another method for detecting jank based on the change of a relationship function in an exemplary embodiment of the present disclosure;

[0023] Figure 7 A schematic diagram showing the result of an abnormal distribution detection in an exemplary embodiment of the present disclosure;

[0024] Figure 8 A schematic diagram showing the interaction process of an application jank detection in an exemplary embodiment of the present disclosure;

[0025] Figure 9 A schematic diagram showing the composition of an application jank detection device in an exemplary embodiment of the present disclosure;

[0026] Figure 10 A schematic diagram showing the structure of an electronic device in an exemplary embodiment of the present disclosure. Detailed implementation manners

[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.

[0028] In this specification, the terms "a", "an", "the", and "said" are used to indicate the presence of one or more elements / components / etc.; the terms "comprising" and "having" are used to mean an open inclusion and mean that there may be additional elements / components / etc. in addition to the listed elements / components / etc.; the terms "first" and "second", etc. are used only as labels and are not a limitation on the quantity of their objects.

[0029] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0030] Currently, with the continuous improvement of the hardware performance of smart terminals, the complexity and functionality of application programs are also continuously enhanced. However, even on high-performance devices, application programs may still have lag problems, which are usually manifested as unsmooth application interfaces, operation delays, etc. This not only affects the user's operation experience but may also lead to negative evaluations of the application by users. Therefore, detecting the lag of application programs can timely discover and correct the lag situation and improve the user experience.

[0031] In the related art, the smoothness of application programs is mainly measured by indicators such as frame rate, number of lag frames, startup time, memory occupancy, CPU and GPU occupancy, network request latency, and ANR, so as to detect the lag situation of application programs. For example, the frame rate indicator can measure the lag situation by counting the number of times the application interface is refreshed per second, the number of lag frames indicator can measure the lag situation by counting the number of frames whose application interface update duration exceeds the threshold, the startup time indicator can measure the lag situation by evaluating the time-consuming of the cold startup or hot startup of the application program, the memory occupancy indicator can measure the lag situation by monitoring the memory usage of the application program during operation, the CPU and GPU occupancy can measure the lag situation by analyzing the usage of the computing resources of the terminal device by the application program, the network request latency can measure the lag situation by evaluating the response speed of the application program during network communication, and ANR can measure the lag situation by detecting whether the application program has an unresponsive situation.

[0032] However, although the above indicators are relatively intuitive and easy to obtain, these indicators also have certain limitations. For example, on the one hand, these indicators are usually detected in separate business scenarios, such as detecting lag in separate business scenarios such as the short video page, live broadcast page, and home page of the application program, and are mostly used for performance evaluation when just switching pages, making it difficult to cover the full scenario of the application program. On the other hand, the statistical methods of these indicators are usually calculated based on weighted summation or average, which easily ignores small-probability events that have a greater impact on lag, such as the lag situations of a small number of users that are difficult to reproduce. Therefore, the accuracy of its lag detection is low.

[0033] To solve the above problems, the present disclosure provides a method and apparatus for detecting application program lag, which can be applied to Figure 1 the system architecture of the exemplary application environment shown.

[0034] As Figure 1 shown, the system architecture 100 may include a terminal device 110 and a server 120. Among them, the terminal device 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a notebook computer, a smart wearable device, etc. The server 120 generally refers to a background system that provides relevant services for the application program lag detection method in the present exemplary embodiment, and may be a single server or a cluster formed by multiple servers. A connection may be formed between the terminal device 110 and the server 120 through a wired or wireless communication link for data interaction.

[0035] In an exemplary embodiment, the above application program lag detection method may be executed by the server 120. Correspondingly, the application program lag detection apparatus may be disposed in the server 120 to implement corresponding module functions. For example, the application program client in each terminal device 110 may report the execution time consumption of the method called during the running of the application program client to the server 120. After receiving this data, the server 120 may group this data, determine the quantity in each group, then fit the relationship function between the execution time consumption and the quantity according to the quantity corresponding to the execution time consumption of each group, and determine the lag situation of the application program client according to this relationship function.

[0036] It should be understood that Figure 1 the numbers of the terminal devices and the servers in

[0037] Figure 2 are merely illustrative. According to the implementation requirements, there may be any number of terminal devices and servers. For example, the server 120 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0037] Figure 2 shows a schematic flowchart of the application program lag detection method in an exemplary embodiment of the present disclosure. Referring to Figure 2 , the method includes:

[0038] Step S210, group the first data reported by the application program client, and determine the reporting quantity of the first data in each group, where the first data includes the execution time consumption of the method called during the running of the application program client;

[0039] Step S220: Fit the relationship function between the execution time and the reporting volume according to the reporting volume of the first data in each group.

[0040] Step S230: Determine the lag situation of the application corresponding to the application client according to the change of the relationship function.

[0041] In Figure 2 In the technical solution provided by the embodiment shown, the execution time of the methods called by the application client during operation reported by the application client is grouped, the number of execution times in each group is determined, and the relationship function between the execution time and the number is fitted. According to the change of the relationship function, it can be determined whether there is a lag situation in the application corresponding to the application client. Compared with the related technology, on the one hand, by fitting the relationship function between the execution time of the methods called by each client and the number of methods corresponding to different execution times, the present disclosure can consider the execution of all clients' methods, thereby capturing small-probability events affecting application lag and improving the accuracy of application lag detection; on the other hand, the present disclosure can fit the relationship function between the execution time of the methods called in the full scenario or any scenario of the application and the number of methods with different execution times according to requirements, so as to perform lag detection on any scenario or full scenario and improve the applicable range of lag detection.

[0042] Next, a detailed description will be given of the specific implementation of "Step S210: Group the first data reported by the application client and determine the reporting volume of the first data in each group".

[0043] In an exemplary implementation, the first data includes the execution time of the methods called by the application client during operation.

[0044] In an exemplary implementation, the first data may include the execution time of all the methods called by the application client during operation, that is, perform lag detection on the full scenario of the application. The first data may also include the execution time of the methods in the specified scenario or of the specified type called by the application client during operation, that is, perform lag detection on the specified business scenario of the application according to business requirements. This exemplary implementation does not make special limitations on this.

[0045] For example, each application client can record the execution time of each method in the UI (User Interface) thread, so as to obtain the time consumption of the methods called during the operation of the application client. For example, a framework capable of recording the time consumption of user methods can be integrated into the application client. This framework needs to have the characteristic of low performance overhead to avoid affecting the performance of the application itself. For example, the Matrix framework can be accessed to record the execution time of each method in the UI thread of the application client. This framework can be seamlessly integrated into the application to capture the detailed time consumption information of method calls in real time. Of course, other frameworks can also be used to implement the function of recording the execution time of each method in the UI thread by the application client. This exemplary implementation does not make special limitations on this.

[0046] Taking the first data as the execution time of the methods in the full scenario called during the operation of the application client as an example, during the operation of each application client, the Matrix framework in each application client can continuously record the method time consumption data in the full scenario of the application client. These data not only cover the critical path of the application, but also include scenarios such as background operations and user interactions. Each application client can report the recorded data to the server side regularly or in real time for centralized storage and processing to ensure the timeliness of the data.

[0047] In an exemplary implementation manner, grouping the first data reported by the application client includes: regularly grouping the first data reported within the first preset duration according to the first preset time interval.

[0048] For example, according to business requirements, the first data reported by each application client can be regularly grouped in units of any time interval such as every hour, every day, every week, every half hour, etc. Taking every hour as the time interval as an example, the first data reported by each application client in the previous hour can be grouped every hour. It can also be grouped every 10 minutes for the first data reported by each application client in the most recent hour. That is, the duration corresponding to the first preset time interval is less than or equal to the first preset duration.

[0049] In another exemplary implementation manner, grouping the first data reported by the application client includes: grouping the first data reported within each second preset time interval within the first preset period.

[0050] For example, the application program lag detection method in the present disclosure can perform real-time lag detection and analysis. As previously mentioned, every 10 minutes, the first data reported by each application program client in the most recent hour is grouped to perform real-time lag detection. In the present disclosure, lag detection and analysis can also be performed on a specified historical period. For example, at 10:20 on March 12, 2025, the first data in August 2024 is analyzed to determine whether there is a lag situation in August 2024. That is, the first preset period can be any historical period or a specified future period. After the future period arrives, real-time lag detection and analysis are performed within that future period.

[0051] Taking the first preset period as August 2024 and the second preset time interval as daily as an example, the first data reported by each application program client every day in August 2024 can be grouped separately, so as to obtain the relationship function fitted every day. According to the distribution of the relationship functions every day, it is determined whether there is a lag situation in August 2024 and which day in August 2024 has a lag situation.

[0052] In yet another exemplary embodiment, grouping the first data reported by the application program client includes: grouping the first data reported by the application program client when the data volume of the first data reported by the application program client reaches a first preset value.

[0053] For example, in the present disclosure, it is mainly to capture small-probability application program lag situations. The number of occurrences of small-probability events is small, but it has a greater weight impact on the detection of application program lags. If the data volume is too small, the fluctuation of the monitoring index data (i.e., the relationship function) in the present disclosure will be relatively large. Therefore, a relatively large data volume is required, such as a data volume of more than 100,000 levels, to have a stable monitoring index value, thereby improving the detection accuracy. Therefore, when the data volume of the first data reported by the application program client reaches the first preset value, that is, when the data volume requirement is met, the first data reported by the application program client can be grouped, and then the counting starts again until 100,000 first data are obtained again, and then the grouping and fitting of the relationship function are performed again, and so on.

[0054] If the first preset value is 100,000 and the lag detection starts at 12:00 on March 12, 2025, and the first data reaches 100,000 at 16:00 on March 12, 2025, then a grouping can be performed on the first data reported between 12:00 on March 12, 2025 and 16:00 on March 12, 2025 to obtain a fitting function. Then, the number of the first data reported after 16:00 on March 12, 2025 is counted. For example, after 16:00 on March 12, 2025, the first data reported until 18:00 on March 13, 2025 reaches 100,000 again. Then, a grouping can be performed on the first data reported between 16:00 on March 12, 2025 and 18:00 on March 13, 2025 to obtain another fitting function, and so on. Until the next moment when 100,000 data is reached, the next grouping is performed.

[0055] In yet another exemplary embodiment, for the foregoing manner of periodically grouping the first data reported within the first preset duration according to the first preset time interval and grouping the first data reported within each second preset time interval within the first preset period, if the data volume of a certain grouping is less than the first preset value, the fitting function obtained in this grouping can be marked to indicate that the data volume of the fitting function of this grouping is insufficient through the marking. If it is determined in subsequent steps that there is an abnormality in the fitting function with a mark added, it can be re-analyzed manually whether there is actually a lag situation within the time period corresponding to this fitting function, or directly determine that there is no lag situation within the time period corresponding to this fitting function. If it is the fitting function without a mark that has an abnormality, it is directly determined that there is actually a lag situation within the time period corresponding to this fitting function.

[0056] In other words, in the present disclosure, the first data in different time periods can be grouped to fit the relationship functions in different time periods, and then according to the change situations of the relationship functions in multiple different time periods, it is determined whether there is an application lag in each of these multiple different time periods.

[0057] Exemplarily, Figure 3 The flowchart shows a method for grouping the first data in an exemplary embodiment of the present disclosure. Refer to Figure 3 , this method may include step S310 to step S320. Among them:

[0058] In step S310, a grouping interval is determined according to the third preset time interval.

[0059] For example, the third preset time interval can be used as a statistical interval to obtain the quantity of reported execution time consumed in different intervals. The third preset time interval can be customized according to requirements. For example, 100 milliseconds can be used as a grouping interval. At the same time, since the execution time consumed by most methods is less than 100 milliseconds, that is, the data volume within 100 milliseconds is too large and can be not statistically analyzed. That is, the grouping interval can start from 100 milliseconds, and every 100 milliseconds is a new grouping interval. That is, 100 - 199 milliseconds is a grouping interval, 200 - 299 milliseconds is a grouping interval, and so on.

[0060] In step S320, the first data with execution time consumed belonging to the same grouping interval is divided into the same group.

[0061] In an exemplary embodiment, the execution time consumed belonging to the same grouping interval can be divided into the same group, so as to realize the grouping of the first data.

[0062] In an exemplary embodiment, it is also possible to detect whether there is a lag in the application client of a specific type of terminal device according to business needs or separately detect the lag situation of the application clients of different types of terminal devices, so as to discover the reasons for different types of lags and make different lag corrections for the application clients in different types of terminal devices.

[0063] Based on this, exemplarily, the first data reported by the application client is grouped, and the reported quantity of the first data in each group is determined, including: classifying the first data reported by the application client according to the type of the terminal device corresponding to the application client; obtaining the first data reported by the application clients in different types of terminal devices according to the classification result; respectively grouping the first data reported by the application clients in each type of terminal device, and determining the reported quantity of the first data in each group corresponding to each type of terminal device.

[0064] For example, if it is currently necessary to fit the relationship functions corresponding to different types of terminal devices based on the first data reported from 12:00 to 16:00 on March 12, 2025, then the first data reported by each application client from 12:00 to 16:00 on March 12, 2025 can be classified according to the type of the terminal device to obtain the first data corresponding to different types of terminal devices. Then, the first data corresponding to each type of terminal device is respectively grouped, and the reported quantity of the first data in each group corresponding to each type of terminal device is determined. Thus, according to the specific implementation manner in step S220, the relationship functions between the execution time consumed and the reported quantity corresponding to each type of terminal device can be respectively fitted based on the reported quantity of the first data in each group corresponding to each type of terminal device.

[0065] Among them, the types of terminal devices can be distinguished according to the brand, model, etc. of the terminal devices, and this exemplary embodiment does not make special limitations thereon. When each application client reports the first data to the server, information such as the brand and model of the terminal device can be carried.

[0066] Next, a detailed description will be given of the specific implementation manner of "step S220, fitting a relationship function between the execution time and the reported amount according to the reported amounts of the first data in each group".

[0067] For example, after grouping the first data, the number of the first data in each group can be counted, so as to obtain the reported amounts of the first data in each group.

[0068] It should be noted that the grouping and the counting of the reported amounts of each group are performed without de-duplication processing, that is, if the execution times of two methods are the same, they need to be counted as 2 reported amounts.

[0069] Exemplarily, an implementation manner of step S220 may include: taking the execution time as the independent variable and the reported amount as the dependent variable, and fitting a relationship function between the execution time and the reported amount in a double logarithmic coordinate system.

[0070] For example, the grouping statistical result may be expressed as that the reported amount of the method with an execution time of 100 - 199 milliseconds is 1000 times, the reported amount of the method with an execution time of 100 milliseconds to 299 milliseconds is 500 times, etc. Since the execution time is grouped according to intervals, the start time of each group can be taken as the independent variable. For example, 100 milliseconds is used as the execution time representation of 100 - 199 milliseconds, 200 milliseconds is used as the execution time representation of the 200 - 299 millisecond interval, that is, 100 milliseconds and 1000 times are a set of data, 200 milliseconds and 500 times are a set of data, etc., so as to perform function relationship fitting.

[0071] Taking the Android system as an example, all code logics related to the UI must be executed on the main thread, and the queue storing these main thread code logics is called a message queue. In the message queue, if the waiting time required for a task from creation to completion is set as τ, then the waiting time distribution function of the task in the main thread queue can be expressed by the following formula (1):

[0072]

[0073] In formula (1), τ is the waiting time of a main thread task in the queue, γ is the complexity of the task, and ρ is the distribution of the enqueued messages, which can be approximately regarded as a constant when τ is large enough. The specific derivation process of formula (1) can refer to the relevant content in the patent application with the publication number CN116668802A, and will not be elaborated here.

[0074] In an exemplary embodiment, let y = ln P(τ) and x = ln τ. Then formula (1) can be simplified to a linear function in the form of formula (2) in the double-logarithmic coordinate system:

[0075] y = b – kx (2)

[0076] Based on this, taking the time interval of each group as the independent variable (such as the start time or end time of each time interval as the independent variable) and the reported quantity of each group as the dependent variable, the relationship function between the execution time and the reported quantity can be fitted in the double-logarithmic coordinate system. As mentioned above, the theoretically fitted relationship function is a linear function, so the least squares method can be used for fitting to obtain the slope K of the linear function. The slope K can be understood as an indicator of the congestion degree of the main thread queue. In the present disclosure, the lag situation of the application program can be detected through the slope K. That is, whether there is a lag situation can be detected according to the distribution of the slope K.

[0077] Exemplarily, Figure 4 FIG. shows a schematic diagram of a fitted relationship function in an exemplary embodiment of the present disclosure. As Figure 4 shown, in the double-logarithmic coordinate system, taking the logarithm of the execution time, i.e., waiting time, as the abscissa and the logarithm of the reported quantity of the execution time, i.e., waitingtime reports, as the ordinate, the fitted relationship function is a linear function.

[0078] Next, a detailed description will be given of the specific implementation manner of "step S230, determining the lag situation of the application program corresponding to the application program client according to the change situation of the relationship function".

[0079] Exemplarily, as mentioned above, in the present disclosure, the lag can be detected in real time, or the lag situation within a specified historical period can be detected and analyzed. Next, Figures 5 to 7 the specific implementation manner of step S230 will be described.

[0080] In an exemplary embodiment, the lag situation within the first preset period within a specified historical period can be detected and analyzed according to the Figure 5 method shown.

[0081] Exemplarily, Figure 5 FIG. shows a schematic flowchart of a method for detecting jank according to the change of a relationship function in an exemplary embodiment of the present disclosure. Refer to Figure 5 , the method may include steps S510 to S520. Among them:

[0082] In step S510, obtain multiple relationship functions fitted according to the first data within the first preset period, and perform abnormal distribution detection on the multiple relationship functions.

[0083] For example, in the case where the grouping of the first data includes grouping the first data reported within each second preset time interval within the first preset period, multiple fitted relationship functions within the first preset period can be obtained according to the second preset time interval. Continuing with the above example where the first preset period is August 2024 and the second preset time interval is one day, the relationship functions corresponding to each day in August can be obtained based on the first data reported every day according to the above steps S210 and S220, thus obtaining 31 relationship functions. Abnormal distribution detection can be performed on these 31 relationship functions, and the method of abnormal distribution detection can be independently selected according to requirements, such as using a box plot for abnormal distribution detection, etc. This exemplary embodiment does not make special limitations on this.

[0084] Taking the fitted relationship function as a linear function as an example, abnormal distribution detection can be performed on the slopes of these 31 linear functions.

[0085] In step S520, according to the abnormal distribution detection result, determine that the application corresponding to the application client has a jank situation within the first preset period.

[0086] If there is a relationship function with abnormal distribution, and the abnormal distribution of the relationship function indicates that the abnormality is due to longer execution time, determine that the application corresponding to the application client has a jank situation within the first preset period; otherwise, determine that there is no jank situation. For example, if the slope K on August 21st in August is the slope K with abnormal distribution, and this slope K is smaller than other slopes K, it indicates that there is a jank situation on August 21st.

[0087] In another exemplary embodiment, real-time jank detection of the application can be performed according to the Figure 6 shown method. Exemplarily, Figure 6 FIG. shows a schematic flowchart of another method for detecting jank according to the change of a relationship function in an exemplary embodiment of the present disclosure. Refer to Figure 6 , the method may include steps S610 to S620. Among them:

[0088] In step S610, multiple already-fitted relationship functions are obtained, and based on the multiple already-fitted relationship functions, an abnormal distribution detection is performed on the currently-fitted relationship function.

[0089] For example, in the case of grouping the first data reported within the first preset duration at regular intervals according to the first preset time interval or when the data volume of the first data reported by the application client reaches the first preset value, after the currently-fitted relationship function is obtained, multiple recently-fitted relationship functions can be obtained, and an abnormal distribution detection is performed on the currently-fitted relationship function based on the multiple recently-fitted relationship functions, that is, an abnormal distribution detection is performed on the multiple recently-fitted relationship functions and the currently-fitted relationship function to determine whether the currently-fitted relationship function is a relationship function with an abnormal distribution.

[0090] Continuing with the example of grouping the first data of each application client reported in the previous hour every hour to fit the relationship function, such as grouping and fitting the relationship function at the whole hour of each day to determine whether there is a lag at the current whole hour. For example, when grouping the first data at 12 o'clock and obtaining the first relationship function corresponding to 12 o'clock after fitting, 10 second relationship functions fitted in the most recent 10 hours can be obtained, and an abnormal distribution detection is performed on the total 12 relationship functions including the first relationship function and the second relationship functions.

[0091] In step S620, based on the abnormal distribution detection result of the currently-fitted relationship function, the current lag situation of the application corresponding to the application client is determined.

[0092] For example, if the abnormal distribution detection result determines that the first relationship function is a relationship function with an abnormal distribution, it indicates that there may be a lag situation in the application client currently. For example, the abnormal distribution detection in step S610 shows that the slope of the linear function obtained at 12 o'clock is a slope with an abnormal distribution, and this slope is smaller than the slopes corresponding to the other 10 second functions, then it indicates that there is a lag situation at the current time (i.e., 12 o'clock).

[0093] In an exemplary implementation manner, as described above, the lag detection of the application can be performed separately for each type of terminal device. Based on this, for each type of terminal device, the lag situation of the application client in this type of terminal device can be determined respectively according to Figure 5 and Figure 6 the method based on the change situation of the relationship function corresponding to this type of terminal device.

[0094] Exemplarily, as described above, the fitted relationship function is a linear function. Based on this, an exemplary implementation of step S230 may include: determining the lag situation of the application corresponding to the application client according to the change of the slope of the linear function.

[0095] For example, under normal circumstances, the slope K of the fitted linear function is a value with a relatively stable distribution. If there is an abnormally distributed slope, it may indicate a lag situation. Therefore, abnormal distribution detection can be performed on the slopes of multiple linear functions fitted from the first data corresponding to different time periods. For example, the box plot outlier determination method can be used to perform abnormal distribution detection on the slopes K of multiple linear functions. If it is detected that there is an abnormally distributed slope K and the abnormally distributed slope K is the smallest among all the slopes K, it means that there is a lag situation in the time period corresponding to the abnormally distributed slope K. If there is no abnormally distributed K among the K values of multiple different time periods, it means that there is no lag situation in these multiple time periods. If it is detected that there is an abnormally distributed slope K, but the abnormally distributed slope K is the largest among all the slopes K, it means that there is no lag situation.

[0096] It should be noted that, as described above, γ is the degree of task heaviness. The larger γ is, the heavier the task is and the more likely there is a lag situation. And γ is inversely proportional to the slope K. Therefore, the smaller the slope K is, the more laggy it indicates. Therefore, when a certain slope K is an outlier and this slope K is the smallest among all the slopes K participating in the abnormal distribution detection, it is determined that there is a lag.

[0097] Exemplarily, Figure 7 Fig. shows a schematic diagram of the result of an abnormal distribution detection in an exemplary embodiment of the present disclosure. Figure 7 It is the abnormal distribution detection result of the K value of a certain application from July to November in a certain year. The abnormal distribution detection is performed once a month, and the relationship function is fitted on a daily basis each month. From Figure 7 It can be seen that there are abnormally distributed slopes K in August and November, and the abnormally distributed slopes K in August and November are the smallest among all the slopes K in the corresponding months. Therefore, there are lag situations in both August and November.

[0098] In an exemplary embodiment, it is also possible to compare the first difference in the slopes of the relationship function determined at the current moment and the linear function determined most recently. If the first difference is greater than a preset value and the slope of the linear function determined at the current moment is less than the slope of the linear function determined in the immediately preceding time, it is determined that there is a lag situation at the current moment. For example, calculate the first difference in the slope K between August 1st and August 2nd. If this first difference exceeds the preset value and the slope K on August 2nd is less than the slope K on August 1st, it is determined that there is a lag situation on August 2nd. Among them, the preset value can be determined according to the normal fluctuation range of the slope, and the normal fluctuation range of the slope can be determined based on statistical analysis or empirical values.

[0099] In the present disclosure, the lag situation can be notified to the business personnel, so that the business personnel can analyze the cause of the lag, thereby improving the lag situation and enhancing the user experience.

[0100] Exemplarily, Figure 8 shows a schematic diagram of an interaction process for detecting application lags in an exemplary embodiment of the present disclosure. Refer to Figure 8 , the client can access the lightweight method time-consuming recording framework, and then the client can collect method time-consuming data and report it to the server side in real time or at regular intervals; the server side can store the data reported by the client, and then the server can analyze and process the reported data to obtain the main thread queue congestion degree index. According to this index, it is judged whether there is a lag. If so, relevant personnel are notified so that they can promptly troubleshoot and handle the problem.

[0101] In addition, it should be noted that the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present invention, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the time sequence of these processes. Additionally, it is also easy to understand that these processes can be executed, for example, synchronously or asynchronously in multiple modules.

[0102] Furthermore, the exemplary embodiment of the present disclosure further provides an application lag detection device. Refer to Figure 9 As shown, the application lag detection device 900 may include the following program modules: a grouping module 910, configured to group the first data reported by the application client and determine the reporting volume of the first data in each group, where the first data includes the execution time consumption of the methods called during the operation of the application client; a fitting module 920, configured to fit the relationship function between the execution time consumption and the reporting volume according to the reporting volume of the first data in each group; a lag determination module 930, configured to determine the lag situation of the application corresponding to the application client according to the change situation of the relationship function.

[0103] In an exemplary embodiment, the grouping of the first data reported by the application client includes: regularly grouping the first data reported within a first preset duration according to a first preset time interval; or grouping the first data reported within each second preset time interval within a first preset period; or grouping the first data reported by the application client when the data volume of the first data reported by the application client reaches a first preset value.

[0104] In an exemplary embodiment, determining the lag situation of the application corresponding to the application client according to the change of the relationship function includes: obtaining multiple relationship functions fitted from the first data within a first preset period, and performing abnormal distribution detection on the multiple relationship functions; determining the lag situation of the application corresponding to the application client within the first preset period according to the abnormal distribution detection result.

[0105] In an exemplary embodiment, determining the lag situation of the application corresponding to the application client according to the change of the relationship function includes: obtaining multiple already-fitted relationship functions, and performing abnormal distribution detection on the currently-fitted relationship function based on the multiple already-fitted relationship functions; determining the current lag situation of the application corresponding to the application client according to the abnormal distribution detection result of the currently-fitted relationship function.

[0106] In an exemplary embodiment, the grouping of the first data reported by the application client includes: determining a grouping interval according to a third preset time interval; dividing the first data with execution durations belonging to the same grouping interval into the same group.

[0107] In an exemplary embodiment, fitting the relationship function between the execution duration and the reported quantity includes: using the execution duration as the independent variable and the reported quantity as the dependent variable, and fitting the relationship function between the execution duration and the reported quantity in a double logarithmic coordinate system.

[0108] In an exemplary embodiment, the relationship function is a linear function; determining the lag situation of the application corresponding to the application client according to the change of the relationship function includes: determining the lag situation of the application corresponding to the application client according to the change of the slope of the linear function.

[0109] In an exemplary embodiment, the grouping of the first data reported by the corresponding application client and determining the reporting volume of the first data in each group includes: classifying the first data reported by the application client according to the type of the terminal device corresponding to the application client; obtaining the first data reported by the application client in different types of terminal devices according to the classification result; respectively grouping the first data reported by the application client in each type of terminal device to determine the reporting volume of the first data in each group corresponding to each type of terminal device; based on this, the fitting of the relationship function between the execution time and the reporting volume according to the reporting volume of the first data in each group includes: respectively fitting the relationship function between the execution time and the reporting volume corresponding to each type of terminal device according to the reporting volume of the first data in each group corresponding to each type of terminal device.

[0110] In an exemplary embodiment, the determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function includes: determining the lag situation of the application client in each type of terminal device according to the change situation of the relationship function corresponding to each type of terminal device.

[0111] The specific details of each part in the above device have been described in detail in the method embodiment. The undisclosed detailed content can refer to the content of the method embodiment, so it will not be repeated here.

[0112] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0113] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be executed in this specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0114] The exemplary embodiments of the present disclosure also provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the above application lag detection method.

[0115] In one embodiment, a computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium may be a storage medium based on signals such as electricity, magnetism, light, electromagnetic, infrared, etc., including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid state drive (SSD), and so on. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.

[0116] In one embodiment, a computer program product may be an intangible product containing a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as an executable file storing the computer program, a digital file such as an installation package.

[0117] The code of the computer program can be written in one or more programming languages. Programming languages such as C, Java, C++, Python, etc. The program code can be executed entirely on the user's computing device, or partially on the user's computing device, or executed as an independent software package, or partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., through an Internet connection provided by an operator).

[0118] The computer program can be carried or transmitted by signals such as electricity, magnetism, light, electromagnetic, infrared, etc. The electronic device can convert the signal carrying the computer program into a digital signal and then run the computer program. When the computer program runs on the electronic device, its code is used to cause the electronic device to execute (more specifically, can cause the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure. For example, it can execute the above application program lag detection method, which includes the following steps: grouping the first data reported by the application program client, determining the reporting amount of the first data in each group, where the first data includes the execution time consumed by the methods called during the operation of the application program client; fitting the relationship function between the execution time consumed and the reporting amount according to the reporting amount of the first data in each group; and determining the lag situation of the application program corresponding to the application program client according to the change situation of the relationship function.

[0119] Executing the above method steps through a computer program. On the one hand, by fitting the relationship function between the execution time consumed by the methods called by each client and the number of methods corresponding to different execution times, the execution situations of the methods of all clients can be considered, so as to capture small-probability events that affect the application freeze, and improve the accuracy of application freeze detection; on the other hand, according to the requirements, the relationship function between the execution time consumed by the methods called in the full scenario or any scenario of the application and the number of methods with different execution times can be fitted, so as to detect freezes in any scenario or the full scenario, and improve the applicable range of freeze detection.

[0120] An exemplary embodiment of the present disclosure further provides an electronic device, which may be the above-mentioned terminal device 110 or server 120. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, which may be a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may further include a display for displaying a graphical user interface.

[0121] The following refers to Figure 10 , and an electronic device is exemplarily described in the form of a general computing device. It should be understood that Figure 10 the electronic device 1000 shown is only an example and should not impose limitations on the functions and usage scope of the embodiments of the present disclosure.

[0122] As Figure 10 shown, the electronic device 1000 may include: a processor 1010, a memory 1020, a bus 1030, an I / O (input / output) interface 1040, a network adapter 1050, and a display 1060.

[0123] The memory 1020 may include volatile memory, such as RAM 1021 and a cache unit 1022, and may also include non-volatile memory, such as ROM 1023. The memory 1020 may further include one or more program modules 1024. Such program modules 1024 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. For example, the program module 1024 may include each module in the above-mentioned device.

[0124] The processor 1010 may include one or more processing units. For example, the processor 1010 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit), etc.

[0125] The processor 1010 can be used to execute executable instructions stored in the memory 1020. For example, it can execute the above application freeze detection method, which includes the following steps: grouping the first data reported by the application client, and determining the reporting amount of the first data in each group, where the first data includes the execution time consumed by the methods called during the operation of the application client; fitting the relationship function between the execution time and the reporting amount according to the reporting amount of the first data in each group; and determining the freeze situation of the application corresponding to the application client according to the change of the relationship function.

[0126] Implementing the above method through a computer program, on the one hand, by fitting the relationship function between the execution time consumed by the methods called by each client and the number of methods corresponding to different execution times, the execution situations of all clients' methods can be considered, thereby capturing small-probability events that affect application freezing and improving the accuracy of application freeze detection; on the other hand, the relationship function between the execution time consumed by the methods called in the full scenario or any scenario of the application and the number of methods with different execution times can be fitted according to requirements, so as to perform freeze detection on any scenario or the full scenario and improve the applicable range of freeze detection.

[0127] The bus 1030 is used to realize the connection between different components of the electronic device 1000, and may include a data bus, an address bus, and a control bus.

[0128] The electronic device 1000 can communicate with one or more external devices 1100 (such as a keyboard, a mouse, an external controller, etc.) through the I / O interface 1040.

[0129] The electronic device 1000 can communicate with one or more networks through the network adapter 1050. For example, the network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless local area network, Bluetooth, near field communication, etc. The network adapter 1050 can communicate with other modules of the electronic device 1000 through the bus 1030.

[0130] The electronic device 1000 can display a graphical user interface through the display 1060, such as displaying Figure 7 the interface of the stutter detection result shown, etc.

[0131] Although Figure 10 not shown in the figure, other hardware and / or software modules can also be set in the electronic device 1000, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0132] In addition, the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.

[0133] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, a device, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation manner, a complete software implementation manner (including firmware, microcode, etc.), or an implementation manner combining hardware and software aspects, such as can be respectively referred to as "circuit", "module", or "system".

[0134] It should be understood that the present disclosure is not limited to the specific method steps or structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. Based on the specific implementation manners provided by the present disclosure, those skilled in the art will easily think of other implementation manners. Therefore, the specific implementation manners provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are pointed out by the claims, and should cover any variations, uses, or adaptive changes of the present disclosure, and these variations, uses, or adaptive changes follow the general principles of the present disclosure and include well-known general knowledge or conventional technical means in the technical field not disclosed by the present disclosure.

Claims

1. A method for detecting application lags, characterized in that, Including: Grouping the first data reported by the application client, and determining the reporting volume of the first data in each group, where the first data includes the execution time consumed by the methods called during the operation of the application client; Fitting a relationship function between the execution time and the reporting volume according to the reporting volume of the first data in each group; Determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function.

2. The method according to claim 1, characterized in that, The grouping of the first data reported by the application client includes: Regularly grouping the first data reported within a first preset duration according to a first preset time interval; or Grouping the first data reported within each second preset time interval within a first preset period; or Grouping the first data reported by the application client when the data volume of the first data reported by the application client reaches a first preset value.

3. The method according to any one of claims 1 to 2, characterized in that The determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function includes: Obtaining multiple relationship functions fitted from the first data within a first preset period, and performing abnormal distribution detection on the multiple relationship functions; Determining the lag situation of the application corresponding to the application client within the first preset period according to the abnormal distribution detection result.

4. The method according to any one of claims 1 to 2, characterized in that, The determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function includes: Obtaining multiple already fitted relationship functions, and performing abnormal distribution detection on the currently fitted relationship function based on the multiple already fitted relationship functions; Determining the current lag situation of the application corresponding to the application client according to the abnormal distribution detection result of the currently fitted relationship function.

5. The method according to claim 1, characterized in that The grouping of the first data reported by the application client includes: Determining a grouping interval according to a third preset time interval; Dividing the first data with execution times belonging to the same grouping interval into the same group.

6. The method according to claim 1, characterized in that, The fitting the relationship function between the execution time and the reporting volume includes: Taking the execution time as the independent variable and the reporting volume as the dependent variable, and fitting the relationship function between the execution time and the reporting volume in a double logarithmic coordinate system.

7. The method according to claim 6, characterized in that The relationship function is a linear function; the determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function includes: Determining the lag situation of the application corresponding to the application client according to the change situation of the slope of the linear function.

8. The method according to claim 1, wherein The grouping of the first data reported by the application client, and determining the reporting volume of the first data in each group, includes: Classifying the first data reported by the application client according to the type of the terminal device corresponding to the application client; Obtaining the first data reported by the application client in different types of terminal devices according to the classification result. Group the first data reported by the application clients in each type of terminal device respectively, and determine the reporting volume of the first data in each group corresponding to each type of terminal device; The step of fitting the relationship function between the execution time and the reporting volume according to the reporting volume of the first data in each group includes: Respectively fit the relationship function between the execution time and the reporting volume corresponding to each type of terminal device according to the reporting volume of the first data in each group corresponding to each type of terminal device.

9. The method according to claim 8, wherein The step of determining the lag situation of the application corresponding to the application client according to the change situation of the relationship function includes: Determine the lag situation of the application clients in each type of terminal device according to the change situation of the relationship function corresponding to each type of terminal device.

10. An application freezing detection device, characterized in that, Including: A grouping module, configured to group the first data reported by the application client, and determine the reporting volume of the first data in each group, where the first data includes the execution time of the method called by the application client during operation; A fitting module, configured to fit the relationship function between the execution time and the reporting volume according to the reporting volume of the first data in each group; A lag determination module, configured to determine the lag situation of the application corresponding to the application client according to the change situation of the relationship function.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 9.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 9.

13. An electronic device, characterized in that, Including: One or more processors; A storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Message queue abnormity monitoring method and device, storage medium and electronic equipment

    CN116668802A