Layer processing method and device, electronic equipment and computer readable storage medium

By distributing virtual vertical synchronization signals in the application, the uneven display problem caused by mismatch in the layer frame rate is solved, and the uniform processing of the target layer and the improvement of picture fluency is achieved.

CN119917045APending Publication Date: 2025-05-02SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998461.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the application, the frame rates of some layers are different from those of other layers, resulting in uneven display of the layer when drawing and synthesis display under the vertical synchronization signal, which affects the smoothness of the picture.

Method used

By obtaining the screen refresh rate and the application's user interface frame rate, determine whether the application requests to process the target layer according to the target frame rate, and distributes a virtual vertical synchronization signal when requested to ensure that the drawing and synthesis of the target layer are evenly displayed.

Benefits of technology

Achieve uniform processing of the target layer, improve picture fluency, optimize user's visual experience, and break through the application's frame rate limit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917045A_ABST
    Figure CN119917045A_ABST
Patent Text Reader

Abstract

Embodiments of the invention disclose a layer processing method and apparatus, an electronic device and a computer readable storage medium. The method comprises the steps of obtaining a screen refresh rate and a user interface frame rate of an application; when the screen refresh rate is not matched with the user interface frame rate of the application program, determining whether the application program requests to process a target layer according to a target frame rate or not; when the application program requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal is distributed to the application program; the distribution frequency of the virtual vertical synchronization signal is matched with the target frame rate; and processing a target layer of the application program according to the virtual vertical synchronization signal. Therefore, the target layer can be uniformly processed in the scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of layer processing technology, and specifically to a layer processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] The vertical synchronization signal (Vsync) is used to coordinate the application's frame rate with the screen refresh rate of the electronic device to ensure that the two can work synchronously. The application responds to the vertical synchronization signal to draw and synthesize each layer. However, the frame rate of some layers in the application is different from that of other layers, resulting in uneven drawing and synthesis of some layers when drawing and synthesizing each layer according to the vertical synchronization signal, which affects the smoothness of the picture and brings a bad visual experience to users. Summary of the invention

[0003] The embodiments of the present application provide a layer processing method, device, electronic device and computer-readable storage medium, which can uniformly process the target layer.

[0004] In a first aspect, an embodiment of the present application provides a layer processing method, including:

[0005] Get the screen refresh rate and the application's UI frame rate;

[0006] When the screen refresh rate does not match the user interface frame rate of the application, determining whether the application requests to process the target layer according to the target frame rate;

[0007] When the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal is dispatched to the application; the dispatch frequency of the virtual vertical synchronization signal matches the target frame rate;

[0008] The target layer of the application is processed according to the virtual vertical synchronization signal.

[0009] In one embodiment, the sending of the virtual vertical synchronization signal to the application comprises:

[0010] Get the next distribution time of the vertical synchronization signal;

[0011] Determining the next delivery time of the virtual vertical synchronization signal according to the next delivery time of the vertical synchronization signal;

[0012] When the next distribution time of the virtual vertical synchronization signal arrives, the virtual vertical synchronization signal is distributed to the application.

[0013] In one embodiment, determining the next delivery time of the virtual vertical synchronization signal according to the next delivery time of the vertical synchronization signal includes:

[0014] The next distribution time of the virtual vertical synchronization signal is determined according to the following formula:

[0015] Target=Time0+round((time-Time0) / Period+0.5)*Period;

[0016] Among them, the Target is the next distribution time of the virtual vertical synchronization signal, the Time0 is the next distribution time of the vertical synchronization signal, round means rounding, time means the time of the current request for the virtual vertical synchronization signal, and Period means the distribution period of the virtual vertical synchronization signal.

[0017] In one of the embodiments, after obtaining the screen refresh rate and the user interface frame rate of the application, the method further includes:

[0018] Determining the frame rate of each layer of the user interface of the application;

[0019] When the frame rate of any of the layers does not match the screen refresh rate, the layer whose frame rate does not match the screen refresh rate is determined as the target layer.

[0020] In one embodiment, processing the target layer of the application according to the virtual vertical synchronization signal includes:

[0021] When the target layer is not drawn, drawing the target layer according to the virtual vertical synchronization signal;

[0022] The virtual vertical synchronization signal is sent to the layer synthesis service of the application program, and the layer synthesis service is driven to perform synthesis display of the target layer.

[0023] In one embodiment, the method further comprises:

[0024] When the screen refresh rate matches the user interface frame rate of the application, obtaining the next dispatch time of the vertical synchronization signal;

[0025] When the next distribution time of the vertical synchronization signal arrives, the vertical synchronization signal is distributed to the application.

[0026] In one embodiment, the method further comprises:

[0027] When the screen refresh rate does not match the user interface frame rate of the application, and the application does not request to process the target layer according to the target frame rate, obtaining the next dispatch time of the vertical synchronization signal;

[0028] When the next distribution time of the vertical synchronization signal arrives, the vertical synchronization signal is distributed to the application.

[0029] In a second aspect, an embodiment of the present application provides a layer processing device, including:

[0030] The acquisition module is used to obtain the screen refresh rate and the user interface frame rate of the application;

[0031] A determination module, used for determining whether the application requests to process the target layer according to the target frame rate when the screen refresh rate does not match the user interface frame rate of the application;

[0032] A dispatching module, configured to dispatch a virtual vertical synchronization signal to the application when the application requests to process the target layer according to the target frame rate; the dispatching frequency of the virtual vertical synchronization signal matches the target frame rate;

[0033] A processing module is used to process the target layer of the application according to the virtual vertical synchronization signal.

[0034] In one embodiment, the dispatch module includes:

[0035] A time acquisition unit, used to acquire the next distribution time of the vertical synchronization signal;

[0036] A time determination unit, configured to determine a next distribution time of the virtual vertical synchronization signal according to a next distribution time of the vertical synchronization signal;

[0037] The dispatching unit is used to dispatch the virtual vertical synchronization signal to the application when the next dispatching time of the virtual vertical synchronization signal arrives.

[0038] In one embodiment, the time determination unit includes:

[0039] The time determination subunit is used to determine the next distribution time of the virtual vertical synchronization signal according to the following formula:

[0040] Target=Time0+round((time-Time0) / Period+0.5)*Period;

[0041] Among them, the Target is the next distribution time of the virtual vertical synchronization signal, the Time0 is the next distribution time of the vertical synchronization signal, round means rounding, time means the time of the current request for the virtual vertical synchronization signal, and Period means the distribution period of the virtual vertical synchronization signal.

[0042] In one of the embodiments, after obtaining the screen refresh rate and the user interface frame rate of the application, the apparatus further includes:

[0043] A frame rate determination module, used to determine the frame rate of each layer of the user interface of the application;

[0044] The target layer determination module is used to determine the layer whose frame rate does not match the screen refresh rate as the target layer when the frame rate of any layer does not match the screen refresh rate.

[0045] In one embodiment, the processing module includes:

[0046] A drawing unit, configured to draw the target layer according to the virtual vertical synchronization signal when the target layer is not drawn;

[0047] The synthesis display unit is used to send the virtual vertical synchronization signal to the layer synthesis service of the application program, and drive the layer synthesis service to perform synthesis display of the target layer.

[0048] In one embodiment, the device further comprises:

[0049] A first acquisition module, used for acquiring the next dispatch time of a vertical synchronization signal when the screen refresh rate matches the user interface frame rate of the application;

[0050] The first dispatching module is used to dispatch the vertical synchronization signal to the application when the next dispatching time of the vertical synchronization signal arrives.

[0051] In one embodiment, the device further comprises:

[0052] A second acquisition module is used to acquire the next dispatch time of the vertical synchronization signal when the screen refresh rate does not match the user interface frame rate of the application and the application does not request to process the target layer according to the target frame rate;

[0053] The second dispatching module is used to dispatch the vertical synchronization signal to the application when the next dispatching time of the vertical synchronization signal arrives.

[0054] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned layer processing method when executed by the processor.

[0055] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned layer processing method are implemented.

[0056] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.

[0057] In summary, in the embodiment of the present application, when the screen refresh rate matches the frame rate of the user interface of the application, it is proved that the frame rates of each layer in the application match the screen refresh rate. Therefore, it is only necessary to determine whether the application requests to process the target layer according to the target frame rate when the screen refresh rate and the frame rate of the user interface of the application do not match, so as to save computing resources. When the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal matching the target frame rate is dispatched to the application, so that the application processes the target layer according to the virtual vertical synchronization signal, and ensures that the drawing and synthetic display of the target layer are processed uniformly, thereby improving the smoothness of the picture and optimizing the user's visual experience. In addition, the processing of the target layer is driven by the virtual vertical synchronization signal, and the dispatch frequency of the virtual vertical synchronization signal is not limited by the frame rate of the user interface of the application. Therefore, the processing of the target layer can break through the frame rate limit of the user interface of the application, making the display of the target layer more natural and smooth. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 It is a schematic diagram of the steps of a layer processing method provided by an embodiment of the present application;

[0060] Figure 2 It is a flowchart of a layer processing method provided by an embodiment of the present application;

[0061] Figure 3 is a structural schematic diagram of a layer processing device provided by an embodiment of the present application;

[0062] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0064] Refresh rate: The number of times the screen is refreshed per unit time, measured in Hertz (Hz). For example, a screen with a refresh rate of 120Hz means that the screen can refresh 120 times per second. The higher the refresh rate, the more frequent and delicate the screen changes can be, and theoretically the smoother the visual experience. Many Android devices have screens with high refresh rates.

[0065] Frame rate: refers to the number of frames generated by an application (such as a game or video player) per unit time, measured in Hertz. For example, if the frame rate of a video is 60 frames per second (60fps), the video will play 60 different frames in one second to form a coherent dynamic image.

[0066] The vertical synchronization signal is used to coordinate the application's frame rate with the screen refresh rate of the electronic device to ensure that the two can work synchronously. In other words, the vertical synchronization signal allows the drawn picture in the application to match the screen refresh action at the right time, avoiding problems such as tearing and freezing that affect the visual effect. The drawing of each layer of the application starts with the receipt of the vertical synchronization signal, and the layer synthesis service (SurfaceFlinger) also starts with the receipt of the vertical synchronization signal.

[0067] The user interface (UI) of an application usually includes multiple layers, and the frame rates of the multiple layers may be different. At this time, if the layers with different frame rates are driven by the same vertical synchronization signal with the same dispatch frequency for drawing and composite display, some of the layers will appear uneven. For example, the frame rate of the first layer in the application is 60 frames per second, and the frame rate of the second layer is 50 frames per second; if the layers are driven by the vertical synchronization signal with the same dispatch frequency (60 Hz) for drawing, 60 frames of the first layer can be drawn evenly per second, while the second layer may draw 51 frames in one second and 49 frames in the next second, resulting in an uneven number of frames drawn per second for the second layer.

[0068] In order to solve the above technical problems, an embodiment of the present application provides a layer processing method, which distributes a virtual vertical synchronization signal that matches the target frame rate to the target layer that requests the target frame rate, thereby ensuring that the target layer drawn per second is uniform, thereby improving the smoothness of the picture.

[0069] In one embodiment, Figure 1 As shown, a layer processing method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the figure. Specifically, the layer processing method can be applied to a terminal or a server, wherein the terminal may include but is not limited to one or more of a smart phone, a tablet computer, a portable computer, a desktop computer, and a vehicle-mounted computer. The server may be a physical server or a cloud server that provides various cloud services. It is worth noting that the present application does not limit the number of terminals or servers. According to the implementation requirements, there may be any number of terminals or servers. For example, the server may be a single server or a server cluster consisting of multiple servers, and so on.

[0070] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.

[0071] according to Figure 1 The layer processing method shown in the figure includes at least steps S110 to S140, which are described in detail as follows:

[0072] In step S110 , the screen refresh rate and the user interface frame rate of the application are obtained.

[0073] The screen refresh rate refers to the number of times the screen refreshes in a unit of time. The screen refresh rate can be directly obtained from the system. For example, a screen refresh rate of 120 Hz means that the screen can refresh 120 times per second.

[0074] An application is a computer program that is used to complete one or more specific tasks. The application runs in user mode, can interact with the user, and has a visual user interface (UI). The user interface of an application is the overall interface through which the user interacts with the application and intuitively sees the content presented by the application. The user interface is the final effect presented by combining multiple layers in a specific order and rules. For example, in a picture editing application, the user interface includes a layer that displays the picture to be edited, a layer where the operation tool icons are located, and a layer where various menu options are located. These layers work together to form the user interface of the entire picture editing application.

[0075] The UI frame rate refers to the number of screens generated per unit time. You can obtain the UI frame rate of an application from the application. Because a UI is composed of multiple layers, obtaining the UI frame rate actually requires obtaining the frame rates of multiple layers.

[0076] In one embodiment, the frame rates of the various layers are the same. For example, in the first picture editing application, the frame rates of the layer displaying the picture to be edited, the layer where the operation tool icon is located, and the layer where the various menu options are located are all 60 frames per second.

[0077] In another embodiment, the frame rates of the layers may be different. For example, in the second picture editing application, the frame rate of the layer displaying the picture to be edited and the frame rate of the layer where the operation tool icon is located are both 60 frames per second, while the frame rate of the layer where the various menu options are located is 70 frames per second.

[0078] In step S120, when the screen refresh rate and the user interface frame rate of the application do not match, it is determined whether the application requests to process the target layer according to the target frame rate.

[0079] Refresh rate and frame rate match means that the refresh rate is divisible by the frame rate. Correspondingly, screen refresh rate and application user interface frame rate match means that the screen refresh rate is divisible by the application user interface frame rate. For example, when the screen refresh rate is 120 Hz and the application user interface frame rate is 60 frames per second, 120 is divisible by 60, and the screen refresh rate is divisible by the application user interface frame rate.

[0080] Because the user interface includes multiple layers, when determining whether the screen refresh rate matches the frame rate of the user interface of the application, it is necessary to determine whether the screen refresh rate matches the frame rate of each layer of the user interface of the application. The screen refresh rate and the frame rate of the layer match means that the screen refresh rate can be divided by the frame rate of the layer of the application. The screen refresh rate and the frame rate of the layer do not match means that the screen refresh rate cannot be divided by the frame rate of the layer of the application.

[0081] In one embodiment, after obtaining the screen refresh rate and the user interface frame rate of the application, the method may further include: determining the frame rates of each layer of the user interface of the application; when the frame rate of any of the layers does not match the screen refresh rate, determining the layer whose frame rate does not match the screen refresh rate as the target layer.

[0082] The obtained application user interface frame rate includes the frame rates of each layer of the application user interface. When the screen refresh rate matches the frame rates of each layer of the application user interface, it is determined that the screen refresh rate matches the application user interface frame rate.

[0083] When the screen refresh rate does not match the frame rate of any layer of the user interface of the application, it is determined that the screen refresh rate and the frame rate of the user interface of the application do not match, and the layer whose frame rate does not match the screen refresh rate can be determined as the target layer. The target frame rate required by the target layer is different from the frame rates required by other layers. The target frame rate refers to a frame rate that is different from the frame rates of other layers.

[0084] In this way, the target layer is determined, and the target layer can be processed separately later. Moreover, it is only necessary to determine whether the application requests the target frame rate for the target layer, and it is not necessary to determine whether the application requests the target frame rate for other non-target layers, which can save computing resources.

[0085] When the screen refresh rate does not match the user interface frame rate of the application, it is also necessary to determine whether the application requests to process the target layer at the target frame rate. The request issued by the application can be obtained to determine whether it includes a request to process the target layer at the target frame rate. When the target layer does not need to be processed, the target layer can be ignored. When the application requests to process the target layer at the target frame rate, step S130 can be executed.

[0086] In step S130, when the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal is sent to the application.

[0087] The dispatch frequency of the virtual vertical synchronization signal matches the target frame rate. The dispatch frequency of the virtual vertical synchronization signal matches the target frame rate, which indicates that the dispatch frequency of the virtual vertical synchronization signal can be divided by the target frame rate. For example, when the target frame rate is 50 frames per second, the dispatch frequency of the virtual vertical synchronization signal that matches the target frame rate can be 50 Hz; the dispatch frequency of the virtual vertical synchronization signal that matches the target frame rate can also be 100 Hz. However, when the dispatch frequency of the virtual vertical synchronization signal is 100 Hz, it is limited by the frame rate limit of 50 frames per second, and the target layer can still only generate 50 frames per second.

[0088] In step S140, the target layer of the application is processed according to the virtual vertical synchronization signal.

[0089] The application may process the target layer in response to the dispatched virtual vertical synchronization signal. The processing of the target layer may include drawing the target layer and / or synthesizing and displaying the target layer. Synthesizing and displaying the target layer refers to synthesizing the already drawn target layer with other layers to obtain a user interface, and displaying the synthesized user interface.

[0090] By adopting the technical solution of the embodiment of the present application, when the screen refresh rate matches the frame rate of the user interface of the application, it is proved that the frame rates of each layer in the application match the screen refresh rate. Therefore, it is only necessary to determine whether the application requests to process the target layer according to the target frame rate when the screen refresh rate and the frame rate of the user interface of the application do not match, so as to save computing resources. When the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal matching the target frame rate is dispatched to the application, so that the application processes the target layer according to the virtual vertical synchronization signal, and ensures that the drawing and synthetic display of the target layer are processed uniformly, thereby improving the smoothness of the picture and optimizing the user's visual experience. In addition, the processing of the target layer is driven by the virtual vertical synchronization signal, and the dispatch frequency of the virtual vertical synchronization signal is not limited by the frame rate of the user interface of the application. Therefore, the processing of the target layer can break through the frame rate limit of the user interface of the application, making the display of the target layer more natural and smooth.

[0091] Based on the above technical solution, as an embodiment, the dispatching of the virtual vertical synchronization signal to the application may include: obtaining the next dispatching time of the vertical synchronization signal; determining the next dispatching time of the virtual vertical synchronization signal according to the next dispatching time of the vertical synchronization signal; and dispatching the virtual vertical synchronization signal to the application when the next dispatching time of the virtual vertical synchronization signal is reached.

[0092] The vertical synchronization signal is a signal originally sent by the system to each layer of the application. The next dispatch time of the vertical synchronization signal can be obtained from the system. According to the next dispatch time of the vertical synchronization signal, the next dispatch time of the virtual vertical synchronization signal is determined to ensure that the target layer and other layers driven by the vertical synchronization signal will not be misaligned.

[0093] When the next delivery time of the virtual vertical synchronization signal is reached, the virtual vertical synchronization signal is delivered to the application so that the application processes the target layer according to the virtual vertical synchronization signal. Optionally, a timer can be set, and when the timer represents the time of the next delivery time of the virtual vertical synchronization signal, the virtual vertical synchronization signal is delivered to the application.

[0094] As an embodiment, determining the next delivery time of the virtual vertical synchronization signal according to the next delivery time of the vertical synchronization signal may include:

[0095] The next distribution time of the virtual vertical synchronization signal is determined according to the following formula:

[0096] Target=Time0+round((Time0-time) / Period+0.5)*Period;

[0097] Wherein, the Target is the next dispatch time of the virtual vertical synchronization signal, the Time0 is the next dispatch time of the vertical synchronization signal, round indicates rounding, time indicates the time of the current request for the virtual vertical synchronization signal, and Period indicates the dispatch period of the virtual vertical synchronization signal. The dispatch period of the virtual vertical synchronization signal is equal to the inverse of the dispatch frequency of the virtual vertical synchronization signal.

[0098] For example, the distribution frequency of the vertical synchronization signal is 60 Hz, the distribution frequency of the virtual vertical synchronization signal is 50 Hz, the time time for the current request for the virtual vertical synchronization signal is regarded as 0s, the next distribution time Time0 of the vertical synchronization signal is 0.017s, and the distribution period Period of the virtual vertical synchronization signal is 1÷50=0.02s, then the next distribution time Target of the virtual vertical synchronization signal is 0.017+{round[(0.017-0)÷0.02+0.5]}×0.02=0.037.

[0099] By adopting the technical solution of the embodiment of the present application, the next dispatch time of the virtual vertical synchronization signal is determined according to the next dispatch time of the vertical synchronization signal, so as to ensure that the processing time of the target layer coincides with the processing time of other layers driven by the vertical synchronization signal as much as possible, so as to ensure that the display of the target layer and other layers is as consistent as possible and avoid misalignment between the layers.

[0100] Based on the above technical solution, as an embodiment, processing the target layer of the application according to the virtual vertical synchronization signal may include: when the target layer is not drawn, drawing the target layer according to the virtual vertical synchronization signal; sending the virtual vertical synchronization signal to the layer synthesis service of the application, driving the layer synthesis service to perform synthetic display of the target layer.

[0101] The virtual vertical synchronization signal can be used to drive the drawing of the target layer on the one hand, and can drive the synthetic display of the target layer on the other hand.

[0102] When the application receives the virtual vertical synchronization signal, if the target layer has not been drawn, the application can respond to the virtual vertical synchronization signal and draw the target layer.

[0103] When the application receives the virtual vertical synchronization signal, if the target layer has not been drawn yet, it can also send the virtual vertical synchronization signal to the layer synthesis service of the application at the same time, so that the layer synthesis service is driven by the virtual vertical synchronization signal. After the target layer is drawn, the target layer is synthesized with other layers to obtain the user interface, and the user interface is displayed.

[0104] When an application receives a virtual vertical synchronization signal, if the target layer has been drawn, it can directly send the virtual vertical synchronization signal to the application's layer synthesis service, so that the layer synthesis service is driven by the virtual vertical synchronization signal to synthesize the target layer with other layers to obtain the user interface, and display the user interface.

[0105] By adopting the technical solution of the embodiment of the present application, the processing of the target layer is driven by the virtual vertical synchronization signal. When the target layer has not been drawn, the target layer can be drawn based on the virtual vertical synchronization signal, and the target layer can be synthesized and displayed. After the target layer has been drawn, the target layer can be synthesized and displayed directly based on the virtual vertical synchronization signal. In this way, the processing of the target layer does not need to be driven by the vertical synchronization signal, and the frame rate limit can be broken.

[0106] Based on the above technical solution, as an embodiment, the method may also include: when the screen refresh rate and the user interface frame rate of the application match, obtaining the next dispatch time of the vertical synchronization signal; when the next dispatch time of the vertical synchronization signal is reached, dispatching the vertical synchronization signal to the application.

[0107] The screen refresh rate matches the frame rate of the user interface of the application, indicating that the screen refresh rate matches the frame rate of each layer of the user interface of the application. At this time, it is only necessary to dispatch the vertical synchronization signal according to the native logic. The next dispatch time of the vertical synchronization signal is obtained from the system, and when the next dispatch time of the vertical synchronization signal is reached, the vertical synchronization signal is dispatched to the application, so that the application responds to the vertical synchronization signal, draws each layer, and synthesizes the display.

[0108] Among them, the vertical synchronization signal may include Vsync-app and Vsync-sf. The dispatch time of Vsync-app and Vsync-sf is consistent. Vsync-app is a vertical synchronization mechanism related to the application, which mainly focuses on the synchronization and coordination between the application's own graphics rendering output and the screen refresh, with the aim of allowing the screen frames generated by the application to better match the screen refresh rate, avoiding screen tearing, freezes and other phenomena that affect the visual experience. Vsync-sf is a vertical synchronization mechanism related to the layer synthesis service at the system level, which is used to control the layer synthesis service to perform layer synthesis and other operations according to the screen refresh rate, to ensure the synchronization and smoothness of multiple applications or interface elements at the entire system level when they are presented on the screen.

[0109] Vsync-app is dispatched to the application, and Vsync-sf is dispatched to the layer synthesis service of the application. The application responds to Vsync-app to draw each layer, and the layer synthesis service responds to Vsync-sf to synthesize and display each layer.

[0110] By adopting the technical solution of the embodiment of the present application, when the screen refresh rate and the user interface frame rate of the application match, the processing of the layers in the application still follows the native logic, ensuring that the user interface of the application can be displayed smoothly when the target layer does not exist.

[0111] Based on the above technical solution, as an embodiment, the method may further include: when the screen refresh rate and the user interface frame rate of the application do not match, and the application does not request to process the target layer according to the target frame rate, obtaining the next dispatch time of the vertical synchronization signal; when the next dispatch time of the vertical synchronization signal is reached, dispatching the vertical synchronization signal to the application.

[0112] In an application, if there is a target layer whose frame rate is inconsistent with that of other layers, but the application does not request to process the target layer according to the target frame rate, each layer can still be processed according to the native logic.

[0113] The next dispatching time of the vertical synchronization signal is obtained from the system, and when the next dispatching time of the vertical synchronization signal is reached, the vertical synchronization signal is dispatched to the application, so that the application responds to the vertical synchronization signal, draws each layer, and performs composite display.

[0114] Among them, the vertical synchronization signal may include Vsync-app and Vsync-sf. The dispatch time of Vsync-app and Vsync-sf is consistent. Vsync-app is a vertical synchronization mechanism related to the application, which mainly focuses on the synchronization and coordination between the application's own graphics rendering output and the screen refresh, with the aim of allowing the screen frames generated by the application to better match the screen refresh rate, avoiding screen tearing, freezes and other phenomena that affect the visual experience. Vsync-sf is a vertical synchronization mechanism related to the layer synthesis service at the system level, which is used to control the layer synthesis service to perform layer synthesis and other operations according to the screen refresh rate, to ensure the synchronization and smoothness of multiple applications or interface elements at the entire system level when they are presented on the screen.

[0115] Vsync-app is dispatched to the application, and Vsync-sf is dispatched to the layer synthesis service of the application. The application responds to Vsync-app to draw each layer, and the layer synthesis service responds to Vsync-sf to synthesize and display each layer.

[0116] By adopting the technical solution of the embodiment of the present application, when the application does not request to process the target layer according to the target frame rate, other layers can still be processed according to the native logic. In this way, the target layer and other layers can be processed in staggered periods of time to avoid frame loss or stuck frames caused by resource competition between the target layer and other layers.

[0117] Figure 2 2 is a flow chart of a layer processing method provided by an embodiment of the present application. In step S210, the application requests a vertical synchronization signal. The application requests a vertical synchronization signal according to the native logic of the system.

[0118] In step S220, determine whether the screen refresh rate matches the user interface frame rate of the application. The screen refresh rate and the user interface frame rate of the application match means that the screen refresh rate can be divided by the user interface frame rate of the application. Among them, because the user interface includes multiple layers, when determining whether the screen refresh rate and the user interface frame rate of the application match, it is actually necessary to determine whether the screen refresh rate and the frame rate of each layer of the user interface of the application match. When the screen refresh rate and the user interface frame rate of the application do not match, you can jump to step S230. When the screen refresh rate and the user interface frame rate of the application match, you can jump to step S290.

[0119] In step S230, it is determined whether the application requests to process the target layer at the target frame rate. The target frame rate required by the target layer is different from the frame rates required by other layers. When the application requests to process the target layer at the target frame rate, the process may jump to step S240. When the application does not request to process the target layer at the target frame rate, the process may jump to step S290.

[0120] In step S240, the time for the next virtual vertical synchronization signal to be sent is calculated. The next time for the virtual vertical synchronization signal to be sent can be determined according to the next time for the vertical synchronization signal to ensure that the target layer and other layers driven by the vertical synchronization signal will not be misaligned.

[0121] In step S250, when the time for the next virtual vertical synchronization signal to be dispatched arrives, the virtual vertical synchronization signal is dispatched. When the time for the next virtual vertical synchronization signal to be dispatched arrives, the virtual vertical synchronization signal is dispatched to the application so that the application processes the target layer according to the virtual vertical synchronization signal. Optionally, a timer can be set, and when the timer represents the time for the next virtual vertical synchronization signal to be dispatched, the virtual vertical synchronization signal is dispatched to the application.

[0122] In step S260, a virtual vertical synchronization signal is sent to the application program. When the application program receives the virtual vertical synchronization signal, if the target layer has not been drawn, the application program can respond to the virtual vertical synchronization signal and draw the target layer.

[0123] In step S270, it is determined whether the target layer has been drawn. When the application receives the virtual vertical synchronization signal, it can determine whether the target layer has been drawn. If the target layer has been drawn, it can jump to step S280.

[0124] In step S280, a virtual vertical synchronization signal is dispatched to a layer synthesis service. The virtual vertical synchronization signal is sent to the layer synthesis service of the application program to drive the layer synthesis service to perform synthesis display of the target layer.

[0125] In step S290, the time for sending the vertical synchronization signal next time is calculated. When the screen refresh rate matches the user interface frame rate of the application, it is only necessary to send the vertical synchronization signal according to the native logic.

[0126] In step S300, when the time for the next vertical synchronization signal is reached, the vertical synchronization signal is distributed. When the time for the next vertical synchronization signal is reached, the vertical synchronization signal is distributed to the application so that the application responds to the vertical synchronization signal to draw each layer and perform synthesis display.

[0127] In step S310, the application responds to the vertical synchronization signal to perform drawing. The application responds to Vsync-app to perform drawing of each layer.

[0128] In step S320, the layer composition service responds to the vertical synchronization signal to perform composition display. The layer composition service responds to Vsync-sf to perform composition display of each layer.

[0129] When an Android device is equipped with a high refresh rate screen, the screen itself has the ability to refresh the screen quickly. However, whether the application can output high frame rate images that match the high refresh rate screen depends on the optimization of the software itself and the performance of the device running the application. When the performance of the device is insufficient, the application cannot quickly generate enough images, resulting in a low frame rate, causing a high refresh rate and low frame rate situation.

[0130] For example, if the screen refresh rate is 120Hz, a new frame will be displayed every 8.33 milliseconds (1 second ÷ 120 times). If the application can only provide 30 frames per second due to performance limitations, the screen will not be updated at certain refresh times, resulting in discontinuity and freezes, affecting the overall fluency of the application.

[0131] By adopting the technical solution of the embodiment of the present application, the frame rate of the target layer is the target frame rate, which can break through the frame rate limit of the application. For example, the frame rate of the application is 60 frames per second, and the frame rate of the target layer can be 70 frames per second, because the drawing and synthetic display of the target layer are driven by the virtual vertical synchronization signal. Therefore, when the virtual vertical synchronization signal is 70 Hz, the target layer can generate 70 frames per second without being limited to 60 frames per second.

[0132] In order to better implement the layer processing method of the present application, the present application also provides a layer processing device based on the above layer processing method. The meanings of the terms are the same as those in the above layer processing method, and the specific implementation details can refer to the description in the method embodiment.

[0133] See also Figure 3 , Figure 3 : is a schematic diagram of the structure of a layer processing device provided in an embodiment of the present application, wherein the layer processing device comprises:

[0134] An acquisition module 301 is used to acquire a screen refresh rate and a user interface frame rate of an application program;

[0135] A determination module 302, configured to determine whether the application requests to process a target layer according to a target frame rate when the screen refresh rate does not match the user interface frame rate of the application;

[0136] The dispatching module 303 is used to dispatch a virtual vertical synchronization signal to the application when the application requests to process the target layer according to the target frame rate; the dispatching frequency of the virtual vertical synchronization signal matches the target frame rate;

[0137] The processing module 304 is used to process the target layer of the application according to the virtual vertical synchronization signal.

[0138] In one embodiment, the dispatch module 303 includes:

[0139] A time acquisition unit, used to acquire the next distribution time of the vertical synchronization signal;

[0140] A time determination unit, configured to determine a next distribution time of the virtual vertical synchronization signal according to a next distribution time of the vertical synchronization signal;

[0141] The dispatching unit is used to dispatch the virtual vertical synchronization signal to the application when the next dispatching time of the virtual vertical synchronization signal arrives.

[0142] In one embodiment, the time determination unit includes:

[0143] The time determination subunit is used to determine the next distribution time of the virtual vertical synchronization signal according to the following formula:

[0144] Target=Time0+round((time-Time0) / Period+0.5)*Period;

[0145] Among them, the Target is the next distribution time of the virtual vertical synchronization signal, the Time0 is the next distribution time of the vertical synchronization signal, round means rounding, time means the time of the current request for the virtual vertical synchronization signal, and Period means the distribution period of the virtual vertical synchronization signal.

[0146] In one of the embodiments, after obtaining the screen refresh rate and the user interface frame rate of the application, the apparatus further includes:

[0147] A frame rate determination module, used to determine the frame rate of each layer of the user interface of the application;

[0148] The target layer determination module is used to determine the layer whose frame rate does not match the screen refresh rate as the target layer when the frame rate of any layer does not match the screen refresh rate.

[0149] In one embodiment, the processing module 304 includes:

[0150] A drawing unit, configured to draw the target layer according to the virtual vertical synchronization signal when the target layer is not drawn;

[0151] The synthesis display unit is used to send the virtual vertical synchronization signal to the layer synthesis service of the application program, and drive the layer synthesis service to perform synthesis display of the target layer.

[0152] In one embodiment, the device further comprises:

[0153] A first acquisition module, used for acquiring the next dispatch time of a vertical synchronization signal when the screen refresh rate matches the user interface frame rate of the application;

[0154] The first dispatching module is used to dispatch the vertical synchronization signal to the application when the next dispatching time of the vertical synchronization signal arrives.

[0155] In one embodiment, the device further comprises:

[0156] A second acquisition module is used to acquire the next dispatch time of the vertical synchronization signal when the screen refresh rate does not match the user interface frame rate of the application and the application does not request to process the target layer according to the target frame rate;

[0157] The second dispatching module is used to dispatch the vertical synchronization signal to the application when the next dispatching time of the vertical synchronization signal arrives.

[0158] By adopting the technical solution of the embodiment of the present application, when the screen refresh rate matches the frame rate of the user interface of the application, it is proved that the frame rates of each layer in the application match the screen refresh rate. Therefore, it is only necessary to determine whether the application requests to process the target layer according to the target frame rate when the screen refresh rate and the frame rate of the user interface of the application do not match, so as to save computing resources. When the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal matching the target frame rate is dispatched to the application, so that the application processes the target layer according to the virtual vertical synchronization signal, and ensures that the drawing and synthetic display of the target layer are processed uniformly, thereby improving the smoothness of the picture and optimizing the user's visual experience. In addition, the processing of the target layer is driven by the virtual vertical synchronization signal, and the dispatch frequency of the virtual vertical synchronization signal is not limited by the frame rate of the user interface of the application. Therefore, the processing of the target layer can break through the frame rate limit of the user interface of the application, making the display of the target layer more natural and smooth.

[0159] The specific definition of the layer processing device can be found in the definition of the layer processing method above, which will not be repeated here. Each module in the above-mentioned layer processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0160] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0161] The electronic device may include one or more processors 401 of processing cores and one or more computer-readable storage media memories 402 and other components. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0162] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0163] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0164] In one embodiment, the electronic device further includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.

[0165] In one embodiment, the electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0166] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby implementing the steps in any layer processing method provided in the embodiments of the present application.

[0167] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0168] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.

[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present application is implemented.

[0170] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the method described in any embodiment of the present application when executed by a processor.

[0171] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0172] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0173] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any layer processing method provided in the present application.

[0174] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0175] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0176] Since the instructions stored in the computer-readable storage medium can execute the steps in any layer processing method provided in the present application, the beneficial effects that can be achieved by any layer processing method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0177] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0178] The above is a detailed introduction to a layer processing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A layer processing method, characterized in that: include: Get the screen refresh rate and the application's UI frame rate; When the screen refresh rate does not match the user interface frame rate of the application, determining whether the application requests to process the target layer according to the target frame rate; When the application requests to process the target layer according to the target frame rate, a virtual vertical synchronization signal is dispatched to the application; the dispatch frequency of the virtual vertical synchronization signal matches the target frame rate; The target layer of the application is processed according to the virtual vertical synchronization signal.

2. The method according to claim 1, characterized in that The sending of the virtual vertical synchronization signal to the application comprises: Get the next distribution time of the vertical synchronization signal; Determining the next delivery time of the virtual vertical synchronization signal according to the next delivery time of the vertical synchronization signal; When the next distribution time of the virtual vertical synchronization signal arrives, the virtual vertical synchronization signal is distributed to the application.

3. The method according to claim 2, characterized in that The step of determining the next delivery time of the virtual vertical synchronization signal according to the next delivery time of the vertical synchronization signal includes: The next distribution time of the virtual vertical synchronization signal is determined according to the following formula: Target=Time0+round((time-Time0) / Period+0.5)*Period; Among them, the Target is the next distribution time of the virtual vertical synchronization signal, the Time0 is the next distribution time of the vertical synchronization signal, round means rounding, time means the time of the current request for the virtual vertical synchronization signal, and Period means the distribution period of the virtual vertical synchronization signal.

4. The method according to claim 1, characterized in that: After acquiring the screen refresh rate and the user interface frame rate of the application, the method further includes: Determining the frame rate of each layer of the user interface of the application; When the frame rate of any of the layers does not match the screen refresh rate, the layer whose frame rate does not match the screen refresh rate is determined as the target layer.

5. The method according to claim 1, characterized in that The step of processing the target layer of the application according to the virtual vertical synchronization signal comprises: When the target layer is not drawn, drawing the target layer according to the virtual vertical synchronization signal; The virtual vertical synchronization signal is sent to the layer synthesis service of the application program, and the layer synthesis service is driven to perform synthesis display of the target layer.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the screen refresh rate matches the user interface frame rate of the application, obtaining the next dispatch time of the vertical synchronization signal; When the next distribution time of the vertical synchronization signal arrives, the vertical synchronization signal is distributed to the application.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the screen refresh rate does not match the user interface frame rate of the application, and the application does not request to process the target layer according to the target frame rate, obtaining the next dispatch time of the vertical synchronization signal; When the next distribution time of the vertical synchronization signal arrives, the vertical synchronization signal is distributed to the application.

8. A layer processing device, characterized in that: include: The acquisition module is used to obtain the screen refresh rate and the user interface frame rate of the application; A determination module, used for determining whether the application requests to process the target layer according to the target frame rate when the screen refresh rate does not match the user interface frame rate of the application; A dispatching module, configured to dispatch a virtual vertical synchronization signal to the application when the application requests to process the target layer according to the target frame rate; the dispatching frequency of the virtual vertical synchronization signal matches the target frame rate; A processing module is used to process the target layer of the application according to the virtual vertical synchronization signal.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the layer processing method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the layer processing method according to any one of claims 1 to 7 are implemented.