Stuttering monitoring method, device, and readable medium
Patent Information
- Application Number
- PCT/CN2024/139581
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-05
- Filing Date
- 2024-12-16
- Publication Date
- 2025-10-02
AI Technical Summary
Existing technologies make it difficult to accurately monitor and evaluate the freezing of applications on mobile terminals, resulting in an unsmooth user experience.
By obtaining the system refresh rate and actual drawing time of each frame corresponding to the target layer of the application currently running on the terminal, the jam index value is calculated, including the number of jammed frames and the number of consecutive dropped frames, and adaptively adapting to different system refresh rates to achieve accurate jam monitoring.
It achieves real-time and accurate monitoring of application freezes, adapts to various system refresh rates, meets the freeze measurement needs of different application layers, and optimizes terminal performance.
Smart Images

Figure CN2024139581_02102025_PF_FP_ABST
Abstract
Description
Jam monitoring method, device and readable medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese Patent Application No. 202410262977.4 filed with the China Patent Office on March 5, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to, but is not limited to, the field of terminal technology. Background Art
[0004] The smoothness of application operation has become one of the performance indicators for mobile terminals. Whether an application can run smoothly on a mobile terminal depends on whether the number of images refreshed per unit time meets the expected number and whether the images are displayed on time.
[0005] When a time-consuming operation occurs in the main thread of the application, the frame rate of the main interface refresh will decrease. At this time, the user will feel obvious unsmoothness, that is, the application interface will freeze.
[0006] Monitoring application freezes is the basis for improving the smoothness of application operation. Summary of the Invention
[0007] Embodiments of the present disclosure provide a jam monitoring method, device, and readable medium.
[0008] A first aspect of an embodiment of the present disclosure provides a jamming monitoring method, including: obtaining a system refresh rate corresponding to a target layer of an application currently running on a terminal; obtaining an actual drawing time of each frame of the target layer; and determining a jamming index value of the target layer based on the system refresh rate and the actual drawing time of each frame.
[0009] According to a second aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: at least one processor; a memory on which at least one program is stored, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to the first aspect; and at least one I / O interface connected between the processor and the memory, and configured to implement information interaction between the processor and the memory.
[0010] A third aspect of the embodiments of the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the method according to the first aspect when the program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] FIG1 is a flow chart of a method for monitoring a jamming problem provided in an embodiment of the present disclosure;
[0012] FIG2 is a schematic diagram of a layer process processing by a terminal provided in an embodiment of the present disclosure;
[0013] FIG3 is a schematic diagram of a display interface for prompt information provided in an embodiment of the present disclosure;
[0014] FIG4a is a schematic diagram of a human-computer interaction interface provided in an embodiment of the present disclosure;
[0015] FIG4 b is a schematic diagram illustrating an example of a jam monitoring result provided in an embodiment of the present disclosure;
[0016] FIG5 is a flow chart of an example of jam monitoring provided in an embodiment of the present disclosure;
[0017] FIG6 is a schematic structural diagram of a jam monitoring device provided in an embodiment of the present disclosure;
[0018] FIG7 is a schematic diagram of an exemplary structure of a jam monitoring device provided in an embodiment of the present disclosure;
[0019] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0021] As used in this disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0022] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure.As used in the present disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0023] When the terms “comprising” and / or “made of…” are used in the present disclosure, it specifies the existence of the stated features, integers, steps, operations, elements and / or components, but does not preclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0024] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meanings as those commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined in this disclosure.
[0025] An embodiment of the present disclosure provides a jam monitoring method, which can be applied to any electronic device. For example, the jam monitoring method is applied to a monitored terminal, or to a server that establishes a communication connection with the monitored terminal.
[0026] As shown in FIG1 , it is a flow chart of the jam monitoring method provided by an embodiment of the present disclosure. The jam monitoring method mainly includes the following steps 101 to 103 .
[0027] In step 101, the system refresh rate corresponding to the target layer of the application currently running on the terminal is obtained.
[0028] In some embodiments, obtaining the system refresh rate corresponding to the target layer of the application currently running on the terminal includes: obtaining the identifier of the target layer of the application currently running on the terminal; and determining the system refresh rate corresponding to the identifier of the target layer of the currently running application based on a pre-configured mapping relationship between the identifiers of each layer of the application and the system refresh rate.
[0029] In the exemplary embodiment, the system refresh rate is expressed as frames per second (FPS). FPS is a definition in the field of graphics that refers to the number of frames transmitted per second. Generally speaking, it refers to the number of frames in an animation or video. FPS measures the amount of information used to store and display dynamic video. The more frames per second, the smoother the displayed action. FPS can also be understood as "refresh rate (unit: Hz)", such as the "FPS value" in games.
[0030] In an exemplary embodiment, the terminal supports at least two system refresh rates, for example, 60Hz, 90Hz, and 120Hz. Of course, this does not mean that the terminal must support at least two system refresh rates. The lag monitoring method is also applicable to terminals that only support one system refresh rate.
[0031] In an exemplary embodiment, the graphical elements and user interface components of an application are broken down into layers. Each application has its own layer, which includes the application's user interface (UI) elements and other visual content. A mapping relationship between the identifiers of each application's layer and the system refresh rate is preconfigured in the terminal. For example, the animation layer of a gaming application is configured with a system refresh rate of 120Hz, the playback layer of a video application is configured with a system refresh rate of 90Hz, and the display layer of other types of applications is configured with a system refresh rate of 60Hz.
[0032] In an exemplary embodiment, the system refresh rate corresponding to the currently running target layer is obtained through the interface of the layer delivery server module.
[0033] In an exemplary embodiment, the target layer is the top layer.
[0034] It should be noted that in the disclosed embodiments, by pre-configuring the mapping relationship between the identifiers of each application layer and the system refresh rate, the system refresh rate is adaptively determined based on the identifier of the target layer of the currently running application. This achieves adaptive adaptation of the jamming measurement standard for each application, making jamming monitoring more accurate and meeting the monitoring needs of terminals that support multiple system refresh rates. Furthermore, by automatically obtaining the pre-configured system refresh rate based on the identifier of the target layer, the jamming monitoring method can adapt to scenarios where different applications are intelligently switched.
[0035] In some embodiments, the layers of different interfaces of each application have a unique identifier, and the unique identifier may have a layer mark bit including an index number. For example, the layer mark bit of the foreground running application includes index number 1.
[0036] In addition to the index number, the layer marker also includes the application identifier of the application to which the layer belongs. The application identifier is used to uniquely identify the corresponding application. For example, the application identifier is the package name (Package Name) of the application.
[0037] The process of setting identification for each layer of the application includes: traversing the information of each layer through the package name of the application, and then obtaining the identification of each layer by setting the index number.
[0038] In step 102, the actual rendering duration of each frame of the target layer is obtained.
[0039] In some embodiments, obtaining the actual drawing duration of each frame of the target layer includes: obtaining the actual drawing duration of each frame of the target layer through a layer deliverer service module of the terminal.
[0040] In an exemplary embodiment, as shown in FIG2 , the following components are involved in the terminal's layer processing of an application:
[0041] The Layer Flinger service module (also known as Surface Flinger) is responsible for analyzing, synthesizing, and managing the services of each application layer. It detects layer changes, synthesizes the final graphics data, and passes the final graphics data to the hardware abstraction layer for rendering. The Layer Flinger service module generally optimizes the display of layers, improves performance, and supports animation effects.
[0042] An important function performed by the layer deliverer service module is layer synthesis, which involves combining layer data from different applications to obtain the final displayable graphics. This process may include transparency, blending mode and other processing related to graphic display effects.
[0043] The Hardware Abstraction Layer (HAL) abstracts hardware operations and provides a consistent interface for upper-layer software. HAL enables layer operations on different hardware platforms to be performed using the same call methods, achieving hardware independence. The HAL works in conjunction with the Layer Deliverer Service module, passing the resulting graphics data to the hardware for rendering.
[0044] Hardware rendering: The final graphics data is passed by HAL to the underlying hardware for rendering. Hardware rendering is usually more efficient, especially for graphics-intensive applications such as games and graphic design software.
[0045] By processing the application's layers, the application's graphic elements are effectively managed, synthesized, and rendered to provide users with a smooth interface experience.
[0046] By monitoring the processing of the application's layers, lag monitoring is implemented to evaluate the performance of graphics rendering.
[0047] In an exemplary embodiment, the GetFrameTime() function is used to call the layer delivery service module interface to obtain the expected drawing time A, actual drawing time B, and the time base parameter C for notifying hardware rendering for each frame during the top-level layer drawing process. The actual drawing time B is the primary focus during the calculation of the lag index value.
[0048] In step 103, the jam index value of the target layer is determined according to the system refresh rate and the actual rendering time of each frame.
[0049] In some embodiments, the jamming index value includes at least one of the following: the number of jammed frames; the number of consecutive dropped frames.
[0050] Among them, the number of stuck frames refers to the mismatch between the FPS value output by the hardware and the FPS value set by the target layer of the application. For example, the FPS value set by the game layer is 120, but the actual FPS value of the terminal is 80, which is understood as a stuck frame, and the number of stuck frames is 40.
[0051] The number of consecutive dropped frames refers to the number of consecutive layers where the actual drawing time is longer than the expected drawing time, that is, the actual drawing completion time is lower than the expected refresh time. It can also be called the number of consecutive stuck frames.
[0052] In some embodiments, determining the stutter index value of the target layer based on the system refresh rate and the actual drawing time of each frame includes: determining the expected drawing time of a single frame based on the system refresh rate; determining the number of stutter frames in each consecutive N-frame drawing process based on the expected drawing time of the single frame and the actual drawing time of each frame; wherein N is an integer greater than or equal to 1.
[0053] In some embodiments, the method further includes: determining the number of consecutive dropped frames in the drawing process of the target layer according to the number of stuck frames in each of the N consecutive frames of drawing corresponding to the target layer.
[0054] In some embodiments, determining the expected rendering duration of a single frame according to the system refresh rate includes: calculating a ratio of unit time to the system refresh rate to obtain the expected rendering duration of a single frame.
[0055] In an exemplary embodiment, the expected rendering time of a single frame is obtained by converting the unit value by the ratio of the unit time to the system refresh rate, for example, T fps = unit time / system refresh rate, such as T corresponding to a 60Hz system refresh rate fps =16.6ms, 90Hz system refresh rate corresponds to T fps =11.1ms, T corresponding to 120Hz system refresh rate fps =8.3ms.
[0056] In some embodiments, determining the number of stuck frames in the drawing process of each consecutive N frames based on the expected drawing time of the single frame and the actual drawing time of each frame includes: for each frame of the target layer, determining the result obtained by dividing the actual drawing time by the expected drawing time of the single frame, subtracting 1 from the result and rounding up to obtain the number of stuck frames of the target layer in the drawing process of the frame.
[0057] The calculation process of the number of jammed frames during a single frame drawing process is expressed as: (the actual drawing time of a frame / T fps )-1, round up the result to get the number of stuck frames during the drawing process of this frame.
[0058] The number of consecutive dropped frames during a single frame drawing process is the value obtained by subtracting 1 from the number of stuck frames during the drawing process of the frame.
[0059] In the exemplary embodiment, it is assumed that the actual drawing time of each of the four consecutive frames is obtained, and the number of stuck frames and the number of consecutive dropped frames in the drawing process of each frame are calculated. See Table 1 for the statistical results of the four frames.
[0060] The result of the first frame, 16.6ms, compared with 16ms, is marked as no lag or frame drop;
[0061] The second frame's 16.6ms is compared to 14ms, and the result is marked as no lag or frame drop;
[0062] The result of the third frame, 16.6ms compared to 50ms, is marked as 3 frames of stuck, that is, the number of dropped frames is 3, and the number of dropped frames is 2 consecutive frames;
[0063] The result of the 4th frame, 16.6ms, compared with 60ms, is marked as 3 frames of stuck, that is, the number of dropped frames is 3, and the number of dropped frames is 2 consecutive frames.
[0064] Table 1 Number of stuck frames and continuous frame drops during single-frame drawing
[0065] In some embodiments, determining the number of stuck frames in each N-frame drawing process based on the expected drawing time of the single frame and the actual drawing time of each frame includes: for each N-frame drawing process, determining the sum of the actual drawing times of the N consecutive frames to obtain a total actual drawing time; determining the sum of the expected drawing times of the N consecutive frames based on the expected drawing time of the single frame to obtain a total expected drawing time; determining the difference between the total actual drawing time and the total expected drawing time, and rounding up the result obtained by dividing the difference by the expected drawing time of the single frame to obtain the number of stuck frames of the target layer in the N-frame drawing process. N is an integer greater than or equal to 1.
[0066] The calculation process of the number of stuck frames during the continuous N-frame drawing process is expressed as:
[0067] (Total actual drawing time of N consecutive frames - total expected drawing time of the same N consecutive frames) / T fps , round up the result to get the number of stuck frames during the N consecutive frame drawing process.
[0068] The number of consecutive dropped frames during the drawing of N consecutive frames is obtained by subtracting 1 from the number of stuck frames during the drawing of N consecutive frames.
[0069] In some embodiments, determining the number of continuous dropped frames in the target layer drawing process based on the number of stuck frames in each consecutive N-frame drawing process corresponding to the target layer includes: for each consecutive N-frame drawing process, determining the number of continuous dropped frames in the consecutive N-frame drawing process based on the number of stuck frames in the consecutive N frames; accumulating the continuous and non-zero numbers of dropped frames corresponding to each consecutive N frames obtained historically to obtain the number of continuous dropped frames in the target layer drawing process.
[0070] This method can be used to count the number of consecutive frame drops during the entire drawing process of the target layer. When the number of consecutive frame drops during a certain N-frame drawing process is 0, the historical statistics of the number of consecutive frame drops during the entire drawing process of the target layer are saved and the number of consecutive frame drops during the entire drawing process of the target layer is re-accumulated.
[0071] In an exemplary embodiment, when N takes a value of 1, the number of consecutive frame drops in the drawing process of each frame is counted separately. When the number of consecutive frame drops in the drawing process of the current frame is obtained, if the number of consecutive frame drops of the current frame is not zero, the number of consecutive frame drops of the current frame is accumulated based on the number of consecutive frame drops in the entire drawing process of the top-level layer previously accumulated; if the number of consecutive frame drops of the current frame is zero, the number of consecutive frame drops in the entire drawing process of the top-level layer previously accumulated is saved, and the number of consecutive frame drops in the entire drawing process of the top-level layer is re-accumulated from zero subsequently.
[0072] If the number of consecutive dropped frames of the frame before the current frame is zero, the previous cumulative number of consecutive dropped frames in the entire drawing process of the target layer is set to zero, that is, the subsequent cumulative number of consecutive dropped frames in the entire drawing process of the target layer starts from zero.
[0073] In an exemplary embodiment, when N is an integer greater than 1, taking N as 4 as an example, the number of consecutive frame drops in each consecutive 4-frame drawing process is counted separately, for example, the number of consecutive frame drops of 1-4 frames, 5-8 frames, 9-12 frames... are counted separately. When the number of consecutive frame drops of the current 4 consecutive frames is obtained, if the number of consecutive frame drops of the current 4 consecutive frames is not zero, the number of consecutive frame drops of the current 4 consecutive frames is accumulated based on the number of consecutive frame drops in the entire drawing process of the top-level layer previously accumulated; if the number of consecutive frame drops of the current 4 consecutive frames is zero, the number of consecutive frame drops in the entire drawing process of the top-level layer previously accumulated is saved, and the number of consecutive frame drops in the entire drawing process of the top-level layer is re-accumulated from zero subsequently.
[0074] If the number of consecutive dropped frames before the current four consecutive frames is zero, the cumulative number of consecutive dropped frames in the entire drawing process of the top layer is set to zero, that is, the continuous dropped frame number in the entire drawing process of the top layer is subsequently accumulated from zero.
[0075] In some embodiments, the method further includes: determining that a freeze occurs when the number of freeze frames exceeds a first preset threshold, or when the number of consecutive dropped frames exceeds a second preset threshold.
[0076] In an exemplary embodiment, the first preset threshold and / or the second preset threshold may be configured according to a system refresh rate corresponding to the layer.
[0077] For example, if the system refresh rate for the layer is 60Hz, the first preset threshold is set to X1 frames; if the system refresh rate for the layer is 90Hz, the first preset threshold is set to X2 frames; and if the system refresh rate for the layer is 120Hz, the first preset threshold is set to X3 frames. The values of X1, X2, and X3 can be the same or different, depending on the application's layer display requirements.
[0078] Similarly, if the system refresh rate for the layer is 60Hz, the second preset threshold is set to Y1 frames; if the system refresh rate for the layer is 90Hz, the second preset threshold is set to Y2 frames; and if the system refresh rate for the layer is 120Hz, the second preset threshold is set to Y3 frames. The values of Y1, Y2, and Y3 can be the same or different, depending on the application's layer display requirements.
[0079] In an exemplary embodiment, the method further includes: displaying a human-computer interaction interface, and obtaining a first preset threshold and / or a second preset threshold set by the user for each layer of the application through the human-computer interaction interface.
[0080] In some embodiments, determining the jam index value of the target layer based on the system refresh rate and the actual drawing time of each frame also includes: determining the actual frame rate of the target layer based on the system refresh rate and the actual drawing time of each frame.
[0081] In an exemplary embodiment, the actual frame rate is calculated as: sum(T fps ) / sum(B)×system refresh rate.
[0082] For example, if the total actual drawing time of 4 consecutive frames is 140ms, T fps The actual frame rate is 16.6ms, and the actual frame rate is: 16.6×4 / 140×60=27 frames.
[0083] In some embodiments, the method further includes: pre-configuring a third preset threshold; comparing the actual frame rate with the third preset threshold, and determining that a freeze occurs when the actual frame rate is less than the third preset threshold.
[0084] The third preset threshold corresponds to the system refresh rate corresponding to the target layer. For example, the third preset threshold corresponding to the system refresh rate of 60Hz is 55, the third preset threshold corresponding to the system refresh rate of 90Hz is 85, and the third preset threshold corresponding to the system refresh rate of 120Hz is 110.
[0085] In some embodiments, after determining that a freeze occurs, the method further includes at least one of the following:
[0086] A prompt message indicating a freeze is displayed on the display interface;
[0087] Capture log information, where the log information includes values of the terminal operating parameters when a freeze occurs.
[0088] In an exemplary embodiment, displaying the prompt information of the freeze on the display interface includes using color marking or highlighting the prompt information.
[0089] In an exemplary embodiment, on the basis of monitoring the jamming index value, basic information of the terminal, such as CPU, GPU, battery capacity, network status, operating temperature, battery life and other hardware parameter information, is captured at the same time, captured through the service module, and saved in a database or table.
[0090] In an exemplary embodiment, after determining that a freeze has occurred, log information is automatically captured immediately and can be uploaded to a background server according to pre-configuration or user selection, so as to facilitate subsequent freeze cause analysis based on the log information and optimize terminal performance.
[0091] In an exemplary embodiment, the log information includes basic information of the terminal. The purpose of capturing the log information is to obtain log records of modules that may cause other reasons for lag when the CPU and GPU are normal.
[0092] In an exemplary embodiment, the log information includes the CPU occupancy and GPU value of the terminal. When the CPU occupancy is higher, the GPU value directly determines the system performance of the terminal. The CPU occupancy and GPU value reported at the moment of lag, combined with other detailed information recorded in the log information (such as the lag caused by the real-time running status of the corresponding process, that is, the related application), further provide a clear system optimization direction for terminal performance optimization.
[0093] In an exemplary embodiment, the prompt information of the occurrence of the freeze is displayed on the display interface, including: displaying at least one of the freeze frame rate, the continuous frame drop rate, and the actual frame rate. As shown in Figure 3, the actual frame rate, the frame drop rate, and the continuous frame drop rate are displayed on the display interface.
[0094] In an exemplary embodiment, configurable parameters are displayed through a human-computer interaction interface, and the configurable parameters include monitoring options and hardware parameter options, wherein the monitoring options include actual frame rate, number of stuck frames, and number of consecutive dropped frames, and the hardware parameter options include: CPU, GPU, battery power (Battery), memory usage (RAM), network status (WIFI) and other data (DATA). By obtaining the user's selection operation on the monitoring options, the specific parameters included in the stuck indicator value in the stuck monitoring method are determined. By obtaining the user's selection operation on the hardware parameter selection, the parameters included in the log information in the stuck monitoring method are determined. Figure 4a is a schematic diagram of the human-computer interaction interface, and Figure 4b is an example of the stuck monitoring result configured by the user.
[0095] In some embodiments, electronic devices such as computers establish a communication connection with a monitored terminal through a universal serial bus (USB) or other means. The code program running on the terminal monitors the terminal's lag information and transmits the monitored lag information to the electronic device, which outputs the results of the lag monitoring, thereby realizing online monitoring of the terminal by the electronic device.
[0096] The electronic device may be a computer or the like.
[0097] The specific implementation principle is as follows: the connection interface module is called through the standard interface library to establish a communication connection between the computer and the terminal. The monitored terminal obtains the basic parameter information of the terminal's layer delivery service module through the character input and output stream and saves it to a list. The basic parameter information is monitored to obtain the jamming index value and related information, and the jamming index value and related information are reported to the electronic device for output. This related information includes log information, etc.
[0098] In some embodiments, a detection APK is installed on the monitored terminal, and the running status of the foreground application is monitored by a background service system, thereby achieving offline monitoring of the terminal.
[0099] The specific implementation principle is as follows: after entering the command to open the terminal's port channel (such as adb tcpip 6666) through the computer, the terminal's connection channel is opened, the terminal obtains the basic parameter information of the layer delivery service module, and obtains the jamming index value and related information based on the basic parameter information, creates a notification interface, and displays the jamming index value and other monitored data on the notification interface, that is, the foreground application runs, the background monitors and captures data, and the notification bar displays the monitored data.
[0100] It's important to note that offline and online monitoring share the same principles: they are triggered by installing different types of software, and the principles of lag monitoring are the same. Different monitoring methods are based on different development platforms, and the development languages used are adapted to the platform. For example, online monitoring software developed on Windows uses languages like Python, while offline monitoring software developed on Android uses languages like Java.
[0101] In one embodiment, FIG5 is a flow chart of a jam monitoring example, which may include but is not limited to the following steps 501 to 507 .
[0102] Step 501: traverse the layer information to obtain the flag bit of the top layer of the currently running application;
[0103] Step 502: Obtain the system refresh rate corresponding to the top layer according to the flag bit of the top layer, and obtain the freeze threshold corresponding to the system refresh rate;
[0104] Step 503: Obtain the actual rendering time of each frame of the top layer through the image delivery service module;
[0105] Step 504: Obtain an algorithm corresponding to the jamming index value, for example, an algorithm corresponding to the frame drop rate included in the jamming index value, an algorithm corresponding to the continuous frame drop rate included in the jamming index value, or an algorithm corresponding to the actual frame rate included in the jamming index value;
[0106] Step 505: Monitor the jamming index value according to an algorithm corresponding to the actual drawing time and the jamming index value;
[0107] Step 506: Determine whether the jamming index value exceeds the jamming threshold. If yes, execute step 507; otherwise, return to step 501.
[0108] Step 507: Mark the freeze information on the display interface and capture log information.
[0109] In the disclosed embodiment, the jam index value of the target layer is determined by the system refresh rate corresponding to the target layer of the application currently running on the terminal and the actual drawing time of each frame of the target layer, so that the jam situation can be monitored according to the actual drawing time of each frame, and the jam situation of the currently running application can be monitored in real time and accurately, providing accurate data support for optimizing terminal performance.
[0110] Moreover, when the terminal supports multiple system refresh rates, it can automatically adapt to the system refresh rate corresponding to the layer, and automatically adapt to the threshold corresponding to the system refresh rate, so as to meet the stuttering design requirements of different application layers, meet diversified needs, meet the different stuttering measurement indicators of each application layer, meet the different stuttering sensitivity requirements of each application layer, and realize the adaptation of stuttering monitoring under different needs.
[0111] The steps of the various methods above are divided only for clarity of description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this disclosure. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of this disclosure.
[0112] In an embodiment of the present disclosure, a jam monitoring device is provided. The specific implementation of the device can be found in the relevant description of the method embodiment and will not be repeated here. Figure 6 shows a schematic structural diagram of the device, which may include: a first acquisition module 601, configured to obtain the system refresh rate corresponding to the target layer of the application currently running on the terminal; a second acquisition module 602, configured to obtain the actual drawing time of each frame of the target layer; a processing module 603, configured to determine the jam index value of the target layer based on the system refresh rate and the actual drawing time of each frame.
[0113] In an exemplary embodiment, FIG7 is a schematic diagram of an exemplary structure of a jam monitoring device, which includes:
[0114] A mode selection module is configured to obtain specific parameters included in the jamming index value and specific parameters included in the log information through a human-computer interaction interface;
[0115] The first acquisition module 601 includes an application top layer acquisition module and a freeze threshold automatic setting module;
[0116] An application top-level layer acquisition module configured to acquire the top-level layer of an application currently running on the terminal;
[0117] A jam threshold automatic setting module is configured to automatically obtain a corresponding configured jam threshold according to the system refresh rate corresponding to the top layer, such as a first preset threshold, a second preset threshold, and a third preset threshold;
[0118] The second acquisition module 602 includes a jamming basic parameter acquisition module configured to obtain the actual rendering time of each frame of the top layer;
[0119] The processing module 603 includes a jam value monitoring module, a recording and reporting module, a jam log automatic capture module, and a jam display module;
[0120] A jam value monitoring module is configured to monitor a jam index value based on an actual rendering time of each frame and a system refresh rate; and to compare the jam index value with a jam threshold value to determine if jamming occurs;
[0121] A recording and reporting module configured to record and report the occurrence of jamming;
[0122] The jam log automatic capture module is configured to automatically capture log information when jam occurs;
[0123] The jam display module is configured to display jam indicator values and log information.
[0124] The functions or modules included in the apparatus provided in the embodiments of the present disclosure can be used to execute the method described in the method embodiments. The specific implementation and technical effects thereof can be referred to the description of the above method embodiments, and will not be repeated here for the sake of brevity.
[0125] It should be noted that all modules involved in this embodiment are logical modules. In actual applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, to highlight the innovations of this disclosure, this embodiment does not include units that are not closely related to solving the technical problems proposed by this disclosure. However, this does not mean that other units do not exist in this embodiment.
[0126] 8 , an embodiment of the present disclosure provides an electronic device, comprising: at least one processor 801; a memory 802 on which at least one program is stored, and when the at least one program is executed by the at least one processor, the at least one processor implements the above method; and at least one I / O interface 803, connected between the processor and the memory, and configured to implement information interaction between the processor and the memory.
[0127] Among them, the processor 801 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 802 is a device with data storage capabilities, including but not limited to random access memory (RAM, such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) 803 is connected between the processor 801 and the memory 802, and can realize information exchange between the processor 801 and the memory 802, including but not limited to a data bus (Bus), etc.
[0128] In some embodiments, the processor 801 , the memory 802 , and the I / O interface 803 are connected to each other via a bus, and further connected to other components of the computing device.
[0129] This embodiment further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in this embodiment is implemented. To avoid repeated description, the specific steps of the method are not repeated here.
[0130] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods applied for above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0131] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0132] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present embodiment and to form different embodiments.
[0133] It is understood that the above embodiments are merely exemplary embodiments for illustrating the principles of the present disclosure, and the present disclosure is not limited thereto. Those skilled in the art may make various modifications and improvements without departing from the essence of the present disclosure, and such modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A jam monitoring method, comprising: Get the system refresh rate corresponding to the target layer of the application currently running on the terminal; Get the actual drawing time of each frame of the target layer; The jam index value of the target layer is determined according to the system refresh rate and the actual drawing time of each frame.
2. The method according to claim 1, wherein The jamming index value includes at least one of the following: Stuttering frames; Consecutive frame drops.
3. The method according to claim 2, wherein: Determining the jam index value of the target layer according to the system refresh rate and the actual rendering time of each frame includes: Determining an expected drawing duration of a single frame according to the system refresh rate; The number of stuck frames in each N-frame drawing process is determined according to the expected drawing time of the single frame and the actual drawing time of each frame; wherein N is an integer greater than or equal to 1.
4. The method according to claim 3, further comprising: The number of consecutive dropped frames in the process of drawing the target layer is determined according to the number of stuck frames in each of the N consecutive frames of drawing corresponding to the target layer.
5. The method according to claim 3, wherein The determining, based on the expected drawing time of the single frame and the actual drawing time of each frame, the number of stuck frames in each N-frame drawing process includes: For each frame of the target layer, determine the result of dividing the actual drawing time by the expected drawing time of the single frame, subtract 1 from the result, and round up to obtain the number of stuck frames of the target layer during the drawing process of the frame.
6. The method according to claim 3, wherein: The determining, based on the expected drawing time of the single frame and the actual drawing time of each frame, the number of stuck frames in each N-frame drawing process includes: For each drawing process of N consecutive frames, determining the sum of the actual drawing durations of the N consecutive frames to obtain a total actual drawing duration; Determine the sum of the expected rendering times of the N consecutive frames according to the expected rendering time of the single frame to obtain a total expected rendering time; Determine the difference between the total actual drawing time and the total expected drawing time, and round up the result obtained by dividing the difference by the expected drawing time of the single frame to obtain the number of stuck frames of the target layer during the drawing process of the N consecutive frames.
7. The method according to claim 4, wherein: The determining, according to the number of stuck frames in each of the N consecutive frames corresponding to the target layer during the drawing process, the number of consecutive dropped frames in the drawing process of the target layer includes: For each N consecutive frames of drawing process, determining the number of consecutive dropped frames in the N consecutive frames of drawing process according to the number of stuck frames in the N consecutive frames; The continuous number of dropped frames corresponding to each of the N consecutive frames obtained in the history, which are continuous and non-zero, are accumulated to obtain the continuous number of dropped frames in the process of drawing the target layer.
8. The method according to any one of claims 1 to 7, wherein: The obtaining of the system refresh rate corresponding to the target layer of the application currently running on the terminal includes: Obtaining an identifier of a target layer of an application currently running on the terminal; According to the pre-configured mapping relationship between the identifiers of each layer of the application and the system refresh rate, the system refresh rate corresponding to the identifier of the target layer of the currently running application is determined.
9. The method according to claim 2, further comprising: When the number of stuck frames exceeds a first preset threshold, or when the number of consecutive dropped frames exceeds a second preset threshold, it is determined that stuck occurs.
10. The method according to claim 9, wherein: After determining that a freeze occurs, the method further includes at least one of the following: A prompt message indicating a freeze is displayed on the display interface; Capture log information, where the log information includes values of the terminal operating parameters when a freeze occurs.
11. An electronic device comprising: at least one processor; a memory having at least one program stored thereon, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 10; At least one I / O interface is connected between the processor and the memory and is configured to implement information interaction between the processor and the memory.
12. A computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.