CN113805983A - Method for adjusting window refresh rate and electronic equipment - Google Patents

Method for adjusting window refresh rate and electronic equipment Download PDF

Info

Publication number
CN113805983A
CN113805983A CN202010937431.6A CN202010937431A CN113805983A CN 113805983 A CN113805983 A CN 113805983A CN 202010937431 A CN202010937431 A CN 202010937431A CN 113805983 A CN113805983 A CN 113805983A
Authority
CN
China
Prior art keywords
window
refresh rate
windows
determining
rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010937431.6A
Other languages
Chinese (zh)
Other versions
CN113805983B (en
Inventor
夏兵
刘聪
李杰纯
张威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202010937431.6A priority Critical patent/CN113805983B/en
Publication of CN113805983A publication Critical patent/CN113805983A/en
Application granted granted Critical
Publication of CN113805983B publication Critical patent/CN113805983B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The application relates to the technical field of terminals, and provides a method for adjusting a window refresh rate and an electronic device, wherein the method comprises the following steps: determining a plurality of windows in a foreground; acquiring attribute information and a current refresh rate of each window; determining a target refresh rate of each window according to the attribute information; and for any window, if the current refresh rate of the window is different from the target refresh rate, notifying the target refresh rate to the window. According to the embodiment of the application, the system load increase caused by simultaneous rendering of a plurality of windows can be avoided by adjusting the refresh rate of the windows.

Description

Method for adjusting window refresh rate and electronic equipment
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for adjusting a window refresh rate and an electronic device.
Background
With the rapid development of multi-device cooperation and distributed scenes, a trend that a plurality of windows are displayed simultaneously appears on the terminal device. When a current graphic display system framework, for example, an Android (Android) graphic display system framework, displays a plurality of windows simultaneously, each window generally renders and generates an interface separately according to a refresh frequency of a system display device, and then the system performs pixel synthesis on each interface. When the display areas of the windows are partially overlapped, because each window is rendered in an independent process, the window does not know whether the window is shielded by other windows or not, each window is still periodically refreshed and rendered according to the refresh rate of the window, and then the window is finally displayed and is subjected to superposition processing or even clipping processing.
Disclosure of Invention
The embodiment of the application provides a method for adjusting a window refresh rate and electronic equipment, which can solve the technical problems that a plurality of windows simultaneously render a complete interface to cause load increase and waste of system resources.
In a first aspect, an embodiment of the present application provides a method for adjusting a window refresh rate, including:
determining a plurality of windows in a foreground;
acquiring attribute information and a current refresh rate of each window;
determining a target refresh rate of each window according to the attribute information;
and for any window, if the current refresh rate of the window is different from the target refresh rate, notifying the target refresh rate to the window.
According to the embodiment of the first aspect, the refresh rate of the window can be adjusted through the attribute information of each window, and the increase of the system load caused by simultaneous rendering of a plurality of windows is avoided.
In one possible implementation manner of the first aspect, the attribute information includes one or more of display content, window size, window position, Z-axis order, window transparency, application type, and user interaction data.
In a possible implementation manner of the first aspect, the determining, according to the attribute information, a target refresh rate of each window includes:
determining a target refresh rate of each window according to the Z-axis sequence of each window; or the like, or, alternatively,
determining a target refresh rate of each window according to the transparency of each window; or the like, or, alternatively,
determining the shielding rate of each window according to the Z-axis sequence, the size and the position of each window, and determining the target refresh rate of each window according to the shielding rate of each window; or the like, or, alternatively,
determining the shielding rate of each window according to the Z-axis sequence, the size and the position of each window, and determining the target refresh rate of each window according to the shielding rate and the transparency of each window; or the like, or, alternatively,
determining whether each window has user interaction operation according to the user interaction data of each window, and determining the target refresh rate of each window according to whether each window has user interaction operation; or the like, or, alternatively,
determining a target refresh rate of each window according to the application type of each window; or the like, or, alternatively,
and determining the target refresh rate of each window according to the display content of each window.
In the implementation manner, on one hand, the target refresh rate can be obtained through simple processing, so that the method is easy to implement; on the other hand, the target refresh rate can be obtained in different modes, so that the method and the device can be suitable for different scenes and have stronger environmental adaptability.
In a possible implementation manner of the first aspect, the determining a target refresh rate of each window according to the Z-axis sequence of each window includes:
if the Z-axis sequence of any window is smaller than or equal to a preset value, determining that the target refresh rate of the window keeps the current refresh rate;
and if the Z-axis sequence of any window is greater than the preset value, determining that the target refresh rate of the window is a first refresh rate, wherein the first refresh rate is less than the reference refresh rate.
In a possible implementation manner of the first aspect, the determining a target refresh rate of each window according to the occlusion rate of each window includes:
and determining a proportional interval to which the shielding rate of any window belongs, acquiring a reduction ratio corresponding to the proportional interval, and determining the target refresh rate of the window according to the reduction ratio and the reference refresh rate, wherein the larger the shielding rate is, the larger the reduction ratio corresponding to the shielding rate is.
In a possible implementation manner of the first aspect, the determining a target refresh rate of each window according to an application type of each window includes:
and determining the application type of any window, and acquiring a target refresh rate corresponding to the application type.
In a possible implementation manner of the first aspect, the determining a target refresh rate of each window according to the display content of each window includes:
and aiming at any one window, determining the display content of the window, and acquiring a target refresh rate corresponding to the display content.
In these present implementations, the target refresh rate can be obtained simply and quickly, making the present application easy to implement.
In a possible implementation manner of the first aspect, the determining multiple windows in the foreground includes:
receiving a first operation input by a user, or monitoring that the display state of the system changes, or monitoring that the application state of the foreground changes, and determining a plurality of windows in the foreground.
In a possible implementation manner of the first aspect, the method further includes:
and for any one window, if the window is determined not to need to be refreshed for the current vertical synchronization request VSYNC according to the current refresh rate of the window, multiplexing the cache content of one frame on the window in the window drawing process.
In this implementation manner, in the case that the refresh rate of a certain application is reduced, the application may not need to perform interface refresh every time VSYNC is received, the surface flicker may multiplex the cache content of the previous frame, and the load and power consumption of the system are reduced by reducing the content of refresh every time.
In a possible implementation manner of the first aspect, the method further includes:
if a plurality of windows which do not need to be refreshed according to the current refresh rate of each window are determined, the plurality of windows which do not need to be refreshed are combined into one first window.
In the implementation mode, on the premise of not influencing user experience, the display content of the application window with the lowered frequency of a part is pre-synthesized to one layer, so that the purpose of reducing layer processing is achieved, the overall load of a system is reduced, the fluency of the system is improved, and the system endurance time of the terminal is prolonged.
In a possible implementation manner of the first aspect, the method further includes:
if a plurality of windows which do not need to be refreshed for the current VSYNC are determined according to the current refresh rate of each window, and the plurality of windows which do not need to be refreshed are combined into one first window, the cache content of one frame on the first window is multiplexed in the drawing process of the plurality of windows which do not need to be refreshed.
In a possible implementation manner of the first aspect, the method further includes:
and determining whether the display content of each window is changed or not, and combining a plurality of windows of which the display content is not changed into one first window when a plurality of windows of which the display content is not changed by the VSYNC is determined according to the current vertical synchronization request.
In a possible implementation manner of the first aspect, the method further includes:
if a plurality of windows of which the display content is not changed by the current VSYNC are determined according to the current refresh rate of each window, and the plurality of windows of which the display content is not changed are synthesized into a first window, the cache content of a frame on the first window is multiplexed in the drawing process of the plurality of windows of which the display content is not changed.
In a possible implementation manner of the first aspect, before determining the target refresh rate of each window according to the attribute information, the method further includes:
and acquiring a second refresh rate of the display screen as a reference of the target refresh rate.
In a second aspect, corresponding to the method for adjusting the window refresh rate provided in the first aspect, there is provided an apparatus for adjusting the window refresh rate, the apparatus comprising:
a first determining module, configured to determine a plurality of windows in a foreground;
the acquisition module is used for acquiring the attribute information and the current refresh rate of each window;
a second determining module, configured to determine a target refresh rate of each of the windows according to the attribute information;
and the notification module is used for notifying the target refresh rate to any window if the current refresh rate of the window is different from the target refresh rate.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program, so that the electronic device implements the method according to any one of the first aspect and possible implementation manners of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspect and possible implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on an electronic device, causes the electronic device to execute the method described in any one of the foregoing first aspect and possible implementations of the first aspect.
It is to be understood that the beneficial effects of the second to fifth aspects can be seen from the related descriptions in the first aspect and the possible implementation manners of the first aspect.
Drawings
FIG. 1A is a schematic view of a multi-window simultaneous display according to an embodiment of the present application;
FIG. 1B is another schematic diagram of a multi-window simultaneous display provided by another embodiment of the present application;
FIG. 2 is a diagram illustrating a multi-window rendering process before optimization according to an embodiment of the present application;
FIG. 3A is a diagram illustrating an optimized multi-window rendering process according to an embodiment of the present application;
FIG. 3B is an application scenario provided by an embodiment of the present application;
FIG. 3C is a schematic diagram illustrating a pre-optimization and post-optimization multi-window rendering process according to an embodiment of the present application;
FIG. 3D is another comparative schematic diagram of a multi-window rendering process before and after optimization according to an embodiment of the present application;
FIG. 3E is a diagram illustrating an optimized multi-window rendering process according to another embodiment of the present application;
FIG. 3F is a diagram illustrating an optimized multi-window rendering process according to another embodiment of the present application;
FIG. 3G is a diagram illustrating an optimized multi-window rendering process according to another embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5A is a first application scenario of a method for adjusting a window refresh rate according to an embodiment of the present application;
fig. 5B is a first application scenario of a method for adjusting a window refresh rate according to an embodiment of the present application;
fig. 6A is a second application scenario of a method for adjusting a window refresh rate according to an embodiment of the present application;
fig. 6B is a second application scenario of the method for adjusting the window refresh rate according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a method for adjusting a window refresh rate according to an embodiment of the present disclosure;
fig. 8 is an application scenario in which two windows are displayed in an overlapping manner according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise.
It should also be understood that in the embodiments of the present application, "a plurality" and "one or more" mean one, two or more; "and/or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when.. or" upon "or" in response to a determination "or" in response to a detection ".
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In order to better understand the technical solution of the present application, the important technical terms related to the present application will be introduced.
Window or picture layer
Each application may correspond to one or more graphical interfaces, each of which may be referred to as a layer (surface), or window (window). For example, fig. 1A is a schematic display diagram of a multi-window simultaneous display. In fig. 1A, three different areas filled with different lines correspond to three different surfaces, i.e., surface a, surface B, and surface C. There is an overlap between the three surfaces. In the schematic shown in FIG. 1A, surface B covers surface A, and surface C covers both surface A and surface B.
Size of the layer
The size of the layer refers to the display area of the layer, and reflects the size of a display area occupied by the layer when the layer is displayed on a display screen. The size of the layer is usually determined by two parameters, the width and the height of the layer. The width of the layer is multiplied by the height, and the size of the layer can be obtained.
Position of the layers
The position of the layer refers to the display position of the layer on the display screen. In general, the start position of the layer is represented by the coordinates of the upper left corner or the lower left corner of the layer. The coordinates of the top left or bottom left corner of the layer are typically pixel coordinates.
It should be noted that when the width, height and position of the layer are determined, which area (including the number of occupied pixels and the coordinates of the occupied pixels) of the display screen the layer is displayed in is determined.
Transparency of layer
The transparency of the layer refers to the transparency degree of the layer, and influences the overlapping effect of the layer and other layers. In order to not completely shield the layer positioned below, the layer positioned above can be provided with a certain transparency, so that the superposition display effect of a plurality of layers can be seen simultaneously. Transparency is generally expressed in percent and ranges from 0 to 1. With continued reference to the schematic diagram shown in fig. 1A, the transparency of surface B and surface C is 0%, and both surface B and surface C belong to non-transparent windows.
Z-axis sequence (Z-order)
The Z-order is called Z-order for short, a Z-axis is arranged in the direction perpendicular to the plane of the display screen, and the front-back order of different layers is determined according to the coordinates on the Z-axis, and the order is called Z-order. The smaller the Z-axis sequence of the layer is, the more front the layer is displayed, namely the more upper the layer is displayed; the larger the Z-axis sequence of the layers is, the more backward the layers are displayed, that is, the more downward the layers are displayed.
With continued reference to the schematic diagram shown in FIG. 1A, the Z-order of surface C is 0, the Z-order of surface B is 1, and the Z-order of surface A is 2. surface C is displayed first on the display screen. surface A is displayed most back on the display screen, and surface B is displayed between surface A and surface C. The graphical display system controls the display of the three windows A, B and C on the display screen by maintaining the Z sequence of the three windows.
Application type
The terminal application and the web application can be used in the electronic device, and in the embodiment of the application, the application can include the terminal application or the web application. The terminal applications may include native applications of the system, and may also include third party applications. The terminal application can be downloaded, installed or managed in the application market. In some embodiments of the present application, applications may be classified according to the type of service they provide. For example, application types include, but are not limited to: tools, instant messaging, education, news reading, video or navigation, etc. As another example, application types include, but are not limited to: utility, audio-visual entertainment, social communication, education, news reading, shooting beautification, or travel navigation, etc. The application types are specifically divided into several categories without limitation, and different classification modes can be adopted according to different actual conditions.
In order to explain the technical means of the present application, the following description will be given by way of specific examples.
With the improvement of the performance of the equipment and the continuous enhancement of the application function, the application scenes of games, live broadcast, video call, meetings or video playing and the like are more and more abundant. More and more applications are beginning to support multiple foreground multiple window modes, such as split screen mode, free mode, and picture-in-picture.
At present, when the display areas of the windows are partially overlapped, because each window is rendered in an independent process, the window does not know whether the window is shielded by other windows or not, and no matter the content displayed in the window needs to be refreshed or the user does not sense the window, and the like, each window is periodically refreshed and rendered according to the refresh rate of the window to form a complete interface. And then, when the display is finally carried out, the superposition processing and even the cutting processing are carried out. The simultaneous rendering of a complete interface by multiple windows results in increased load and wasted system resources.
As a non-limiting example, an Android graphics display system framework is used for illustration.
The Android interface is usually formed by overlapping layers of a plurality of areas, such as a navigation bar, a status bar, a foreground application, a floating window and the like. For example, as shown in fig. 1B, an Android interface is formed by superimposing a layer E, a layer F, and a layer G. And the layer E is a system window. Layer F is a window of the first application. And the layer G is a window of the second application.
The display of one interface in the Android system needs to go through the stages of interface drawing, interface rendering and display refreshing. Fig. 2 is a schematic diagram illustrating a drawing process of an Android interface in an Android system. In this example, the example is described with an example in which the Android interface includes three application interfaces that are displayed simultaneously, and each application interface includes one layer or window.
As shown in fig. 2, the multi-window drawing process may include the following 8 key steps:
1) the system sends a Vertical Synchronization (VSYNC) signal.
2) And after receiving VSYNC, the nth application, namely App [ n ], refreshes the content of the window of the application to the rendering thread of the application, namely RendThread [ n ]. Wherein n is 1,2 and 3.
3) Each application's RenderThread [ n ] generates a corresponding set of rendering instructions, Rc [ n ], from the contents of a User Interface (UI).
4) OpenGL converts the rendering instruction set of the nth application into OpenGL instructions and sends them to a windowing system (surface flicker).
5) The SurfaceFlinger distributes and caches the application interface drawing instructions, refreshes the instructions as needed, and then sends the contents to a Hardware mixer (Hardware Composer, HWC) after the contents are rearranged.
6) The HWC sends the Buffer content to a Display subsystem (MDSS), or a Graphics Processing Unit (GPU).
7) MDSS or GPU carries out rendering operation.
8) The MDSS or GPU renders the rendered content to a display screen or display device (FBx) for display.
It can be seen that each window is rendered in an independent process, and under the condition that the content displayed in the window does not need to be refreshed or the user does not perceive the window, the windows are periodically refreshed and rendered according to respective refresh rates to form a complete interface.
Due to the complex interface and uncontrollable content of the application, different applications are usually refreshed at the highest refresh rate set by the system, which causes the load of the system to become more heavy. Especially, under the conditions of refresh drawing with high interface complexity or no perception of the user, the system load is too high, the drawing time is long, and frame loss can be caused.
Therefore, the embodiment of the application provides a method for adjusting the window refresh rate, which dynamically adjusts the refresh rate of a plurality of foreground windows to reduce the load of a display scene and reduce the time consumption for drawing an interface.
By using the method for adjusting the window refresh rate provided by the embodiment of the application, the drawing processes of a plurality of foreground windows can be optimized.
As a non-limiting example of the present application, a drawing process of multiple optimized foreground windows, taking an Android system as an example, is shown in fig. 3A. It should be understood that other imaging systems may also be suitable.
As shown in fig. 3A, the multi-window rendering process may include the following 9 key steps:
1) the system sends a VSYNC signal.
2) The system is additionally provided with a dynamic adjustment and refresh module, the module dynamically calculates the refresh rate of each application interface after adjustment, and the module informs the corresponding application of the adjusted refresh rate. Some applications may require a reduced refresh rate for certain regulatory strategies. For the current VSYNC, if it is determined that an application needs or allows to refresh the interface according to the adjusted refresh rate, the application performs the step of refreshing the interface, that is, performs steps 3) to 5). If it is determined that an application does not allow or need to refresh the interface according to the adjusted refresh rate for the current VSYNC, the application skips the step of refreshing the interface, that is, skips steps 3) to 5). In the following embodiments, how the dynamically adjusting refresh module dynamically calculates the adjusted refresh rate will be described in detail, and details thereof are not repeated herein.
3) And after receiving the notification comprising the adjusted refresh rate, the nth application, namely App [ n ], judging whether the interface needs to be refreshed aiming at the VSYNC at the current time according to the adjusted refresh rate, if so, refreshing the content of the window of the application per se and sending the content to the rendering thread of the application per se, namely RendThread [ n ]. Wherein n is 1,2 and 3.
4) The RenderThread [ n ] of the nth application generates a corresponding rendering instruction set, Rc [ n ], based on the contents of the User Interface (UI).
5) OpenGL converts the rendering instruction set of the nth application into OpenGL instructions and sends them to a windowing system (surface flicker).
6) For the application allowing the interface to be refreshed, the surfaceFlinger performs distributed caching on the three application interface drawing instructions again, and refreshes the instructions as required; for applications that do not allow the interface to be refreshed, the SurfaceFlinger multiplexes the cached content of a frame on the application interface. The surfafinger then sends the content to a Hardware mixer (Hardware Composer, HWC) after it has been rearranged.
7) The HWC sends the Buffer content to a Display subsystem (MDSS), or a Graphics Processing Unit (GPU).
8) MDSS or GPU carries out rendering operation.
9) The MDSS or GPU renders the rendered content to a display screen or display device (FBx) for display.
It should be noted that, in some other examples, the application may also invoke the system interface to actively obtain the adjustment result of the dynamic adjustment refresh module, and determine whether the refresh rate of the application needs to be updated, so as to determine whether the interface refresh of this time needs to be executed. Rather than passively receiving refresh notifications for the module as described above.
In some other examples, the result of dynamically adjusting the refresh module to notify the surface flunger of whether the refresh rate needs to be adjusted or not may also be that the surface flunger updates the refresh rate of the application that needs to adjust the refresh rate, and the application that needs to adjust the refresh rate refreshes the interface according to the new refresh rate.
After the method for adjusting the window refresh rate provided by the embodiment of the application is used for optimization, the drawing processes of a plurality of foreground windows do not need to perform interface refreshing every time a VSYNC is received by an application under the condition that the refresh rate of the application is reduced, and the cache content of the previous frame can be multiplexed by the SurfaceFlinger, so that the load and the power consumption of a system are reduced.
The principle of the optimized drawing scheme is described below by taking a user scene on a tablet computer as an example, so that the beneficial effects brought by the embodiment of the application can be better understood.
As shown in fig. 3B, a user scene of window a and window B is displayed superimposed on the tablet computer. Window a is the interface of the instant messaging application, and the user is using the instant messaging application to chat with a friend. Window B is the interface of the video application. The user opens the chat window A due to the temporary meeting time with friends, the window B is temporarily placed behind the window A, and the user may need to continue browsing the content of the window B later.
Because the window B is positioned at the lower layer of the window A, in the optimized drawing process, a newly added dynamic adjustment and refresh module of the system calculates that the window A can maintain the current refresh rate, such as 60Hz, namely the window A does not need to adjust the refresh rate; the refresh rate of window B needs to be adjusted, and the refresh rate of window B needs to be adjusted to a target refresh rate, for example, 30 Hz. And the dynamic adjustment refreshing module informs the video application of the adjusted refreshing rate.
Fig. 3C and 3D are schematic diagrams showing a comparison of the rendering flow before and after optimization. Referring to fig. 3C and fig. 3D, when the 2 nd refresh period comes, that is, when the system sends the 2 nd VSYNC, the video application determination window B does not need to be refreshed, and the instant messaging application determination window a needs to be refreshed. For the window B, the 2 nd frame of the surface flag can multiplex the buffer content of the 1 st frame, thereby reducing the load and power consumption of the system. And the original drawing process is still maintained for the window a.
Specifically, as shown in fig. 3C, the black dashed box includes the interface refreshing of the window B, rendering instruction generation, OpenGL instruction conversion, surface flinger composition, and other flows. In the optimized schematic diagram shown in fig. 3C, since the window B is not refreshed in the frame 2, the cache content stored in the frame 1 can be used, and the processing flows of the CPU, the GPU, and the like in the frame 2 are reduced, thereby reducing the load of the entire device and reducing the power consumption.
According to the embodiment of the application, on the premise that user experience is not influenced, the refresh rate of part of application windows is reduced, under the condition that the refresh rate of system display equipment is kept unchanged, the overall load of a system is reduced by reducing the content refreshed at each time, the fluency of the system is improved, and the system endurance time of the terminal is prolonged.
On the basis of the embodiment shown in fig. 3A, in other embodiments of the present application, the electronic device may monitor a current layer composite load condition of the electronic device, and if it is determined that the layer composite load is greater than or equal to the first threshold, may decide to trigger the dynamic adjustment refresh module, and dynamically adjust the refresh rate of the application window, so as to reduce the load. If it is determined that the layer composition load is smaller than the first threshold, it may be decided not to trigger the dynamic adjustment refresh module, that is, it is not necessary to dynamically adjust the refresh rate of the application window, and the electronic device adopts an original multi-window display flow, that is, the multi-window display flow shown in fig. 2.
It should be noted that the first threshold may be an empirical value. The setting may be set by default of the system or may be set by user-defined, which is not limited in the present application.
As another non-limiting example of the present application, the present example provides another multi-window drawing process, as shown in FIG. 3E. This example differs from the example shown in fig. 3A, only the differences between this example and the example shown in fig. 3A are shown in fig. 3E, and the same thing please refer to the example shown in fig. 3A described earlier.
In this example, for the current VSYNC, if it is determined that an application needs or allows to refresh the interface according to the adjusted refresh rate, the application performs the step of refreshing the interface, that is, sequentially performs step 3) to step 5) of the example shown in fig. 3A. For the current VSYNC, if it is determined that multiple applications do not allow or need to refresh the interface according to the adjusted refresh rate, different from the example shown in fig. 3A, these applications are unified into one back-end window. That is, several windows that do not need to be refreshed are processed into one layer cache.
As shown in fig. 3E, for the current VSYNC, it is determined that the windows of the application interface 1 and the application interface 2 do not need to be refreshed according to the adjusted refresh rate, a corresponding rendering instruction set is generated according to the content of the user interface synthesized by the two windows, and OpenGL converts the rendering instruction set into an OpenGL instruction and sends the OpenGL instruction to the surface flag. And determining that the window of the application interface 3 needs to be refreshed, generating a corresponding rendering instruction set according to the content of the user interface of the application interface 3, converting the rendering instruction set into an OpenGL instruction by OpenGL, and sending the OpenGL instruction to a surface flag. And the surfaceFlinger distributes and caches the two OpenGL drawing instructions again and refreshes the instructions as required.
According to the method, the display content of the application window with the lowered frequency is pre-synthesized to one layer on the premise of not influencing user experience through dynamically counting the change condition of the display window in the system, so that the purpose of reducing layer processing is achieved, the overall load of the system is reduced, the fluency of the system is improved, and the system endurance time of the terminal is prolonged.
It should be noted that, for the next VSYNC, if the application that does not need to be refreshed is the previous application, since the applications have already been synthesized into one back-end window when receiving the last VSYNC, it is not necessary to uniformly synthesize one back-end window for the applications, and the surfefinger may reuse the cache content of the last frame of the back-end window, thereby further reducing the load and power consumption of the system. Reference may be made to the corresponding description of the example shown in fig. 3A.
Based on the embodiment shown in fig. 2 or fig. 3A, in other embodiments of the present application, the electronic device may monitor whether display contents of a plurality of windows currently displayed are changed, and if it is determined that the display contents of the plurality of windows are not changed, combine the plurality of applications that are not changed into one backend window. That is, several windows whose display contents are changed are treated as a background image and processed as a layer buffer.
As shown in fig. 3F, it is determined that the display contents of the windows of the application interface 1 and the application interface 2 are not changed, a corresponding rendering instruction set is generated according to the contents of the user interface obtained by synthesizing the two windows, and OpenGL converts the rendering instruction set into an OpenGL instruction and sends the OpenGL instruction to the surface flag. And determining that the display content of the window of the application interface 3 is changed, generating a corresponding rendering instruction set according to the content of the user interface of the application interface 3, converting the rendering instruction set into an OpenGL instruction by OpenGL, and sending the OpenGL instruction to the surface flag. And the surfaceFlinger distributes and caches the two OpenGL drawing instructions again and refreshes the instructions as required.
It should be noted that, on the basis of the example shown in fig. 3F, if an application with unchanged display content is an application with unchanged display content for a next VSYNC, because the applications have already been synthesized into a backend window when receiving the last VSYNC, it may not be necessary to uniformly synthesize a backend window for the applications, and the surfafinger may reuse the cache content of a frame on the backend window, thereby further reducing the load and power consumption of the system. Reference may be made to the corresponding description of the example shown in fig. 3A.
On the basis of the embodiment shown in fig. 2 or fig. 3E, in other embodiments of the present application, the electronic device may count a refresh condition of a current system window, and/or monitor a current layer composite load condition of the electronic device, and if it is determined that the current system starts dynamic adjustment of a refresh rate, and/or it is determined that the layer composite load is greater than or equal to a first threshold, may decide to trigger a layer preprocessing control device, and the layer preprocessing control device may obtain a window list to be synthesized, for example, a list of multiple windows displayed by the electronic device, and perform a preprocessing decision.
Taking an example of determining that the current system starts dynamic adjustment of the refresh rate, at this time, the layer preprocessing control device is triggered. The layer preprocessing control device comprises two branches after acquiring a window list to be synthesized and carrying out preprocessing decision. In the first branch, if the layer preprocessing control device determines that the refresh rates of several windows are reduced, the several windows with reduced refresh rates are used as pre-synthesized windows, and the pre-synthesized windows are uniformly processed into a layer cache, such that two windows of the application interface 1 and the application interface 2 shown in fig. 3E are synthesized into a back-end window. In the second branch, if the refresh rate of one or more windows is not changed, for example, the refresh rate of a focus window or a window with frequent user interaction may be maintained, the windows are respectively processed into layer caches according to the original flow, such as the window of the application interface 3 shown in fig. 3E. And finally, all the layers are cached, synthesized and sent to the display.
On the basis of the embodiments shown in fig. 2 or fig. 3F, in other embodiments of the present application, as shown in fig. 3G, the electronic device may count a change condition of a current system window, and/or monitor a current layer composite load condition of the electronic device, and if it is determined that the current system includes a plurality of windows whose display contents are not changed, and/or it is determined that the layer composite load is greater than or equal to a first threshold, may decide to trigger the layer preprocessing control device, trigger the layer preprocessing control device to obtain a window list to be synthesized, where the window list to be synthesized is, for example, a list of a plurality of windows displayed by the electronic device, and make a preprocessing decision.
Specifically, the layer preprocessing control device obtains a window list to be synthesized and carries out preprocessing decision, and the method comprises two branches. In the first branch, if the layer preprocessing control device determines that the display contents of multiple windows are not changed, the multiple windows with unchanged display contents are used as pre-synthesized windows, and the pre-synthesized windows are processed into a layer cache in a unified manner, such that two windows of the application interface 1 and the application interface 2 shown in fig. 3F are synthesized into a back-end window. In the second branch, if there is a change in the display content of one or more windows, for example, a focus window or a window frequently changed due to frequent user interaction, the windows are respectively processed into layer caches according to the original flow, such as the window of the application interface 3 shown in fig. 3F. And finally, all the layers are cached, synthesized and sent to the display.
The method for adjusting the window refresh rate according to the embodiment of the present application will be described in detail below.
The method for adjusting the window refresh rate provided by the embodiment of the application can be applied to electronic devices, including but not limited to mobile phones, wearable devices, vehicle-mounted devices, Augmented Reality (AR)/Virtual Reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, tablet computers, smart speakers, Set Top Boxes (STBs), televisions, and the like. The embodiment of the present application does not set any limit to the specific type of the electronic device.
Fig. 4 shows a schematic structural diagram of the electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also called a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The following illustrates application scenarios and implementation flows of the embodiments of the present application by way of non-limiting examples.
First application scenario
As shown in fig. 5A and 5B, a first application scenario is illustrated. The first application scenario is an application scenario of the mobile phone. As shown in fig. 5A, in the split-screen display mode of the mobile phone, a window a of a certain video application and a window B of a certain instant messaging application are simultaneously displayed, so that the user can browse videos through the video application and chat with friends through the instant messaging application. The user feels that the video is interesting and wants to share the video with friends, for example, the user may click a share button 51 in a window a shown in fig. 5A to select a way of sharing the video. The mobile phone receives a click operation of the user on the sharing button, and superimposes the sharing window C on the basis of the split-screen display shown in fig. 5A, as shown in fig. 5B.
And receiving the click operation of the user on the sharing button, and monitoring that the interface of the system is changed by a newly added dynamic adjustment and refresh module of the system.
And the dynamic adjustment refreshing module is used for respectively acquiring key attributes such as the size, the position, the transparency, the refreshing rate (unit is hertz (Hz)), the Z-axis sequence and the like of the window A, the window B and the window C according to a drawing instruction of the surfaceFlinger, as shown in the following table I.
Watch 1
Window opening Window A Window B Window C
Size and breadth X1*Y1 X2*Y2 X3*Y3
Position of Size1 Size2 Size3
Z-axis sequence 2 3 1
Transparency 0% 0% 0%
Application type Instant messaging Video Video
Refresh rate 60Hz 60Hz 60Hz
Where Xi represents the width of window i and Yi represents the height of window i. Sizei denotes the coordinates of the upper left corner of window i. The values of i are 1,2 and 3, the window 1 is the window A, the window 2 is the window B, and the window 3 is the window C.
According to the Z-axis sequence, the size, the position, the transparency and other four key attributes of the three windows. Determining that the window A and the window C are not occluded; the window B is positioned behind the window C, the window B is shielded by the window C, and the shielding area exceeds 40%.
Based on the information determined according to the four key attributes, the fact that the original refresh rate of the window A and the original refresh rate of the window C are kept unchanged is calculated, the shielded area of the window B exceeds 40% due to shielding, user perception is weakened, and the refresh rate of the window B is adjusted to 50% of the original refresh rate.
The window B of the video application is informed by the surface flunger via an interface, e.g. via the interface surface. The window B is refreshed at 50% of the original refresh rate, i.e., 30 Hz.
When the user finishes sharing the video and the window C disappears, the dynamic adjustment and refresh module monitors that the interface of the system changes again, can acquire the key attributes of the window A and the window B, and then adjusts the refresh rate of the window A and/or the window B.
Second application scenario
Fig. 6A and 6B are schematic diagrams of a second application scenario. The second application scenario is an application scenario of the tablet computer. As shown in fig. 6A, in the floating window display mode of the tablet computer, a video chat window a of a certain instant messaging application is displayed on a window B of a certain news application in a floating window manner. The user can video chat with friends while browsing news. When the user does not need to browse the news, the user can move the window a from the position shown in fig. 6A to the position shown in fig. 6B, and the size of the window a becomes larger. As shown in fig. 6B, video chat window a is overlaid on top of window B.
And receiving the sliding operation of the user moving window A, and monitoring the change of the interface of the system by a newly added dynamic adjustment refreshing module of the system.
And the dynamic adjustment refreshing module is used for respectively acquiring key attributes such as the size, the position, the transparency, the refreshing rate, the Z-axis sequence and the like of the window A and the window B according to the drawing instruction of the SurfaceFlinger, as shown in the following table II.
Watch two
Window opening Window A Window B
Size and breadth X1*Y1 X2*Y2
Position of Size1 Size2
Z-axis sequence 1 2
Transparency 0% 0%
Application type Instant messaging News
Refresh rate 60Hz 60Hz
Where Xi represents the width of window i and Yi represents the height of window i. Sizei represents the coordinates of the upper or lower left corner of window i. The values of i are 1 and 2, the window 1 is the window A, and the window 2 is the window B.
According to the Z-axis sequence, the size, the position, the transparency and other four key attributes of the two windows. Determining that the window B is shielded by the window A, wherein the shielding area exceeds 50%; window B is located behind window a.
Based on the information determined according to the four key attributes, the method calculates that the window A keeps the original refresh rate unchanged, the shielded area of the window B exceeds 50% due to shielding, the user perception is weakened, and the refresh rate of the window B is adjusted to 20% of the original refresh rate.
The window B of the news application is informed by the surface flunger via an interface, e.g. via the interface surface. Window B is refreshed at 20% of the original refresh rate, i.e., 12 Hz.
And the user moves the window A again, at the moment, the dynamic adjustment refreshing module monitors that the interface of the system changes again, the key attributes of the window A and the window B can be obtained again, and the refreshing rate of the window A and/or the window B is adjusted again.
The following describes in detail the implementation procedure of the embodiments of the present application by way of non-limiting examples.
In combination with the application scenario and the related drawings, an embodiment of the present application provides a method for adjusting a window refresh rate, where the method for adjusting a window refresh rate may be executed by an electronic device. As a non-limiting example, the method for adjusting the window refresh rate may be performed by the electronic device shown in fig. 4, or by the mobile phone shown in fig. 5A and 5B, or by the tablet computer shown in fig. 6A and 6B. As shown in fig. 7, the method for adjusting the window refresh rate includes steps S710 to S760.
And S710, acquiring the current refresh rate of the display screen as a reference refresh rate.
The refresh rate of a display screen mounted in an electronic device is typically 60Hz (units: hertz), i.e. a frame is generated every 16.6 ms. At present, some electronic devices may carry a display screen with a higher refresh rate, such as 90Hz or 120 Hz. Still other electronic devices may support variable refresh rates, for example, both 60Hz and 90Hz refresh rates.
In some embodiments, the current refresh rate of the display screen is obtained as a reference refresh rate (BaseRefreshRate), which is the basis for subsequently adjusting the window refresh rate.
It should be noted that, in some other embodiments, the step S710 may be executed after the subsequent step S720 or step S730, and it is only required that the step S710 is executed before the step S740.
S720, receiving the interactive operation input by the user, or monitoring that the display state of the system changes, or monitoring that the application state of the foreground changes, and determining the window in the foreground.
The electronic equipment receives the interactive operation input by the user, monitors that the display state of the system changes, or monitors that the application state of the foreground changes, and determines the window in the foreground. I.e. determining which windows are currently foreground.
As a non-limiting example, the electronic device can obtain a list of windows that are in the foreground.
When the user inputs the interactive operation, the whole display interface of the electronic device is changed under the normal condition. Therefore, in some implementations, the electronic device receives an interactive operation input by a user, determines a window in the foreground, and then determines whether the refresh rate of the foreground window needs to be adjusted.
The interactive operation includes but is not limited to a touch operation, a voice control operation or a cursor control operation. The interaction may differ depending on the input device that the electronic device is capable of providing.
In other implementations, the electronic device monitors that the system display status changes and determines the window in the foreground. When the display state of the system changes, the possibility that the display interface of the electronic device is focused by the user changes.
The system display state changes, including but not limited to switching the electronic device from the on-screen state to the off-screen state, or decreasing the brightness of the display screen. It should be noted that the change of the display state of the system is not necessarily triggered by the user input interaction.
For example, the electronic device automatically switches from the on-screen state to the off-screen state, or the electronic device automatically switches from the on-screen state to the screen-locked state, and the like.
In other implementations, the electronic device monitors that the foreground application state changes and determines the window in the foreground. A change in foreground application state includes a change in state of any one or more foreground windows.
The foreground application state changes, including but not limited to starting a new application, closing one or more applications, turning the background application to the foreground for operation, and the like.
For example, an application automatically goes to the background or shuts down for a predetermined duration.
And S730, acquiring the key attribute and the current refresh rate of each window in the foreground.
In some embodiments of the present application, the foreground window includes a visually visible window, such as a full unobstructed window, a partially obstructed window, and the like. In some embodiments of the present application, the foreground window includes foreground-running windows, such as a full non-occluded window, a partially occluded window, a fully occluded window, a minimized window, and the like.
Key attributes include, but are not limited to, one or more of display content type, window size, window position, Z-axis order, window transparency, application type, user interaction data, and the like.
And S740, calculating the refresh rate of each window in the foreground according to the key attributes acquired in the step S730.
The key attribute of the window can reflect the user perception intensity of the window or the display change speed, and the refresh rate of the window can be reduced for the window with weak user perception or the window with slow display change.
In the embodiment of the present application, the refresh rate of each window in the foreground state may be calculated based on a combination of one or more of the key attributes. The refresh rate of each window in the foreground state is calculated based on one or more key attributes, hereinafter referred to as an adjustment policy.
The window adjusted refresh rate may be calculated according to any of the following adjustment strategies. It should be noted that the following adjustment strategies are only exemplary descriptions, and are not intended to limit the scope of the present application. Indeed, various modifications, combinations, substitutions, or alterations may be contemplated based on the examples set forth in the specification without departing from the scope of the present application.
1. And adjusting the refreshing rate of the windows according to the Z-axis sequence of each window.
Since the larger the Z-axis order, the lower the window is located, the less the user perceives the window. Thus, in this example, the refresh rate of the windows is adjusted according to the Z-axis order of the windows.
As an implementation manner, if the Z-axis sequence of the window is equal to or greater than the preset value N, the refresh rate of the window may be reduced to the first refresh rate. If the Z-axis sequence of the window is smaller than the preset value N, the window can keep the original refresh rate, namely, the current refresh rate. Where N may be a positive integer, for example, a positive integer greater than or equal to 3, 4, or 5.
As an example, the first refresh rate may be, for example, 50% of the reference refresh rate.
Optionally, in other implementation manners, when the Z-axis sequence of the window is equal to the preset value N, the window may maintain the original refresh rate, that is, maintain the current refresh rate.
It should be noted that N is an empirical value, the value of N may have a certain relationship with the maximum value of the current Z-axis sequence of the system, and the Z-axis sequence has a certain relationship with the complexity of the interface, and an appropriate N value may be set according to actual needs. The value of N can be set by default of the system or can be set by user self-definition. For example, when the maximum value of the Z-axis order is 7, N may be 3. The Z-axis order has a maximum value of 10, and N can be 5.
2. And determining the shielding rate of each window according to the Z-axis sequence, size and position of each window, and adjusting the refresh rate according to the shielding rate of the windows.
The occlusion rate of a window refers to the proportion of the area of the window that is occluded to the total area of the window.
The larger the proportion of the area of the window that is blocked, the weaker the user will perceive the window. Therefore, in this example, the refresh rate of the window is adjusted according to the proportion of the blocked area of the window.
As shown in fig. 8, the two windows are displayed in an overlapping manner. The Z-axis order of the window W1 is less than the Z-axis order of the window W2. The window W1 on the upper layer is not shielded, and the window W1 partially shields the window W2 on the lower layer.
Referring to fig. 8, the shielding rate of the window W2 is (shielded area S1/total area of the window W2) × 100%. S1 is the area indicated by the grid line in fig. 8.
As a non-limiting example, and with continued reference to FIG. 8, the occluded area S1 of window W2 may be calculated based on the pixel sizes occupied by the lower left corner pixel coordinates (Xi, Yi), width widei, and height of window W1 and window W2, respectively, where i takes the values 1 and 2. The shielded area S1 of the window W2 is [ wide1- (X2-X1) ]. high 2. The total area S of the window W2 is calculated based on the pixel size occupied by the width and height of the window W2. The total area S of the window W2 is wide2 high 2.
As an implementation manner, for each window, a proportion interval to which the occlusion rate of the window belongs is determined, and the refresh rate of the window is adjusted according to the drop ratio corresponding to the proportion interval. The larger the shielding rate is, the larger the corresponding drop ratio is.
As a non-limiting example, if the occlusion rate of a window is smaller than the first ratio, the first ratio may be, for example, 40%, and the window may maintain the original refresh rate, that is, maintain the current refresh rate.
If the occlusion rate of a window is greater than the first ratio and less than the second ratio, the first ratio may be, for example, 40%, and the second ratio may be, for example, 60%, the refresh rate of the window may be reduced to the first refresh rate. The first refresh rate may take, for example, 50% of the reference refresh rate.
If the occlusion rate of a window is greater than the second proportion and less than the third proportion, the second proportion may be, for example, 60%, and the third proportion may be, for example, 80%, the refresh rate of the window may be reduced to the second refresh rate. The second refresh rate may, for example, take 30% of the reference refresh rate.
If the occlusion rate of a window is greater than the third percentage and less than 100%, the third percentage may be, for example, 80%, and the refresh rate of the window may be reduced to the third refresh rate. The third refresh rate may be, for example, 20% of the reference refresh rate.
If the occlusion rate of a window is equal to 100%, i.e. the window is completely occluded, the window will not be refreshed, i.e. the refresh rate is reduced to 0.
It should be understood that in other implementations, an analogy can be made in this. And setting a plurality of proportion intervals, and setting the corresponding reduction ratio of each different proportion interval, thereby calculating the refresh rate RefreshRate of each window. The proportional interval and the corresponding drop ratio can be set by the system or can be set by the user in a self-defined way.
3. And adjusting the refresh rate of the window according to the transparency of the window.
Since the higher the transparency of a window, the less the user perceives the window. Thus, in this example, the refresh rate of the window is adjusted according to the transparency of the window.
As an implementation, if the window transparency is 100%, i.e. the window is completely transparent, the refresh rate of the window may be adjusted to 0, i.e. not refreshed at all.
If the window is partially transparent, a ratio can be calculated based on the transparency (unit:%), and the refresh rate of the window can be adjusted based on this ratio.
As a non-limiting example, a transparency of 100% is described as completely transparent, and 0 is described as completely opaque. The transparency of the window is d%, the adjustment ratio R1 of the window refresh rate is as follows:
R1=γ*d%;
wherein γ is a fixed coefficient, and is an empirical value. Based on the ratio R1, a refresh rate RefreshRate after window adjustment is determined, RefreshRate ═ BaseRefreshRate × R1.
4. And determining the shielding rate of each window according to the Z-axis sequence, size and position of each window, and adjusting the refresh rate according to the shielding rate and transparency of each window.
As an implementation, continuing to refer to fig. 8, the greater the proportion of the area of the window W2 that is obscured, the less the user perceives the window W2. However, the higher the transparency of the upper window W1, the stronger the user's perception of the window W2. Therefore, in this example, the refresh rate of the window is adjusted by comprehensively considering the proportion of the area of the window W2 that is blocked and the transparency of the upper window W1 that blocks the window W2.
As a non-limiting example, if the transparency of the window W1 exceeds 60%, the refresh rate of the window W2 may be reduced to the first refresh rate regardless of how high the occlusion rate of the window W2 is. The first refresh rate may be, for example, 20% of the reference refresh rate.
If the transparency of the window W1 is lower than 60%, the reduction ratio corresponding to the shielding rate of the window W2 may be determined according to the shielding rate of the window W2, so as to calculate the refresh rate RefreshRate of the window W2.
If the window W1 is not blocked and the blocking rate is 0, the refresh rate of the window W1 can be adjusted according to the transparency of the window W1. For the refresh rate of window W1, see the aforementioned example of the 3 rd adjustment strategy.
5. And determining whether the window has user interaction operation according to the user interaction data of the window, and adjusting the refresh rate of the window according to the presence or absence of the user interaction operation.
If it is determined that the user interaction operation, such as clicking, sliding, zooming, or the like, exists on the window within the preset historical time, the window may maintain the original refresh rate, that is, maintain the current refresh rate, or maintain the original refresh rate for a preset time.
In some implementation manners, different preset durations may be set corresponding to different user interaction operations. The preset duration can be set by default of the system or can be set by user definition.
As a non-limiting example, there is a user click action on a window within a preset historical duration, which keeps the current refresh rate from adjusting for 200 milliseconds. In this example, if other key attributes of the window change, the refresh rate of the window is not adjusted.
As another non-limiting example, there is a user action on the sliding list in a window whose refresh rate, which continues for 300 milliseconds, is not adjusted for a preset historical duration.
And if the preset historical duration is determined, no user interaction operation acting on a certain window exists. For the window, the refresh rate may be adjusted according to the Z-axis order, transparency, occlusion rate, etc. of the window. For example, if the Z-axis order of the window is greater than N, the refresh rate of the window is reduced to a first refresh rate, which may take, for example, 50% of the reference refresh rate.
6. And adjusting the refresh rate of the window according to the application type of the window.
Because the application type of the window can reflect the change speed of the window to a certain extent, the refresh rate of the window can be adjusted according to the application type of the window in order not to influence the user experience.
In some implementation manners, the electronic device presets respective target refresh rates corresponding to different application types, i.e., the adjusted refresh rates. For any window, after the application type of the window is determined, the target refresh rate corresponding to the application type can be obtained, and the target refresh rate of the window is also determined.
In some implementation manners, for a window with an application type of a conference, live broadcast, or the like, in order to avoid affecting user experience, an original refresh rate of the window is maintained, that is, a current refresh rate is maintained.
In other implementations, the refresh rate may be reduced to a first refresh rate for windows where the application type is video or music, etc. The first refresh rate may be 80% of the reference refresh rate.
In other implementations, the refresh rate may be reduced even lower for windows where the application type is reading, etc. For example, to a second refresh rate, which may be 50% of the reference refresh rate.
7. And adjusting the refresh rate of the window according to the display content of the window.
The displayed content of the window is classified, such as video, live, music, or text. The classification of the display content is related to how fast the window changes. In this example, the refresh rate of the window is adjusted according to the display content of the window.
In some implementations, the electronic device presets respective target refresh rates corresponding to different display contents. For any window, after the display content of the window is determined, the target refresh rate corresponding to the display content can be obtained, and the target refresh rate of the window is also determined.
In some implementation manners, for a window whose display content is a video session, a video conference, or a live broadcast, in order to avoid affecting user experience, an original refresh rate of the window is maintained, that is, a current refresh rate is maintained.
In other implementations, the refresh rate may be reduced to a first refresh rate for a window whose display content is a type of video playback, music playback, or window animation. The first refresh rate may be 80% of the reference refresh rate.
In other implementations, the refresh rate may be reduced for static windows where the display content is text display or the like. For example, to a second refresh rate, which may be 50% of the reference refresh rate.
And calculating the refresh rate RefreshRate after each window is adjusted according to the adjustment strategy.
In some implementations, the foreground window may include a minimized window that may not be refreshed, i.e., the refresh rate of the minimized window is reduced to 0.
As a non-limiting example, if the display content of the window only includes an icon or pattern, and/or the window size is smaller than or equal to a preset area threshold, the window is determined to be a minimized window, and the refresh rate of the window is reduced to 0. It should be understood that the preset area threshold may be an empirical value.
S750, judging whether the current refresh rate of the foreground window needs to be adjusted. If so, step S760 is executed, otherwise, the process ends, and the process returns to step S720.
And judging whether the current refresh rate of the foreground window needs to be adjusted or not, namely judging whether the current refresh rate of the foreground window is equal to the adjusted refresh rate RefreshRate or not. The adjusted refresh rate RefreshRate may be referred to as a target refresh rate.
If the refresh rate RefreshRate adjusted by a certain window, i.e. the target refresh rate, is not equal to the current refresh rate, the window needs to be notified to adjust the refresh rate. If the target refresh rate of a certain window is equal to the current refresh rate, the window does not need to be informed to adjust the refresh rate, and the window scheme carries out refresh according to the original refresh rate. The process of notification is omitted, thereby further saving resource consumption.
And S760, informing the calculation result of the step S740, namely the adjusted refresh rate, to a foreground window needing to adjust the refresh rate, and refreshing the foreground window according to the adjusted refresh rate.
In some implementations, the dynamic adjustment refresh module notifies the computed result of step S740, that is, the adjusted refresh rate, to the surface flinger, and then the surface flinger notifies the adjusted refresh rate to each foreground window, for example, the surface flinger notifies the computed result to each foreground window through the interface surface.
As an alternative to the foregoing implementation manners, in other implementation manners, the dynamically adjusting and refreshing module notifies the application of the calculation result of step S740, that is, the adjusted refresh rate, and the application refreshes the foreground window according to the adjusted refresh rate of the foreground window, so that different windows can be refreshed according to different refresh rates, and each foreground window is refreshed according to a new refresh rate.
As an example, three windows, e.g., window A, window B, and window C, are displayed simultaneously in the foreground. Window a and window B are two windows of the first application. Window C is a window of the second application. And the dynamic adjustment refreshing module calculates the refreshing rate of the window A, the window B and the window C after adjustment. And the first application refreshes the window A according to the refresh rate adjusted by the window A and refreshes the window B according to the refresh rate adjusted by the window B. And the second application refreshes the window C according to the refresh rate adjusted by the window C.
It should be noted that the electronic device may continuously monitor, and repeat the subsequent steps if the condition of step S720 is monitored, so as to dynamically adjust the window refresh rate.
It should be understood that the execution sequence of each process in the above embodiments should be determined by the function and the inherent logic thereof, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the method for adjusting the window refresh rate described in the above embodiments, the device for adjusting the window refresh rate includes various modules that can implement the steps of the method for adjusting the window refresh rate.
It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The present application can be realized in hardware or a combination of hardware and computer software in conjunction with the description of the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application with the embodiment described, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It should be noted that, because the details of information interaction, execution process, and the like between the modules/units of the device for adjusting the window refresh rate are based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be specifically referred to a part of the method embodiment, and details thereof are not repeated herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The 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, and when the processor executes the computer program, the electronic device is enabled to implement the steps in the above method embodiments.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments may be implemented.
Embodiments of the present application provide a computer program product, which when executed on an electronic device, enables the electronic device to implement the steps in the above method embodiments.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/electronic device, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunication signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed electronic device and method may be implemented in other ways. For example, the above-described electronic device embodiments are merely illustrative. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (16)

1. A method for adjusting a window refresh rate, comprising:
determining a plurality of windows in a foreground;
acquiring attribute information and a current refresh rate of each window;
determining a target refresh rate of each window according to the attribute information;
and for any window, if the current refresh rate of the window is different from the target refresh rate, notifying the target refresh rate to the window.
2. The method of claim 1, wherein the attribute information comprises one or more of display content, window size, window position, Z-axis order, window transparency, application type, and user interaction data.
3. The method of claim 2, wherein determining a target refresh rate for each of the windows based on the attribute information comprises:
determining a target refresh rate of each window according to the Z-axis sequence of each window; or the like, or, alternatively,
determining a target refresh rate of each window according to the transparency of each window; or the like, or, alternatively,
determining the shielding rate of each window according to the Z-axis sequence, the size and the position of each window, and determining the target refresh rate of each window according to the shielding rate of each window; or the like, or, alternatively,
determining the shielding rate of each window according to the Z-axis sequence, the size and the position of each window, and determining the target refresh rate of each window according to the shielding rate and the transparency of each window; or the like, or, alternatively,
determining whether each window has user interaction operation according to the user interaction data of each window, and determining the target refresh rate of each window according to whether each window has user interaction operation; or the like, or, alternatively,
determining a target refresh rate of each window according to the application type of each window; or the like, or, alternatively,
and determining the target refresh rate of each window according to the display content of each window.
4. The method of claim 3, wherein determining the target refresh rate for each of the windows based on the Z-axis order for each of the windows comprises:
if the Z-axis sequence of any window is smaller than or equal to a preset value, determining that the target refresh rate of the window keeps the current refresh rate;
and if the Z-axis sequence of any window is greater than the preset value, determining that the target refresh rate of the window is a first refresh rate, wherein the first refresh rate is less than the reference refresh rate.
5. The method of claim 3, wherein determining the target refresh rate for each of the windows based on the occlusion rate of each of the windows comprises:
and determining a proportional interval to which the shielding rate of any window belongs, acquiring a reduction ratio corresponding to the proportional interval, and determining the target refresh rate of the window according to the reduction ratio and the reference refresh rate, wherein the larger the shielding rate is, the larger the reduction ratio corresponding to the shielding rate is.
6. The method of claim 3, wherein determining the target refresh rate for each of the windows based on the application type for each of the windows comprises:
and determining the application type of any window, and acquiring a target refresh rate corresponding to the application type.
7. The method of claim 3, wherein determining the target refresh rate for each of the windows based on the display content of each of the windows comprises:
and aiming at any one window, determining the display content of the window, and acquiring a target refresh rate corresponding to the display content.
8. The method of claim 1 or 2, wherein the determining the plurality of windows in the foreground comprises:
receiving a first operation input by a user, or monitoring that the display state of the system changes, or monitoring that the application state of the foreground changes, and determining a plurality of windows in the foreground.
9. The method of claim 1 or 2, further comprising:
and for any one window, if the window is determined not to need to be refreshed for the current vertical synchronization request VSYNC according to the current refresh rate of the window, multiplexing the cache content of one frame on the window in the window drawing process.
10. The method of claim 1 or 2, further comprising:
if a plurality of windows which do not need to be refreshed according to the current refresh rate of each window are determined, the plurality of windows which do not need to be refreshed are combined into one first window.
11. The method of claim 10, further comprising:
if a plurality of windows which do not need to be refreshed for the current VSYNC are determined according to the current refresh rate of each window, and the plurality of windows which do not need to be refreshed are combined into one first window, the cache content of one frame on the first window is multiplexed in the drawing process of the plurality of windows which do not need to be refreshed.
12. The method of claim 1 or 2, further comprising:
and determining whether the display content of each window is changed or not, and combining a plurality of windows of which the display content is not changed into one first window when a plurality of windows of which the display content is not changed by the VSYNC is determined according to the current vertical synchronization request.
13. The method of claim 12, further comprising:
if a plurality of windows of which the display content is not changed by the current VSYNC are determined according to the current refresh rate of each window, and the plurality of windows of which the display content is not changed are synthesized into a first window, the cache content of a frame on the first window is multiplexed in the drawing process of the plurality of windows of which the display content is not changed.
14. The method according to claim 1 or 2, wherein before determining the target refresh rate for each of the windows according to the attribute information, further comprising:
and acquiring a second refresh rate of the display screen as a reference of the target refresh rate.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, causes the electronic device to implement the method of any of claims 1 to 14.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 14.
CN202010937431.6A 2020-09-08 2020-09-08 Method for adjusting window refresh rate and electronic equipment Active CN113805983B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010937431.6A CN113805983B (en) 2020-09-08 2020-09-08 Method for adjusting window refresh rate and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010937431.6A CN113805983B (en) 2020-09-08 2020-09-08 Method for adjusting window refresh rate and electronic equipment

Publications (2)

Publication Number Publication Date
CN113805983A true CN113805983A (en) 2021-12-17
CN113805983B CN113805983B (en) 2022-12-02

Family

ID=78943441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010937431.6A Active CN113805983B (en) 2020-09-08 2020-09-08 Method for adjusting window refresh rate and electronic equipment

Country Status (1)

Country Link
CN (1) CN113805983B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327738A (en) * 2022-03-14 2022-04-12 恒生电子股份有限公司 User interface refreshing method and device, electronic equipment and readable storage medium
CN115273763A (en) * 2022-06-16 2022-11-01 北京小米移动软件有限公司 Method and device for adjusting frame rate of picture composition, display device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160180762A1 (en) * 2014-12-22 2016-06-23 Elwha Llc Systems, methods, and devices for controlling screen refresh rates
CN106933587A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of figure layer draws control method, device and mobile terminal
CN106933526A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of method of dynamic regulation screen refresh rate, device and mobile terminal
CN109345992A (en) * 2017-08-01 2019-02-15 富泰华工业(深圳)有限公司 The method of adjustment of electronic device and screen refresh frequency
CN110619860A (en) * 2019-10-15 2019-12-27 Oppo广东移动通信有限公司 Screen refresh rate adjusting method and device, storage medium and electronic equipment
CN110928396A (en) * 2019-11-18 2020-03-27 Oppo(重庆)智能科技有限公司 Screen refreshing method and related equipment
CN111131622A (en) * 2019-12-31 2020-05-08 联想(北京)有限公司 Refresh frequency adjusting method and device, electronic equipment and readable storage medium
CN111583886A (en) * 2020-04-29 2020-08-25 珠海市魅族科技有限公司 Screen refresh rate adjusting method, device, equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160180762A1 (en) * 2014-12-22 2016-06-23 Elwha Llc Systems, methods, and devices for controlling screen refresh rates
CN106933587A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of figure layer draws control method, device and mobile terminal
CN106933526A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of method of dynamic regulation screen refresh rate, device and mobile terminal
CN109345992A (en) * 2017-08-01 2019-02-15 富泰华工业(深圳)有限公司 The method of adjustment of electronic device and screen refresh frequency
CN110619860A (en) * 2019-10-15 2019-12-27 Oppo广东移动通信有限公司 Screen refresh rate adjusting method and device, storage medium and electronic equipment
CN110928396A (en) * 2019-11-18 2020-03-27 Oppo(重庆)智能科技有限公司 Screen refreshing method and related equipment
CN111131622A (en) * 2019-12-31 2020-05-08 联想(北京)有限公司 Refresh frequency adjusting method and device, electronic equipment and readable storage medium
CN111583886A (en) * 2020-04-29 2020-08-25 珠海市魅族科技有限公司 Screen refresh rate adjusting method, device, equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327738A (en) * 2022-03-14 2022-04-12 恒生电子股份有限公司 User interface refreshing method and device, electronic equipment and readable storage medium
CN114327738B (en) * 2022-03-14 2022-06-14 恒生电子股份有限公司 Refreshing method and device of user interface, electronic equipment and readable storage medium
CN115273763A (en) * 2022-06-16 2022-11-01 北京小米移动软件有限公司 Method and device for adjusting frame rate of picture composition, display device and storage medium
CN115273763B (en) * 2022-06-16 2024-02-06 北京小米移动软件有限公司 Picture composition frame rate adjustment method and device, display equipment and storage medium

Also Published As

Publication number Publication date
CN113805983B (en) 2022-12-02

Similar Documents

Publication Publication Date Title
EP3974970A1 (en) Full-screen display method for mobile terminal, and apparatus
CN113362783B (en) Refresh rate switching method and electronic equipment
CN114895861A (en) Message processing method, related device and system
CN112328130B (en) Display processing method and electronic equipment
US12020620B2 (en) Display method, electronic device, and computer storage medium
EP4053783A1 (en) Energy-efficient display processing method, and apparatus
WO2022262313A1 (en) Picture-in-picture-based image processing method, device, storage medium, and program product
CN116055786B (en) Method for displaying multiple windows and electronic equipment
EP4156158A1 (en) Drive control method and related device
WO2023065873A1 (en) Frame rate adjustment method, terminal device, and frame rate adjustment system
CN113625860B (en) Mode switching method and device, electronic equipment and chip system
CN113254120A (en) Data processing method and related device
CN113935898A (en) Image processing method, system, electronic device and computer readable storage medium
WO2023030168A1 (en) Interface display method and electronic device
CN113805983B (en) Method for adjusting window refresh rate and electronic equipment
CN114756184A (en) Collaborative display method, terminal device and computer-readable storage medium
CN116051351B (en) Special effect processing method and electronic equipment
CN116048831B (en) Target signal processing method and electronic equipment
CN115686403A (en) Display parameter adjusting method, electronic device, chip and readable storage medium
CN113923351A (en) Method, apparatus, storage medium, and program product for exiting multi-channel video shooting
WO2024066834A1 (en) Vsync signal control method, electronic device, storage medium and chip
CN116095512B (en) Photographing method of terminal equipment and related device
CN115550714B (en) Subtitle display method and related equipment
CN115480680A (en) Multi-device cooperative control method, terminal device and computer-readable storage medium
CN118113386A (en) Transition dynamic effect generation method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant