Stuttering detection method and device
By triggering the time-consuming detection subthread of the graphics processor during the image processing, acquiring the processing time of the image and determining the lag status, the problem of inaccurate lag detection caused by detecting only the CPU in the prior art is solved, and the accuracy and user experience of the image processing are improved.
Patent Information
- Application Number
- CN202210273239.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In the prior art, only detecting whether the CPU is stuck will lead to inaccurate detection of lag during image processing.
When the central processor acquires the display information for the image, the time-consuming detection subthread of the graphics processor is triggered to obtain the first processing time of the image, and determine whether the graphics processor is in a stuttering state based on the duration.
It improves the accuracy of lag detection during image processing, reduces the inaccuracy caused by only detecting whether the CPU is stuck, thereby improving the user experience.
Smart Images

Figure CN114723866B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a freeze detection method and device. Background Art
[0002] With the rapid development of terminals, users use terminals more and more frequently and for longer periods of time. When users use mobile terminals, the smoothness of image processing is one of the most direct and important factors affecting users' evaluation of terminal performance. Therefore, terminal freeze detection is of great practical significance for improving user experience.
[0003] In the related art, it is possible to determine whether the terminal is stuck by detecting whether the time consumed by the central processing unit (CPU) exceeds the time consumption threshold. Since the corresponding processing modules in image imaging include CPU, graphics processing unit (GPU) and view controller. When the processing time of any image frame in the CPU or GPU is too long, the data corresponding to the next image frame is not ready, and the terminal display interface still displays the previous image frame, causing the image processing process to be stuck. Therefore, only detecting whether the CPU is stuck will lead to inaccurate detection of stuck during image processing. Summary of the invention
[0004] The present disclosure provides a method and device for detecting a jam, which at least solves the problem in the related art that only detecting whether the CPU is jammed will lead to inaccurate jam detection during image processing. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a jam detection method is provided, including:
[0006] If it is detected that the central processor obtains the display information for the image, the time-consuming detection sub-thread of the graphics processor is triggered;
[0007] Using the time-consuming detection subthread, obtaining a first processing duration corresponding to the image, where the first processing duration is the duration between a drawing start time point corresponding to the image and a rendering completion time point corresponding to the image;
[0008] If the first processing time is greater than or equal to a first time threshold, it is determined that the graphics processor is in a stuck state.
[0009] Optionally, the adopting the time-consuming detection sub-thread to obtain a first processing duration corresponding to the image includes:
[0010] If it is determined to perform frame callback processing on the image, then obtaining the drawing start time point corresponding to the image;
[0011] Add a blank image view corresponding to the image, and send the blank image view adding completion information to the time-consuming detection sub-thread;
[0012] If it is determined that the triggered graphics processor has completed rendering of the image view of the image, the time-consuming detection sub-thread is used to obtain a rendering completion time point corresponding to the image;
[0013] The duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image is determined as the first processing duration corresponding to the image.
[0014] Optionally, after triggering the time-consuming detection sub-thread of the graphics processor, the method further includes:
[0015] Using the time-consuming detection subthread, obtaining a second processing duration corresponding to the image, where the second processing duration is the duration between a drawing start time point corresponding to the image and a rendering time point of a currently rendered image view, where the currently rendered image view is an image view currently rendered among all image views corresponding to the image;
[0016] If the second processing time reaches a second time threshold, and it is determined that all image views corresponding to the image have not been rendered, then the freeze detection result of the graphics processor is determined to be that the graphics processor is in a freeze state.
[0017] Optionally, the method further includes:
[0018] Obtaining a sub-duration of processing an image view when the graphics processor is not in the stuck state;
[0019] A target duration corresponding to a preset number of the sub-durations is obtained, and the target duration is determined as a duration threshold.
[0020] Optionally, the method further includes:
[0021] If it is determined that the graphics processor is in a stuck state, the rendering quantity corresponding to at least one image view rendered at the same time in the graphics processor is adjusted.
[0022] According to a second aspect of an embodiment of the present disclosure, a jam detection device is provided, including:
[0023] The sub-thread triggering unit is used to trigger the time-consuming detection sub-thread of the graphics processor if it is detected that the central processing unit obtains the display information for the image;
[0024] A duration acquisition unit, configured to use the time-consuming detection subthread to acquire a first processing duration corresponding to the image, wherein the first processing duration is a duration between a drawing start time point corresponding to the image and a rendering completion time point corresponding to the image;
[0025] The result determination unit is used to determine that the jam detection result of the graphics processor is that the graphics processor is in a jam state if the first processing time is greater than or equal to a first time threshold.
[0026] Optionally, the duration acquisition unit includes a time point acquisition subunit, a view adding subunit and a duration acquisition subunit, and the duration acquisition unit is used to adopt the time-consuming detection subthread to acquire the first processing duration corresponding to the image, including:
[0027] The time point acquisition subunit is used to acquire the drawing start time point corresponding to the image if it is determined to perform frame callback processing on the image;
[0028] The view adding sub-unit is used to add a blank image view corresponding to the image, and send the blank image view adding completion information to the time-consuming detection sub-thread;
[0029] The time point acquisition subunit is further configured to, if it is determined that the triggered graphics processor has completed rendering of the image view of the image, use the time-consuming detection subthread to acquire the rendering completion time point corresponding to the image;
[0030] The duration acquisition subunit is used to determine the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image.
[0031] Optionally, the duration acquisition unit is further used to, after triggering the time-consuming detection sub-thread of the graphics processor, use the time-consuming detection sub-thread to acquire a second processing duration corresponding to the image, where the second processing duration is the duration between the drawing start time point corresponding to the image and the rendering time point of the currently rendered image view, where the currently rendered image view is an image view among all image views corresponding to the image;
[0032] The result determination unit is further used to determine that the jam detection result of the graphics processor is that the graphics processor is in a jammed state if the second processing duration reaches a second duration threshold and it is determined that all image views corresponding to the image have not been rendered.
[0033] Optionally, the device further comprises a threshold setting unit, configured to obtain a sub-duration of processing an image view when the graphics processor is not in the stuck state;
[0034] A target duration corresponding to a preset number of the sub-durations is obtained, and the target duration is determined as a duration threshold.
[0035] Optionally, the device further includes a quantity adjustment unit, which is used to adjust the rendering quantity corresponding to at least one image view rendered in the graphics processor at the same time if it is determined that the graphics processor is in a stuck state.
[0036] According to a third aspect of an embodiment of the present disclosure, a terminal is provided, including:
[0037] at least one processor; and
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods described in the above aspect.
[0040] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods described in the preceding aspect.
[0041] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements any one of the methods described in the preceding aspects when executed by a processor.
[0042] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0043] In some or related embodiments, if it is detected that the central processing unit obtains display information for an image, the time-consuming detection sub-thread of the graphics processor is triggered, and the time-consuming detection sub-thread is used to obtain the first processing duration corresponding to the image in the image set corresponding to the image, and the first processing duration is the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image. If the first processing duration is greater than or equal to the first duration threshold, the jam detection result of the graphics processor is determined to be that the graphics processor is in a jammed state. Therefore, the first processing duration can be obtained through the time-consuming detection sub-thread, and whether the graphics processor is jammed can be determined based on the duration. This can improve the situation where only the CPU can be determined whether it is jammed when jamming occurs during image processing, and can reduce the situation where only detecting whether the CPU is jammed leads to inaccurate jam detection during image processing, can improve the accuracy of jam detection, and can improve the user experience.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0046] Figure 1 is a schematic diagram of a terminal framework of a jam detection method according to an exemplary embodiment;
[0047] Figure 2 is a background schematic diagram of a jamming detection method according to an exemplary embodiment;
[0048] Figure 3 is a schematic diagram of an architecture of a jam detection method according to an exemplary embodiment;
[0049] Figure 4 is a flow chart of a jamming detection method according to an exemplary embodiment;
[0050] Figure 5 is a flow chart of a jamming detection method according to an exemplary embodiment;
[0051] Figure 6 is a timing diagram of a jam detection method according to an exemplary embodiment;
[0052] Figure 7 is a schematic diagram showing an example of a terminal interface according to an exemplary embodiment;
[0053] Figure 8 is a flow chart of a jamming detection method according to an exemplary embodiment;
[0054] Fig. 9 is a schematic diagram showing an example of a terminal interface according to an exemplary embodiment;
[0055] Fig.10 is a block diagram of a jamming detection device according to an exemplary embodiment;
[0056] Fig.11 is a block diagram of a jamming detection device according to an exemplary embodiment;
[0057] Fig.12 is a block diagram of a jamming detection device according to an exemplary embodiment;
[0058] Fig.13 It is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0059] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0061] With the development of science and technology, the terminal technology has become increasingly mature, which has improved the convenience of users' production and life. When users operate the terminal, the display interface of the terminal needs to be imaged on the screen. Figure 1 FIG. 1 is a schematic diagram of a terminal framework of a method for detecting a jamming according to an exemplary embodiment. Figure 1 As shown, the terminal 1 includes a central processing unit 11 (CPU), a graphics processing unit 12 (GPU) and a view controller 13. During the screen imaging process of the terminal 1, first, the central processing unit 11 calculates the view to be displayed and the corresponding display mode; secondly, the graphics processor 12 renders the view to be displayed into a bitmap and then stores it in the frame buffer; finally, the view controller 13 reads the content of the frame buffer according to the frequency, and displays the view to be displayed on the display interface of the terminal according to the corresponding display mode.
[0062] In some embodiments, when the CPU or GPU processing time of a frame of data exceeds the processing threshold, resulting in the next frame of data not being ready, so that the terminal is still displaying the image of the previous frame, frame loss will occur. If the frame loss time is too long, the terminal's display interface will be stuck, and the user experience will be reduced. Therefore, terminal jam detection is of great practical significance for developers to optimize terminal performance and improve user experience.
[0063] According to some embodiments, Figure 2 FIG. 1 is a background diagram of a jamming detection method according to an exemplary embodiment. Figure 2As shown, during the screen imaging process of the terminal, the terminal monitors the time consumed by the event processing runloop when the CPU calculates the view to be displayed and the corresponding display mode. When the terminal detects that the time consumed by the runloop exceeds the time consumption threshold, it is determined that the terminal is stuck.
[0064] In some embodiments, there is no detection scheme for whether the GPU is stuck. Therefore, when the GPU is stuck during rendering and the CPU processing time does not exceed the threshold, only monitoring the time of the runloop cycle cannot detect the stuck situation caused by the terminal image processing process, thereby affecting the user experience.
[0065] According to some embodiments, Figure 3 FIG. 1 is a schematic diagram of a method for detecting a jamming according to an exemplary embodiment. Figure 3 As shown, the terminal 110 can determine whether the terminal 110 has a jam by monitoring the time taken by the CPU to process each runloop cycle. When the terminal 110 determines that the terminal 110 has a jam, the terminal 110 can upload the jam information to the server 130 through the network 120. When the server 130 receives the jam information, the server 130 can collect statistics on the jam information. The user can optimize the terminal based on the statistical jam information, thereby improving the user experience.
[0066] It is easy to understand that the terminal includes but is not limited to: wearable devices, handheld devices, personal computers, tablet computers, vehicle-mounted devices, smart phones, computing devices or other processing devices connected to wireless modems, etc. In different networks, terminal devices can be called different names, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), terminal devices in the fifth generation mobile communication technology (5th generation mobile networks, 5G) network or future evolution network, etc. The live broadcast terminal can be installed with an operating system, which refers to an operating system that can be run in the terminal, a program that manages and controls terminal hardware and terminal applications, and is an indispensable system application in the terminal. The operating system can be an IOS system.
[0067] According to some embodiments, the terminal 110 may be connected to the server 130 via a network 120. The network 120 is used to provide a communication link between the terminal 110 and the server 130. The network 120 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. It should be understood that Figure 2 The number of terminals 110, networks 120, and servers 130 is only illustrative. Any number of terminals, networks, and servers may be provided according to actual needs. For example, server 130 may be a server cluster composed of multiple servers. A user may use terminal 110 to interact with server 130 through network 120 to perform freeze detection, etc.
[0068] Figure 4 is a flow chart of a jam detection method according to an exemplary embodiment. Figure 4 As shown, the jam detection method can be applied to an image processing scenario, for example. The method can be implemented by a computer program and can be run on a terminal including an image display function, including the following steps:
[0069] In step S11, if it is detected that the central processor obtains display information for the image, the time-consuming detection subthread of the graphics processor is triggered;
[0070] According to some embodiments, the execution subject of the embodiment of the present disclosure may be a terminal, and the operating system included in the terminal may be an IOS system. The central processing unit (CPU) is the computing and control core of the computer system and is the final execution unit for information processing and program running. The CPU of the embodiment of the present disclosure may be a processor in a terminal. The CPU may be used to calculate the displayed view and specific display information. The CPU does not specifically refer to a fixed CPU. For example, when the CPU identifier changes, the CPU will also change accordingly.
[0071] In some embodiments, the image may be a single image or an image in a set of images. An image set refers to a group of at least one image. The image set does not specifically refer to a fixed set. For example, when the number of images included in the image set changes, the image set may also change accordingly. For example, when the images included in the image set change, the image may also change accordingly.
[0072] According to some embodiments, the image does not specifically refer to a fixed image. For example, when the image content of the image changes, the image may also change accordingly. For example, when the image identifier of the image changes, the image may also change accordingly.
[0073] It is easy to understand that the display information refers to the display information corresponding to the image determined by the CPU, including but not limited to the image view information of the displayed image, the display method of the image, the display position of the image, etc.
[0074] Optionally, a graphics processing unit (GPU), also known as a display core, visual processor, or display chip, is a microprocessor that is specifically used to perform image and graphics related operations on personal computers, workstations, game consoles, and some mobile devices (such as tablets, smart phones, etc.). The GPU of the disclosed embodiment refers to a microprocessor that renders the view information to be displayed into a bitmap and then stores the frame buffer. The GPU does not specifically refer to a fixed GPU. For example, when the GPU identifier changes, the GPU will also change accordingly.
[0075] In some embodiments, a thread is the smallest unit that the operating system can schedule operations on. A thread refers to a single sequential control flow in a process. A process can have many threads, and each thread executes different tasks in parallel. For example, an image processing process may include a GPU image processing thread and a CPU image processing thread. The GPU image processing thread is used to render the view to be displayed into a bitmap and then store it in the frame buffer. The CPU image processing thread is used to calculate the view to be displayed and the corresponding display method.
[0076] It is easy to understand that the time-consuming detection sub-thread refers to the sub-thread added to the GPU image processing thread during the image processing process and is responsible for monitoring the GPU time consumption. In other words, the time-consuming detection sub-thread does not affect the operation of the GPU image processing thread during the image processing process. The time-consuming detection sub-thread is only used to obtain the time spent by the GPU during the rendering process of a certain image. The time-consuming detection sub-thread can be a thread that is executed concurrently with the GPU image processing thread during the image processing process. The time-consuming detection sub-thread does not specifically refer to a fixed sub-thread. For example, when a modification instruction for the time-consuming detection sub-thread is received, the time-consuming detection sub-thread may also change accordingly.
[0077] According to some embodiments, when the terminal executes the jam detection method, if it is detected that the central processing unit obtains display information for an image, a time-consuming detection sub-thread that can trigger a graphics processor is performed.
[0078] In step S12, a time-consuming detection subthread is used to obtain a first processing duration corresponding to the image;
[0079] According to some embodiments, the first processing duration is the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image. The first processing duration does not specifically refer to a fixed duration. For example, when the graphics processor is in a stuck state, the first processing duration may also change accordingly. For example, when the rendering speed of the graphics processor changes, the first processing duration may also change accordingly.
[0080] In some embodiments, when the terminal executes the jam detection method, if it is detected that the central processor obtains display information for the image, then the time-consuming detection subthread that can trigger the graphics processor is detected. The terminal can use the time-consuming detection subthread to obtain the first processing duration corresponding to the image. For example, the terminal can use the time-consuming detection subthread to obtain the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image, that is, the terminal can obtain the duration between the start of rendering the image and the completion of rendering the image.
[0081] In step S13, if the first processing time is greater than or equal to the first time threshold, it is determined that the GPU freeze detection result is that the GPU is in a freeze state.
[0082] According to some embodiments, when the terminal executes the jam detection method, if it is detected that the central processing unit obtains the display information for the image, a time-consuming detection sub-thread is detected for triggering the graphics processor. The terminal can use the time-consuming detection sub-thread to obtain the first processing duration corresponding to the image. For example, the terminal can use the time-consuming detection sub-thread to obtain the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image, that is, the terminal can obtain the duration between the start of rendering the image and the completion of rendering the image. When the terminal obtains the first processing duration, if the first processing duration is greater than or equal to the first duration threshold, the terminal can determine that the jam detection result of the graphics processor is that the graphics processor is in a jammed state.
[0083] In some or related embodiments, if it is detected that the central processing unit obtains display information for an image, the time-consuming detection sub-thread of the graphics processor is triggered, and the time-consuming detection sub-thread is used to obtain the first processing duration corresponding to the image in the image set corresponding to the image, and the first processing duration is the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image. If the first processing duration is greater than or equal to the first duration threshold, the stuttering detection result of the graphics processor is determined to be that the graphics processor is in a stuttering state. Therefore, the first processing duration can be obtained through the time-consuming detection sub-thread, and whether the graphics processor is stuttered can be determined based on the duration. This can improve the situation where only the CPU can be determined to be stuttered when stuttering occurs during image processing, and can reduce the situation where only detecting whether the CPU is stuttered leads to inaccurate stuttering detection during image processing, can improve the accuracy of stuttering detection, and can improve the user experience.
[0084] Figure 5 FIG. 1 is a flow chart of a jam detection method according to an exemplary embodiment. Figure 5 As shown, the jam detection method includes the following steps:
[0085] In step S21, if it is detected that the central processor obtains display information for the image, the time-consuming detection sub-thread of the graphics processor is triggered;
[0086] The specific process is as described above and will not be repeated here.
[0087] In some embodiments, Figure 6 FIG. 1 is a timing diagram of a jam detection method according to an exemplary embodiment. Figure 6 As shown, the terminal can use the runloop to detect whether the CPU is in a stuck state. When the terminal detects that the central processor obtains the display information for the image, the terminal can trigger the time-consuming detection sub-thread of the graphics processor.
[0088] According to some embodiments, the terminal controls the central processor to obtain display information for the image, for example, the display position of the image and the display view information.
[0089] In step S22, if it is determined to perform frame callback processing on the image, the drawing start time point corresponding to the image is obtained;
[0090] According to some embodiments, the drawing start time point refers to the time point when the GPU starts rendering the image. The drawing start time point does not specifically refer to a fixed time point. The drawing start time point can be, for example, starting from zero, or the current time point when the image starts drawing. For example, the drawing start time point can be the current time point when the image starts drawing. When the time point when the CPU obtains the display information for the image changes, the drawing start time point can also change accordingly.
[0091] In some embodiments, when the terminal detects that the central processor obtains display information for an image and triggers the time-consuming detection subthread of the graphics processor, if it is determined to perform frame callback processing on the image, the terminal can obtain the drawing start time point corresponding to the image.
[0092] It is easy to understand that the terminal obtains the drawing start time point corresponding to the image, for example, which can be 1.20 seconds at 13:25 on January 5, 2020.
[0093] In step S23, a blank image view corresponding to the image is added, and blank image view addition completion information is sent to the time-consuming detection sub-thread;
[0094] According to some embodiments, a blank image view refers to a simple view added to determine whether the GPU is stuck. A blank view does not specifically refer to a fixed view. An image view refers to a view or a control for displaying an image. When the rendering information of the terminal for the image changes, the blank image view may also change accordingly.
[0095] According to some embodiments, the blank image view addition completion information is used to indicate that the addition of the blank image view has been completed. When the terminal determines to perform frame callback processing on the image, the terminal can obtain the drawing start time point corresponding to the image. The terminal can add a blank image view corresponding to the image and send the blank image view addition completion information to the time-consuming detection subthread.
[0096] In step S24, if it is determined that the triggering graphics processor has completed rendering of the image view of the image, a time-consuming detection subthread is used to obtain a rendering completion time point corresponding to the image;
[0097] According to some embodiments, when the terminal adds a blank image view corresponding to an image, the terminal can control the GPU to render all views corresponding to the image on the blank image view. In other words, when the terminal determines that the triggering graphics processor has completed rendering of the image view for the image, the terminal can use a time-consuming detection subthread to obtain the rendering completion time point corresponding to the image.
[0098] In some embodiments, the terminal uses a time-consuming detection sub-thread to obtain the rendering completion time point corresponding to the image, for example, which can be 1.29 seconds at 13:25 on January 5, 2020.
[0099] In step S25, the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image is determined as the first processing duration corresponding to the image;
[0100] The specific process is as described above and will not be repeated here.
[0101] According to some embodiments, the first processing duration is the duration between a drawing start time point corresponding to the image and a rendering completion time point corresponding to the image.
[0102] In some embodiments, if it is determined to perform frame callback processing on the image, the terminal can obtain the drawing start time point corresponding to the image. If it is determined that the triggering graphics processor completes the image view rendering of the image, the time-consuming detection subthread is used to obtain the rendering completion time point corresponding to the image. The terminal can determine the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image.
[0103] In some embodiments, the terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses the time-consuming detection subthread to obtain the rendering completion time point corresponding to the image, for example, which may be 1.29 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image, for example, which may be 0.09 seconds.
[0104] In step S26, if the first processing time is greater than or equal to the first time threshold, it is determined that the GPU freeze detection result is that the GPU is in a freeze state.
[0105] According to some embodiments, when the terminal obtains the first processing duration, the terminal may determine the jam detection result of the graphics processor based on the first processing duration, specifically, if the first processing duration is greater than or equal to the first duration threshold, the terminal may determine that the jam detection result of the graphics processor is that the graphics processor is in a jam state. If the first processing duration is less than the first duration threshold, the terminal may determine that the jam detection result of the graphics processor is that the graphics processor is not in a jam state.
[0106] In some embodiments, the first duration threshold refers to a threshold for detecting whether the graphics processor is stuck based on the first processing duration. The first duration threshold does not specifically refer to a fixed duration threshold. For example, when the terminal obtains a modification instruction for the first duration threshold, the terminal can modify the first duration threshold based on the modification instruction.
[0107] According to some embodiments, the first duration threshold may be, for example, 0.08s. The terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses a time-consuming detection subthread to obtain the rendering completion time point corresponding to the image, for example, which may be 1.29 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image, which may be, for example, 0.09 seconds. When the terminal determines that the first processing duration of 0.09 seconds is greater than the first duration threshold of 0.08 seconds, the terminal may determine that the freeze detection result of the graphics processor is that the graphics processor is in a freeze state.
[0108] In some embodiments, the first duration threshold may be, for example, 0.08s. The terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses a time-consuming detection subthread to obtain the rendering completion time point corresponding to the image, for example, which may be 1.25 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image, which may be, for example, 0.09 seconds. When the terminal determines that the first processing duration of 0.05 seconds is less than the first duration threshold of 0.08 seconds, the terminal can determine that the freeze detection result of the graphics processor is that the graphics processor is not in a freeze state.
[0109] In some embodiments, when the terminal determines the first duration threshold, the terminal can obtain the sub-duration of processing an image view when the graphics processor is not in a stuck state, obtain the target duration corresponding to a preset number of sub-durations, and determine the target duration as the first duration threshold, which can improve the accuracy of the duration threshold setting, improve the accuracy of determining the graphics processor stuck detection results, and improve the user experience.
[0110] According to some embodiments, when the terminal determines the first duration threshold, the terminal may obtain a sub-duration for processing an image view when the graphics processor is not in a stuck state, and the sub-duration obtained by the terminal may be, for example, 16ms. The terminal obtains a target duration of 80ms corresponding to a preset number of 5 sub-durations of 16ms, and determines the target duration of 80ms as the first duration threshold.
[0111] According to some embodiments, when the first processing duration is greater than or equal to the first duration threshold, the terminal determines that the GPU freeze detection result is that the GPU is in a freeze state, and the terminal can display the freeze detection result through a display interface. Figure 7 shown.
[0112] In some or related embodiments, if it is detected that the central processing unit obtains display information for an image, the time-consuming detection subthread of the graphics processor is triggered. If it is determined that the image is to be processed with a frame callback, the drawing start time point corresponding to the image is obtained, a blank image view corresponding to the image is added, and the blank image view addition completion information is sent to the time-consuming detection subthread. If it is determined that the triggering of the graphics processor to render the image view of the image is completed, the time-consuming detection subthread is used to obtain the rendering completion time point corresponding to the image. The duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image can be determined as the first processing duration corresponding to the image, which can improve the accuracy of obtaining the first processing duration, and can improve the accuracy of determining the jam detection result. In addition, if the first processing duration is greater than or equal to the first duration threshold, the jam detection result of the graphics processor is determined to be that the graphics processor is in a jammed state, reducing the situation where only detecting whether the CPU is jammed leads to inaccurate jam detection during image processing. The jam detection result can be obtained based on the first duration threshold, which can improve the accuracy of obtaining the detection result.
[0113] Figure 8 is a flow chart of a jam detection method according to an exemplary embodiment. Figure 8 As shown, the jam detection method includes the following steps:
[0114] In step S31, if it is detected that the central processor obtains display information for the image, the time-consuming detection sub-thread of the graphics processor is triggered;
[0115] The specific process is as described above and will not be repeated here.
[0116] In step S32, a time-consuming detection subthread is used to obtain a second processing time corresponding to the image;
[0117] According to some embodiments, the second processing duration is the duration between the drawing start time point corresponding to the image and the rendering time point of the currently rendered image view, and the currently rendered image view is the currently rendered image view among all image views corresponding to the image. The second processing duration does not specifically refer to a fixed duration. For example, when the current rendering view changes, the second processing duration may also change accordingly. For example, when the drawing start time point corresponding to the image changes, the second processing duration may also change accordingly.
[0118] In some embodiments, the terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses the time-consuming detection subthread to obtain the current rendering image view time point, for example, which may be 1.29 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering time point of the current rendering image view as the first processing duration corresponding to the image, for example, which may be 0.09 seconds.
[0119] In step S33, if the second processing time reaches the second time threshold, and it is determined that all image views corresponding to the image have not been rendered, then it is determined that the graphics processor freeze detection result is that the graphics processor is in a freeze state;
[0120] According to some embodiments, when the terminal obtains the second processing duration, the terminal may determine a jam detection result of the graphics processor based on the second processing duration.
[0121] According to some embodiments, if the second processing duration reaches the second duration threshold and it is determined that all image views corresponding to the image have not been rendered, the terminal can determine that the graphics processor's jam detection result is that the graphics processor is in a jammed state.
[0122] According to some embodiments, when the terminal obtains the second processing duration, the terminal can determine the jam detection result of the graphics processor based on the second processing duration. Specifically, if the second processing duration is greater than or equal to the second duration threshold, and it is determined that all image views corresponding to the image have not been rendered, the terminal can determine that the jam detection result of the graphics processor is that the graphics processor is in a jammed state. If the second processing duration is less than the second duration threshold, and it is determined that all image views corresponding to the image have been rendered, the terminal can determine that the jam detection result of the graphics processor is that the graphics processor is not in a jammed state.
[0123] In some embodiments, the second duration threshold refers to a threshold for detecting whether the graphics processor is stuck based on the second processing duration. The second duration threshold does not specifically refer to a fixed duration threshold. For example, when the terminal obtains a modification instruction for the second duration threshold, the terminal can modify the second duration threshold based on the modification instruction.
[0124] According to some embodiments, the terminal determines that all image views corresponding to the image have not been rendered, for example, the terminal may obtain the view number of the current rendered view, and determine whether all image views corresponding to the image have been rendered based on the view number. If the view number indicates that the current view is not the last image view, the terminal may determine that all image views corresponding to the image have not been rendered.
[0125] In some embodiments, the second duration threshold may be, for example, 0.1s. In some embodiments, the terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses a time-consuming detection sub-thread to obtain the current rendering image view time point, for example, which may be 1.31 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering time point of the current rendering image view as the first processing duration corresponding to the image, for example, which may be 1.01 seconds. When the terminal determines that the second processing duration of 1.01 seconds is greater than the second duration threshold of 0.1 seconds, and determines that all image views corresponding to the image have not been rendered, the terminal can determine that the freeze detection result of the graphics processor is that the graphics processor is in a freeze state.
[0126] In some embodiments, the second duration threshold may be, for example, 0.1s. In some embodiments, the terminal obtains the drawing start time point corresponding to the image, for example, which may be 1.20 seconds at 13:25 on January 5, 2020. The terminal uses a time-consuming detection sub-thread to obtain the current rendering image view time point, for example, which may be 1.22 seconds at 13:25 on January 5, 2020. The terminal determines the duration between the drawing start time point corresponding to the image and the rendering time point of the current rendering image view as the first processing duration corresponding to the image, for example, which may be 0.02 seconds. When the terminal determines that the second processing duration of 0.02 seconds is less than the second duration threshold of 0.1 seconds, and determines that all image views corresponding to the image are rendered, the terminal can determine that the freeze detection result of the graphics processor is that the graphics processor is not in a freeze state.
[0127] In some embodiments, when the terminal determines the second duration threshold, the terminal can obtain the sub-duration of processing an image view when the graphics processor is not in a stuck state, obtain the target duration corresponding to a preset number of sub-durations, and determine the target duration as the second duration threshold, which can improve the accuracy of setting the second duration threshold, improve the accuracy of determining the graphics processor stuck detection results, and improve the user experience.
[0128] According to some embodiments, when the terminal determines the second duration threshold, the terminal may obtain a sub-duration for processing an image view when the graphics processor is not in a stuck state, and the sub-duration obtained by the terminal may be, for example, 16ms. The terminal obtains a preset number of 5 sub-durations of 16ms corresponding to a target duration of 80ms, and determines the target duration of 80ms as the second duration threshold.
[0129] In step S34, if it is determined that the graphics processor is in a stuck state, the rendering quantity corresponding to at least one image view rendered at the same time in the graphics processor is adjusted.
[0130] According to some embodiments, when the terminal determines that the graphics processor is in a stuck state, the terminal may adjust the rendering quantity corresponding to at least one image view rendered in the graphics processor at the same time.
[0131] In some embodiments, the number of renderings corresponding to at least one image view rendered by the terminal at the same time may be, for example, 5. When the terminal determines that the graphics processor is in a stuck state, the terminal may adjust the number of renderings corresponding to at least one image view rendered by the graphics processor at the same time from 5 to 3.
[0132] In some or related embodiments, if it is detected that the central processing unit obtains display information for an image, the time-consuming detection subthread of the graphics processor is triggered, and the time-consuming detection subthread is used to obtain the second processing time corresponding to the image. Based on the second processing time, the freeze detection result of the graphics processor is determined. Since the second processing time is the time between the drawing start time point corresponding to the image and the rendering time point of the current rendered image view, it is possible to directly determine whether the graphics processor is frozen based on the rendering time point of the current rendered image view, which can reduce the waiting time until all views are rendered, reduce the time to obtain the freeze detection result, and improve the efficiency of freeze detection. Secondly, if it is determined that the graphics processor is in a frozen state, the number of renderings corresponding to at least one image view rendered at the same time in the graphics processor is adjusted, which can reduce the number of image views rendered by the graphics processor at the same time, reduce the freeze situation of the graphics processor, and reduce the situation where only detecting whether the CPU is frozen leads to inaccurate freeze detection during image processing, improve the efficiency of image processing, and improve the user experience.
[0133] Fig. 9 is a block diagram of a device for detecting a jamming according to an exemplary embodiment. Fig. 9 The jam detection device 900 includes a sub-thread triggering unit 901, a duration acquisition unit 902 and a result determination unit 903.
[0134] The sub-thread triggering unit 901 is used to trigger the time-consuming detection sub-thread of the graphics processor if it is detected that the central processor obtains the display information for the image;
[0135] The duration acquisition unit 902 is used to acquire a first processing duration corresponding to the image by using a time-consuming detection subthread, where the first processing duration is the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image;
[0136] The result determination unit 903 is used to determine that the GPU jam detection result is that the GPU is in a jam state if the first processing duration is greater than or equal to a first duration threshold.
[0137] According to some embodiments, Fig.10 is a block diagram of a jam detection device according to an exemplary embodiment. Fig.10 As shown, the duration acquisition unit 902 includes a time point acquisition subunit 912, a view adding subunit 922 and a duration acquisition subunit 932. The duration acquisition unit 902 is used to use a time-consuming detection subthread to acquire a first processing duration corresponding to the image, including:
[0138] The time point acquisition subunit 912 is used to acquire the drawing start time point corresponding to the image if it is determined to perform frame callback processing on the image;
[0139] The view adding sub-unit 922 is used to add a blank image view corresponding to the image, and send blank image view adding completion information to the time-consuming detection sub-thread;
[0140] The time point acquisition subunit 912 is further used to use the time-consuming detection subthread to acquire the rendering completion time point corresponding to the image if it is determined that the triggering graphics processor has completed rendering of the image view for the image;
[0141] The duration acquisition subunit 932 is used to determine the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image.
[0142] According to some embodiments, the duration acquisition unit 902 is further used to trigger the time-consuming detection sub-thread of the graphics processor, and then use the time-consuming detection sub-thread to acquire a second processing duration corresponding to the image, where the second processing duration is the duration between the drawing start time point corresponding to the image and the rendering time point of the currently rendered image view, and the currently rendered image view is an image view among all image views corresponding to the image;
[0143] The result determination unit 903 is further used to determine that the graphics processor's jam detection result is that the graphics processor is in a jammed state if the second processing duration reaches a second duration threshold and it is determined that all image views corresponding to the image have not been rendered.
[0144] According to some embodiments, Fig.11 is a block diagram of a jam detection device according to an exemplary embodiment. Fig.11 As shown, the device 900 further includes a threshold setting unit 904, which is used to obtain a sub-duration of processing an image view when the graphics processor is not in a stuck state;
[0145] A target duration corresponding to a preset number of sub-durations is obtained, and the target duration is determined as a duration threshold.
[0146] According to some embodiments, Fig.12 is a block diagram of a jam detection device according to an exemplary embodiment. Fig.12 As shown, the device 900 further includes a quantity adjustment unit 905, which is used to adjust the rendering quantity corresponding to at least one image view rendered in the graphics processor at the same time if it is determined that the graphics processor is in a stuck state.
[0147] In some or related embodiments, if the sub-thread triggering unit detects that the central processing unit has obtained display information for the image, the time-consuming detection sub-thread of the graphics processor is triggered, and the duration acquisition unit can use the time-consuming detection sub-thread to obtain the first processing duration corresponding to the image, and the first processing duration is the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image. The result determination unit can determine that the stuttering detection result of the graphics processor is that the graphics processor is in a stuttering state if the first processing duration is greater than or equal to the first duration threshold. Therefore, the first processing duration can be obtained through the time-consuming detection sub-thread, and whether the graphics processor is stuttered can be determined based on the duration. This can improve the situation where only the CPU can be determined to be stuttered when stuttering occurs during image processing, and reduce the situation where only detecting whether the CPU is stuttered leads to inaccurate stuttering detection during image processing, which can improve the accuracy of stuttering detection and improve the user experience.
[0148] See also Fig.13 , is a block diagram of a terminal according to an exemplary embodiment. Fig.13 As shown, the terminal 1300 may include: at least one processor 1301 , at least one network interface 1304 , a user interface 1303 , a memory 1305 , and at least one communication bus 1302 .
[0149] The communication bus 1302 is used to realize the connection and communication between these components.
[0150] The user interface 1303 may include a speaker and a display screen, and the optional user interface 1303 may also include a standard wired interface and a wireless interface.
[0151] The network interface 1304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0152] Among them, the processor 1301 may include one or more processing cores. The processor 1301 uses various interfaces and lines to connect various parts in the entire terminal 1300, and executes various functions and processes data of the terminal 1300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1305, and calling data stored in the memory 1305. Optionally, the processor 1301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 1301, and it can be implemented separately through a chip.
[0153] Among them, the memory 1305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1305 includes a non-transitory computer-readable storage medium. The memory 1305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1305 may also be optionally at least one storage device located away from the aforementioned processor 1301. As Fig.13 As shown, the memory 1305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application for freeze detection.
[0154] exist Fig.13 In the terminal 1300 shown in the figure, the user interface 1303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 1301 can be used to call the jam detection application stored in the memory 1305 and specifically execute Figure 4-8 Each step in the method embodiment.
[0155] Accordingly, the present disclosure also provides a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores the computer program and the computer program is executed by one or more processors, the one or more processors execute Figure 4-8 Each step in the method embodiment.
[0156] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0160] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0161] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0162] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0163] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0164] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0165] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0166] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A jam detection method, characterized in that: include: If it is detected that the central processing unit obtains display information for the image, the time-consuming detection sub-thread of the graphics processing unit is triggered. The time-consuming detection sub-thread refers to a sub-thread added to the GPU processing image thread during the image processing process and is responsible for monitoring the GPU time consumption; Using the time-consuming detection subthread, obtaining a first processing duration corresponding to the image, where the first processing duration is the duration between a drawing start time point corresponding to the image and a rendering completion time point corresponding to the image; If the first processing time is greater than or equal to a first time threshold, determining that the GPU jam detection result is that the GPU is in a jam state; Wherein, the method further comprises: If it is determined that the graphics processor is in a stuck state, the rendering quantity corresponding to at least one image view rendered at the same time in the graphics processor is adjusted.
2. The method according to claim 1, characterized in that The adopting the time-consuming detection sub-thread to obtain a first processing duration corresponding to the image includes: If it is determined to perform frame callback processing on the image, then obtaining the drawing start time point corresponding to the image; Add a blank image view corresponding to the image, and send the blank image view adding completion information to the time-consuming detection sub-thread; If it is determined that the triggered graphics processor has completed rendering of the image view of the image, the time-consuming detection sub-thread is used to obtain a rendering completion time point corresponding to the image; The duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image is determined as the first processing duration corresponding to the image.
3. The method according to claim 1, characterized in that After triggering the time-consuming detection sub-thread of the graphics processor, the method further includes: Using the time-consuming detection subthread, obtaining a second processing duration corresponding to the image, where the second processing duration is the duration between a drawing start time point corresponding to the image and a rendering time point of a currently rendered image view, where the currently rendered image view is an image view currently rendered among all image views corresponding to the image; If the second processing time reaches a second time threshold, and it is determined that all image views corresponding to the image have not been rendered, then the freeze detection result of the graphics processor is determined to be that the graphics processor is in a freeze state.
4. The method according to claim 1, characterized in that The method further comprises: Obtaining a sub-duration of processing an image view when the graphics processor is not in the stuck state; A target duration corresponding to a preset number of the sub-durations is obtained, and the target duration is determined as a duration threshold.
5. A jamming detection device, characterized in that: include: A sub-thread triggering unit is used to trigger a time-consuming detection sub-thread of a graphics processor if it is detected that the central processing unit obtains display information for an image. The time-consuming detection sub-thread refers to a sub-thread added to the GPU image processing thread during the image processing process and is responsible for monitoring the GPU time consumption; A duration acquisition unit, configured to use the time-consuming detection subthread to acquire a first processing duration corresponding to the image, wherein the first processing duration is a duration between a drawing start time point corresponding to the image and a rendering completion time point corresponding to the image; A result determination unit, configured to determine, if the first processing duration is greater than or equal to a first duration threshold, that the freeze detection result of the graphics processor is that the graphics processor is in a freeze state; The device also includes: A quantity adjustment unit is used to adjust the rendering quantity corresponding to at least one image view rendered at the same time in the graphics processor if it is determined that the graphics processor is in a stuck state.
6. The device according to claim 5, characterized in that The duration acquisition unit includes a time point acquisition subunit, a view adding subunit and a duration acquisition subunit, and the duration acquisition unit is used to adopt the time-consuming detection subthread to acquire the first processing duration corresponding to the image, including: The time point acquisition subunit is used to acquire the drawing start time point corresponding to the image if it is determined to perform frame callback processing on the image; The view adding sub-unit is used to add a blank image view corresponding to the image, and send the blank image view adding completion information to the time-consuming detection sub-thread; The time point acquisition subunit is further configured to, if it is determined that the triggered graphics processor has completed rendering of the image view of the image, use the time-consuming detection subthread to acquire the rendering completion time point corresponding to the image; The duration acquisition subunit is used to determine the duration between the drawing start time point corresponding to the image and the rendering completion time point corresponding to the image as the first processing duration corresponding to the image.
7. The device according to claim 5, characterized in that The duration acquisition unit is further configured to, after triggering the time-consuming detection subthread of the graphics processor, use the time-consuming detection subthread to acquire a second processing duration corresponding to the image, wherein the second processing duration is the duration between a drawing start time point corresponding to the image and a rendering time point of a currently rendered image view, wherein the currently rendered image view is an image view among all image views corresponding to the image; The result determination unit is further used to determine that the jam detection result of the graphics processor is that the graphics processor is in a jammed state if the second processing duration reaches a second duration threshold and it is determined that all image views corresponding to the image have not been rendered.
8. The device according to claim 5, characterized in that The device further comprises a threshold setting unit, which is used to obtain a sub-duration of processing an image view when the graphics processor is not in the stuck state; A target duration corresponding to a preset number of the sub-durations is obtained, and the target duration is determined as a duration threshold.
9. A terminal, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the jam detection method as described in any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, when the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the jamming detection method as described in any one of claims 1 to 4.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
GPU performance bottleneck determination method and device, terminal and storage medium
CN109800141A