Data processing method and apparatus, and storage medium
Patent Information
- Application Number
- CN202210583441.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-05-25
AI Technical Summary
[0003]但是,通过内置的脚本,无法实现对界面生成的整个过程进行监控,且不能实现对窗口动画进行监控,进而导致得到的丢帧数据误差大,可信度低
[0061] In this embodiment of the disclosure, at least one set of initial data can be obtained. During the process of drawing and compositing layers based on the initial data, drawing time parameters and compositing time parameters are obtained respectively. Then, based on the drawing time parameters and compositing time parameters, the target frame loss data in the process of generating the target interface is determined.
Smart Images

Figure CN117170959B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to computer information technology, and more particularly to a data processing method, apparatus, and storage medium. Background Technology
[0002] In related technologies, during the process of generating interfaces using electronic devices, it is necessary to statistically analyze frame drops in order to adjust the interface generation strategy based on these drops or to provide analytical basis for determining the smoothness of the generated interface. Currently, frame drops can be monitored using scripts built into the electronic device's operating system to determine the smoothness of the generated interface, or frame drops can be identified through user feedback to pinpoint smoothness issues.
[0003] However, the built-in scripts cannot monitor the entire interface generation process or window animations, resulting in large errors and low reliability in the obtained frame loss data. When determining frame loss through user feedback, user feedback often lacks performance analysis tools, especially regarding frame loss data at the problem's location, leading to delayed and unreliable frame loss data. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this disclosure provides a data processing method, apparatus and storage medium, which can not only comprehensively monitor the entire process of interface generation, including the layer drawing process and the synthesis process, and determine the target frame loss data more accurately and reliably; on the other hand, it can automatically complete the acquisition of time parameters and automatically determine the target frame loss data based on the acquired time parameters, reducing the cost of manpower and material resources.
[0005] According to a first aspect of the present disclosure, a data processing method is provided, comprising:
[0006] Obtain at least one set of initial data;
[0007] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state;
[0008] Based on the drawing time parameters, determine the successfully drawn layers to be composited;
[0009] Obtain the compositing data corresponding to the layer to be composited;
[0010] In the process of compositing the layers to be composited into the target interface based on the composite data, the composite time parameters corresponding to each layer to be composited are obtained.
[0011] Based on the drawing time parameters and the synthesis time parameters, the target frame loss data during the generation of the target interface is determined.
[0012] In some embodiments, determining the target frame loss data during the generation of the target interface based on the rendering time parameter and the synthesis time parameter includes:
[0013] Based on the drawing time parameters, determine the first frame loss data during the drawing process;
[0014] Based on the synthesis time parameters, determine the second frame loss data during the synthesis of the target interface;
[0015] The target frame loss data is determined based on the first frame loss data and the second frame loss data.
[0016] In some embodiments, the first frame loss data includes: a first number of frame losses; the second frame loss data includes: a second number of frame losses; the target frame loss data includes: a target number of frame losses; determining the target frame loss data based on the first frame loss data and the second frame loss data includes:
[0017] Based on the drawing time parameters and the compositing time parameters, determine the layers that failed to be drawn;
[0018] The first number of dropped frames is compared with the number of layers that failed to be drawn to obtain a first comparison result;
[0019] The target number of dropped frames is determined based on the first comparison result and the second number of dropped frames.
[0020] In some embodiments, determining the target number of dropped frames based on the first comparison result and the second number of dropped frames includes:
[0021] If the first comparison result indicates that the number of the first dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames is determined based on the number of layers that failed to be drawn and the second number of dropped frames.
[0022] If the first comparison result indicates that the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, the target number of dropped frames is determined based on the first number of dropped frames and the second number of dropped frames.
[0023] In some embodiments, determining the first lost frame data during the rendering process based on the rendering time parameter includes:
[0024] If the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle of the previous layer, the frame loss data corresponding to the current layer to be drawn is determined according to the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, until the frame loss data corresponding to each layer to be drawn is determined.
[0025] The first frame loss data in the drawing process is obtained based on the frame loss data corresponding to each of the layers to be drawn.
[0026] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0027] A first duration is determined based on the timestamp of the start of drawing the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; wherein, the first duration includes: the duration required to draw the current layer to be drawn;
[0028] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn.
[0029] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0030] If the timestamp of the completion of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the current layer to be drawn, the second duration is determined based on the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn and the timestamp of the completion of drawing of the current layer to be drawn.
[0031] Based on the second duration and the standard drawing cycle of the current layer to be drawn, the dropped frame data corresponding to the current layer to be drawn is determined.
[0032] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the second duration and the standard drawing cycle of the current layer to be drawn includes:
[0033] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the second duration and the standard drawing cycle of the current layer to be drawn.
[0034] In some embodiments, during the process of drawing layers based on each set of initial data, obtaining the drawing time parameters corresponding to each layer to be drawn includes:
[0035] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to the layers to be drawn that meet the preset conditions are obtained;
[0036] The layers to be drawn that meet the preset conditions include: layers to be drawn after a preset time period following the occurrence of an interface switching event when an interface switching event is detected.
[0037] In some embodiments, determining the second lost frame data during the synthesis process based on the synthesis time parameter includes:
[0038] If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing cycle of the previous layer, the frame loss data corresponding to the current layer to be composed is determined based on the timestamp of the start of the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing cycle of the current layer to be composed, until the frame loss data corresponding to each layer to be composed is determined.
[0039] The second frame loss data in the compositing process is obtained based on the frame loss data corresponding to each of the layers to be synthesized.
[0040] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes:
[0041] A third duration is determined based on the timestamp of the start of compositing the current layer to be composited and the timestamp of the end of compositing the current layer to be composited; wherein, the third duration includes: the duration required to composite the current layer to be composited;
[0042] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited.
[0043] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes:
[0044] If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing period corresponding to the current layer to be composed, the dropped frame data corresponding to the current layer to be composed is determined based on the timestamp of the end of the standard compositing period corresponding to the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing period of the current layer to be composed.
[0045] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited includes:
[0046] The fourth duration is determined based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited and the end timestamp of the compositing of the current layer to be composited.
[0047] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the fourth duration and the standard compositing cycle of the current layer to be composited.
[0048] According to a second aspect of the present disclosure, a data processing apparatus is provided, comprising:
[0049] The first acquisition module is configured to acquire at least one set of initial data.
[0050] The second acquisition module is configured to acquire the drawing time parameters corresponding to each layer to be drawn during the drawing process of each layer based on the initial data of each group; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state;
[0051] The first determining module is configured to determine the successfully drawn layers to be composited based on the drawing time parameters;
[0052] The third acquisition module is configured to acquire the composite data corresponding to the layer to be composited.
[0053] The fourth acquisition module is configured to acquire the synthesis time parameters corresponding to each of the layers to be synthesized during the process of synthesizing each of the layers to be synthesized into a target interface based on each of the synthesis data.
[0054] The second determining module is configured to determine the target frame loss data during the generation of the target interface based on the drawing time parameter and the synthesis time parameter.
[0055] According to a third aspect of the present disclosure, a data processing apparatus is provided, comprising:
[0056] processor;
[0057] Memory configured to store processor-executable instructions;
[0058] The processor is configured to implement the steps of any of the data processing methods in the first aspect above during execution.
[0059] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a data processing apparatus, the apparatus is enabled to perform the steps of any of the data processing methods in the first aspect described above.
[0060] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0061] In this embodiment of the disclosure, at least one set of initial data can be obtained. During the process of drawing and compositing layers based on the initial data, drawing time parameters and compositing time parameters are obtained respectively. Then, based on the drawing time parameters and compositing time parameters, the target frame loss data in the process of generating the target interface is determined.
[0062] In this way, during the real-time monitoring of electronic devices to determine the target frame loss data, on the one hand, the entire process of interface generation can be fully monitored, including the layer drawing and compositing process, making the determined target frame loss data more accurate and reliable; on the other hand, the acquisition of time parameters can be completed automatically, and the target frame loss data can be determined automatically based on the acquired time parameters, reducing the cost of manpower and material resources.
[0063] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0064] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0065] Figure 1 This is a flowchart illustrating a data processing method according to an exemplary embodiment;
[0066] Figure 2 This is a schematic diagram illustrating different output strategies according to an exemplary embodiment;
[0067] Figure 3 This is a schematic diagram illustrating data output through a display window according to an exemplary embodiment;
[0068] Figure 4 This is a schematic diagram of a drawing scene corresponding to a layer to be drawn, according to an exemplary embodiment. Figure 1 ;
[0069] Figure 5 This is a schematic diagram of a drawing scene corresponding to a layer to be drawn, according to an exemplary embodiment. Figure 2 ;
[0070] Figure 6 This is a schematic diagram of a compositing scene corresponding to a layer to be composited, according to an exemplary embodiment. Figure 1 ;
[0071] Figure 7 This is a schematic diagram of a compositing scene corresponding to a layer to be composited, according to an exemplary embodiment. Figure 2 ;
[0072] Figure 8 This is a block diagram of a data processing apparatus according to an exemplary embodiment;
[0073] Figure 9 This is a block diagram illustrating a data processing apparatus 900 according to an exemplary embodiment;
[0074] Figure 10 This is a hardware structure block diagram of a data processing apparatus according to an exemplary embodiment. Detailed Implementation
[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0076] This disclosure provides a data processing method. Figure 1 This is a flowchart illustrating a data processing method according to an exemplary embodiment, such as... Figure 1 As shown. This method mainly includes the following steps:
[0077] In step 101, at least one set of initial data is obtained;
[0078] In step 102, during the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state;
[0079] In step 103, the successfully drawn layers to be composited are determined according to the drawing time parameters;
[0080] In step 104, the composite data corresponding to the layer to be composited is obtained;
[0081] In step 105, during the process of compositing the layers to be composited into the target interface based on the composite data, the composite time parameters corresponding to each layer to be composited are obtained.
[0082] In step 106, the target frame loss data during the generation of the target interface is determined based on the drawing time parameter and the synthesis time parameter.
[0083] It should be noted that the data processing method proposed in this disclosure can be applied to electronic devices or servers. Here, electronic devices can include terminal devices, such as mobile terminals or fixed terminals. Mobile terminals can include devices such as mobile phones, tablets, and laptops. Fixed terminals can include desktop computers, smart TVs, etc. In some embodiments, the operating system of the electronic device can include an Input Output System (iOS) operating system, an Android operating system, etc.
[0084] The data processing method in this embodiment can be configured in a data processing device, which can be located in a server or an electronic device. This embodiment does not limit this.
[0085] It should be noted that the execution entity of the embodiments disclosed herein may be, in hardware, a central processing unit (CPU) in a server or electronic device, and in software, a related background service in a server or electronic device, without limitation.
[0086] During the process of displaying the interface, at least one set of initial data can be obtained from a preset first buffer. Layers are drawn according to each set of initial data, and drawing time parameters for each layer are obtained during the drawing process. The layers to be drawn include layers where the drawing thread is active. In some embodiments, the layers to be drawn may include layers where the drawing thread is active but not yet completed, or layers where the drawing thread is active and the drawing process is complete.
[0087] In some embodiments, after a drawing event for a specific layer is triggered, a drawing thread corresponding to that layer can be started, and that layer can be designated as the layer to be drawn. The drawing event for a specific layer may include detecting a refresh (vsync) signal for that layer.
[0088] In some embodiments, a layer to be drawn can correspond to a set of initial data, that is, a set of initial data is used to draw a certain layer. Here, a preset first buffer is used to buffer the initial data, and one buffer can correspond to a set of initial data. It can be understood that each layer to be drawn corresponds to one buffer.
[0089] In other embodiments, the electronic device can obtain initial data from an external device and store the initial data in a corresponding first buffer. When the electronic device needs to draw a certain layer, it can retrieve the initial data corresponding to that layer from the first buffer. The initial data may include: graphics data, control data, window data, frame data, etc.; the preset first buffer may include: a system-preset buffer configured in the electronic device, a buffer formed by connecting to the electronic device, etc.
[0090] In this embodiment of the disclosure, during the drawing process of layers, the drawing time parameters corresponding to each layer to be drawn can be automatically obtained. For example, the drawing time parameters that can be obtained include: the timestamp of the start of the drawing thread of the layer to be drawn, the timestamp of the end of the drawing thread of the layer to be drawn, etc.
[0091] For example, during the layer drawing process, the rendering inspector can be used to obtain the drawing time parameters. The rendering inspector can include custom class algorithms, such as a custom `renderInspector` class, as long as it can automatically obtain the drawing time parameters; these will not be listed individually here.
[0092] After obtaining the rendering time parameters, the successfully rendered layers to be composited can be determined based on these parameters. Successfully rendered layers include those rendered before the compositing process begins, after the rendering end has completed rendering, and after the generated composite data has been successfully transmitted to the compositing end. Specifically, the rendering of the corresponding layer is confirmed to be complete when the rendering thread finishes running. Taking the generated interface as an example of an application interface, the rendering end can be the application itself (app), and the compositing end can be an image management server on an electronic device (SF).
[0093] In some embodiments, the drawing time parameter can be used to determine whether each layer to be drawn has been drawn before the start of the compositing process. If the drawing is completed before the start of the compositing process, the layer to be drawn is determined to have been drawn successfully; if the drawing is not completed before the start of the compositing process, the layer to be drawn is determined to have failed to be drawn.
[0094] Because the drawing process of the layer to be drawn takes a long time, occupying the main thread or the drawing thread for a long time, the drawing process is delayed, which causes the layer to be drawn to fail to be drawn in time before the compositing process begins.
[0095] A layer that is drawn before the main thread or drawing thread has finished running and before the compositing process begins can be considered a successfully drawn layer to be composed.
[0096] In some embodiments, after the drawing is completed, the composite data corresponding to each layer to be composited can be obtained, and the composite data can be stored in the second buffer corresponding to each layer to be composited.
[0097] At the start of the compositing process, compositing data corresponding to the layer to be composed is retrieved from the second buffer corresponding to the layer to be composed. Then, using the corresponding compositing thread, the layer to be composed is composited according to the compositing data to obtain the target interface. In some embodiments, after obtaining the target interface, it can be output through an electronic device, for example, by displaying the target interface through the display module of the electronic device.
[0098] In this embodiment of the disclosure, during the compositing process of each layer to be composited, the compositing time parameters corresponding to each layer to be composited can be automatically obtained. For example, the compositing time parameters that can be obtained include: the timestamp of the start of the compositing thread of the layer to be composited, the timestamp of the end of the compositing thread of the layer to be composited, etc.
[0099] For example, during the layer compositing process, a compositing inspector can be used to obtain compositing timing parameters. This compositing inspector can include custom algorithm classes, such as a custom `surfaceflingerInspector` class, as long as it can automatically obtain compositing timing parameters; these will not be listed individually here.
[0100] In this embodiment of the disclosure, after obtaining the rendering time parameters and the compositing time parameters, the target frame loss data during the generation of the target interface can be determined based on the obtained rendering time parameters and compositing time parameters. The target frame loss data can be used to determine the result of data processing and thus the effect of data processing. In some embodiments, the target frame loss data may include the number of target frame losses or the target frame loss time, etc. For example, the time when frame loss occurs during rendering, the image frame with the frame loss, or the number of frame losses during rendering can be determined based on the rendering time parameters. Alternatively, the time when frame loss occurs during compositing, the image frame with the frame loss, or the number of frame losses during compositing can be determined based on the compositing time parameters. The total number of frame losses is determined based on both the rendering time parameters and the compositing time parameters, and the total number of frame losses is displayed in the display window of the electronic device.
[0101] In other embodiments, after obtaining the target frame loss data, the target frame loss data can be output. Taking the target frame loss data as the total number of frame losses during the rendering and compositing process as an example, the total number of frame losses can be output through an electronic device. For example, it can be output through the display module of the electronic device. The timing of outputting through the display module of the electronic device includes: outputting the target frame loss data when the target interface is displayed on the electronic device; outputting the target frame loss data within a preset duration of the update event during the interface update process of the electronic device; and outputting the target frame loss data after configuring a test script to monitor and test the target interface display process, etc.
[0102] In some embodiments, before the interface is displayed on an electronic device, it undergoes a drawing process and a compositing process. The drawing process and the compositing process require the processor to cooperate to complete this series of operations. During this process, if there is a delay in the layer drawing process or the compositing process, it will affect the user experience. The layer drawing and compositing processes in this process are monitored by obtaining the drawing time parameters and the compositing time parameters to complete the monitoring of the entire process.
[0103] Taking a mobile phone as an example and an Android operating system as an example, during the process of displaying the interface on the phone screen, the phone obtains at least one set of initial data from a preset first buffer and performs the layer drawing process based on the obtained initial data. In some embodiments, when the phone or application (app) needs to update the interface, it sends a request to refresh (vsync) signal to the application's event handling thread (EventThread). The application's event handling thread then sends a request to the refresh signal generation thread (DispSyncThread). After receiving the request, the refresh signal generation thread sends a drawing refresh (vsync-app) signal to the application's event handling thread. Upon receiving the drawing refresh signal, the application's event handling thread wakes up the application's drawing thread, and the application begins drawing. The main thread (UIThread) and the rendering thread (RenderThread) start running respectively to perform the layer drawing process.
[0104] After the application finishes rendering, it calls the `queuebuffer` function to submit the rendering data of the successfully rendered layers to the corresponding second buffer and notifies the image management server (SurfaceFlinger, SF) to begin the compositing process of the target interface. When the image management server needs to compose the interface, it sends a refresh request signal to its event handling thread. The event handling thread then sends a request to the refresh signal generation thread. Upon receiving the request, the refresh signal generation thread sends a compositing refresh (vsync-sf) signal to the event handling thread. Upon receiving the compositing refresh signal, the event handling thread wakes up the image management server's compositing thread, and the image management server begins the process of compositing the target interface.
[0105] In some embodiments, the drawing refresh signal and the composite refresh signal can be generated simultaneously, used to wake up the compositing thread on the application side and the drawing thread on the image management server side, respectively. In other embodiments, the composite refresh signal can be delayed by a certain duration (e.g., 5 milliseconds (ms)) compared to the drawing refresh signal, with an offset time between them. This offset time can be adjusted according to actual conditions to improve the interface display effect. It should be noted that the period between each drawing refresh signal is equal to the period between each composite refresh signal, and this period can include 16.6ms, 8.3ms, 7.44ms, etc.
[0106] During the layer rendering process on the application side and the interface compositing process on the image management server side, the rendering inspector can be used to obtain the rendering time parameters for the application rendering stage, and the compositing inspector can be used to obtain the compositing time parameters for the image management server compositing stage. The parameters from the application side (e.g., rendering time parameters) are reported to the image management server via the inter-process communication tool binder. The image management server processes these parameters and combines them with the compositing time parameters to determine the target frame loss data during the generation of the target interface.
[0107] In some embodiments, a high-speed camera robot arm can be used to determine frame drops by image recognition or by using a script called dumpsysgfxinfo (used to obtain data on the time taken to render layers), perform smoothness calculations, monitor the data, and collect smoothness issues through user feedback.
[0108] Because using a high-speed camera robotic arm to determine frame drops cannot guarantee that the image recognition method is completely correct, manual frame-by-frame verification is still required. Each verification takes more than ten minutes, which is a huge waste of manpower and resources. In addition, because manual verification is required, the interval between two adjacent slides is relatively long, making it impossible to conduct stress tests. This does not conform to user scenarios and it is not easy to find problems during the verification process. When collecting smoothness issues through user feedback, it is very difficult to analyze smoothness issues based solely on user feedback, and it is impossible to find and resolve smoothness issues in a timely manner.
[0109] In this embodiment of the disclosure, at least one set of initial data can be obtained. During the process of drawing and compositing layers based on the initial data, drawing time parameters and compositing time parameters are obtained respectively. Then, based on the drawing time parameters and compositing time parameters, the target frame loss data in the process of generating the target interface is determined.
[0110] In this way, during the real-time monitoring of electronic devices to determine the target frame loss data, on the one hand, the entire process of interface generation can be fully monitored, including the layer drawing and compositing process, making the determined target frame loss data more accurate and reliable; on the other hand, the acquisition of time parameters can be completed automatically, and the target frame loss data can be determined automatically based on the acquired time parameters, reducing the cost of manpower and material resources.
[0111] In some embodiments, determining the target frame loss data during the generation of the target interface based on the rendering time parameter and the synthesis time parameter includes:
[0112] Based on the drawing time parameters, determine the first frame loss data during the drawing process;
[0113] Based on the synthesis time parameters, determine the second frame loss data during the synthesis of the target interface;
[0114] The target frame loss data is determined based on the first frame loss data and the second frame loss data.
[0115] Here, the drawing time parameters obtained during the drawing process on the application side can be used to determine the first frame loss data during the drawing process; the compositing time parameters obtained during the compositing process on the image management server can be used to determine the second frame loss data during the compositing of the target interface, and then the target frame loss data can be determined based on the first and second frame loss data. In some embodiments, the drawing time parameters may include: the timestamp of each drawing refresh signal emitted during the drawing process, the timestamps of the start and stop of the main thread and rendering thread, etc.; the compositing time parameters may include: the timestamp of each compositing refresh signal emitted during the compositing process, the timestamps of the start and stop of the compositing thread, etc.
[0116] In some embodiments, during the layer drawing process, whether the drawing thread of the layer to be drawn is started is determined by whether the corresponding first buffer is called for each layer to be drawn, that is, whether the layer to be drawn has started drawing. Whether the corresponding second buffer is called for each layer to be drawn is determined by whether the layer to be drawn stores the composite data in the corresponding second buffer, that is, whether the layer to be drawn has been drawn.
[0117] For example, during the layer drawing process on the application side, the system determines whether the queuebuffer function is invoked by a drawing refresh signal in the running state. This is used to determine whether the layer to be drawn corresponding to the drawing refresh signal has invoked the corresponding second buffer, and whether the compositing data corresponding to the layer to be drawn is stored in the second buffer. For instance, if the first drawing refresh signal corresponding to the first layer to be drawn invokes the queuebuffer function, it is determined that the first layer to be drawn has invoked the corresponding second buffer, and the compositing data corresponding to the first layer to be drawn is stored in the second buffer. In this case, the first layer to be drawn can also be referred to as the first layer to be composed.
[0118] For example, if the application does not call the `queuebuffer` function during the refresh signal generation period (meaning it does not store the composite data in the corresponding second buffer), it is determined that the drawing process of the layer to be drawn was not completed during that refresh signal generation period, and frame drops occurred on the application side during that period. Whenever frame drops occur on the application side, the first dropped frame data is sent to the image management server via the oneway binder tool.
[0119] In some embodiments, during the layer compositing process, the image management server can determine whether a post-composition to display process occurs within each standard compositing cycle. For example, if the image management server does not call the post-composition function within a standard compositing cycle, it can be determined that the image management server has not stored the target interface obtained from the post-compositing process in the corresponding third buffer. In this case, it can be determined that the compositing process of the layers to be composited was not completed within that standard compositing cycle, and the image management server experienced frame drops within that standard compositing cycle. Whenever frame drops occur, the image management server automatically updates the second frame drop data based on the frame drop situation.
[0120] Upon receiving the first lost frame data and the updated second lost frame data, the image management server can process the first lost frame data and the second lost frame data to obtain the target lost frame data.
[0121] The technical solution in this embodiment can comprehensively determine the target frame loss data by combining the first frame loss data in the drawing process and the second frame loss data in the synthesis process. This allows for more comprehensive monitoring of frame loss during the interface generation process, making the determination of the target frame loss data more accurate and based on data references. Furthermore, the acquisition of drawing time parameters and synthesis time parameters, as well as the determination of the first and second frame loss data, can all be completed automatically without manual monitoring, making it highly operable.
[0122] In some embodiments, the first frame loss data includes: a first number of frame losses; the second frame loss data includes: a second number of frame losses; the target frame loss data includes: a target number of frame losses; determining the target frame loss data based on the first frame loss data and the second frame loss data includes:
[0123] Based on the drawing time parameters and the compositing time parameters, determine the layers that failed to be drawn;
[0124] The target number of dropped frames is determined based on the first number of dropped frames, the number of layers that failed to be drawn, and the second number of dropped frames.
[0125] Here, based on the obtained drawing time parameters and compositing time parameters, the layers that failed to be drawn can be determined. In some embodiments, the drawing time parameters may include: a timestamp indicating the end of drawing the layer to be drawn. The compositing time parameters may include: a timestamp indicating the start of the compositing process. In this embodiment of the disclosure, the layers that failed to be drawn can be determined based on the timestamp indicating the end of drawing the layer to be drawn and the timestamp indicating the start of the compositing process. For example, the layers to be drawn whose timestamp indicating the end of drawing is greater than the corresponding timestamp indicating the start of the compositing process can be determined as the layers that failed to be drawn.
[0126] When the image management server calls the layerbuffer function corresponding to the layer that failed to be drawn, it cannot obtain (latch) the composite data corresponding to the layer that failed to be drawn. At this time, the image management server can trigger the counting function of the counter and start counting to obtain the number of layers that failed to be drawn.
[0127] In some embodiments, the first frame loss data includes: the number of first frame loss; the second frame loss data includes: the number of second frame loss; and the target frame loss data includes: the target number of frame loss. That is, in this embodiment of the present disclosure, the number of first frame loss during the rendering process and the number of second frame loss during the compositing process can be determined, and the target number of frame loss can be determined based on the number of first frame loss, the number of layers that failed to be rendered, and the number of second frame loss.
[0128] In other embodiments, the target number of dropped frames can be output using different output strategies. For example, the target number of dropped frames can be output through the display window of an electronic device; it can also be output through a test report.
[0129] Figure 2 This is a schematic diagram illustrating different output strategies according to an exemplary embodiment, such as... Figure 2 As shown, the application uses a rendering inspector to count the number of dropped frames during the rendering process, while the image management server uses a compositing inspector to count the number of dropped frames during the compositing process. The application reports the number of dropped frames to the image management server via a binder tool. The image management server can then calculate the target number of dropped frames based on both the application and server-side data. The FrameRateService configured in the PowerKeeper system application retrieves the target number of dropped frames and other data related to the target interface from the image management server via a service call tool. The result of the target number of dropped frames can be displayed through the user interface (UI) 201 of the electronic device.
[0130] When outputting the number of target frame drops during the process of generating the target interface through the display window of the electronic device, other data related to the target interface can also be output simultaneously. Other data related to the target interface may include: the number of frames drawn by the current target interface, the frame rate of the current target interface, the current screen refresh rate, and the time consumed when frame drops occur. Among them, the frame rate may include the number of frames drawn by the graphics processing unit (GPU) in one second, and the unit is frames per second (fps); the refresh rate may include the number of times the electron beam scans the image on the screen repeatedly.
[0131] Figure 3 This is a schematic diagram illustrating data output through a display window according to an exemplary embodiment, such as... Figure 3 As shown, the current target interface name is: com.miui.gallery-HomePageActivity#0; the current target interface's frame rate is: 2161; the current target interface's frame rate is: 120fps; the current target interface's frame rate bar chart updates per second as follows: the values reached by each bar; the current screen refresh rate is: 120 Hz; the current screen resolution is: 1080×2261; the current unallocated memory is: 2226 MB; the current phone temperature is: 30.2℃; the current CP... The core frequencies of the U processors are 1.65, 1.17, 1.39, 1.65, 1.55, 1.65, 2.03, and 2.25 GHz, respectively. The frame drop record during the generation of the current target interface is: com.miui.gallery-HomePageActivity#0:3|3|48, where "com.miui.gallery-HomePageActivity#0" is the name of the current target interface, and "3|3|48" indicates that three consecutive frames were dropped, for a total of three frames dropped, taking a total of 48 ms.
[0132] Or as Figure 2 As shown, the system application can also save the acquired data and configure the dump interface. When testing the process of generating the target interface, the entire process of drawing, compositing, and displaying data can be recorded through logs. A corresponding frame loss monitoring script can be added to monitor the log content, enabling control over the entire process of generating the target interface. This helps identify all data conditions corresponding to the timestamps where frame loss occurs and proposes corresponding solutions to prevent similar problems from recurring. The corresponding frame loss monitoring script obtains data by dumping PowerKeeper and captures the frame loss trace file 202 through monitoring logs.
[0133] In this embodiment of the disclosure, the performance analysis tool systrace can be used during testing to statistically analyze the time consumption of each thread (drawing thread or synthesis thread). The systrace performance analysis tool is used by R&D teams to analyze frame drop issues. Using this performance analysis tool, problems can be clearly analyzed, data can be provided for testing, a test report 203 can be generated, and the target number of dropped frames can be output through the test report 203 and the trace file 202. Identifying the frame drop issue based on this test report facilitates the resolution of similar frame drop problems.
[0134] In this embodiment of the disclosure, increasing the number of layers that fail to be drawn together to jointly determine the target number of dropped frames can more accurately determine the frame dropping situation during the layer drawing process and improve the accuracy of the target number of dropped frames. In addition, different output strategies can be used to output the target number of dropped frames. Depending on the actual situation, the target number of dropped frames can be output in real time or all content related to the target number of dropped frames can be output in the form of a report, which expands the application scope of the technical solution in this embodiment of the disclosure.
[0135] In some embodiments, the first frame loss data includes: a first number of frame loss; the second frame loss data includes: a second number of frame loss; the target frame loss data includes: a target number of frame loss; determining the target frame loss data based on the first frame loss data and the second frame loss data includes: determining layers that failed to be drawn based on the drawing time parameter and the compositing time parameter; comparing the first number of frame loss and the number of layers that failed to be drawn to obtain a first comparison result; and determining the target number of frame loss based on the first comparison result and the second frame loss count.
[0136] In some embodiments, determining the target number of dropped frames based on the first number of dropped frames, the number of layers that failed to be drawn, and the second number of dropped frames includes:
[0137] The first number of dropped frames is compared with the number of layers that failed to be drawn to obtain a first comparison result;
[0138] The target number of dropped frames is determined based on the first comparison result and the second number of dropped frames.
[0139] Here, both the initial number of dropped frames and the number of layers that failed to render are used to determine the total number of dropped frames during the rendering process. Therefore, before determining the target number of dropped frames, the initial number of dropped frames is compared with the number of layers that failed to render, resulting in a first comparison result. Based on this first comparison result, the number of dropped frames during the rendering process is determined using either the initial number of dropped frames or the number of layers that failed to render. The target number of dropped frames is then determined by combining the first comparison result and the second number of dropped frames.
[0140] In some embodiments, the first number of dropped frames may include: the number of dropped frames reported by the application to the image management server; the number of layers that failed to be drawn may include: the number of layers detected by the image management server that the application did not transmit to the image management server before the start of the standard compositing cycle, i.e., the number of dropped frames detected by the image management server. By combining the first number of dropped frames and the number of layers that failed to be drawn, the number of dropped frames during the application's drawing process can be determined; the number of dropped frames during the image management server's compositing process can be determined based on the second number of dropped frames; and then, the target number of dropped frames can be determined based on the number of dropped frames during the application's drawing process and the number of dropped frames during the image management server's compositing process.
[0141] In this embodiment of the disclosure, by comparing the number of first dropped frames counted during the drawing process with the number of layers that failed to draw, the situation that occurs during the drawing process and the compositing process, as well as the interaction between the application and the image management server, can be fully considered. This allows for a more accurate determination of the number of dropped frames during the drawing process, and the resulting target number of dropped frames is also more accurate.
[0142] In some embodiments, determining the target number of dropped frames based on the first comparison result and the second number of dropped frames includes:
[0143] If the first comparison result indicates that the number of the first dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames is determined based on the number of layers that failed to be drawn and the second number of dropped frames.
[0144] If the first comparison result indicates that the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, the target number of dropped frames is determined based on the first number of dropped frames and the second number of dropped frames.
[0145] Here, the number of first dropped frames counted during the drawing process is compared with the number of layers that failed to be drawn. If the number of first dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames is determined based on the number of layers that failed to be drawn and the number of second dropped frames.
[0146] In some embodiments, if the first number of dropped frames is greater than the number of layers that failed to be drawn, it indicates that during the layer drawing process, due to the time consumed by the application, the compositing time of the layers to be drawn is too long, exceeding the drawing cycle, resulting in dropped frames. However, the image management server may be able to obtain the corresponding composite data during the compositing process. When the first number of dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames can be determined based on the actual situation of the dropped frames, according to the number of layers that failed to be drawn and the second number of dropped frames.
[0147] In some embodiments, if the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, it indicates that during the layer drawing process, the application side completes the drawing and stores the composite data in the corresponding second buffer, but the image management server fails to obtain the corresponding composite data for the layer compositing process. The failure of the image management server to obtain the corresponding composite data is a frame drop situation that occurred during the image management server's compositing process, rather than a frame drop situation on the application side. Therefore, if the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, the number of dropped frames of the target can be determined based on the first number of dropped frames and the second number of dropped frames.
[0148] In this embodiment of the disclosure, after obtaining the first number of dropped frames (i.e., the number of dropped frames reported by the application to the image management server) and the number of layers that failed to be drawn (i.e., the number of dropped frames detected by the image management server from the application), the number of dropped frames during the drawing process can be obtained by directly calculating the first number of dropped frames and the number of layers that failed to be drawn. The corresponding calculation formula is as follows:
[0149] N1 = min(n1, n2) (1);
[0150] In formula (1), N1 is the number of frames dropped by the application, n1 is the number of frames dropped by the application reported to the image management server during the drawing process, and n2 is the number of frames dropped by the application detected by the image management server.
[0151] By comparing the number of layers that failed to be drawn with the number of the first frame drops, the accuracy of the number of frame drops during the drawing process can be improved. At the same time, the drawing process and the compositing process can be connected. By combining the calling status of the compositing data contained in the second buffer during the drawing process and the compositing process, the frame drops in the drawing process can be determined as a whole according to the actual situation, so that the target number of frame drops is closer to the actual number.
[0152] In some embodiments, determining the first lost frame data during the rendering process based on the rendering time parameter includes:
[0153] Based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, determine the frame loss data corresponding to the current layer to be drawn, until the frame loss data corresponding to each layer to be drawn is determined.
[0154] The first frame loss data in the drawing process is obtained based on the frame loss data corresponding to each of the layers to be drawn.
[0155] In some embodiments, the drawing time parameters may include: the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing period of the current layer to be drawn. The timestamp of the start of drawing the current layer to be drawn may include the timestamp of the start of the main thread corresponding to the current layer to be drawn; the timestamp of the end of drawing the current layer to be drawn may include the timestamp of the end of the rendering thread corresponding to the current layer to be drawn. The standard drawing period of the current layer to be drawn can be determined according to the screen refresh rate. For example, when the screen refresh rate is 60Hz, the standard drawing period can be determined to be 16.6ms. As another example, when the screen refresh rate is 120Hz, the standard drawing period can be determined to be 8.3ms, etc.
[0156] In some embodiments, each time the application determines a lost frame data corresponding to a current layer to be drawn, it can send the lost frame data to the image management server via a oneway binder, and the image management server will process the lost frame data reported by the application.
[0157] In other embodiments, frame loss data can be calculated based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn. Since the calculation result is not necessarily an integer, for non-integers less than 1, it can be determined that the corresponding current layer to be drawn has not experienced frame loss, and there is no need to report the frame loss data to the image management server; for integers or non-integers greater than or equal to 1, it can be determined that the corresponding current layer to be drawn has experienced frame loss, and the frame loss data is reported to the image management server.
[0158] Because monitoring is done through scripts to detect frame drops, it is not possible to comprehensively monitor every layer and animation window, resulting in low data reliability.
[0159] In this embodiment of the disclosure, the required drawing time parameters can be clearly defined and obtained during the process of determining the lost frame data. During the data processing, the corresponding drawing time parameters can be obtained more specifically, thereby enabling more comprehensive monitoring of the changes in each layer and interface.
[0160] In some embodiments, determining the first frame loss data during the drawing process based on the drawing time parameter includes: when the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the previous layer, determining the frame loss data corresponding to the current layer to be drawn based on the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, until the frame loss data corresponding to each of the layers to be drawn is determined; and obtaining the first frame loss data during the drawing process based on the frame loss data corresponding to each of the layers to be drawn.
[0161] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0162] If the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle of the previous layer, the dropped frame data corresponding to the current layer to be drawn is determined according to the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn.
[0163] It should be noted that if the timestamp of the previous layer's drawing completion falls within the previous layer's standard drawing cycle, it indicates that the previous layer's drawing is proceeding normally without frame drops. In this case, the drawing process of the previous layer does not affect the drawing process of the current layer. The determination of frame drops for the current layer is related to the drawing time parameters of the current layer.
[0164] Therefore, the frame loss data corresponding to the current layer to be drawn can be determined based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn.
[0165] In this embodiment of the disclosure, when the drawing process of the current layer to be drawn does not overlap with the drawing process of the previous layer, the frame loss data corresponding to the current layer to be drawn can be determined by obtaining three timestamps: the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn. This reduces the time and memory consumed by obtaining other unnecessary timestamps.
[0166] In some embodiments, the method further includes:
[0167] If the timestamp of the end of drawing the previous layer is less than the timestamp of the start of drawing the current layer to be drawn, it is determined that the timestamp of the end of drawing the previous layer is within the standard drawing cycle corresponding to the previous layer.
[0168] It should be noted that, due to the multi-buffering mechanism, the issuance of each draw refresh signal, i.e., the start of a standard draw cycle, indicates that the layer to be drawn has begun to be drawn. In other words, the timestamp of the draw refresh signal issuance is equal to the timestamp of the start of the drawing of the layer to be drawn.
[0169] In other words, the standard drawing cycle of the previous layer is connected to the standard drawing cycle of the current layer to be drawn. If the timestamp of the end of the drawing of the previous layer is less than the timestamp of the start of the drawing of the current layer to be drawn, it is determined that the timestamp of the end of the drawing of the previous layer is within the standard drawing cycle of the previous layer. The drawing process of the previous layer and the drawing process of the current layer do not overlap in time. In this case, the drawing process of the previous layer has no effect on the drawing process of the current layer.
[0170] In this embodiment of the disclosure, the relationship between the current layer to be drawn and the previous layer can be determined based on the timestamp. If it is determined that the previous layer has no effect on the current layer to be drawn, the frame loss data corresponding to the current layer to be drawn can be determined based on the timestamp of the start of the drawing of the current layer to be drawn, the timestamp of the end of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, which can improve the accuracy of the determined frame loss data.
[0171] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0172] A first duration is determined based on the timestamp of the start of drawing the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; wherein, the first duration includes: the duration required to draw the current layer to be drawn;
[0173] Based on the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn, determine the frame loss data corresponding to the current layer to be drawn.
[0174] In some embodiments, a first duration is determined based on the timestamps of the start and end of drawing the current layer to be drawn. The first duration includes the time required to draw the current layer to be drawn, which can be determined as the difference between the timestamps of the end and start of drawing the current layer to be drawn. In some embodiments, the time required to draw the current layer to be drawn can be directly compared with the standard drawing cycle of the current layer to be drawn, and the frame loss data corresponding to the current layer to be drawn can be determined based on the comparison result.
[0175] Figure 4 This is a schematic diagram of a drawing scene corresponding to a layer to be drawn, according to an exemplary embodiment. Figure 1 ,like Figure 4 As shown, the first duration of the first currently drawn layer can be the difference between the timestamp t1 when the drawing of the first currently drawn layer begins and the timestamp t2 when the drawing of the first currently drawn layer ends. The difference d1 between the timestamp t1 when the drawing of the first currently drawn layer begins and the timestamp t2 when the drawing of the first currently drawn layer ends is the first duration. By comparing d1 of the first currently drawn layer with the standard drawing period T1 of the first currently drawn layer, the frame loss data corresponding to the first currently drawn layer can be determined.
[0176] In this embodiment of the disclosure, the time required to draw the current layer to be drawn is determined, and the frame loss data corresponding to the current layer to be drawn is determined in combination with the standard drawing cycle of the current layer to be drawn. This can more intuitively reflect the frame loss situation, and the time required to draw the current layer to be drawn and the standard drawing cycle of the current layer to be drawn can be more clearly represented in the corresponding drawing scene diagram.
[0177] In some embodiments, determining the frame loss data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes: determining a first duration based on the timestamp of the start of drawing the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; wherein, the first duration includes: the duration required to draw the current layer to be drawn; and determining the frame loss data corresponding to the current layer to be drawn based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn.
[0178] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn includes:
[0179] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn.
[0180] Here, the frame drop data corresponding to the current layer to be drawn can be determined based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn. The first duration of the current layer to be drawn is the time required to draw the current layer. When the ratio between the time required to draw the current layer to be drawn and the standard drawing cycle of the current layer to be drawn is greater than 1, it is determined that the time required to draw the current layer to be drawn is greater than the standard drawing cycle of the current layer to be drawn. In this case, due to the time consumption on the application side, the drawing of the current layer to be drawn may not be completed within the standard drawing cycle of the current layer to be drawn, which is determined to be a frame drop situation, and the obtained ratio is determined as the frame drop data corresponding to the current layer to be drawn.
[0181] In some embodiments, the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn is 1.5, thus determining the frame loss data corresponding to the current layer to be drawn as 1.5 and the number of frame loss corresponding to the current layer to be drawn as 1. In other embodiments, the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn is 2.1, thus determining the frame loss data corresponding to the current layer to be drawn as 2.1 and the number of frame loss corresponding to the current layer to be drawn as 2.
[0182] In this embodiment of the disclosure, the frame loss data corresponding to the current layer to be drawn is determined by directly calculating the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn. This can provide a reasonable data basis for determining the frame loss data and improve the convenience of determining the frame loss data.
[0183] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0184] If the timestamp of the previous layer adjacent to the current layer to be drawn ends within the standard drawing cycle corresponding to the current layer to be drawn, the dropped frame data corresponding to the current layer to be drawn is determined based on the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn, the timestamp of the end of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn.
[0185] It should be noted that if the timestamp of the previous layer's drawing completion falls within the standard drawing cycle of the current layer, it indicates that frame drops may have occurred during the drawing of the previous layer. In this case, the drawing process of the previous layer affects the drawing process of the current layer, and the determination of frame drops for the current layer is related to the drawing time parameters of the previous layer.
[0186] The end timestamp of the standard drawing cycle corresponding to the current layer to be drawn is the timestamp of the first drawing refresh signal that appears after the drawing of the previous layer ends. Since the drawing process of the previous layer affects the drawing process of the current layer to be drawn, the influence of the previous layer on the current layer to be drawn needs to be removed when determining the frame loss data corresponding to the current layer to be drawn.
[0187] Therefore, the frame loss data corresponding to the current layer to be drawn can be determined based on the end timestamp of the standard drawing cycle of the current layer to be drawn, the end timestamp of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn.
[0188] In this embodiment of the disclosure, when the drawing process of the current layer to be drawn overlaps with the drawing process of the previous layer, the frame loss data corresponding to the current layer to be drawn can be determined by obtaining three timestamps: the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn, the end timestamp of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn. This reduces the time and memory consumed by obtaining other unnecessary timestamps.
[0189] In some embodiments, the method further includes:
[0190] If the timestamp of the end of drawing the previous layer is greater than the timestamp of the start of drawing the current layer to be drawn, it is determined that the timestamp of the end of drawing the previous layer is within the standard drawing cycle corresponding to the current layer to be drawn.
[0191] It should be noted that, due to the multi-buffering mechanism, the standard drawing cycle of the previous layer is connected to the standard drawing cycle of the current layer to be drawn. If the timestamp of the previous layer's drawing ends is greater than the timestamp of the current layer's drawing begins, it is determined that the timestamp of the previous layer's drawing ends is within the standard drawing cycle of the current layer. The drawing process of the previous layer overlaps with the drawing process of the current layer in time, and the drawing process of the previous layer affects the drawing process of the current layer.
[0192] In this embodiment of the disclosure, the relationship between the current layer to be drawn and the previous layer can be determined based on the timestamp. When it is determined that the previous layer has an impact on the current layer to be drawn, the frame loss data corresponding to the current layer to be drawn can be determined based on the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn, the end timestamp of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, which can improve the accuracy of the determined frame loss data.
[0193] In some embodiments, determining the frame loss data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes: if the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the current layer to be drawn, determining a second duration based on the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; and determining the frame loss data corresponding to the current layer to be drawn based on the second duration and the standard drawing cycle of the current layer to be drawn.
[0194] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn, the end timestamp of the drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes:
[0195] The second duration is determined based on the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn and the end timestamp of the drawing of the current layer to be drawn;
[0196] Based on the second duration and the standard drawing cycle of the current layer to be drawn, the dropped frame data corresponding to the current layer to be drawn is determined.
[0197] In some embodiments, a second duration is determined based on the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn and the end timestamp of the drawing of the current layer to be drawn. The difference between the end timestamp of the drawing of the current layer to be drawn and the end timestamp of the standard drawing cycle corresponding to the current layer to be drawn is determined as the second duration.
[0198] In some embodiments, the second duration is directly compared with the standard drawing cycle of the current layer to be drawn, and the dropped frame data corresponding to the current layer to be drawn is determined based on the comparison result.
[0199] Figure 5 This is a schematic diagram of a drawing scene corresponding to a layer to be drawn, according to an exemplary embodiment. Figure 2 ,like Figure 5As shown, the second duration of the second currently drawn layer can be the difference between the end timestamp t3 of the standard drawing cycle corresponding to the second currently drawn layer and the end timestamp t4 of the drawing of the second currently drawn layer. The length d2 of the line segment between the end timestamp t3 of the standard drawing cycle corresponding to the second currently drawn layer and the end timestamp t4 of the drawing of the second currently drawn layer is the second duration. By comparing the second duration d2 of the second currently drawn layer with the standard drawing cycle T2 of the second currently drawn layer, the dropped frame data corresponding to the second currently drawn layer can be determined.
[0200] In this embodiment, since the drawing process of the current layer to be drawn overlaps with the drawing process of the previous layer, determining the second duration can eliminate the influence of the drawing process of the previous layer on the drawing process of the current layer to be drawn. Based on eliminating this influence, and combining the standard drawing cycle of the current layer to be drawn to determine the corresponding frame loss data, the frame loss situation can be determined more accurately.
[0201] In some embodiments, determining the dropped frame data corresponding to the current layer to be drawn based on the second duration and the standard drawing cycle of the current layer to be drawn includes:
[0202] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the second duration and the standard drawing cycle of the current layer to be drawn.
[0203] Here, the dropped frame data corresponding to the current layer to be drawn can be determined based on the ratio between the second duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn. The second duration of the current layer to be drawn is the duration determined to eliminate the influence of the previous layer on the current layer to be drawn. When the ratio between the second duration and the standard drawing cycle of the current layer to be drawn is greater than 1, the second duration is determined to be greater than the standard drawing cycle of the current layer to be drawn. In this case, due to the time consumption on the application side, the drawing of the previous layer may not be completed within the standard drawing cycle of the previous layer, and this will affect the drawing of the current layer to be drawn. This is determined to be a case of dropped frames, and the obtained ratio is determined as the dropped frame data corresponding to the current layer to be drawn.
[0204] In some embodiments, the ratio between the second duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn is 1.5, thus determining the frame loss data corresponding to the current layer to be drawn as 1.5 and the number of frame loss corresponding to the current layer to be drawn as 1. In other embodiments, the ratio between the second duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn is 2.1, thus determining the frame loss data corresponding to the current layer to be drawn as 2.1 and the number of frame loss corresponding to the current layer to be drawn as 2.
[0205] In this embodiment of the disclosure, the frame loss data corresponding to the current layer to be drawn is determined by directly calculating the second duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn. This can provide a reasonable data basis for determining the frame loss data and improve the convenience of determining the frame loss data.
[0206] In some embodiments, determining the first lost frame data during the rendering process based on the rendering time parameter includes:
[0207] If the timestamp of the end of drawing the current layer to be drawn is outside the standard drawing cycle corresponding to the current layer to be drawn, the first frame loss data in the drawing process is determined according to the drawing time parameter.
[0208] It should be noted that if the timestamp of the current layer's drawing completion is outside the standard drawing cycle corresponding to that layer (i.e., the timestamp of the current layer's drawing completion is greater than the timestamp of the standard drawing cycle), then the timestamp of the current layer's drawing completion is determined to be outside the standard drawing cycle. In other words, the time required to draw the current layer exceeds its standard drawing cycle. Due to the extended drawing time, the drawing of the current layer may not be completed within the specified standard drawing cycle, potentially resulting in dropped frames. Therefore, it is necessary to determine the first dropped frame data during the drawing process based on the drawing time parameters.
[0209] In some embodiments, if the timestamp of the current layer's drawing completion is within the standard drawing cycle corresponding to the current layer (i.e., the timestamp of the current layer's drawing completion is less than or equal to the timestamp of the standard drawing cycle's completion), then the timestamp of the current layer's drawing completion is determined to be within the standard drawing cycle corresponding to the current layer. In other words, if the time required to draw the current layer is less than or equal to the standard drawing cycle of the current layer, the drawing of the current layer is completed within the specified standard drawing cycle, and no frame drops occur during the drawing process, then the first dropped frame data for the current layer does not need to be calculated.
[0210] If the timestamp of the end of drawing the current layer to be drawn is outside the standard drawing cycle corresponding to the current layer to be drawn, the first frame loss data in the drawing process can be determined according to the drawing time parameter.
[0211] In some embodiments, when the drawing time parameter is obtained and it is determined that the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the previous layer, the first number of dropped frames can be directly determined based on the timestamp of the end of drawing of the current layer to be drawn, the timestamp of the start of drawing of the current layer to be drawn, and the standard drawing cycle of the layer to be drawn. That is, the number of dropped frames sent from the application to the image management server during the drawing process. The corresponding calculation formula is as follows:
[0212]
[0213] In formula (2), n1 is the number of frames lost by the application to the image management server during the drawing process, e1 is the timestamp of the end of the drawing of the current layer to be drawn, s1 is the timestamp of the start of the drawing of the current layer to be drawn, and v1 is the standard drawing cycle of the current layer to be drawn.
[0214] In other embodiments, after obtaining the drawing time parameters and determining that the timestamp of the previous layer's drawing end is within the standard drawing cycle corresponding to the current layer to be drawn, the first number of dropped frames can be directly determined based on the timestamp of the current layer's drawing end, the timestamp of the standard drawing cycle corresponding to the current layer's drawing end, and the standard drawing cycle of the current layer's drawing end. That is, the number of dropped frames sent from the application to the image management server during the drawing process. The corresponding calculation formula is as follows:
[0215]
[0216] In formula (3), n1 is the number of frames lost by the application to the image management server during the drawing process, e1 is the timestamp of the end of the drawing of the current layer to be drawn, a is the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn, and v1 is the standard drawing cycle of the current layer to be drawn.
[0217] In this embodiment of the disclosure, by determining whether the timestamp of the end of the drawing of the current layer to be drawn is within the standard drawing cycle corresponding to the current layer to be drawn, it is easy to determine whether the current layer to be drawn has a frame drop, reducing the process of processing drawing time parameters and reducing the burden on the program.
[0218] In some embodiments, during the process of drawing layers based on each set of initial data, obtaining the drawing time parameters corresponding to each layer to be drawn includes:
[0219] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to the layers to be drawn that meet the preset conditions are obtained;
[0220] The layers to be drawn that meet the preset conditions include: layers to be drawn after a preset time period following the occurrence of an interface switching event when an interface switching event is detected.
[0221] During the process of drawing layers based on each set of initial data, the drawing time parameters corresponding to the layers to be drawn that meet the preset conditions can be obtained. The layers to be drawn that meet the preset conditions include: the layers to be drawn after a preset time after the occurrence of the interface switching event when the interface switching event is detected.
[0222] The preset duration can be set as needed. For example, it can be set to 30ms, 50ms, etc. Taking a preset duration of 30ms as an example, the drawing time parameters obtained within 30ms after the interface switching event can be ignored, or the drawing time parameters generated within 30ms after the switching event can be directly ignored. In some embodiments, the preset duration can be determined based on the drawing duration of historical layers. For example, if the time required to draw a historical layer is 10ms, and the drawing time parameters of the layers drawn in the previous 3 frames can be ignored, then the preset duration can be set to 30ms.
[0223] In some embodiments, the layers drawn before the preset duration may include: the first three frames after the initial screen is generated during the page transition (StartActivity); the first frame after the settings screen (SetSurface) switches back to the foreground; the first frame updated by the hardware layer, etc. Specifically, since the initial screen is invisible during the page transition, the user experience is affected by the transition animation, not the initial screen, so these frames are hidden. Since the settings screen is the first frame after switching back to the foreground, this frame falls into the category where user interaction will not cause changes and will not affect the user experience, so the first frame is hidden. Because application developers often set frames that do not change during animation as the hardware layer to improve performance during animation, thus providing a separate memory space, and the first frame of the animation falls into the category where user interaction will not cause changes and will not affect the user experience, so this first frame is hidden.
[0224] If a layer is drawn before the preset conditions are met, it is not necessary to obtain the drawing time parameters for those frames. In this embodiment of the disclosure, when obtaining drawing time parameters, only the drawing time parameters of the layers to be drawn that meet the preset conditions are obtained. This can save memory and time costs caused by obtaining the drawing time parameters of extra layers, and also allows for more comprehensive monitoring of the changes in each layer and interface.
[0225] In some embodiments, determining the second lost frame data during the synthesis process based on the synthesis time parameter includes:
[0226] Based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing cycle of the current layer to be composited, determine the frame loss data corresponding to the current layer to be composited, until the frame loss data corresponding to each layer to be composited is determined.
[0227] The second frame loss data in the compositing process is obtained based on the frame loss data corresponding to each of the layers to be synthesized.
[0228] In some embodiments, the compositing time parameters may include: the timestamp of the start of compositing for the current layer to be composed, the timestamp of the end of compositing for the current layer to be composed, and the standard compositing period for the current layer to be composed. The timestamp of the start of compositing for the current layer to be composed may include the timestamp of the start of the main thread corresponding to the current layer to be composed; the timestamp of the end of compositing for the current layer to be composed may include the timestamp of the end of the compositing thread corresponding to the current layer to be composed. The standard compositing period for the current layer to be composed can be determined based on the screen refresh rate. For example, when the screen refresh rate is 60Hz, the standard compositing period can be determined to be 16.6ms. As another example, when the screen refresh rate is 120Hz, the standard compositing period can be determined to be 8.3ms, etc.
[0229] In some embodiments, each time the image management server determines a lost frame data corresponding to a current layer to be composited, the image management server's composite checker processes the lost frame data corresponding to the current layer to be composited.
[0230] In other embodiments, frame loss data can be calculated based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard composite cycle of the current layer to be composited. Since the calculation result is not necessarily an integer, for non-integers less than 1, it can be determined that no frame loss has occurred in the corresponding current layer to be composited, and the composite checker on the image management server does not need to process the frame loss data corresponding to the current layer to be composited; for integers or non-integers greater than or equal to 1, it can be determined that the corresponding current layer to be composited has experienced frame loss, and the composite checker processes the frame loss data.
[0231] Because monitoring is done through scripts to detect frame drops, it is not possible to comprehensively monitor every layer and animation window, resulting in low data reliability.
[0232] In this embodiment of the disclosure, the required synthesis time parameters can be clearly defined and obtained during the process of determining lost frame data. During the data processing, the corresponding synthesis time parameters can be obtained more specifically, thereby enabling more comprehensive monitoring of the change process of each layer and interface.
[0233] In some embodiments, determining the second frame loss data during the compositing process based on the compositing time parameter includes: when the timestamp of the end of compositing of the previous layer adjacent to the current layer to be composed is within the standard compositing period corresponding to the previous layer, determining the frame loss data corresponding to the current layer to be composed based on the timestamp of the start of compositing of the current layer to be composed, the timestamp of the end of compositing of the current layer to be composed, and the standard compositing period of the current layer to be composed, until the frame loss data corresponding to each layer to be composed is determined; and obtaining the second frame loss data during the compositing process based on the frame loss data corresponding to each layer to be composed.
[0234] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes:
[0235] If the timestamp of the end of compositing of the previous layer adjacent to the current layer to be composed is within the standard compositing period of the previous layer, the dropped frame data corresponding to the current layer to be composed is determined according to the timestamp of the start of compositing of the current layer to be composed, the timestamp of the end of compositing of the current layer to be composed, and the standard compositing period of the current layer to be composed.
[0236] It should be noted that if the timestamp of the previous layer's composition completion falls within the standard composition cycle of that previous layer, it indicates that the composition of the previous layer is proceeding normally without frame drops. In this case, the composition process of the previous layer does not affect the composition process of the current layer to be composed. The determination of frame drops in the current layer to be composed is related to the composition time parameters of the current layer to be composed.
[0237] Therefore, the frame loss data corresponding to the current layer to be composited can be determined based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing cycle of the current layer to be composited.
[0238] In this embodiment of the disclosure, when the compositing process of the current layer to be composed does not overlap with the compositing process of the previous layer, three timestamps can be obtained: the timestamp of the start of compositing of the current layer to be composed, the timestamp of the end of compositing of the current layer to be composed, and the standard compositing cycle of the current layer to be composed to determine the frame loss data corresponding to the current layer to be composed, thereby reducing the time and memory consumed by obtaining other unnecessary timestamps.
[0239] In some embodiments, the method further includes:
[0240] If the timestamp of the previous layer's composition ending is less than the timestamp of the current layer's composition starting, then the timestamp of the previous layer's composition ending is determined to be within the standard composition cycle corresponding to the previous layer.
[0241] It should be noted that, due to the multi-buffering mechanism, the issuance of each composition refresh signal, i.e., the start of a standard composition cycle, indicates that the layers to be composed have begun compositing. In other words, the timestamp of the composition refresh signal issuance is equal to the timestamp of the start of composition for the layers to be composed.
[0242] In other words, the standard compositing cycle corresponding to the previous layer is connected to the standard compositing cycle of the current layer to be composed. If the timestamp of the end of the composition of the previous layer is less than the timestamp of the start of the composition of the current layer to be composed, it is determined that the timestamp of the end of the composition of the previous layer is within the standard compositing cycle corresponding to the previous layer. The composition process of the previous layer and the composition process of the current layer do not overlap in time. In this case, the composition process of the previous layer has no effect on the composition process of the current layer.
[0243] In this embodiment of the disclosure, the relationship between the current layer to be composited and the previous layer can be determined based on the timestamp. If it is determined that the previous layer has no effect on the current layer to be composited, the frame loss data corresponding to the current layer to be composited can be determined based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard composite cycle of the current layer to be composited, which can improve the accuracy of the determined frame loss data.
[0244] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes:
[0245] A third duration is determined based on the timestamp of the start of compositing the current layer to be composited and the timestamp of the end of compositing the current layer to be composited; wherein, the third duration includes: the duration required to composite the current layer to be composited;
[0246] Based on the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited, the dropped frame data corresponding to the current layer to be composited is determined.
[0247] In some embodiments, a third duration is determined based on the timestamps of the start and end of the current layer to be composited. The third duration includes the time required to composite the current layer, which can be determined as the difference between the timestamps of the end and start of the current layer's composite process. In some embodiments, the time required to composite the current layer can be directly compared with the standard compositing cycle of the current layer, and the dropped frame data corresponding to the current layer can be determined based on the comparison result.
[0248] Figure 6 This is a schematic diagram of a compositing scene corresponding to a layer to be composited, according to an exemplary embodiment. Figure 1 ,like Figure 6 As shown, the third duration of the first currently to-be-composited layer can be the difference between the timestamp t5 when the first currently to-be-composited layer starts compositing and the timestamp t6 when the first currently to-be-composited layer ends compositing. The difference d3 between t5 and t6 is the third duration. By comparing d3 with the standard compositing period T3 of the first currently to-be-composited layer, the dropped frame data corresponding to the first currently to-be-composited layer can be determined.
[0249] In this embodiment of the disclosure, the time required to synthesize the current layer to be synthesized is determined, and the frame loss data corresponding to the current layer to be synthesized is determined in combination with the standard synthesis cycle of the current layer to be synthesized. This can more intuitively reflect the frame loss situation, and the time required to synthesize the current layer to be synthesized and the standard synthesis cycle of the current layer to be synthesized can be more clearly represented in the corresponding synthesis scene diagram.
[0250] In some embodiments, determining the frame loss data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes: determining a third duration based on the timestamp of the start of the current layer to be composited and the timestamp of the end of the current layer to be composited; wherein, the third duration includes: the duration required to composite the current layer to be composited; and determining the frame loss data corresponding to the current layer to be composited based on the ratio between the third duration of the current layer to be composited and the standard compositing period of the current layer to be composited.
[0251] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the third duration of the current layer to be composited and the standard compositing period of the current layer to be composited includes:
[0252] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited.
[0253] Here, the dropped frame data corresponding to the current layer to be composited can be determined based on the ratio between the third duration of the current layer to be composited and the standard composite period of the current layer to be composited. The third duration of the current layer to be composited is the duration required to composite the current layer. When the ratio between the duration required to composite the current layer to be composited and the standard composite period of the current layer to be composited is greater than 1, it is determined that the duration required to composite the current layer to be composited is greater than the standard composite period of the current layer to be composited. In this case, due to the time consumed by the image management server, the composite of the current layer to be composited may not be completed within the standard composite period of the current layer to be composited, thus determining that a frame drop has occurred, and the obtained ratio is determined as the dropped frame data corresponding to the current layer to be composited.
[0254] In some embodiments, the ratio between the third duration of the current layer to be composited and the standard compositing period of the current layer to be composited is 1.5, thus determining that the frame loss data corresponding to the current layer to be composited is 1.5, and the number of frame loss data corresponding to the current layer to be composited is 1. In other embodiments, the ratio between the third duration of the current layer to be composited and the standard compositing period of the current layer to be composited is 2.1, thus determining that the frame loss data corresponding to the current layer to be composited is 2.1, and the number of frame loss data corresponding to the current layer to be composited is 2.
[0255] In this embodiment of the disclosure, the frame loss data corresponding to the current layer to be composited is determined by directly calculating the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited. This can provide a reasonable data basis for determining the frame loss data and improve the convenience of determining the frame loss data.
[0256] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes:
[0257] If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing period corresponding to the current layer to be composed, the dropped frame data corresponding to the current layer to be composed is determined based on the timestamp of the end of the standard compositing period corresponding to the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing period of the current layer to be composed.
[0258] It should be noted that if the timestamp of the previous layer's composition completion falls within the standard composition cycle corresponding to the current layer, it indicates that frame drops may have occurred during the composition of the previous layer. In this case, the composition process of the previous layer affects the composition process of the current layer, and the determination of frame drops in the current layer is related to the composition time parameters of the previous layer.
[0259] The end timestamp of the standard compositing cycle corresponding to the current layer to be composed is the timestamp of the first compositing refresh signal that appears after the previous layer is composed. Since the compositing process of the previous layer affects the compositing process of the current layer to be composed, the influence of the previous layer on the current layer to be composed needs to be removed when determining the frame loss data corresponding to the current layer to be composed.
[0260] Therefore, the frame loss data corresponding to the current layer to be composited can be determined based on the end timestamp of the standard compositing cycle of the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited.
[0261] In this embodiment of the disclosure, when the compositing process of the current layer to be composed overlaps with the compositing process of the previous layer, the three timestamps—the end timestamp of the standard compositing cycle corresponding to the current layer to be composed, the end timestamp of the compositing of the current layer to be composed, and the standard compositing cycle of the current layer to be composed—can be obtained to determine the frame loss data corresponding to the current layer to be composed, thereby reducing the time and memory consumed by obtaining other unnecessary timestamps.
[0262] In some embodiments, the method further includes:
[0263] If the timestamp of the previous layer's composition ending is greater than the timestamp of the current layer's composition starting, then the timestamp of the previous layer's composition ending is determined to be within the standard composition cycle corresponding to the current layer's composition.
[0264] It should be noted that, due to the multi-buffering mechanism, the standard compositing cycle of the previous layer is connected to the standard compositing cycle of the current layer to be composed. If the timestamp of the previous layer's compositing ends is greater than the timestamp of the current layer's compositing begins, it is determined that the timestamp of the previous layer's compositing ends is within the standard compositing cycle of the current layer. The compositing process of the previous layer overlaps with the compositing process of the current layer in time, and the compositing process of the previous layer affects the compositing process of the current layer.
[0265] In this embodiment of the disclosure, the relationship between the current layer to be composited and the previous layer can be determined based on the timestamp. When it is determined that the previous layer has an impact on the current layer to be composited, the frame loss data corresponding to the current layer to be composited can be determined based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited, which can improve the accuracy of the determined frame loss data.
[0266] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited includes:
[0267] The fourth duration is determined based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited and the end timestamp of the compositing of the current layer to be composited.
[0268] Based on the fourth duration and the standard compositing cycle of the current layer to be composed, the dropped frame data corresponding to the current layer to be composed is determined.
[0269] In some embodiments, a fourth duration is determined based on the end timestamp of the standard compositing cycle corresponding to the current compositing layer and the end timestamp of the current compositing layer. The difference between the end timestamp of the current compositing layer and the end timestamp of the standard compositing cycle corresponding to the current compositing layer is determined as the fourth duration.
[0270] In some embodiments, the fourth duration is directly compared with the standard compositing period of the current layer to be composed, and the dropped frame data corresponding to the current layer to be composed is determined based on the comparison result.
[0271] Figure 7 This is a schematic diagram of a compositing scene corresponding to a layer to be composited, according to an exemplary embodiment. Figure 2 ,like Figure 7 As shown, the fourth duration of the second current layer to be composed can be the difference between the end timestamp t7 of the standard compositing cycle corresponding to the second current layer to be composed and the end timestamp t8 of the compositing of the second current layer to be composed. The length d4 of the line segment between the end timestamp t7 of the standard compositing cycle corresponding to the second current layer to be composed and the end timestamp t8 of the compositing of the second current layer to be composed is the fourth duration. By comparing the fourth duration d4 of the second current layer to be composed with the standard compositing cycle T4 of the second current layer to be composed, the dropped frame data corresponding to the second current layer to be composed can be determined.
[0272] In this embodiment, since the compositing process of the current layer to be composited overlaps with the compositing process of the previous layer, determining the fourth duration can eliminate the influence of the compositing process of the previous layer on the compositing process of the current layer to be composited. Based on eliminating this influence, and combining the standard compositing cycle of the current layer to be composited to determine the corresponding frame loss data, the frame loss situation can be determined more accurately.
[0273] In some embodiments, determining the frame loss data corresponding to the current layer to be composited based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited includes: determining a fourth duration based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited and the end timestamp of the compositing of the current layer to be composited; and determining the frame loss data corresponding to the current layer to be composited based on the ratio between the fourth duration and the standard compositing cycle of the current layer to be composited.
[0274] In some embodiments, determining the dropped frame data corresponding to the current layer to be composited based on the fourth duration and the standard compositing cycle of the current layer to be composited includes:
[0275] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the fourth duration and the standard compositing cycle of the current layer to be composited.
[0276] Here, the dropped frame data corresponding to the current layer to be composed can be determined based on the ratio between the fourth duration of the current layer to be composed and the standard compositing period of the current layer to be composed. The fourth duration of the current layer to be composed is the duration determined to eliminate the influence of the previous layer on the current layer to be composed. When the ratio between the fourth duration and the standard compositing period of the current layer to be composed is greater than 1, the fourth duration is determined to be greater than the standard compositing period of the current layer to be composed. In this case, due to the time consumption on the application side, the compositing of the previous layer may not be completed within the standard compositing period of the previous layer, and this will affect the compositing of the current layer to be composed. This is determined to be a dropped frame situation, and the obtained ratio is determined as the dropped frame data corresponding to the current layer to be composed.
[0277] In some embodiments, the ratio between the fourth duration of the current layer to be composited and the standard compositing period of the current layer to be composited is 1.5, thus determining that the frame loss data corresponding to the current layer to be composited is 1.5, and the number of frame loss data corresponding to the current layer to be composited is 1. In other embodiments, the ratio between the fourth duration of the current layer to be composited and the standard compositing period of the current layer to be composited is 2.1, thus determining that the frame loss data corresponding to the current layer to be composited is 2.1, and the number of frame loss data corresponding to the current layer to be composited is 2.
[0278] In this embodiment of the disclosure, the frame loss data corresponding to the current layer to be composited is determined by directly calculating the fourth duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited. This can provide a reasonable data basis for determining the frame loss data and improve the convenience of determining the frame loss data.
[0279] In some embodiments, determining the second lost frame data during the synthesis process based on the synthesis time parameter includes:
[0280] If the timestamp of the completion of the current layer to be composited is outside the standard compositing cycle corresponding to the current layer to be composited, the second frame loss data in the compositing process is determined according to the compositing time parameter.
[0281] It should be noted that if the timestamp of the current layer to be composed ends outside the standard compositing period for that layer (i.e., the timestamp of the current layer to be composed ends is greater than the timestamp of the standard compositing period), then the timestamp of the current layer to be composed is determined to be outside the standard compositing period. In other words, the time required to compose the current layer exceeds its standard compositing period. Due to the extended compositing time, the compositing of the current layer may not be completed within the specified standard compositing period, potentially resulting in dropped frames. Therefore, it is necessary to determine the second dropped frame data during the compositing process based on the compositing time parameters.
[0282] In some embodiments, if the timestamp of the current layer to be composed ends within the standard compositing period corresponding to the current layer, that is, if the timestamp of the current layer to be composed ends is less than or equal to the timestamp of the standard compositing period, then the timestamp of the current layer to be composed is determined to be within the standard compositing period corresponding to the current layer. In other words, if the time required to compose the current layer is less than or equal to the standard compositing period of the current layer, the compositing of the current layer is completed within the specified standard compositing period, and no frame drops occur during the compositing process of the current layer, then the second frame drop data for the current layer does not need to be calculated.
[0283] If the timestamp of the current layer to be composited ends outside the standard compositing cycle corresponding to the current layer to be composited, the second frame loss data in the compositing process can be determined based on the compositing time parameter.
[0284] In some embodiments, when the compositing time parameters are obtained and it is determined that the timestamp of the end of compositing of the previous layer adjacent to the current layer to be composed is within the standard compositing period of the previous layer, the second number of dropped frames, i.e., the number of dropped frames on the image management server, can be directly determined based on the timestamp of the end of compositing of the current layer to be composed, the timestamp of the start of compositing of the current layer to be composed, and the standard compositing period of the layer to be composed. The corresponding calculation formula is as follows:
[0285]
[0286] In formula (4), N2 is the number of frames lost by the image management server, e2 is the timestamp of the end of the current layer to be synthesized, s2 is the timestamp of the start of the current layer to be synthesized, and v2 is the standard synthesis cycle of the current layer to be synthesized.
[0287] In other embodiments, after obtaining the compositing time parameters and determining that the timestamp of the previous layer's compositing end is within the standard compositing cycle corresponding to the current layer to be composited, the first number of dropped frames can be directly determined based on the timestamp of the current layer's compositing end, the timestamp of the standard compositing cycle corresponding to the current layer, and the standard compositing cycle of the current layer. That is, the number of dropped frames sent from the application to the image management server during the compositing process. The corresponding calculation formula is as follows:
[0288]
[0289] In formula (5), N2 is the number of frames lost by the image management server, e2 is the timestamp of the end of the current composite layer, b is the timestamp of the end of the standard composite cycle corresponding to the current composite layer, and v2 is the standard composite cycle of the current composite layer.
[0290] In this embodiment of the disclosure, by determining whether the timestamp of the current layer to be composited ends is within the standard compositing cycle corresponding to the current layer to be composited, it is easy to determine whether the current layer to be composited has dropped frames, reducing the process of processing compositing time parameters and alleviating the burden on the program.
[0291] Figure 8 This is a block diagram of a data processing apparatus according to an exemplary embodiment. Figure 8 As shown, the data processing device 800 is used in electronic devices, and the data processing device 800 mainly includes:
[0292] The first acquisition module 801 is configured to acquire at least one set of initial data;
[0293] The second acquisition module 802 is configured to acquire the drawing time parameters corresponding to each layer to be drawn during the drawing process of each layer based on the initial data of each group; wherein, the layers to be drawn include: layers in the drawing thread being in the running state;
[0294] The first determining module 803 is configured to determine the successfully drawn layer to be composited based on the drawing time parameter;
[0295] The third acquisition module 804 is configured to acquire the composite data corresponding to the layer to be composited.
[0296] The fourth acquisition module 805 is configured to acquire the synthesis time parameters corresponding to each of the layers to be synthesized during the process of synthesizing each of the layers to be synthesized into a target interface based on each of the synthesis data.
[0297] The second determining module 806 is configured to determine the target frame loss data in the process of generating the target interface based on the drawing time parameter and the synthesis time parameter.
[0298] In some embodiments, the second determining module 806 is configured to:
[0299] Based on the drawing time parameters, determine the first frame loss data during the drawing process;
[0300] Based on the synthesis time parameters, determine the second frame loss data during the synthesis of the target interface;
[0301] The target frame loss data is determined based on the first frame loss data and the second frame loss data.
[0302] In some embodiments, the first frame loss data includes: a first number of frame losses; the second frame loss data includes: a second number of frame losses; the target frame loss data includes: a target number of frame losses; the second determining module 806 is configured to:
[0303] Based on the drawing time parameters and the compositing time parameters, determine the layers that failed to be drawn;
[0304] The first number of dropped frames is compared with the number of layers that failed to be drawn to obtain a first comparison result;
[0305] The target number of dropped frames is determined based on the first comparison result and the second number of dropped frames.
[0306] In some embodiments, the second determining module 806 is configured to:
[0307] If the first comparison result indicates that the number of the first dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames is determined based on the number of layers that failed to be drawn and the second number of dropped frames.
[0308] If the first comparison result indicates that the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, the target number of dropped frames is determined based on the first number of dropped frames and the second number of dropped frames.
[0309] In some embodiments, the second determining module 806 is configured to:
[0310] If the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle of the previous layer, the frame loss data corresponding to the current layer to be drawn is determined according to the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, until the frame loss data corresponding to each layer to be drawn is determined.
[0311] The first frame loss data in the drawing process is obtained based on the frame loss data corresponding to each of the layers to be drawn.
[0312] In some embodiments, the second determining module 806 is configured to:
[0313] A first duration is determined based on the timestamp of the start of drawing the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; wherein, the first duration includes: the duration required to draw the current layer to be drawn;
[0314] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn.
[0315] In some embodiments, the second determining module 806 is configured to:
[0316] If the timestamp of the completion of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the current layer to be drawn, the second duration is determined based on the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn and the timestamp of the completion of drawing of the current layer to be drawn.
[0317] Based on the second duration and the standard drawing cycle of the current layer to be drawn, the dropped frame data corresponding to the current layer to be drawn is determined.
[0318] In some embodiments, the second determining module 806 is configured to:
[0319] The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the second duration and the standard drawing cycle of the current layer to be drawn.
[0320] In some embodiments, the second acquisition module 802 is configured to:
[0321] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to the layers to be drawn that meet the preset conditions are obtained;
[0322] The layers to be drawn that meet the preset conditions include: layers to be drawn after a preset time period following the occurrence of an interface switching event when an interface switching event is detected.
[0323] In some embodiments, the second determining module 806 is configured to:
[0324] If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing cycle of the previous layer, the frame loss data corresponding to the current layer to be composed is determined based on the timestamp of the start of the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing cycle of the current layer to be composed, until the frame loss data corresponding to each layer to be composed is determined.
[0325] The second frame loss data in the compositing process is obtained based on the frame loss data corresponding to each of the layers to be synthesized.
[0326] In some embodiments, the second determining module 806 is configured to:
[0327] A third duration is determined based on the timestamp of the start of compositing the current layer to be composited and the timestamp of the end of compositing the current layer to be composited; wherein, the third duration includes: the duration required to composite the current layer to be composited;
[0328] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited.
[0329] In some embodiments, the second determining module 806 is configured to:
[0330] If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing period corresponding to the current layer to be composed, the dropped frame data corresponding to the current layer to be composed is determined based on the timestamp of the end of the standard compositing period corresponding to the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing period of the current layer to be composed.
[0331] In some embodiments, the second determining module 806 is configured to:
[0332] The fourth duration is determined based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited and the end timestamp of the compositing of the current layer to be composited.
[0333] The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the fourth duration and the standard compositing cycle of the current layer to be composited.
[0334] Figure 9 This is a block diagram illustrating a data processing apparatus 900 according to an exemplary embodiment. For example, apparatus 900 may be a mobile phone, a mobile computer, etc.
[0335] Reference Figure 9 The device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0336] Processing component 902 typically controls the overall operation of device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.
[0337] Memory 904 is configured to store various types of data to support the operation of device 900. Examples of this data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0338] Power supply component 906 provides power to various components of device 900. Power supply component 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 900.
[0339] Multimedia component 908 includes a screen that provides an output interface between device 900 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When device 900 is in an operating mode, such as shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0340] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0341] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0342] Sensor assembly 914 includes one or more sensors for providing state assessments of various aspects of device 900. For example, sensor assembly 914 may detect the on / off state of device 900, the relative positioning of components such as the display and keypad of device 900, changes in the position of device 900 or a component of device 900, the presence or absence of user contact with device 900, the orientation or acceleration / deceleration of device 900, and temperature changes of device 900. Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0343] Communication component 916 is configured to facilitate wired or wireless communication between device 900 and other devices. Device 900 can access wireless networks based on communication standards, such as Wi-Fi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0344] In an exemplary embodiment, the apparatus 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0345] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of the device 900 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0346] A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of a data processing apparatus, enable the data processing apparatus to perform a data processing method, the method comprising:
[0347] Obtain at least one set of initial data;
[0348] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state;
[0349] Based on the drawing time parameters, determine the successfully drawn layers to be composited;
[0350] Obtain the compositing data corresponding to the layer to be composited;
[0351] In the process of compositing the layers to be composited into the target interface based on the composite data, the composite time parameters corresponding to each layer to be composited are obtained.
[0352] Based on the drawing time parameters and the synthesis time parameters, the target frame loss data during the generation of the target interface is determined.
[0353] Figure 10 This is a hardware structure block diagram of a data processing apparatus according to an exemplary embodiment. For example, electronic device 1900 may be provided as a server. (Refer to...) Figure 10 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform a data processing method, including:
[0354] Obtain at least one set of initial data;
[0355] During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state;
[0356] Based on the drawing time parameters, determine the successfully drawn layers to be composited;
[0357] Obtain the compositing data corresponding to the layer to be composited;
[0358] In the process of compositing the layers to be composited into the target interface based on the composite data, the composite time parameters corresponding to each layer to be composited are obtained.
[0359] Based on the drawing time parameters and the synthesis time parameters, the target frame loss data during the generation of the target interface is determined.
[0360] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0361] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0362] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that, Applied to electronic devices, including: Obtain at least one set of initial data; During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state; Based on the drawing time parameters, determine the successfully drawn layers to be composited; Obtain the compositing data corresponding to the layer to be composited; In the process of compositing the layers to be composited into the target interface based on the composite data, the composite time parameters corresponding to each layer to be composited are obtained. Based on the rendering time parameters and the compositing time parameters, target frame loss data is determined during the generation of the target interface; the target frame loss data includes: the number of target frame losses; determining the target frame loss data during the generation of the target interface based on the rendering time parameters and the compositing time parameters includes: Based on the drawing time parameters and the compositing time parameters, determine the layers that failed to be drawn; The first comparison result is obtained by comparing the number of dropped frames during the rendering process with the number of layers that failed to be rendered. The target frame loss number is determined based on the first comparison result and the second frame loss number during the synthesis of the target interface.
2. The method according to claim 1, characterized in that, The method further includes: Based on the drawing time parameters, the first frame loss data during the drawing process is determined; wherein, the first frame loss data includes the number of first frame loss frames; Based on the synthesis time parameter, the second frame loss data during the synthesis of the target interface is determined; wherein, the second frame loss data includes the number of second frame loss.
3. The method according to claim 1, characterized in that, Determining the target number of dropped frames based on the first comparison result and the second number of dropped frames includes: If the first comparison result indicates that the number of the first dropped frames is greater than the number of layers that failed to be drawn, the target number of dropped frames is determined based on the number of layers that failed to be drawn and the second number of dropped frames. If the first comparison result indicates that the first number of dropped frames is less than or equal to the number of layers that failed to be drawn, the target number of dropped frames is determined based on the first number of dropped frames and the second number of dropped frames.
4. The method according to claim 2, characterized in that, The step of determining the first lost frame data during the rendering process based on the rendering time parameter includes: If the timestamp of the end of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle of the previous layer, the frame loss data corresponding to the current layer to be drawn is determined according to the timestamp of the start of drawing of the current layer to be drawn, the timestamp of the end of drawing of the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn, until the frame loss data corresponding to each layer to be drawn is determined. The first frame loss data in the drawing process is obtained based on the frame loss data corresponding to each of the layers to be drawn.
5. The method according to claim 4, characterized in that, The step of determining the dropped frame data corresponding to the current layer to be drawn based on the timestamp of the start of drawing the current layer to be drawn, the timestamp of the end of drawing the current layer to be drawn, and the standard drawing cycle of the current layer to be drawn includes: A first duration is determined based on the timestamp of the start of drawing the current layer to be drawn and the timestamp of the end of drawing the current layer to be drawn; wherein, the first duration includes: the duration required to draw the current layer to be drawn; The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the first duration of the current layer to be drawn and the standard drawing cycle of the current layer to be drawn.
6. The method according to claim 4, characterized in that, The method further includes: If the timestamp of the completion of drawing of the previous layer adjacent to the current layer to be drawn is within the standard drawing cycle corresponding to the current layer to be drawn, the second duration is determined based on the timestamp of the end of the standard drawing cycle corresponding to the current layer to be drawn and the timestamp of the completion of drawing of the current layer to be drawn. Based on the second duration and the standard drawing cycle of the current layer to be drawn, the frame loss data corresponding to the current layer to be drawn is determined.
7. The method according to claim 6, characterized in that, The step of determining the dropped frame data corresponding to the current layer to be drawn based on the second duration and the standard drawing cycle of the current layer to be drawn includes: The dropped frame data corresponding to the current layer to be drawn is determined based on the ratio between the second duration and the standard drawing cycle of the current layer to be drawn.
8. The method according to claim 1, characterized in that, In the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to each layer to be drawn are obtained, including: During the process of drawing layers based on the initial data of each group, the drawing time parameters corresponding to the layers to be drawn that meet the preset conditions are obtained; The layers to be drawn that meet the preset conditions include: layers to be drawn after a preset time period following the occurrence of an interface switching event when an interface switching event is detected.
9. The method according to claim 2, characterized in that, The step of determining the second lost frame data during the synthesis process based on the synthesis time parameter includes: If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing cycle of the previous layer, the frame loss data corresponding to the current layer to be composed is determined based on the timestamp of the start of the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing cycle of the current layer to be composed, until the frame loss data corresponding to each layer to be composed is determined. The second frame loss data in the compositing process is obtained based on the frame loss data corresponding to each of the layers to be synthesized.
10. The method according to claim 9, characterized in that, The step of determining the dropped frame data corresponding to the current layer to be composited based on the timestamp of the start of the current layer to be composited, the timestamp of the end of the current layer to be composited, and the standard compositing period of the current layer to be composited includes: A third duration is determined based on the timestamp of the start of compositing the current layer to be composited and the timestamp of the end of compositing the current layer to be composited; wherein, the third duration includes: the duration required to composite the current layer to be composited; The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the third duration of the current layer to be composited and the standard compositing cycle of the current layer to be composited.
11. The method according to claim 9, characterized in that, The method further includes: If the timestamp of the previous layer adjacent to the current layer to be composed ends within the standard compositing period corresponding to the current layer to be composed, the dropped frame data corresponding to the current layer to be composed is determined based on the timestamp of the end of the standard compositing period corresponding to the current layer to be composed, the timestamp of the end of the current layer to be composed, and the standard compositing period of the current layer to be composed.
12. The method according to claim 11, characterized in that, The step of determining the dropped frame data corresponding to the current layer to be composited based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited, the end timestamp of the compositing of the current layer to be composited, and the standard compositing cycle of the current layer to be composited includes: The fourth duration is determined based on the end timestamp of the standard compositing cycle corresponding to the current layer to be composited and the end timestamp of the compositing of the current layer to be composited. The dropped frame data corresponding to the current layer to be composited is determined based on the ratio between the fourth duration and the standard compositing cycle of the current layer to be composited.
13. A data processing apparatus, characterized in that, Applied to electronic devices, including: The first acquisition module is configured to acquire at least one set of initial data. The second acquisition module is configured to acquire the drawing time parameters corresponding to each layer to be drawn during the drawing process of each layer based on the initial data of each group; wherein, the layers to be drawn include: layers in which the drawing thread is in the running state; The first determining module is configured to determine the successfully drawn layers to be composited based on the drawing time parameters. The third acquisition module is configured to acquire the composite data corresponding to the layer to be composited. The fourth acquisition module is configured to acquire the synthesis time parameters corresponding to each of the layers to be synthesized during the process of synthesizing each of the layers to be synthesized into a target interface based on each of the synthesis data. The second determining module is configured to determine the target frame loss data during the generation of the target interface based on the drawing time parameter and the synthesis time parameter; the target frame loss data includes: the number of target frame losses; the second determining module is specifically configured as follows: Based on the drawing time parameters and the compositing time parameters, determine the layers that failed to be drawn; The first comparison result is obtained by comparing the number of dropped frames during the rendering process with the number of layers that failed to be rendered. The target frame loss number is determined based on the first comparison result and the second frame loss number during the synthesis of the target interface.
14. A data processing apparatus, characterized in that, include: processor; Memory configured to store processor-executable instructions; The processor is configured to implement the steps of any one of the data processing methods of claims 1 to 12 during execution.
15. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the data processing device, the device is able to perform the steps of any one of the data processing methods of claims 1 to 12.
Citation Information
Patent Citations
Control method based on vertical synchronization signal and electronic equipment
CN114531519A