Image display method and electronic equipment
Patent Information
- Application Number
- CN202480037543.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-17
- Filing Date
- 2024-07-24
- Publication Date
- 2026-02-03
AI Technical Summary
Traditional image display methods frequently display images at the highest refresh rate, resulting in wasted system resources.
The content in the display is refreshed at the highest refresh rate when the electronic device receives a click event and a first sliding event, and in other cases, the appropriate refresh rate is determined by scoring according to the layer status in the display.
Reduces the number of times electronic devices refresh content in the display with the highest refresh rate, avoiding unnecessary waste of resources and reduced power consumption.
Smart Images

Figure CN121464418A_ABST
Abstract
Description
Image display method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on November 17, 2023, with application number 202311545433.0 and invention name “A method for displaying an image and an electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal devices, and in particular to an image display method and electronic device. Background Art
[0003] The refresh rate of an electronic device's display screen refers to the number of times the electronic device refreshes the content displayed on its display screen per unit time, usually measured in Hertz (Hz). Common display screen refresh rates include 60Hz, 90HZ, 120Hz, etc. For example, a 60Hz refresh rate means that the content displayed on the display screen is refreshed 60 times per second, where the content displayed at a single time can be called a frame of image or a frame of picture. By continuously refreshing the content displayed, the display screen can play dynamic content such as videos and motion effects. Usually, electronic devices can automatically switch the refresh rate based on the needs of the application, the user's operation, and the status of the device itself.
[0004] In practice, electronic devices can make refresh rate decisions based on their interaction with the user. For example, if the display is being touched by the user, that is, the user is interacting with the electronic device, the electronic device may determine the display's refresh rate to be the highest possible, such as 120Hz.
[0005] However, if an electronic device refreshes its display at the highest refresh rate every time an interaction occurs, it can easily waste system resources. For example, when a user taps the display multiple times at a low frequency, the display will only display a few animations, and refreshing at the highest refresh rate is unnecessary, resulting in a waste of system resources.
[0006] Summary of the Invention
[0007] Embodiments of the present application provide an image display method and an electronic device to solve the problem that conventional image display methods frequently display images at the highest refresh rate, resulting in waste of system resources.
[0008] In a first aspect, an embodiment of the present application provides an image display method, which is applied to an electronic device, including: when the electronic device is in a first device state, the display screen of the electronic device displays an image at a first refresh rate, wherein the electronic device being in the first device state includes: the electronic device receiving a target interaction event, the target interaction event including: a click event and a first sliding event, the first sliding event being a sliding event with a sliding speed greater than a first preset threshold; the first refresh rate is the maximum refresh rate of the display screen, or the first refresh rate is greater than or equal to a preset refresh rate threshold.
[0009] In the image display method provided by the embodiment of the present application, the electronic device refreshes the content on the display screen at the highest refresh rate only when it receives a click event and a first slide event. This can reduce the number of times the electronic device refreshes the content on the display screen at the highest refresh rate, avoid the electronic device refreshing at the highest refresh rate unnecessarily, and reduce the power consumption of the electronic device.
[0010] In one achievable method, the electronic device is in the first device state and further includes: the display screen is playing the target motion effect, wherein the target motion effect is that the range of change of the motion effect image exceeds the first change value. When the display screen plays the target motion effect, the electronic device enters the first device state and refreshes the content on the display screen at the highest refresh rate, which can improve the playback effect of the target motion effect, and can avoid refreshing the content on the display screen at the highest refresh rate when the display screen plays any motion effect, which can reduce the power consumption of the electronic device. Generally speaking, when the range of change of the motion effect is relatively small, the user's perception is not obvious. At this time, the image can be refreshed at a relatively low refresh rate. When the range of change of the motion effect is large, the user may perceive the corresponding image change. In this case, appropriately increasing the refresh rate can improve the display effect of the motion effect and enhance the user experience. Therefore, this solution can reduce the power consumption of the electronic device as much as possible without affecting the display of the motion effect.
[0011] In one achievable embodiment, the target animation is that the range of change of the animation image exceeds a first change value, including: the target animation is that the range of change of the animation image exceeds the first change value within a first preset duration. The first preset duration and the first change value define the speed of change of the animation image. In this way, when playing animation images with a faster change rate, the display can display the image at the highest refresh rate, thereby improving the user experience.
[0012] Specifically, when the range of changes in an animation is large within a short period of time, the user may perceive the corresponding image changes. In this case, appropriately increasing the refresh rate can improve the display effect of the animation and enhance the user experience. However, when the range of changes in an animation is small within a short period of time, the user's perception is not obvious. In this case, a relatively low refresh rate can be used to refresh the image. This solution can minimize the power consumption of electronic devices without affecting the display of animation effects.
[0013] In one feasible manner, it further includes: when the electronic device is not in the first device state, the display screen displays the image using a refresh rate that matches the image layer. In the embodiment of the present application, using a refresh rate that matches the image layer can ensure that the image is smoother and clearer during the display process, reduce the tearing or blurring of the picture, and provide a good visual experience. If the refresh rate is too high, it will cause the system to over-consume system resources and power, and will not bring additional visual effects. Therefore, using a refresh rate that matches the image layer to display an image can also avoid unnecessary waste of resources and energy consumption.
[0014] In one achievable manner, when the electronic device is not in the first device state, the display screen displays an image using a refresh rate that matches the image layer, including: when the electronic device is not in the first device state and the display screen includes M first target layers, the display screen displays the image at a second refresh rate, wherein the first target layer is an active layer, and the matching frame rate of the first target layer is greater than or equal to a first threshold, the active layer includes a visible layer whose image content has been updated within a first historical period, and the second refresh rate is determined based on the matching frame rates of the M first target layers; when the electronic device is not in the first device state and the display screen does not include the first target layer, the display screen displays the image at a third refresh rate, which is the default refresh rate of the display screen. When the electronic device is not in the first device state and the display screen includes the first target layer, the refresh rate of the image displayed on the display screen is determined based on the matching frame rate of the first target layer, so that the refresh rate matches the first target layer and the display effect of the first target layer is improved. When the electronic device is not in the first device state and the display screen does not include the first target layer, the electronic device displays the image at the default refresh rate, which can provide a good visual experience and avoid excessive power consumption.
[0015] In one achievable method, the second refresh rate is the maximum refresh rate among refresh rate 1 to refresh rate M, wherein refresh rate 1 is the refresh rate expected for the first first target layer, refresh rate M is the refresh rate expected for the Mth first target layer, refresh rate 1 is determined based on the matching frame rate of the first first target layer and the optional refresh rate supported by the display screen, and refresh rate M is determined based on the matching frame rate of the Mth first target layer and the optional refresh rate supported by the display screen.
[0016] The embodiment of the present application can calculate the expected refresh rate of each first target layer and finally take the maximum expected refresh rate of all first target layers. In this way, the refresh effect of each first target layer can be optimized without any lag or tearing.
[0017] In one achievable manner, the default refresh rate is the refresh rate when no adjustment is made to the refresh rate of the image displayed on the display screen. The display screen refreshes content at the default refresh rate, which can reduce the power consumption of the electronic device and avoid unnecessary waste of resources.
[0018] In one practicable manner, the default refresh rate may be pre-set according to the refresh rates supported by the display screen. Generally speaking, refresh rates other than the maximum and minimum refresh rates supported by the display screen may be used as the default refresh rate.
[0019] In one achievable approach, the default refresh rate is 60Hz. The 60Hz refresh rate is widely compatible with displays, and many layers have a frame rate of 60 frames per second. Therefore, refreshing the content on the display with 60Hz as the default refresh rate can provide a good user experience.
[0020] For example, if the display supports refresh rates including 30Hz, 60Hz, 90Hz and 120Hz, 60Hz can be set as the default refresh rate.
[0021] In a second aspect, an embodiment of the present application provides an image display method, comprising: before the electronic device refreshes the content on the display screen each time, determining whether the electronic device is in a first device state, the first device state including that the electronic device receives a target interaction event or the display screen is playing a target animation effect, the target interaction event including a click event and / or a first sliding event, the first sliding event being a sliding event with a sliding speed greater than a first preset threshold; when the electronic device is in the first device state, refreshing the content on the display screen at a first refresh rate, the first refresh rate being the highest refresh rate of the display screen, or the first refresh rate being greater than or equal to a preset refresh rate threshold; when the electronic device is not in the first device state, determining whether the display screen includes a first target layer, the first target layer being an active layer, and the matching frame rate of the first target layer being greater than or equal to the first threshold, the active layer including a visible layer whose image content has been updated within a first historical time period; when the display screen includes at least one first target layer, determining at least one expected refresh rate from at least one optional refresh rate based on the matching frame rate of each first target layer, and refreshing the content on the display screen at the highest refresh rate of the at least one expected refresh rate; when the display screen does not include the first target layer, refreshing the content on the display screen at a third refresh rate, the third refresh rate being the default refresh rate of the display screen.
[0022] The image display method provided in the embodiment of the present application is that the electronic device refreshes the content on the display screen at the highest refresh rate when receiving a click event and / or a first sliding event, or when the display screen is playing a target motion effect; in other cases, the electronic device can determine the refresh rate used by the display screen from multiple optional refresh rates by scoring according to the layer status in the display screen, or refresh the content on the display screen at the default refresh rate, thereby avoiding the electronic device refreshing the content on the display screen at the highest refresh rate when it is not necessary, saving system resources.
[0023] In one achievable embodiment, before determining whether the display screen includes the first target layer, the method further includes: determining whether the display screen includes a second target layer, where the second target layer is the active layer currently playing the animation; and determining whether the display screen includes the first target layer includes: if the display screen does not include the second target layer, then determining whether the display screen includes the first target layer. In this way, even if the display screen does not include the second target layer, the refresh rate of the image displayed on the display screen can be determined based on the scoring process.
[0024] In one achievable method, at least one expected refresh rate is determined from at least one optional refresh rate based on the matching frame rate of each first target layer, including: for each first target layer, when the matching frame rate is less than or equal to a second threshold, determining the optional refresh rate less than or equal to the second threshold as the selected refresh rate, and the second threshold is greater than the first threshold; for each first target layer, when the matching frame rate is greater than the second threshold, determining the optional refresh rate greater than the second threshold as the selected refresh rate; scoring each selected refresh rate based on the matching frame rate; and determining the selected refresh rate with the highest score as the expected refresh rate of the first target layer. In this way, an expected refresh rate close to the layer matching frame rate can be selected, and scoring all optional refresh rates based on the matching frame rate can be avoided, which can reduce the amount of calculation and determine the refresh rate of the image displayed on the display screen as soon as possible.
[0025] In one achievable method, each candidate refresh rate is scored based on the matching frame rate, including: if the candidate refresh rate is equal to the matching frame rate, determining the candidate refresh rate to be a first score; if the candidate refresh rate is not equal to the matching frame rate, determining the candidate refresh rate to be a second score, the second score being less than the first score; or, if the candidate refresh rate is an integer multiple of the matching frame rate, determining the candidate refresh rate to be the first score; if the candidate refresh rate is not an integer multiple of the matching frame rate, determining the candidate refresh rate to be the second score. In this way, the selected desired refresh rate can be made as close as possible to the matching frame rate of the layer, thereby improving the display effect of the layer.
[0026] In one achievable method, the method further includes: obtaining a cached result before each refresh of the content on the display screen of the electronic device, the cached result including the device state information of the electronic device, the layer state information of the active layer, and the historical refresh rate information used by the display screen before the last refresh of the content on the display screen, wherein the screen refresh rate when the electronic device last refreshed the content on the display screen was a first historical refresh rate; determining whether the number of current active layers is the same as the number of active layers before the last refresh of the content on the display screen; if the number of active layers is different, determining the number of optional refresh rates; if the number of active layers is the same, determining whether the layer state information of the current active layer is the same as the layer state information of the active layer before the last refresh of the content on the display screen, and determining whether the device state information of the current electronic device is the same as the device state information of the electronic device before the last refresh of the content on the display screen; if the layer state information of the active layer is the same and the device state information of the electronic device is the same, refreshing the content on the display screen at the first historical refresh rate. In this way, determining the refresh rate based on the cached result can reduce the amount of calculation.
[0027] In one possible implementation, the method further includes: determining the number of selectable refresh rates when the layer state information of the active layer or the device state information of the electronic device is different; and refreshing the content on the display screen at the selectable refresh rate when only one selectable refresh rate is available. This reduces the amount of computation.
[0028] In one achievable manner, the method further includes: when multiple selectable refresh rates are included, determining whether all layers in the display screen are in a stationary state and the electronic device has not received a touch event; when all layers in the display screen are in a stationary state and the electronic device has not received a touch event, refreshing the content in the display screen at the lowest refresh rate among the multiple selectable refresh rates; when at least one layer in the display screen is in a non-stationary state or the display screen receives a touch event, determining whether the active layer includes only a third target layer; wherein the third target layer includes a wallpaper layer, and / or a layer with a matching frame rate less than a first threshold and a status bar layer; when the active layer includes only the third target layer, refreshing the content in the display screen at the lowest refresh rate among the multiple selectable refresh rates. When the active layer includes the third target layer and also includes other layers, determining whether the electronic device is in the first device state. In this way, the refresh rate of the image displayed on the display screen can be determined based on the device state information and the state information of the active layer in the display screen.
[0029] In one achievable manner, it further includes: when the electronic device receives a target interaction event or the display screen is playing a target motion effect, the electronic device enters a first device state and starts a first timer, the first timer being set with a first timing duration; when the first timer exceeds the first timing duration, and / or when the electronic device receives a second sliding event, and / or when all layers in the display screen are in a static state, and / or when the target motion effect ends, the electronic device exits the first device state, the second sliding event being a sliding event with a sliding speed less than or equal to a first preset threshold. In this way, it can be determined whether the electronic device is in the first device state.
[0030] In one achievable method, before obtaining the cached result, the method further includes: before the electronic device refreshes the content on the display screen each time, for each active layer, determining whether the active layer contains matching frame rate information, where the matching frame rate information is used to indicate the matching frame rate; if the active layer does not contain matching frame rate information, determining the matching frame rate based on the number of updates of the active layer within the second historical duration and the time interval between updates. Determining the matching frame rate based on the number of updates of the active layer within the second historical duration and the time interval between updates includes: if the number of updates is greater than or equal to a threshold number of times or the time interval between each update is equal, the matching frame rate is the ratio of the number of updates to the second historical duration; if the number of updates is less than the threshold number of times or the time interval between each update is unequal, the matching frame rate is a first preset value. In this way, the matching frame rate of the first target layer can be obtained based on the calculation.
[0031] In one possible implementation, the system further includes: storing device status information, layer status information, and the refresh rate used by the display screen each time the electronic device refreshes the content on the display screen. This allows a cached result corresponding to the current image display to be used when determining the refresh rate for the next image display.
[0032] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor and a memory, wherein the memory stores program instructions. When the program instructions are executed by the processor, the electronic device executes the image display method as described in the first aspect and any implementation method or the second aspect and any implementation method.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on an electronic device, the electronic device executes the image display method as described in the first aspect and any implementation method or the second aspect and any implementation method.
[0034] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the image display method as described in the first aspect and any implementation method or the second aspect and any implementation method.
[0035] It can be understood that the electronic devices, computer-readable storage media and computer program products provided in the above aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] FIG1 is a schematic diagram of the synthesis of layers of an electronic device;
[0037] FIG2 is a first schematic diagram of a refresh rate decision model for an electronic device;
[0038] FIG3 is a logic diagram of switching system states of an electronic device according to an embodiment of the present application;
[0039] FIG4 is a second schematic diagram of the refresh rate decision model for an electronic device;
[0040] FIG5 is a third schematic diagram of the refresh rate decision model for an electronic device;
[0041] FIG6 is a schematic diagram of a large weight layer and a small weight layer;
[0042] Figure 7 is a schematic diagram of multiple layers participating in decision-making;
[0043] FIG8 is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of the present application;
[0044] FIG9 is a software structure block diagram of the electronic device 100 provided in an embodiment of the present application;
[0045] FIG10 is a first flow chart of an image display method provided in an embodiment of the present application;
[0046] FIG11 is a schematic diagram of a target interaction event provided by an embodiment of the present application;
[0047] FIG12 is a second flow chart of the image display method provided in an embodiment of the present application;
[0048] FIG13 is a first schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application;
[0049] FIG14 is a second schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application;
[0050] FIG15 is a schematic diagram of a first application of the image display method provided in an embodiment of the present application;
[0051] FIG16 is a schematic diagram of a display screen provided by an embodiment of the present application that does not include a first target layer;
[0052] FIG17 is a third schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application;
[0053] FIG18 is a schematic diagram of a second application of the image display method provided in an embodiment of the present application;
[0054] FIG19 is a third flow chart of the image display method provided in an embodiment of the present application;
[0055] FIG20 is a fourth schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application;
[0056] FIG21 is a schematic diagram of a third application of the image display method provided in an embodiment of the present application;
[0057] FIG22 is a schematic diagram of a fourth application of the image display method provided in an embodiment of the present application;
[0058] FIG23 is a fifth schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application;
[0059] FIG24 is a schematic diagram of a process for comparing with cached results according to an embodiment of the present application;
[0060] FIG25 is a flowchart of determining a layer type according to an embodiment of the present application;
[0061] FIG26 is an example diagram of the process shown in FIG25 ;
[0062] FIG27 is a flowchart of scoring optional refresh rates provided in an embodiment of the present application;
[0063] FIG28 is an example diagram of the process shown in FIG27;
[0064] FIG29 is a schematic diagram of an electronic device switching device state according to an embodiment of the present application;
[0065] FIG30 is a schematic structural diagram of an image display device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The technical solutions of the embodiments of the present application will be clearly described below in conjunction with the drawings in the embodiments of the present application.
[0067] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.
[0068] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0069] The refresh rate of a display screen refers to the number of times an electronic device updates the image displayed on its screen per unit time. It is usually measured in Hertz (Hz). Common refresh rates include 60Hz, 90Hz, and 120Hz. For example, a 60Hz refresh rate means that the electronic device can refresh the displayed content 60 times per second. The content displayed at a single time is called a frame of image or a picture.
[0070] As the display screen is continuously refreshed, it can continuously display new image data to show continuous image changes. Generally speaking, the higher the refresh rate of the display screen, the smoother the image display, and the less stuttering and flickering. In addition, a high refresh rate can also reduce the generation of image afterimages (Motion Blur). Image afterimages refer to the blurring or smearing effect between consecutive frames caused by insufficient refresh rate in the fast-moving elements displayed on the display screen. Among them, fast-moving elements are, for example, fast-moving game characters in the game screen.
[0071] Therefore, increasing the refresh rate of the display can improve the appearance of the display and enhance the user experience.
[0072] However, the displays of electronic devices, such as mobile phones, do not always operate at their highest refresh rates. This is because the higher the refresh rate, the more system resources the electronic device consumes to render the composite image. Therefore, electronic devices can provide an automatic refresh rate adjustment mechanism. This allows the electronic device to automatically adjust the display refresh rate to regulate the resource consumption of the image display process and improve the user experience.
[0073] The following is an exemplary introduction to the general method of automatically switching the refresh rate of an electronic device.
[0074] The mechanism by which electronic devices automatically switch refresh rates is usually called adaptive refresh rate or intelligent refresh rate. Specifically, the refresh rate of the display can be dynamically adjusted based on the content currently displayed on the display. For example, when a still image is displayed on the electronic device display or the text message editing interface is in progress, the electronic device can reduce the refresh rate to save battery power. When the electronic device display is playing a video or a game interface, the electronic device can increase the refresh rate to obtain a smoother picture effect and faster response speed.
[0075] Typically, mobile phone displays have multiple refresh rate options (e.g., 60Hz, 90Hz, 120Hz), which are switched by the operating system as needed. Applications and other applications also control the refresh rate to ensure that the image content they output can adapt to different refresh rates. The benefit of automatically switching the refresh rate is that it can reduce power consumption while maintaining a good display quality, thus extending battery life.
[0076] In mobile display technology, all applications and system interfaces exist in the form of "layers." Electronic devices can stack and arrange these layers according to attributes such as priority, transparency, and position to ultimately form the content displayed on the display. Each layer is called a layer. In mobile display technology, each layer can contain different images, text, icons, or other visible elements. Each layer on the mobile display can be processed and rendered independently, and then superimposed together to form the final display image. By placing different elements on different layers, more efficient, flexible, and smooth image presentation can be achieved.
[0077] The following is a detailed introduction to the types and styles of layers as well as the layer synthesis and display process.
[0078] Figure 1 is a schematic diagram of the synthesis of electronic device layers.
[0079] As shown in Figure 1, common mobile phone display layers include the following:
[0080] Application Layer: Contains the main display content of the application, such as the application interface, images, videos, etc. FIG1 exemplarily shows the layers of the application "Voice Recorder".
[0081] System Layer: Contains system-level elements such as the operating system's user interface, status bar, and notification bar.
[0082] Launcher layer: Usually located at the bottom of all other layers. It contains elements such as application icons and folders, and is responsible for handling user touch operations or gestures on these elements.
[0083] Wallpaper Layer: Responsible for displaying desktop wallpaper.
[0084] From the generation to the display on the display screen, the layer generally includes the following stages: creation and drawing stage, rendering stage, layer synthesis stage, frame buffer storage stage, display controller processing stage and display screen refresh stage.
[0085] Taking the application layer as an example, the steps from layer generation to display are described. The application needs to display graphics on the phone's display, which involves the following process:
[0086] S1, layer creation and drawing: The application first creates layer data such as graphics objects, textures, or bitmaps through a drawing API (such as OpenGL ES), and then submits them to the surface compositor (SurfaceFlinger).
[0087] S2, Graphics Processing Unit (GPU) rendering: After the application submits the layer data to SurfaceFlinger, SurfaceFlinger passes them to the GPU for actual graphics rendering. The GPU can use its graphics processing capabilities to process and render these graphics objects, such as vertex transformation, texture mapping, lighting calculation, etc., to generate the final image.
[0088] S3, Image Composition: After the GPU completes rendering, the resulting image is returned to SurfaceFlinger in the form of an image buffer. Continuing with Figure 1, SurfaceFlinger is responsible for compositing multiple layers. The compositing process involves blending, transparency processing, and image transformations of different layers to produce the final image to be displayed on the display.
[0089] S4, frame buffer storage stage: After the synthesis is completed, SurfaceFlinger can store the final image data in the frame buffer.
[0090] S5, display controller processing: The display controller is responsible for reading image data from the frame buffer and sending the data to the display screen.
[0091] S6, display screen refresh: the display screen may refresh each pixel segment in a certain order based on the received image data, thereby displaying an image.
[0092] The above process is ongoing. When the application needs to refresh a layer, it will send the image to the GPU again to keep the content on the display updated in real time.
[0093] Generally speaking, the electronic device can determine the refresh rate (Best Refresh Rate) each time the display screen is refreshed based on a refresh rate decision model.
[0094] FIG2 is a schematic diagram of the architecture of a refresh rate decision model shown in an embodiment of the present application.
[0095] As shown in FIG2 , in the refresh rate decision model, the refresh rate is mainly determined by three factors: the available refresh rate of the electronic device, the layer status of the layer in the display screen, and the system status.
[0096] The available refresh rates include one or more display refresh rates supported by the electronic device. These rates are generally determined by factors such as the electronic device's operating system, display performance, and image processor performance. For example, an electronic device may support four available refresh rates: Rate 1, Rate 2, Rate 3, and Rate 4, where Rate 1, Rate 2, Rate 3, and Rate 4 can be, for example, 30 Hz, 60 Hz, 90 Hz, and 120 Hz. In actual applications, the operating system typically provides interfaces or APIs that allow applications to express their expectations or requirements for refresh rates to the system.
[0097] Continuing to refer to FIG. 2 , the layer status includes the layer type, the layer voting type, the layer weight (weight), and the layer desired frame rate (desiredFps).
[0098] Taking the Android operating system as an example, layers can generally be divided into the following types:
[0099] Status bar layer, wallpaper layer: Among them, the status bar layer and wallpaper layer are both system layers.
[0100] Minimum refresh rate layer (MIN): As shown in Figure 2, layer-0 includes layers with a low application sending frequency, for example, less than 10Hz. The sending frequency refers to the frequency at which the application sends layer data to SurfaceFlinger.
[0101] Maximum refresh rate layer (MAX): This layer, such as layer-2 in Figure 2, includes the layer corresponding to application startup or the layer involving large-scale animation. The expected frame rate of the maximum refresh layer is equal to the highest refresh rate among the available refresh rates.
[0102] Explicit frame rate layer: As shown in layer-1 in Figure 2, this layer includes a layer for which the application sets the expected frame rate.
[0103] Heuristic layer: As shown in layer-3 in Figure 2, it includes a layer that can count the frequency of image sending. The Android system can set the expected frame rate for the layer based on the image sending frequency.
[0104] Unable to count layers: Layer-4 shown in Figure 2 includes layers whose image sending frequency cannot be counted.
[0105] Layer weight can refer to the ratio of the layer size to the display size.
[0106] 2 , the system state refers to the state of the electronic device determined based on user operations, including the touch state (Touch State) and the non-touch state (Non-Touch State), as well as the idle state (IDLE State) and the non-idle state (Non-IDLE State).
[0107] FIG3 is a logic diagram of switching system states of an electronic device according to an embodiment of the present application.
[0108] Among them, Figure 3 (a) shows the switching logic of the electronic device between the touch state and the non-touch state. For example: when the electronic device is in the non-touch state, the electronic device can enter the touch state when receiving an input event. An input event is, for example, a user touching the mobile phone display, the mobile phone display switching from portrait to landscape display, or from landscape to portrait display, etc. After the electronic device enters the touch state, a touch timer can be started. If no new input event arrives at the end of the timer, the electronic device will enter the non-touch state.
[0109] FIG3( b) shows the switching logic of the electronic device between the static state and the non-static state. For example, when the electronic device is in the static state, the electronic device can enter the non-static state upon receiving an input event, such as the movement of an element on the display screen. When the electronic device is in the non-static state, the electronic device can start a static timer when the display screen is static. A static display screen means that there are no moving elements on the display screen. If no elements on the display screen move or the user does not touch the display screen when the timer expires, the system state will switch from the non-static state to the static state.
[0110] Based on the refresh rate decision model shown in FIG2 , the electronic device may first determine whether the foreground application has set a maximum refresh rate or a frame rate, that is, whether there is a MAX type or Explicit type layer.
[0111] If a MAX or Explicit layer exists, the electronic device scores one or more available refresh rates based on the layer status of the display and switches the display's refresh rate to the one with the highest score. The specific scoring process is described in detail below and is not detailed here.
[0112] FIG4 is a second schematic diagram of the refresh rate decision model of an electronic device.
[0113] As shown in Figure 4, if there are no MAX or Explicit layers, the electronic device can make a refresh rate decision based on the system state. Specifically, if the system state is touch, the refresh rate is determined to be the highest refresh rate among the available refresh rates, such as 120Hz. If the system state is static, the refresh rate is determined to be the lowest refresh rate among the available refresh rates, such as 30Hz.
[0114] Because electronic devices typically enter a touch state upon receiving an input event, this decision-making method is closely tied to the user's interaction with the electronic device. In other words, as soon as the electronic device receives an input event, it switches the display's refresh rate to its highest possible refresh rate. However, in some scenarios, the display doesn't need to operate at the highest refresh rate. For example, when a user taps the display multiple times at a slow speed, the resulting dynamic effect is minimal, and refreshing at the highest possible refresh rate isn't necessary. Therefore, this decision-making method wastes system resources.
[0115] FIG5 is a third schematic diagram of the refresh rate decision model of an electronic device.
[0116] As shown in Figure 5, when the electronic device is in a non-interactive state and a non-static state at the same time, for example, when the electronic device is playing a video, the electronic device can score and vote on one or more available refresh rates based on the layer state, and switch the refresh rate of the display screen based on the scoring and voting results.
[0117] Among them, in the scoring stage, each layer participating in the scoring in the electronic device display screen scores each available refresh rate. After the electronic device has completed the scoring based on each layer participating in the scoring, the score of each available refresh rate is summed to obtain the final score of each available refresh rate. The available refresh rate with the highest score is used as the required refresh rate of each layer participating in the scoring. The specific scoring process of the layer will be described in detail below. It should be noted that the layers with the expected frame rate (layer-1, layer-2, layer-3) participate in the scoring process, and the layers that cannot be counted (layer-4), the layer with the lowest refresh rate (layer-0), the status bar layer and the wallpaper layer do not participate in the scoring process.
[0118] The voting phase involves the electronic device voting on each layer at its desired refresh rate. It's understood that after the scoring process is complete, the electronic device can determine the desired refresh rate for each layer involved in the scoring. For the lowest refresh rate layer and the wallpaper layer, the Android system sets the desired refresh rate to the lowest available refresh rate. For layers that can't be counted, the Android system sets the desired refresh rate to the highest available refresh rate.
[0119] During the voting phase, the electronic device can score the available refresh rates based on the desired refresh rate of each layer in the display screen. For example, if the display screen includes the lowest refresh rate layer, the desired refresh rate of the lowest refresh rate layer is the lowest refresh rate among the available refresh rates, so a score of 1 can be given for the lowest refresh rate among the available refresh rates. For another example, if the display screen includes an uncountable layer, the desired refresh rate of the uncountable layer is the highest refresh rate among the available refresh rates, so a score of 1 can be given for the highest refresh rate among the available refresh rates. The electronic device can then refresh the display screen at the available refresh rate with the highest vote score.
[0120] In the actual decision-making process, the layers participating in the voting depend on the layers actually included in the electronic device's display. For example, if the electronic device does not include the layers participating in the scoring (layer-1, layer-2, layer-3) and does not include the layer whose frame rate cannot be calculated (layer-4), then only the layer with the lowest refresh rate (layer-0) and the wallpaper layer will participate in the voting.
[0121] The scoring phase involves the electronic device scoring the available refresh rate based on the expected frame rate of each layer. The score ranges from [0, 1] and is determined by the difference between the expected frame rate and the available refresh rate. The closer the available refresh rate is to the expected frame rate, the higher the score. When the available refresh rate is equal to the expected frame rate, the available refresh rate score is 1. The scoring result is then multiplied by the layer weight of the layer to obtain one of the scores for the available refresh rate. After the electronic device completes the scoring process for all participating layers, the scores for each available refresh rate are summed to obtain the final score for each available refresh rate in the scoring phase.
[0122] For optional refresh rate 120Hz:
[0123] ① The electronic device scores 120Hz based on the expected frame rate of layer-1, with a score of x1, where x1 ranges from [0, 1]. The final value of the score given to 120Hz based on layer-1 is x1*weight.
[0124] ② The electronic device scores 120Hz based on the expected frame rate of layer-2, with a score of x2, where x2 ranges from [0, 1]. The final value of the score given to 120Hz based on layer-2 is x2*weight.
[0125] ③ The electronic device scores 120Hz based on the expected frame rate of layer-3, with a score of x3, where x3 ranges from [0, 1]. The final value of the layer-3 score for 120Hz is x4*weight.
[0126] The final score of 120Hz in the scoring stage = x1*weight+x2*weight+x4*weight.
[0127] The scoring process for other available refresh rates is the same as the above process and will not be repeated here.
[0128] Because electronic devices score based on a layer's desired frame rate, the closer the available refresh rate is to the desired frame rate, the higher the score. Furthermore, the final score for the available refresh rate during the scoring phase is closely tied to the layer's weight. Available refresh rates close to the desired frame rate of heavily weighted layers receive higher scores, while available refresh rates close to the desired frame rate of lightly weighted layers receive lower scores. Therefore, incorporating layer weight into refresh rate decisions can easily lead to issues like lag.
[0129] FIG6 is a schematic diagram of a large weight layer and a small weight layer.
[0130] As shown in Figure 6 (a), the layer with a larger weight expects a frame rate of 30Fps when playing videos. Due to its larger weight, the layer gives a larger score to 30Hz, which will result in a higher final score for 30Hz. The layer with a smaller weight expects a frame rate of 60Fps when playing videos. Due to its smaller weight, the layer gives a smaller score to 60Hz, which will result in a lower final score for 60Hz. The above process causes the two layers to participate in the voting process with 30Hz as the requested refresh rate, which in turn leads to a decision result of 30Hz. However, as shown in Figure 6 (b), this decision result will cause both the large layer and the small layer to refresh at a refresh rate of 30Hz, which will eventually cause the video playback of the small layer to be stuck.
[0131] Figure 7 is a schematic diagram of multiple layers participating in decision-making.
[0132] It should also be noted that when there are multiple layers participating in the scoring, for the same available refresh rate, each layer participating in the scoring process will participate. In other words, each layer will participate in the calculation process of the requested refresh rate of other layers, which may easily lead to inaccurate layer requested refresh rates. For example, if the weight of each layer is equal and equal to 0.5, there are the following scoring scenarios:
[0133] As shown in Figure 7 (a), the expected frame rate of layer 1 is 120 FPS. 120 Hz gets 1*0.5=0.5 points, and other available refresh rates get 0 points;
[0134] The desired frame rate for layer 2 is 60 FPS. 60 Hz gets 1*0.5=0.5 points, and other available refresh rates get 0 points.
[0135] The expected frame rate of layer 3 is 60 FPS. 60 Hz gets 1*0.5=0.5 points, and other available refresh rates get 0 points.
[0136] In the total score obtained in this scoring stage, 60Hz (1 point) > 120Hz (0.5 points) > other available refresh rates. In this way, the desired refresh rate of each layer participating in the scoring is 60Hz. As shown in Figure 7 (b), after each layer votes with its desired refresh rate, the final decision result will be 60Hz, resulting in a suboptimal motion effect experience for layer 1. It can be seen that each layer participates in the calculation process of the desired refresh rate of other layers, which ultimately leads to a poor motion effect experience.
[0137] In addition, electronic devices typically set the requested refresh rate of layers that do not have a specified frame rate and whose image delivery frequency cannot be counted to the highest refresh rate. If these layers also participate in the vote, the highest refresh rate may receive the most votes, causing the electronic device to switch the refresh rate of the display to the highest refresh rate. However, layers that do not have a specified frame rate and whose image delivery frequency cannot be counted are usually layers that suddenly appear on the display and contain irregular animations. When these layers appear, switching the refresh rate of the display to the highest refresh rate will result in a waste of system resources.
[0138] To solve the above problems, the present invention provides an image display method that can be applied to electronic devices. This solution can avoid wasting resources during the refresh rate display process, while also avoiding poor layer refresh effects, thereby improving the user experience.
[0139] The image display method provided in the embodiments of the present application can be applied to electronic devices with display functions. Among them, electronic devices include but are not limited to mobile phones, tablet computers, personal computers, workstations, large-screen devices (such as smart screens and smart TVs), wearable devices (such as smart bracelets and smart watches), handheld game consoles, home game consoles, virtual reality devices, augmented reality devices, mixed reality devices, etc., and in-vehicle smart terminals.
[0140] FIG8 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application.
[0141] As shown in Figure 8, the electronic device 100 may include a processor 110, a memory 120, 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 sensor module 180, a button 190, a motor 191, a camera 192, a display screen 193, and a subscriber identification module (SIM) card interface 194, etc.
[0142] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0143] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a display controller (display controller) 195, a graphics processing unit (GPU) 196, 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). The different processing units may be independent devices or integrated into one or more processors.
[0144] The graphics processor 196 may be used to perform image rendering, video decoding and encoding, etc. The display controller 195 may be used to receive image data from the graphics processor 196 and convert the image data into a signal capable of driving the display screen 193 for display.
[0145] The memory 120 can be used to store computer executable program code, which includes instructions. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory 120, and / or instructions stored in a memory provided in the processor.
[0146] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0147] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0148] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0149] 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 charging management module 140 and provides power to the processor 110, the memory 120, the display 193, the camera 192, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0150] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0151] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0152] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G 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), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0153] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed 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 193. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0154] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0155] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. 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).
[0156] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0157] FIG9 is a block diagram of the software structure of the electronic device according to an embodiment of the present application.
[0158] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0159] The application layer can include a series of application packages.
[0160] As shown in FIG9 , the application package may include applications such as battery management, camera, gallery, calendar, call, map, navigation, music, video, and short message.
[0161] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0162] As shown in FIG5 , the application framework layer may include a window manager, an input manager, a sensor manager, a telephony manager, a resource manager, a notification manager, and the like.
[0163] The input manager can be used to monitor user input events, such as click events and slide events performed by the user's finger on the display screen 193 of the electronic device 100. By monitoring the input events, the electronic device 100 can determine whether the electronic device is being used.
[0164] The sensor manager is used to monitor the data returned by various sensors in the electronic device, such as motion sensor data, proximity sensor data, temperature sensor data, etc. Using the data returned by each sensor, the electronic device can determine whether it is shaking or whether the display screen 193 is blocked.
[0165] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0166] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0167] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0168] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0169] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0170] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0171] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0172] A 2D graphics engine is a drawing engine for 2D drawings.
[0173] Furthermore, the system library also includes a surface compositor (SurfaceFlinger), which is used to manage and synthesize the graphical interface of the application. For example, the application can provide layer data to SurfaceFlinger. After receiving the layer data from the application, SurfaceFlinger can pass the layer data to GPU 196 for GPU 196 to render the image. SurfaceFlinger can then synthesize the rendered image to obtain multiple layers. After the layer synthesis is completed, SurfaceFlinger can send the image to the frame buffer.
[0174] The kernel layer is the layer between hardware and software. The kernel layer includes at least the display driver (Display Driver), camera driver, audio driver, sensor driver, and graphics driver (Graphics Driver).
[0175] The display driver is responsible for processing the image data in the frame buffer from the graphics processor 196 and converting it into signals recognizable by the display screen 193, thereby ensuring that the correct image is sent to the display screen 193 and presented in an appropriate manner. The graphics driver can be used to manage and control the graphics processing unit 196 in the computer system and its related graphics functions and display devices.
[0176] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0177] FIG10 is a first flow chart of the image display method provided in an embodiment of the present application.
[0178] As shown in Figure 10, the image display method provided by the embodiment of the present application may include S10: when the electronic device is in a first device state, the display screen of the electronic device displays an image at a first refresh rate, wherein the electronic device being in the first device state includes: the electronic device receives a target interaction event, the target interaction event includes: a click event and a first sliding event, the first sliding event is a sliding event with a sliding speed greater than a first preset threshold; the first refresh rate is the highest refresh rate of the display screen, or the first refresh rate is greater than or equal to the preset refresh rate threshold.
[0179] In an embodiment of the present application, a display screen may be determined to refresh an image at a first refresh rate based on a device state of the electronic device. The device state may specifically be a first device state, also known as a Boost state. A condition for the electronic device to enter the first device state may be the occurrence of a specific event, which may specifically be triggered by a touch sensor of the electronic device capturing various user operations on the display screen.
[0180] Specifically, a click event is triggered by a click operation, but not all user touch actions on the display screen can trigger a click event. An action where the interval between the user's press and lift actions is less than a certain time threshold can trigger a click event. For example, as shown in Figure 11 (a), the user's finger quickly presses and lifts on the game interface, and a click event occurs at this time. The time threshold is, for example, 300ms, which is not specifically limited in the embodiments of the present application.
[0181] The first sliding event can be triggered by the user sliding their finger quickly on the display screen, such as the user quickly browsing a long page or quickly scrolling a list. The first sliding event is a sliding event in which the sliding speed is greater than the first preset threshold. In actual applications, the sliding speed can be determined based on the number of sliding pixels and the time of the sliding operation. Specifically, the electronic device can record the position of the finger touch at a fixed time interval, and calculate the position of the finger on the display screen after m time intervals based on these position information, and obtain the pixel difference between the first position and the mth position, and then calculate the sliding speed based on the pixel difference and the total time corresponding to the two positions. The time interval is, for example, 1ms, and m can be, for example, equal to 5. This embodiment of the present application does not make specific restrictions on this. Afterwards, it can be calculated based on the sliding speed whether the sliding event is the first sliding event. For example, as shown in (b) in Figure 11, the user quickly turns the page, and the first sliding event can occur at this time.
[0182] The first preset threshold value may be, for example, 1000 pixels / second or 500 pixels / second, which may be determined by actual conditions and is not specifically limited in the embodiments of the present application.
[0183] The first refresh rate may be determined based on all refresh rates supported by the display. For example, if the display supports any of 30 Hz, 60 Hz, 120 Hz, and 144 Hz refresh rates, the electronic device may determine the first refresh rate to be the highest refresh rate supported by the display at that time, 144 Hz.
[0184] In an embodiment of the present application, the first refresh rate can be determined based on the optional refresh rate supported by the display screen, and the first refresh rate is one of the optional refresh rates. The optional refresh rate supported by the display screen can be determined by the operating state of the electronic device and the hardware capabilities of the display screen. For example, the hardware capabilities of the display screen support a refresh rate of 144Hz or higher, but the electronic device locks the refresh rate range based on factors such as its operating state, so that the display screen refreshes at 120Hz as the highest refresh rate. At this time, the optional refresh rate when the display screen refreshes is less than or equal to 120Hz, then the first refresh rate can be 120Hz. Figure 11 (a) and (b) exemplify that the first refresh rate is equal to 120Hz.
[0185] In the embodiment of the present application, the refresh rate threshold may be 60 Hz or 90 Hz, and the embodiment of the present application does not specifically limit this.
[0186] It is understandable that when a user uses an electronic device, many events may be triggered as the interaction progresses. In addition to click events and the first sliding event, these events also include, for example, long press events and screen orientation change events. Since not all events can trigger the first device state, when events other than click events and the first sliding event occur, the electronic device will not enter the first device state, thereby preventing the display screen from displaying images at the first refresh rate. Therefore, based on the method provided in the embodiment of the present application, the number of times the electronic device refreshes the content on the display screen at the highest refresh rate can be reduced, preventing the electronic device from refreshing at the highest refresh rate when it is not necessary, and reducing the power consumption of the electronic device.
[0187] In an embodiment of the present application, the electronic device being in the first device state may further include: the display screen is playing a target motion effect, wherein the target motion effect may be a motion effect image whose change range exceeds a first change value. The change range may refer to the degree or magnitude of change in the attributes or features of an image, such as the size change range, position change range, color change range, or transparency change range of an element in the image. For example, if a button in an image is enlarged, the size change range of the button is the difference between the enlarged size and the initial size, and the first change value is the size threshold. For another example, the button in the image is initially located in the lower left corner of the display screen, and after a certain period of time, the button is located in the middle of the display screen. The position change range is the distance covered by the movement path of the button from the lower left corner to the middle position, and the first change value is the distance threshold. The position change range can be measured in different dimensions, such as horizontal movement in the horizontal direction and vertical movement in the vertical direction.
[0188] In the embodiment of the present application, the target animation effect can specifically be a screen opening animation effect or a transition animation effect. The screen opening animation effect can be the animation effect during the startup process before the application enters the user interface, and the transition animation effect can refer to the animation effect that appears when switching between electronic device interfaces or switching between applications. For example, the transition animation effect that appears when switching to the home screen of the electronic device, closing an application, etc.
[0189] As can be seen, in the embodiment of the present application, the electronic device can enter the first device state when the target animation occurs, and when the electronic device is in the first device state, the display screen displays images at the first refresh rate. This can reduce the number of times the electronic device refreshes the content on the display screen at the highest refresh rate, avoid the electronic device refreshing at the highest refresh rate when it is not necessary, and reduce the power consumption of the electronic device.
[0190] Furthermore, the target animation effect being that the range of change of the animation image exceeds the first change value may include: the target animation effect being that the range of change of the animation image exceeds the first change value within a first preset duration. The first preset duration may be, for example, 100ms, 200ms, 300ms, or 500ms, and the first change value may be, for example, 300 pixels or 500 pixels, which are not specifically limited in this embodiment of the present application.
[0191] Continuing to refer to FIG. 10 , the image display method provided in the embodiment of the present application may further include S20 : when the electronic device is not in the first device state, the display screen displays the image using a refresh rate that matches the image layer.
[0192] In the embodiments of the present application, the image layer refers to the layer in the display screen used to display images. Using a refresh rate that matches the image layer can ensure that the image is smoother and clearer during display, reduce tearing or blurring of the screen, and provide a good visual experience. If the refresh rate is too high, the system will cause excessive consumption of system resources and power without providing additional visual effects. Therefore, using a refresh rate that matches the image layer to display images can also avoid unnecessary waste of resources and energy consumption.
[0193] Further, step S20 may include S21: when the electronic device is not in the first device state and the display screen includes M first target layers, the display screen displays the image at a second refresh rate, wherein the first target layer with the matching frame rate is the active layer, and the matching frame rate of the first target layer is greater than or equal to the first threshold, the active layer includes a visible layer whose image content has been updated within the first historical time period, and the second refresh rate is determined based on the matching frame rate of the M first target layers.
[0194] The matching frame rate can indicate the speed at which the first target layer is updated and rendered per second. Determining the second refresh rate based on the matching frame rate of the first target layer can match the refresh rate of the display screen with the speed at which the first target layer is updated and rendered, thereby avoiding problems such as tearing in the image content of the first target layer.
[0195] In some implementations, the first historical duration may be equal to 1.2 seconds, which is not specifically limited in the embodiments of the present application.
[0196] It is understandable that the value of M is determined by the actual situation of the layers in the display screen.
[0197] The following describes specific steps for determining the second refresh rate based on the matching frame rates of the M first target layers.
[0198] Specifically, the second refresh rate is the maximum refresh rate among refresh rate 1 to refresh rate M, wherein refresh rate 1 is the refresh rate expected for the first first target layer, refresh rate M is the refresh rate expected for the Mth first target layer, refresh rate 1 is determined based on the matching frame rate of the first first target layer and the optional refresh rate supported by the display screen, and refresh rate M is determined based on the matching frame rate of the Mth first target layer and the optional refresh rate supported by the display screen.
[0199] The step of calculating and then determining the expected refresh rate based on the matching frame rate and the optional refresh rate supported by the display screen may be to calculate the degree of proximity between the matching frame rate and the optional refresh rate, and determine the optional refresh rate closest to the matching frame rate as the expected refresh rate of the first target layer. The method for calculating the degree of proximity is, for example, to calculate the multiple relationship between the matching frame rate and the optional refresh rate, and determine the optional refresh rate closest to the matching frame rate based on the multiple relationship. The method for calculating the degree of proximity may also be to calculate the percentage difference between the matching frame rate and the optional refresh rate. Specifically, the difference between the two can be calculated, and the difference can be divided by the matching frame rate, and then multiplied by 100 to obtain a percentage value. The embodiments of the present application do not specifically limit this.
[0200] For each first target layer, one or more optional refresh rates can be determined after calculation. For example, if the matching frame rate of the i-th first target layer is 30 FPS, then the desired refresh rates of the i-th first target layer can be 30 Hz and 60 Hz.
[0201] Exemplarily, the optional refresh rates may include 30Hz, 60Hz, 90Hz, and 120Hz. The display screen may include three first target layers. The matching frame rate of the first first target layer may be 30Fps, and its expected refresh rate is determined to be 30Hz and 60Hz through calculation. The matching frame rate of the second first target layer may be 120Fps, and its expected refresh rate is determined to be 120Hz through calculation. The matching frame rate of the third first target layer may be 60Fps, and its expected refresh rate is determined to be 120Hz through calculation. Then, the second expected refresh rate is the maximum refresh rate among 30Hz, 60Hz, and 120Hz, that is, the second expected refresh rate is 120Hz.
[0202] The method provided in the embodiment of the present application may further include step S30: when the electronic device is not in the first device state and the display screen does not include the first target layer, the display screen displays the image at a third refresh rate, and the third refresh rate is the default refresh rate of the display screen.
[0203] The default refresh rate is the refresh rate when no adjustment is made to the refresh rate of the image displayed on the display. The display refreshes content at the default refresh rate, which can reduce the power consumption of the electronic device and avoid unnecessary waste of resources.
[0204] In an embodiment of the present application, the default refresh rate may be 60 Hz. The 60 Hz refresh rate has wide compatibility in display screens, and the frame rate of many layers is 60 frames per second. Therefore, refreshing the content in the display screen with 60 Hz as the default refresh rate can provide a good user experience. The default refresh rate may also be determined based on multiple factors such as the hardware capabilities of the display screen. For example, when the display screen supports a maximum refresh rate of 144 Hz, the default refresh rate may be 90 Hz. This embodiment of the present application does not specifically limit this.
[0205] FIG12 is a second flow chart of the image display method provided in an embodiment of the present application.
[0206] As shown in FIG12 , the image display method provided in the embodiment of the present application includes the following steps S100 to S500 :
[0207] S100: Before the electronic device refreshes the content on the display screen each time, determining whether the electronic device is in the first device state.
[0208] In an embodiment of the present application, the timing of each refresh of the content on the display screen of the electronic device can be controlled by a vertical synchronization signal (VSync). The vertical synchronization signal can include a hardware-generated VSync-HW signal, as well as software-simulated VSync-APP and VSync-SF signals. The VSync-HW, VSync-APP, and VSync-SF signals usually arrive periodically at certain time intervals.
[0209] Taking an electronic device equipped with an Android system as an example, when the VSync-APP signal arrives, the SurfaceFlinger process performs the drawing of one or more layers required for the image frame based on the layer data sent from the foreground application, and performs layer rendering on the drawn one or more layers; thereafter, when the VSync-SF signal arrives, the SurfaceFlinger process synthesizes the rendered one or more layers into an image frame and sends the synthesized image frame to the display; thereafter, when the VSync-HW signal arrives, the display will refresh to display the image frame. Therefore, before each refresh of the content on the display of an electronic device can refer to before the electronic device receives the VSync-HW signal.
[0210] The first device state may include that the electronic device receives a target interaction event or the display screen is playing a target motion effect, and the target interaction event includes a click event and / or a first sliding event.
[0211] In the embodiment of the present application, the target interaction event may include a click event (Click) and / or a first sliding event.
[0212] Before introducing target interaction events, let's first briefly introduce touch events involved in electronic devices. In electronic devices, touch screens are often used as the primary method of input and user interaction. When a user touches or clicks on the display, corresponding touch events are triggered. These events can include:
[0213] 1. Touch Down event: This event indicates that the user begins to press their finger on the display. In this event, the electronic device usually records the location and time stamp of the user's press.
[0214] 2. Touch Move event: This event indicates that the user swipes their finger across the display. In this event, the electronic device typically records the current swipe position, distance moved, and timestamp.
[0215] 3. Touch Up event: This event indicates that the user releases their finger from the display. In this event, the electronic device typically records the location and timestamp of the finger release.
[0216] 4. Click event: A Click event is triggered by a click operation. A series of events that occur consecutively between a Touch Down event and a Touch Up event is considered a Click event. Specifically, a Click event is triggered when the difference between the timestamps of the Touch Down event and the Touch Up event on the display screen is less than a certain duration (for example, 300ms). Clearly, the Click event depends on the occurrence of the Touch Down event, and the occurrence of the Touch Down event does not necessarily trigger a Click event. A Click event is triggered only when the difference between the timestamps of the Touch Down event and the Touch Up event is less than a certain duration.
[0217] It should be noted that not every Click event can trigger the first device state. The embodiment of the present application can prohibit triggering the first device state for specific application settings. For example, the Click event of the layer of the input method application cannot trigger the first device state.
[0218] The first sliding event may be a sliding event in which the sliding speed is greater than a first preset threshold. The first sliding event may be triggered by a Touch Move event. Specifically, the electronic device may calculate the sliding speed based on the position information, movement distance, and timestamp of the sliding finger, and may trigger the first sliding event when the sliding speed is greater than the first preset threshold. It is understood that when the first sliding event occurs, the content on the display screen will scroll rapidly as the user's finger slides, and therefore the content on the display screen will change significantly.
[0219] The target animation can be an animation that involves a wide range of changes or changes quickly. Specifically, the target animation can be an animation image whose change range exceeds the first change value. For example, the animation involved when the application opens the screen, the animation in the game, etc., which can be gradient and transition effects, translation and zoom animations, drag and scroll effects, etc. The slight movement of miniature icons or the slight swing of graphic elements are all non-target animations. The specific type of target animation can be determined by actual needs, and the embodiments of this application do not specifically limit this.
[0220] S200: When the electronic device is in a first device state, refresh content on the display screen at a first refresh rate.
[0221] The first refresh rate is the maximum refresh rate of the display screen, or the first refresh rate is greater than or equal to a preset refresh rate threshold.
[0222] Step S200 is a condition for determining the refresh rate of a displayed image provided by an embodiment of the present application. Based on step S200, the refresh rate of the image displayed on the display screen can be determined.
[0223] FIG13 is a first schematic diagram of conditions for determining a refresh rate of a displayed image in the image display method provided in an embodiment of the present application.
[0224] As shown in FIG13 , the electronic device may refresh the content on the display screen at a first refresh rate when it is in the first device state.
[0225] It can be seen that the image display method provided in the embodiment of the present application will not refresh at the highest refresh rate based on the occurrence of any interactive event, but will switch the display screen to the highest refresh rate only when a click event and / or a first sliding event occurs. In this way, for some relatively simple interactive events or animations, the highest refresh rate will not be triggered, which can solve the problem of resource waste caused by frequent refresh at the highest refresh rate.
[0226] For example, when a user reads text on a display screen, a Touch Down event, a Touch Move event, and a Touch Up event are typically triggered. The Touch Down event corresponds to the user pressing their finger, the Touch Move event corresponds to the user slowly sliding the page to present new text content, and the Touch Up event corresponds to completing the page turn and releasing the finger. It can be seen that in this process, the display screen changes involved are very small, and the maximum refresh rate is not required. Based on the embodiment of the present application, the above process does not trigger the target interaction event and will not trigger the maximum refresh rate.
[0227] The maximum refresh rate supported by an electronic device's display depends on a variety of factors, including the device's hardware capabilities and display technology. Hardware capabilities include the performance of components like the processor, graphics processing unit, memory, and storage. The performance of these hardware components determines the computing and graphics processing capabilities of the device. Higher hardware capabilities support higher refresh rates and smoother displays. Display technology refers to the technology used to manufacture the display. For example, displays made with OLED or AMOLED technology can support refresh rates up to 144Hz.
[0228] In the embodiment of the present application, the maximum refresh rate may be the maximum value of one or more optional refresh rates supported by the display. For example, if the display supports any of 30Hz, 60Hz, 120Hz, and 144Hz refresh rates, the electronic device may determine the first refresh rate to be the highest refresh rate supported at that time, 144Hz. If the display supports any of 30Hz, 60Hz, and 120Hz refresh rates, the electronic device may determine the first refresh rate to be the highest refresh rate supported at that time, 120Hz.
[0229] In actual applications, electronic devices can dynamically adjust the refresh rate range provided based on their own status. For example, when the electronic device is in high-performance mode, the electronic device can support any refresh rate of 30Hz, 60Hz, 120Hz, and 144Hz, then the electronic device can determine the first refresh rate as 144Hz. When the electronic device is in power saving mode, the electronic device can support any refresh rate of 30Hz, 60Hz, and 120Hz, then the electronic device can determine the first refresh rate as 120Hz. When the electronic device is in super power saving mode, the electronic device can support both 30Hz and 60Hz refresh rates, then the electronic device can determine the first refresh rate as 60Hz.
[0230] It should be noted that in order not to affect the user experience, electronic devices can also take some measures to lock the refresh rate. For example, by locking the refresh rate of the display screen, applications or games will be restricted to run within a specific frame rate or frame rate range, and will not exceed or fall below the frame rate or frame rate range, so as to avoid frequent changes in refresh rate that reduce the gaming experience. If the electronic device locks the refresh rate to 120Hz, then only one optional refresh rate is included at this time. For example, when the display screen is in a low-brightness display state, the low-brightness display is, for example, a brightness value of 30. At this time, the electronic device can also lock the refresh rate of the display screen, for example, locked to 30Hz.
[0231] It is worth noting that when the nth VSync-HW signal arrives, the steps of refreshing the display screen for the nth time and determining the refresh rate for refreshing the display screen can be performed, and then the timing of the arrival of the n+1th VSync-HW signal is adjusted based on the first refresh rate. For example, the nth VSync-HW signal arrives at the 0th second, and the refresh rate for refreshing the display screen is determined to be the first refresh rate, i.e., 120Hz, based on steps S100-S200. At this time, the electronic device can adjust the interval length between two adjacent VSync-HW signals to 8.33ms. That is, at the 8.33ms, the n+1th VSync-HW signal arrives, and the steps of refreshing the display screen for the n+1th time and determining the refresh rate for refreshing the display screen can be performed.
[0232] S300: When the electronic device is not in the first device state, determine whether the display screen includes a first target layer.
[0233] Step S300 is another condition for determining the refresh rate of the displayed image, which is different from step S200. Based on step S300, the refresh rate of the displayed image on the display screen can be determined.
[0234] FIG14 is a second schematic diagram of the conditions for determining the refresh rate of the displayed image in the image display method provided in an embodiment of the present application.
[0235] As shown in FIG. 14 , not being in the first device state may also be referred to as the electronic device being in the Non-Boost state.
[0236] In an embodiment of the present application, layers are divided into three layer types: a first target layer, a second target layer, and a third target layer. The first target layer is an active layer, and the matching frame rate (desiredFps) of the first target layer is greater than or equal to a first threshold value. The active layer includes a visible layer whose image content has been updated within a first historical duration. The desiredFps here is only an exemplary description of the matching frame rate. The first threshold value can be equal to 10Hz, for example, and the first historical duration can be equal to 1.2s, for example. The matching frame rate can be preset by the application, or it can be obtained by counting the frequency of the application or system sending images to SurfaceFlinger. The specific statistical process will be described in detail below and will not be repeated here. The matching frame rate indicates the speed at which the first target layer is updated. For example, a game application can set the matching frame rate of the game layer to 60Fps, that is, update 60 times per second.
[0237] The second target layer is the layer that is currently being animated, and the third target layer is the wallpaper layer, and / or the layer whose matching frame rate is less than the first threshold, and the status bar layer. It should be noted that Figure 14 only exemplarily illustrates the first target layer including Layer 1-Layer 5, and the second target layer Layer 6. The active layer may also include a third target layer, which is not fully illustrated in Figure 14.
[0238] In one implementation, the step of determining whether a layer is an active layer may include: before the electronic device refreshes the content of the display screen each time, calculating, for all visible layers in the display screen, the difference between the time when the visible layer last updated its image content and the current time; if the difference is less than or equal to the first historical duration, then the visible layer may be determined to be the active layer.
[0239] The layer updating image content referred to here may refer to the application sending layer data to SurfaceFlinger within the first historical duration, or may refer to the property of the layer changing within the first historical duration.
[0240] S400: In a case where a display screen includes at least one first target layer, determine at least one expected refresh rate from at least one optional refresh rate based on the matching frame rate of each first target layer, and refresh the content in the display screen at the highest refresh rate among the at least one expected refresh rate.
[0241] Exemplarily, the optional refresh rates may include Rate1, Rate2, Rate3, and Rate4, and Rate1, Rate2, Rate3, and Rate4 may be 30Hz, 60Hz, 90Hz, and 120Hz, respectively. For each first target layer, the step of determining at least one desired refresh rate from at least one optional refresh rate may be to score at least one optional refresh rate of the display screen, and determine the optional refresh rate with the highest score as the desired refresh rate of the layer. For example, for layer x, the electronic device scores 30Hz, 60Hz, 90Hz, and 120Hz based on the matching frame rate of layer x, and determines that 60Hz has the highest score, then the desired refresh rate of layer x is 60Hz. For another example, for layer y, the electronic device scores 30Hz, 60Hz, 90Hz, and 120Hz based on the matching frame rate of layer y, and determines that 120Hz has the highest score, then the desired refresh rate of layer y is 120Hz.
[0242] It can be seen that in the scoring method provided in the embodiment of the present application, for any first target layer, the electronic device can score the optional refresh rate based on the matching frame rate of the first target layer, determine the expected refresh rate of the first target layer, and then select the highest expected refresh rate among the expected refresh rates of all first target layers for refresh. In this way, in the step of determining the expected refresh rate of the layer, the various first target layers will not affect each other, which can make the expected refresh rate calculation more accurate. The requirements of each layer are met, which can avoid the situation where the dynamic effect experience of the layer with a higher expected refresh rate is poor.
[0243] FIG15 is a first application diagram of the image display method provided in an embodiment of the present application.
[0244] As shown in Figure 15, for example, a user is watching a video in portrait mode while browsing the comments section. At this point, the display screen includes at least Layer 4, which displays the currently playing video, and Layer 5, which displays the comments interface. Layer 4's matching frame rate is 60 FPS. After scoring, the highest-scoring optional refresh rate is 60 Hz, meaning the expected refresh rate for Layer 4 is 60 Hz. Layer 5's matching frame rate is 30 FPS. After scoring, the highest-scoring optional refresh rate is 30 Hz, meaning the expected refresh rate for Layer 5 is 30 Hz. Since the expected refresh rate for Layer 4 is greater than that for Layer 5, the electronic device ultimately refreshes the content on the display screen at 60 Hz.
[0245] S500: When the display screen does not include the first target layer, refresh the content in the display screen at a third refresh rate, where the third refresh rate is a default refresh rate of the display screen.
[0246] In an embodiment of the present application, when the first target layer does not exist, that is, when the active layer does not include a layer whose matching frame rate is greater than or equal to the first threshold, the scoring process can be skipped and the display screen can be directly refreshed at the default refresh rate.
[0247] FIG16 is a schematic diagram showing a display screen provided in an embodiment of the present application that does not include the first target layer.
[0248] The electronic device is not in the first device state and the first target layer does not exist. For example, a scene in which a transient motion effect appears on the display screen may occur. As shown in (a) in Figure 16, the electronic device display screen includes a status bar layer and a weather application layer, and each layer has not changed. At this time, the refresh rate is 10Hz. As shown in (b) in Figure 16, a GPS logo appears on the status bar layer. It can be seen that the weather application layer has not changed, and a transient motion effect appears on the status bar layer. At this time, the display screen can be refreshed at the default refresh rate, and the default refresh rate is, for example, 60Hz.
[0249] In an embodiment of the present application, the default refresh rate can be 60Hz. It can be understood that the 60Hz display refresh rate, as a central refresh rate, has wide compatibility, and the 60Hz refresh rate can provide a relatively smooth and natural animation and video playback experience, can provide good visual effects, and can reduce energy consumption, taking into account performance and smoothness.
[0250] From the above content, it can be seen that the image display method provided by the embodiment of the present application can use whether the electronic device is in the Boost state as a condition for determining the refresh rate of the displayed image, and whether it is in the Boost state is related to whether the target interactive event or target dynamic effect occurs. In this way, the highest refresh rate can be applied when the target interactive event or target dynamic effect arrives, rather than applying the highest refresh rate when any interactive event or dynamic effect arrives, which can avoid wasting resources. When the electronic device is not in the Boost state, the method provided by the embodiment of the present application can also determine whether the display screen includes the first target layer. In the case where the display screen includes the first target layer, the optional refresh rate is scored based on the matching frame rate of each first target layer to determine the expected refresh rate of each first target layer. In this way, for any first target layer, the expected refresh rate can be determined based on its own matching frame rate. The various first target layers will not affect each other, which can make the expected refresh rate calculation more accurate. Finally, the content in the display screen is refreshed at the highest refresh rate among the expected refresh rates, so that the refresh effect of the first target layer with the highest expected refresh rate is in the best state, and there is no jamming or the like. In the case where the display screen does not include the first target layer, the display screen can be refreshed at the default refresh rate.
[0251] In some implementations, before determining whether the display screen includes the first target layer in step S300 , the process further includes S301 : determining whether the display screen includes the second target layer.
[0252] That is, the electronic device may first determine whether the display screen includes an active layer that is playing a motion effect.
[0253] Determining whether the display screen includes the first target layer may include S302: if the display screen does not include the second target layer, determining whether the display screen includes the first target layer.
[0254] In this way, the refresh rate of the image displayed on the display screen can be determined based on the scoring process when the display screen does not include the second target layer.
[0255] In some implementations, when a first target layer exists on a display screen, it may be further determined that the matching frame rates of all first target layers on the display screen are equal to a first preset value and none of the matching frame rates are preset. If all first target layers on the display screen are equal to the first preset value and none of the matching frame rates are preset, the display screen is refreshed at a default refresh rate. In this embodiment of the present application, if the active layer does not have a preset matching frame rate, and the number of updates of the active layer within the second historical duration is less than a threshold number, and the time interval between each update is unequal, the matching frame rate of the active layer is the first preset value.
[0256] If at least one first target layer in the display screen has a preset matching frame rate, at least one optional refresh rate of the display screen is scored based on the matching frame rate of each first target layer, and at least one expected refresh rate is determined from the at least one optional refresh rate based on the scoring result, and the content in the display screen is refreshed at the highest refresh rate of the at least one expected refresh rate.
[0257] FIG17 is a third schematic diagram of the conditions for determining the refresh rate of the displayed image in the image display method provided in an embodiment of the present application.
[0258] In some implementations, as shown in FIG17 , in an embodiment of the present application, step S301 may be followed by step S303 : when the display screen includes a second target layer, refreshing the content in the display screen at the first refresh rate.
[0259] That is to say, when the electronic device is not in the first device state, if the display screen is playing an animation, the display screen can be refreshed using the highest refresh rate to improve the user experience.
[0260] For example, as shown in (a) and (b) of FIG18 , the display screen includes at least a layer of content such as text and images posted by the user in the application. The user can press and hold the display screen and slowly pull it down, then release it. Since the slow pull-down operation is not a click event or a first slide event, it will not trigger the electronic device to enter the first device state.
[0261] When a slow pull-down operation is performed, an updated animation appears on the display screen, that is, an active layer that is playing the animation appears on the display screen. At this time, the electronic device refreshes the content on the display screen at the first refresh rate, which can be 120Hz. Next, as shown in (c) and (d) in Figure 18, after the user lets go, the updated animation continues to appear on the display screen, that is, the active layer includes the second target layer, and the electronic device continues to refresh at the first refresh rate.
[0262] In this implementation, before determining whether the display screen includes the first target layer, the electronic device first determines whether the display screen includes the second target layer. If the second target layer is included, the content on the display screen is refreshed at the first refresh rate. If the second target layer is not included, the electronic device then determines whether the first target layer is included, and then performs the scoring step based on the first target layer. In this way, if the electronic device has the first target layer, the refresh rate of the image displayed on the display screen can be determined before executing the scoring process, reducing the amount of calculation, speeding up the refresh rate determination, and avoiding resource waste.
[0263] FIG19 is a third flow chart of the image display method provided in an embodiment of the present application.
[0264] As shown in FIG. 19 , in some embodiments, step S100 , i.e., determining whether the electronic device is in the first device state before the electronic device refreshes the content on the display screen each time, can be implemented by following steps S601 - S612 .
[0265] S601: Before the electronic device refreshes the content on the display screen each time, a cache result is obtained, where the cache result includes the device status information of the electronic device, the layer status information of the active layer, and the historical refresh rate information used by the display screen before the content on the display screen was last refreshed.
[0266] The screen refresh rate when the electronic device refreshed the content on the display screen last time was the first historical refresh rate.
[0267] In an embodiment of the present application, the refresh rate of the image displayed on the display screen can be determined before each refresh of the content on the display screen. After determining the refresh rate, the electronic device can cache the refresh rate as historical refresh rate information, and can also cache device state information and layer state information of the active layer for use when determining the refresh rate of the image displayed on the display screen the next time.
[0268] In the embodiment of the present application, the device status information may include information on other device states in addition to the information on the first device state, such as Touch state information and IDLE state information.
[0269] The electronic device may enter the Touch state upon receiving a touch event, such as a Touch Down event. It is understood that as long as a user touches the display screen, the electronic device will receive a touch event, and the user may touch the display screen by clicking the display screen, long pressing the display screen, or sliding the display screen. Therefore, after receiving a touch event and entering the Touch state, the electronic device may also receive a click event (Click) and / or a first slide event, entering the first device state from the Touch state.
[0270] In some implementations, a change in screen orientation may also trigger the electronic device to enter the Touch state.
[0271] The electronic device may enter an IDLE state when all layers in the display are in a static state. All layers being in a static state may mean that all layers remain unchanged during n consecutive refreshes, where n ≥ 2.
[0272] Continuing to refer to FIG14 , the layer status information may include, for example, the layer name (name), matching frame rate (desiredFps), voting type (vote type), seamlessness (Seamlessness) and weight (weight). In some implementations, the layer status may also include focus (focused).
[0273] The matched frame rate indicates the number of times a layer updates per second. This can be a preset setting by the application or calculated based on the frequency at which the application sends images. For layers with a preset matched frame rate, the matched frame rate represents the number of frames per second that the application expects the layer to render. For example, a game developer may want the game to run at a frame rate of 60 FPS to provide a smooth gaming experience. The display refresh rate is the number of times the display updates its content per second. Therefore, for optimal visual quality and smoothness, the matched frame rate should match or be close to the display refresh rate. When the matched frame rate matches the refresh rate, each new image frame of the application layer is rendered when the display updates, ensuring image continuity. If the matched frame rate is lower than the display refresh rate, image frames may be repeated between consecutive refreshes, resulting in an unsmooth visual experience.
[0274] The first target layer, the second target layer, and the third target layer have different layer types and different voting types. For example, the voting type of the status bar layer (StatusBar) is NoVote. Voting types also include many other types, such as minimum voting rights Min, maximum voting rights Max, explicit default value ExplicitDefault, explicit exact value or multiple values ExplicitExactOrMultiple, statistical type Heuristic, default voting rights Default, explicit exact value ExplicitExact, etc. The voting type is also related to the scoring process. The voting types of the layers participating in the scoring are different, and the calculation method of the electronic device for scoring the optional refresh rate based on the matching frame rate of the layer is also different.
[0275] In the embodiment of the present application, the voting type of the second target layer can be Max, and the voting type of the third target layer can be Min. The voting type of the first target layer with the preset matching frame rate can include ExplicitDefault, ExplicitExactOrMultiple, and ExplicitExact.
[0276] Specifically, ExplicitDefault may refer to the first target layer calling the setFrameRate interface and setting the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT parameter.
[0277] ExplicitExactOrMultiple can mean that the first target layer calls the setFrameRate interface and sets the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE parameter.
[0278] ExplicitExact may refer to the first target layer calling the setFrameRate interface and setting the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_EXACT parameter.
[0279] The voting type of the first target layer whose matching frame rate is the first preset value is Default. The voting type of the first target layer whose matching frame rate is calculated and is greater than or equal to the first threshold can be Heuristic.
[0280] Seamlessness refers to whether the refresh rate can be switched without affecting the experience. Seamlessness is generally determined by the application.
[0281] The focus may refer to a layer that is responding to user input or operation, or a layer displayed in the foreground. Whether a layer is a focus layer may be determined by actual conditions, and the embodiments of the present application do not impose specific limitations on this.
[0282] The weight specifically refers to the ratio of the layer size to the display size.
[0283] Layer state information can be determined by the application or operating system to which the layer belongs. When the application submits the layer data and other information to SurfaceFlinger, it can also submit the above layer state information to SurfaceFlinger. This allows the electronic device to obtain this layer state information before refreshing the content on the display screen each time. For layer information not provided by the application, it can be calculated when determining the layer type. The specific calculation process will be detailed below and is not repeated here.
[0284] In some embodiments, the electronic device may also store device state information, layer state information, and the refresh rate used by the display screen each time the electronic device refreshes the content on the display screen. The refresh rate used by the electronic device each time the electronic device refreshes the content on the display screen is the refresh rate determined before the display screen is refreshed. In this way, after the refresh rate is determined, a cached result can be generated for use the next time step S601 is executed.
[0285] Continuing to refer to FIG. 19 , the following steps are included after step S601 .
[0286] S602: Determine whether the number of currently active layers is the same as the number of active layers before the last refresh.
[0287] It is understandable that if the number of active layers in the display screen changes when the display screen is refreshed twice, for example, a new layer is added, then when determining the refresh rate of refreshing the display screen, the layer status of the newly appeared layer needs to be taken into account. Therefore, when comparing the cached results, the embodiment of the present application can first compare whether the number of active layers before refreshing the display screen twice has changed. For example, before the nth refresh of the display screen, the display screen includes a total of 5 active layers, and before the n-1th refresh of the display screen, the display screen also includes 5 active layers, and the number of layers has not changed, then the status information of each layer can be further compared. If before the nth refresh of the display screen, the display screen includes a total of 5 active layers, and before the n-1th refresh of the display screen, the display screen includes 4 active layers, it means that the cached result is unavailable, and other methods can be used to determine the refresh rate of the image displayed on the display screen.
[0288] S603: When the number of active layers is different, determine the number of selectable refresh rates.
[0289] If the number of active layers on the display screen is different between the two refreshes, it may indicate that an active layer has been added or removed. The layer state of the active layer will change, and therefore the cached historical refresh rate cannot be used directly to refresh the display screen content. In this case, the number of selectable refresh rates for the display screen can be determined first. If there is only one selectable refresh rate, step S607 is executed. If there are multiple selectable refresh rates, step S608 is executed.
[0290] S6041: When the number of active layers is the same, determine whether the layer state information of the current active layer is the same as the layer state information of the active layer before the content on the display screen was last refreshed.
[0291] S6042: Determine whether the current device status information of the electronic device is the same as the device status information before the content on the display screen was last refreshed.
[0292] For example, before refreshing the display screen, the display screen includes six active layers: layer a, layer b, layer c, layer d, layer e, and layer f. The layer states of the six active layers can be saved in their respective data structures LayerRequirement according to the order in which the layers were created. For example:
[0293] ①name=layer a,vote type=NoVate,desiredFps=nall,Seamlessness=true,
[0294] focused=false,weight=0.1;
[0295] Among them, name=layer a means that the display screen includes a layer named layer a, vote type=NoVate means that the voting type of layer a is NoVate, desiredFps=nall means that layer a does not match the frame rate, seamlessness=true means that layer a allows the refresh rate to be switched without affecting the experience, focused=false means that layer a is not the focus layer, and weight=0.1 means that the weight of layer a is 0.1.
[0296] ②name=layer b,vote type=Default,desiredFps=60Fps,Seamlessness=true,
[0297] focused=true,weight=0.5;
[0298] Among them, name=layer b means that the display screen includes a layer named layer b, vote type=Default means that the voting type of layer b is Default, desiredFps=60Fps means that the matching frame rate of layer b is 60Fps, seamlessness=true means that layer b allows the refresh rate to be switched without affecting the experience, focused=true means that layer b is the focus layer, and weight=0.5 means that the weight of layer b is 0.5.
[0299] ③name=layer c,vote type=Default,desiredFps=60Fps,Seamlessness=true,
[0300] focused=false,weight=0.4;
[0301] Among them, name=layer c means that the display screen includes a layer named layer c, vote type=Default means that the voting type of layer c is Default, desiredFps=60Fps means that the matching frame rate of layer c is 60Fps, seamlessness=true means that layer c allows the refresh rate to be switched without affecting the experience, focused=false means that layer c is not the focused layer, and weight=0.4 means that the weight of layer c is 0.4.
[0302] ④name=layer d, vote type=NoVate, desiredFps=nall, Seamlessness=true,
[0303] focused=false,weight=0.1;
[0304] Among them, name=layer d means that the display screen includes a layer named layer d, vote type=NoVate means that the voting type of layer d is NoVate, desiredFps=nall means that layer d does not match the frame rate, seamlessness=true means that layer d allows the refresh rate to be switched without affecting the experience, focused=false means that layer d is not the focused layer, and weight=0.1 means that the weight of layer d is 0.1.
[0305] ⑤name=layer e, vote type=Max, desiredFps=120Fps, Seamlessness=true,
[0306] focused=false,weight=0.7;
[0307] Among them, name=layer e indicates that the display screen includes a layer named layer e, vote type=Max indicates that the voting type of layer e is Max, desiredFps=120Fps indicates that the matching frame rate of layer e is 120Fps, seamlessness=true indicates that layer e allows the refresh rate to be switched without affecting the user experience, focused=false indicates that layer e is not the focused layer, and weight=0.7 indicates that the weight of layer e is 0.7.
[0308] ⑥name=layer f, vote type=Max, desiredFps=120Fps, Seamlessness=true,
[0309] focused=false,weight=0.6;
[0310] Among them, name=layer f means that the display screen includes a layer named layer f, vote type=Max means that the voting type of layer f is Max, desiredFps=120Fps means that the matching frame rate of layer f is 120Fps, seamlessness=true means that layer f allows the refresh rate to be switched without affecting the user experience, focused=false means that layer f is not the focused layer, and weight=0.6 means that the weight of layer c is 0.6.
[0311] Before the display was last refreshed, the display had six active layers: layer a, layer b, layer c, layer d, layer e, and layer g. The layer states, in the order in which the layers were created, are as follows:
[0312] ①name=layer a,vote type=NoVate,desiredFps=nall,Seamlessness=true,
[0313] focused=false,weight=0.1;
[0314] ②name=layer b,vote type=Default,desiredFps=60Fps,Seamlessness=true,
[0315] focused=true,weight=0.5;
[0316] ③name=layer c,vote type=Default,desiredFps=60Fps,Seamlessness=true,
[0317] focused=false,weight=0.4;
[0318] ④name=layer d, vote type=NoVate, desiredFps=nall, Seamlessness=true,
[0319] focused=false,weight=0.1;
[0320] ⑤name=layer e, vote type=Max, desiredFps=120Fps, Seamlessness=true,
[0321] focused=false,weight=0.7;
[0322] ⑥name=layer g, vote type=Default, desiredFps=60Fps, Seamlessness=true,
[0323] focused=false,weight=0.4;
[0324] Among them, name=layer g means that the display screen includes a layer named layer g, vote type=Default means that the voting type of layer g is Default, desiredFps=60Fps means that the matching frame rate of layer f is 60Fps, seamlessness=true means that layer g allows the refresh rate to be switched without affecting the experience, focused=false means that layer g is not the focused layer, and weight=0.4 means that the weight of layer f is 0.4.
[0325] In step S602, the active layers before the current screen refresh, layer a, layer b, layer c, layer d, layer e, and layer f, can be traversed in the order in which the layers were created to determine whether the layer state information of the active layer has changed compared to the last time the screen was refreshed. A change in any of the items, name, vote type, desiredFps, seamlessness, focused, and weight, indicates a change in the layer state information. For example, a comparison shows that the name, vote type, matching frame rate, and weight of the sixth layer before the current screen refresh have all changed.
[0326] Furthermore, embodiments of the present application may also compare whether the device status information of the electronic device has changed. For example, before the current display screen is refreshed, the device status is in the Touch state, and before the last display screen is refreshed, the device status is in the IDLE state, indicating that the device status information of the display screen has changed before the current refresh compared to before the last refresh. For another example, before the current display screen is refreshed, the device status is in the Touch state, and before the last display screen is refreshed, the device status is also in the Touch state, indicating that the device status information has not changed between the current refresh and the last refresh of the display screen.
[0327] It should be noted that determining whether the layer status information of the currently active layer is the same as the layer status information of the active layer before the last refresh, and determining whether the device status information of the current electronic device is the same as the device status information of the electronic device before the last refresh can be performed simultaneously or successively, and the embodiments of the present application do not make specific limitations on this.
[0328] S605: When the layer state information of the active layer and the device state information of the electronic device are the same, refresh the content on the display screen at the first historical refresh rate.
[0329] The number of active layers is the same, the layer state information of the active layers is the same, and the device state information of the electronic device is the same, indicating that the cached result is available, so the content in the display screen can be refreshed at the first historical refresh rate of the last refresh.
[0330] S606: When the layer state information of the active layer or the device state information of the electronic device is different, determine the number of selectable refresh rates.
[0331] If the number of active layers is the same, but the layer state information of the active layers is different or the device state information of the electronic device is different, it indicates that the layer state of the layers on the display screen has changed, or the device state of the electronic device has changed. Therefore, the cached first historical refresh rate cannot be directly used to refresh the content of the display screen. In this case, it is also possible to determine how many selectable refresh rates the display screen has. If there is only one selectable refresh rate, step S607 is executed; if there are multiple selectable refresh rates, step S608 is executed.
[0332] Step S607: When only one optional refresh rate is included, refresh the content on the display screen at the optional refresh rate.
[0333] It is understood that electronic devices can dynamically adjust the specific value of the selectable refresh rate, for example, adjusting the selectable refresh rate based on the power supply status (high performance, power saving, ultra power saving), locking the display refresh rate based on application requirements or system animations, or locking the refresh rate based on display brightness, etc. In the scenario of locking the refresh rate, the electronic device only includes one selectable refresh rate.
[0334] Therefore, the embodiment of the present application can first determine whether only one optional refresh rate is included. If only one optional refresh rate is included, then the optional refresh rate can be used to refresh the content in the display screen to reduce the amount of calculation.
[0335] S608: In the case of multiple optional refresh rates, determine whether all layers in the display screen are in a static state and the electronic device does not receive a touch event.
[0336] Among them, each layer is in a static state, indicating that the electronic device is in an IDLE state, and the display screen does not receive a touch event, indicating that the electronic device is not in a Touch state.
[0337] S609: When all layers in the display screen are in a static state and the electronic device does not receive a touch event, refresh the content in the display screen at a lowest refresh rate among multiple optional refresh rates.
[0338] FIG20 is a fourth schematic diagram of the conditions for determining the refresh rate of a displayed image in the image display method provided in an embodiment of the present application.
[0339] As shown in Figure 20, when the electronic device is in the IDLE state and not in the Touch state, the lowest refresh rate can be determined from multiple optional refresh rates, and the content on the display screen can be refreshed at the lowest refresh rate. It is understandable that when all layers in the electronic device display screen are in a static state and no touch event occurs, the content on the display screen will not change, so a lower display screen refresh rate can be set.
[0340] Taking the lowest refresh rate of 10Hz as an example, Figure 21 shows an example of a display screen including a status bar layer, a wallpaper layer, and a launcher layer. At this time, the user is not touching the display screen, and the status bar layer, wallpaper layer, and launcher layer are all in a static state. The electronic device refreshes the display screen at the lowest refresh rate of 10Hz.
[0341] S610: When at least one layer in the display screen is in a non-static state or the display screen receives a touch event, determine whether the active layer includes only the third target layer.
[0342] The third target layer includes a wallpaper layer, a layer with a matching frame rate less than a first threshold, and a status bar layer.
[0343] The fact that at least one layer is in a non-static state indicates that the electronic device is not in an IDLE state, and the display screen receives a touch event, indicating that the electronic device is in a Touch state. The fact that the electronic device is in a Touch state or is not in an IDLE state indicates that the subsequent refresh process may involve layer changes, so the refresh rate can be determined based on the actual conditions of each layer.
[0344] There are three specific situations in which at least one layer in the display screen is in a non-static state or the display screen receives a touch event: situation 1: the electronic device is in a touch state and an idle state; situation 2: the electronic device is in a touch state and not in an idle state; situation 3: the electronic device is neither in a touch state nor in an idle state.
[0345] Furthermore, Figures 22 (a) and (b) illustrate a scenario where a layer is in a non-static state and the display receives a touch event. When a user slowly slides their finger upwards over an unresponsive area on the display, the electronic device receives a Touch Down event and enters the Touch state. An unresponsive area is an area where the electronic device does not respond to Touch Down events. At this point, the status bar layer and the clock layer change, entering a non-static state.
[0346] Taking the lowest refresh rate of 10Hz among the optional refresh rates as an example, continue to refer to (b) in Figure 22. When a Touch Down event occurs and the status bar layer and the clock layer are in a non-static state, the active layer includes the status bar layer and the clock layer, and the launcher layer is not the active layer. It can be understood that the status bar layer is the third target layer, and the matching frame rate of the clock layer is 1Hz, that is, it is updated once per second. The matching frame rate is less than the first threshold of 10Hz, and the clock layer is also the third target layer. It can be seen that the active layer in (b) in Figure 22 only includes the third target layer. At this time, the electronic device can refresh the content on the display screen at the lowest refresh rate of 10Hz among the optional refresh rates.
[0347] S611: When the active layer includes only the third target layer, refresh the content in the display screen at a lowest refresh rate among a plurality of optional refresh rates.
[0348] FIG23 is a fifth schematic diagram of the conditions for determining the refresh rate of a displayed image in the image display method provided in an embodiment of the present application.
[0349] As shown in Figure 23, if all active layers include only the third target layer, indicating that the changes involved in the layers on the display are relatively small, a lower display refresh rate can be used, and the content on the display can be refreshed at the lowest refresh rate among the multiple selectable refresh rates. Figure 23 shows that the third target layer can include the wallpaper layer and a layer with a matching frame rate less than the first threshold, represented by layer7. The third target layer can also include the status bar layer, represented by layer8.
[0350] S612: When the active layer includes the third target layer and also includes other layers, determine whether the electronic device is in the first device state.
[0351] It can be understood that if all active layers include other layers except the third target layer, it may indicate that there are active layers with large changes in the display screen. Therefore, it can be further determined whether the electronic device is in the first device state, and the refresh rate of the image displayed on the display screen is determined based on the device state.
[0352] FIG24 is a flow chart showing the comparison with the cached results provided in an embodiment of the present application.
[0353] As shown in Figure 24, at 0ms, the electronic device performs the n-1th refresh, and the refresh rate of the n-1th refresh is not limited here. After the n-1th refresh is completed, the electronic device can perform the step of determining the refresh rate of the image displayed on the display screen. The process of comparing the cached results is not shown here, but the refresh rate of the nth refresh display screen is directly determined in steps S606-S612, and the final 120Hz is an illustrative value. It is worth noting that the device status information and layer status information applied to steps S606-S612 are determined based on the status after the n-1th refresh is completed. Afterwards, the electronic device can cache the device status information, layer status information and refresh rate of 120Hz. Since the display screen refresh rate determined before the nth refresh is 120Hz, the nth refresh can be performed when the 8.33ms arrives.
[0354] Furthermore, after the nth refresh is completed, the electronic device can execute steps S601-S612 again to determine the refresh rate of the image displayed on the display screen. In the process of determining the refresh rate this time, the electronic device first obtains the cached results before the nth refresh, and obtains the device status information, layer status information and the first historical refresh rate of 120Hz before the nth refresh. It is assumed here that the device status information and layer status information after the nth refresh (before the n+1th refresh) have not changed compared to the device status information and layer status information in the cached results, so it can continue to refresh at 120Hz, that is, the n+1th refresh is performed when the 16.66ms arrives.
[0355] Furthermore, after the (n+1)th refresh is completed, the electronic device may execute steps S601-S612 again to determine the refresh rate of the image displayed on the display screen, so as to determine the refresh rate of the display screen for the (n+2)th refresh.
[0356] The following is an introduction to the steps for determining the layer type with reference to the accompanying drawings.
[0357] FIG25 is a flowchart for determining layer type provided in an embodiment of the present application.
[0358] FIG26 is an example diagram of the process shown in FIG25 .
[0359] As shown in Figures 25 and 26, the electronic device can perform the following steps S701-S707 before each refresh of the display screen to determine the layer type of each active layer on the display screen. In practical applications, the layer type of each active layer on the display screen can be determined after the nth refresh of the display screen and before the n+1th refresh of the display screen, and steps S601-S612 can be performed based on the layer type. The active layer for which the layer type is determined can be the layer obtained by deduplicating the active layer for which the layer type was determined after the n-1th refresh of the display screen.
[0360] S701: For the active layer in the display screen, determine whether the active layer has called the target interface.
[0361] The target interface can be the setFrameRate interface for setting the matching frame rate. If the active layer has called the target interface, it indicates that the active layer contains matching frame rate information, and the matching frame rate information is preset by the application. If the active layer has not called the target interface, it indicates that the active layer does not contain matching frame rate information. The matching frame rate information is specifically used to indicate the matching frame rate of the active layer.
[0362] Whether the active layer calls the target interface is determined by the application to which the active layer belongs.
[0363] S702: When the active layer has not called the target interface, determine whether the active layer is a status bar layer.
[0364] S703: When the active layer is not the status bar layer, determine whether the active layer is the wallpaper layer. When the active layer is the wallpaper layer, end the calculation.
[0365] S704: When the active layer is not a wallpaper layer, determine whether the active layer is a layer that is playing a motion effect; wherein, the basis for determining whether the active layer is playing a motion effect may be that the layer has changes such as scaling, rotation, fading in and out of elements in two or more consecutive frames. If the elements of the layer are involved in the above changes in two or more consecutive frames, then the layer is playing a motion effect.
[0366] S7051: When the active layer is a layer that is currently playing an animation, the active layer is determined as the second target layer.
[0367] S7052: When the active layer is not the layer that is playing the animation, calculate the matching frame rate of the active layer.
[0368] S706: Determine the active layer whose matching frame rate is less than the first threshold as the third target layer, and determine the active layer whose matching frame rate is greater than or equal to the first threshold as the first target layer.
[0369] Specifically, the step of calculating the matching frame rate of the active layer in step S7052 specifically includes S7052a: when the active layer does not contain matching frame rate information, determining the matching frame rate based on the number of updates of the active layer within the second historical time length and the update time interval.
[0370] The second history duration can be 1s, 2s, 5s, or 10s. The number of updates can refer to the number of times an application submits a layer's graphics object to SurfaceFlinger. The update interval can refer to the time interval between each submission. For example, for a clock application's second hand layer, the clock application submits a new second hand layer graphics object to SurfaceFlinger every second. Therefore, within 5 seconds, the second hand layer is updated 5 times, and the update interval is 1s.
[0371] Furthermore, step S7052a includes the following steps S7052a-1 and S7052a-2.
[0372] S7052a-1: When the number of updates is greater than or equal to the number threshold or the time interval between each update is equal, the matching frame rate is a ratio of the number of updates to the second historical duration.
[0373] Among them, the matching frame rate calculated based on a smaller number of updates has lower accuracy. In addition, if the update time intervals vary greatly, it means that the application does not send images to the layer regularly, and the calculated matching frame rate cannot represent the actual update status of the layer and the demand for refresh rate. Therefore, the embodiment of the present application can calculate the matching frame rate for active layers with a number of updates greater than or equal to the number threshold or with equal time intervals between each update. The number threshold can be equal to 3 times, for example, and the second historical duration can be equal to 3s or 5s, for example. This embodiment of the present application does not specifically limit this.
[0374] For example, when the second historical duration is 5 seconds, for the second hand layer of the clock application, the ratio of its update times to the second historical duration is 5 / 5 = 1 time / second. Then, the matching frame rate of the second hand layer of the clock application is 1 fps.
[0375] S7052a-2: When the number of updates is less than the number threshold and the time intervals between each update are not equal, the matching frame rate is a first preset value.
[0376] The first preset value is, for example, 60 FPS. Thus, for layers whose update counts are less than the threshold and whose update intervals are unequal, and whose matching frame rates cannot be calculated, the matching frame rate can be determined as 60 FPS, thereby avoiding setting the matching frame rate to the highest refresh rate among the selectable refresh rates and thus preventing the electronic device from refreshing the display at the highest refresh rate, which would waste resources.
[0377] It is understandable that some layer state information that is not provided to SurfaceFlinger by the application, such as voting type information and matching frame rate information, can be determined when calculating the layer type.
[0378] S707: Determine the active layer whose matching frame rate is the first preset value as the first target layer.
[0379] In some implementations, step S701 may further include:
[0380] S708: In the case where the active layer has called the target interface, the active layer that has called the target interface is determined as the first target layer.
[0381] It is understandable that the fact that the active layer has called the target interface indicates that the active layer has a preset matching frame rate.
[0382] Figure 27 is a flowchart for scoring optional refresh rates provided in an embodiment of the present application.
[0383] FIG28 is an example diagram of the process shown in FIG27 .
[0384] The following describes in detail step S400 , ie, the step of determining at least one desired refresh rate from at least one optional refresh rate when the display screen includes at least one first target layer, with reference to the accompanying drawings.
[0385] In step S400 , for the first target layer whose voting type is ExplicitExact, its expected refresh rate may be equal to the matching frame rate.
[0386] For the first target layer whose voting type is Heuristic, ExplicitDefault, ExplicitExactOrMultiple, and Default, step S400 may specifically include the following steps:
[0387] S401: For each first target layer, when the matching frame rate of the first target layer is less than or equal to a second threshold, determining an optional refresh rate less than or equal to the second threshold as a candidate refresh rate for the first target layer.
[0388] The second threshold is greater than the first threshold. For example, the second threshold may be 60 FPS. The optional refresh rates may include, for example, 30 Hz, 60 Hz, 90 Hz, 120 Hz, and 144 Hz. The matching frame rate of the first target layer may be 60 FPS, so the candidate refresh rates for the first target layer are 30 Hz and 60 Hz. In this way, only 30 Hz and 60 Hz can be scored to determine the expected refresh rate, without having to score 90 Hz, 120 Hz, and 144 Hz, thereby reducing the amount of calculation.
[0389] S402: For each first target layer, when the matching frame rate is greater than a second threshold, determining an optional refresh rate greater than the second threshold as a candidate refresh rate.
[0390] For example, if the matching frame rate of the first target layer is equal to 90 Fps, then the first target layer can be scored for 90 Hz, 120 Hz, and 144 Hz, but does not need to be scored for 30 Hz and 60 Hz.
[0391] In some implementations, the electronic device may also score each optional refresh rate based on the matching frame rate of the first target layer to obtain the expected refresh rate of the first target layer. This embodiment of the present application does not specifically limit this.
[0392] S403: Score each candidate refresh rate based on the matching frame rate.
[0393] S404: Determine the candidate refresh rate with the highest score as the expected refresh rate of the first target layer.
[0394] This way, you can select a desired refresh rate that is close to the layer matching frame rate, reduce the amount of calculation, and increase the speed of determining the refresh rate.
[0395] The following further explains step S403, ie, the step of scoring each candidate refresh rate based on the matching frame rate.
[0396] In some implementations, step S403 may specifically include the following steps S4031 and S4032:
[0397] S4031: When the refresh rate to be selected is equal to the matching frame rate, determine that the refresh rate to be selected is a first score.
[0398] Among them, the selected refresh rate displayRate=matching frame rate desiredFps, then it can be determined that the selected refresh rate is the first score, and the first score is 1, for example.
[0399] Exemplarily, desiredFps=30Fps, displayRate includes 30Hz and 60Hz, 30Hz=30Fps, and the score of 30Hz is the first score, that is, 1 point.
[0400] It should be noted that, in the embodiment of the present application, the expected refresh rate of the first target layer may be one or more, and the specific number may be determined by calculation results.
[0401] S4032: When the refresh rate to be selected is not equal to the matching frame rate, determine that the refresh rate to be selected is a second score, and the second score is smaller than the first score.
[0402] For example, 60 Hz≠30 Fps, and the score of 60 Hz is the second score. The second score can be obtained based on calculation, and the specific calculation process will be described in detail below.
[0403] In this way, the expected refresh rate can be the candidate refresh rate of the first score. There is no difference between the expected refresh rate and the matching frame rate. The matching frame rate of the layer is met, which can make the display effect of the layer smooth and improve the user experience.
[0404] In some other implementations, step S403 may further include the following steps S4033-S4034:
[0405] S4033: When the refresh rate to be selected is an integer multiple of the matching frame rate, determine that the refresh rate to be selected is a first score.
[0406] Wherein, displayRate=(N*desiredFps), then the score of the optional refresh rate is determined as the first score, and the first score is 1, for example.
[0407] For example, desiredFps=30Fps, displayRate includes 30Hz and 60Hz, 30Hz=(1*30Fps), and the score of 30Hz is the first score, that is, 1 point. 60Hz=(2*30Fps), and the score of 60Hz is also the first score, that is, 1 point.
[0408] S4034: When the refresh rate to be selected is not an integer multiple of the matching frame rate, determine the refresh rate to be selected as a second score.
[0409] Among them, the situation where the selected refresh rate is not an integer multiple of the matching frame rate includes at least the following two cases: the selected refresh rate is greater than the matching frame rate (displayRate>desiredFps) and the selected refresh rate is less than the matching frame rate (displayRate<desiredFps). In both cases, the second score of the selected refresh rate is less than the first score. When the first score is 1, the score of the selected refresh rate is less than 1. The specific scoring process is shown in the following table:
[0410] Table 1 is the formula for scoring the optional refresh rate
[0411] Specifically, for the first target layer with the voting type of ExplicitDefault, when the refresh rate to be selected is less than the matching frame rate, the formula score = displayRate / desiredFps can be used to calculate the second score. When the refresh rate to be selected is greater than the matching frame rate, the formula score = displayRate / (multiplier * desiredFps) can be used to calculate the second score, where multiplier is a multiple, for example, it can be equal to the least common multiple of displayRate and desiredFps, and the specific value can be determined by the actual situation. It is worth noting that the second score calculated based on the formula score = displayRate / (multiplier * desiredFps) is less than 1.
[0412] For the first target layer with voting types of Default, Heuristic and ExplicitExactOrMultiple, when the refresh rate to be selected is an approximate integer multiple of the matching frame rate (isFractionPairOrMultiple), the score of the refresh rate to be selected can be set to 0.8, that is, the second score is equal to 0.8. When the refresh rate to be selected is less than the matching frame rate, the second score can be calculated using the formula score=displayRate / (desiredFps*(10+1)). When the refresh rate to be selected is greater than the matching frame rate, the second score can be calculated using the formula score=1 / iter+2, where iter represents the number of iterations, and the specific value can be determined by the actual situation. The embodiment of the present application does not make specific restrictions on this. It is worth noting that the second score calculated based on the formula score=1 / iter+2 is a value between 0.1 and 0.5.
[0413] It can be seen that in the embodiment of the present application, when scoring each candidate refresh rate based on the matching frame rate, no weight calculation step is involved, that is, the layer size does not affect the calculation of the expected refresh rate. In this way, both layers with small weights and layers with large weights can obtain an expected refresh rate close to the matching frame rate, which can prevent large layers with low refresh rates from affecting the selection of the expected refresh rate of small layers with high refresh rates, and further prevent large layers with low refresh rates from affecting the dynamic effect experience of small layers with high refresh rates.
[0414] It is worth noting that since the matching frame rate of the first target layer with the voting type of Default is the first preset value, rather than the maximum value supported by the display or the highest refresh rate among the optional refresh rates, it can avoid the refresh rate of the image displayed on the display being too high when the display includes this layer, thereby avoiding waste of resources.
[0415] The following describes the device status of the electronic device with reference to the accompanying drawings.
[0416] Figure 29 is a schematic diagram of an electronic device switching device state provided in an embodiment of the present application.
[0417] As shown in Figure 29(a), the embodiment of the present application sets a first timer for the first device state. Specifically, the electronic device can switch between the first device state (Boost state) and the non-first device state (Non-Boost state).
[0418] S801: When the electronic device receives a target interaction event or the display screen is playing a target motion effect, it enters a first device state and starts a first timer, where the first timer is set with a first timing duration.
[0419] Among them, the target interaction event is, for example, a click event or a first sliding event, and the target animation effect is, for example, an application screen opening animation effect, etc. For details, please refer to the above content and will not be repeated here.
[0420] In some implementations, when a Click event occurs, the electronic device may start a first timer. In other implementations, when the sliding speed corresponding to the Touch Move event exceeds a certain threshold, the first sliding event is considered to have occurred, and the electronic device may start a first timer. When a target animation appears on the display screen, or when a graphic object in a layer received by SurfaceFlinger corresponds to the target animation, the target animation is considered to have occurred, and the electronic device may start a first timer.
[0421] It should be noted that the start of the first timer corresponds to the electronic device entering the first device state, the first timer being in timing corresponds to the electronic device being in the first device state, and the first timer timing exceeding the first timing duration corresponds to the electronic device exiting the first device state.
[0422] In some implementations, the first timing duration may be equal to 200 ms, for example, and this embodiment of the present application does not impose any specific limitation on this.
[0423] S802: When the first timer exceeds the first timing duration, and / or when the electronic device receives a second sliding event, and / or when all layers in the display screen are in a static state, and / or when the target animation ends, the electronic device exits the first device state, and the second sliding event may be a sliding event with a sliding speed less than or equal to the first preset threshold.
[0424] It can be understood that whenever a target interaction event occurs or a target animation appears, the electronic device can start the first timer. Therefore, if the timing of the first timer exceeds the first timing duration, it means that no new target interaction event occurs or target animation appears within the first timing duration. Then, the first device state can be exited to save resources.
[0425] The electronic device receiving the second sliding event can specifically mean that after the user presses his finger to perform a quick sliding operation to trigger the first device state, the user slows down the sliding operation, and the quick sliding operation changes to a slow sliding operation. The quick sliding operation and the slow sliding operation are single-press operations by the user without releasing the finger. It can be understood that the key factor for the first sliding event to trigger the first device state is the fast sliding operation speed. Therefore, when the sliding speed decreases, the first sliding event switches to the second sliding event, and the layer change involved in the second sliding event is generally smaller than the layer change involved in the first sliding event. Therefore, in the embodiment of the present application, the second sliding event will interrupt the first device state.
[0426] In some implementations, the electronic device entering the IDLE state also interrupts the first device state. Specifically, after the last reset of the first timer, no click events have triggered a change in the layer content. For example, if the user clicks on an unresponsive area of the display, such as a static wallpaper, then no click events have triggered a change in the layer content. At this point, the electronic device may enter the IDLE state, and after the electronic device enters the IDLE state, the first device state is interrupted.
[0427] In some implementations, the end of the target animation means that the layer may no longer change frequently, thereby interrupting the first device state of the electronic device.
[0428] It can be seen that in the embodiment of the present application, whether the electronic device is in the first device state can be determined based on the timing duration of the first timer. If the timing of the first timer does not exceed the first timing duration, then the electronic device is in the first device state; if the timing of the first timer exceeds the first timing duration, then the electronic device is not in the first device state, that is, it is in a non-first device state.
[0429] In an embodiment of the present application, an interface may be provided externally, in which target interaction events and target animations may be defined for application calls. When an application calls the interface, if a user performs a target interaction event on the application's layer or a target animation occurs on the application's layer, a first device state may be triggered. The interface may also define access permissions to prohibit, for example, the calling of an input method application, though this embodiment of the present application does not specifically limit this.
[0430] As shown in FIG. 29( b ), in an embodiment of the present application, the electronic device can switch between a Touch state and a Non-Touch state.
[0431] S803: When the display screen receives a touch event and / or the touch event lasts for more than a second preset time, the electronic device enters a Touch state and starts a second timer, where the second timer is set with a second timing time.
[0432] The second timing duration should be greater than the second preset duration. The second preset duration can be, for example, 50 ms or 100 ms, and this embodiment of the present application does not specifically limit this. The touch event is, for example, a Touch Down event or a Touch Move event. A detailed explanation of the Touch Down event and the Touch Move event can be found in the aforementioned content and is not further elaborated here.
[0433] In actual applications, when a Touch Down event occurs, the electronic device can start a second timer. If a Touch Move event occurs during the period before the second timer exceeds the second timing duration, and the Touch Move event lasts for a certain period of time, the electronic device can restart the second timer, that is, the second timer will start again. For example, as the Touch Move event occurs, the electronic device is notified once every 100ms so that the electronic device restarts the second timer. Therefore, the electronic device can restart the second timer every time a Touch Down event occurs, and can restart the second timer every time a Touch Move event lasts for 100ms.
[0434] In some implementations, the second timing duration may be equal to 200ms, 500ms, or 1000ms, which is not specifically limited in the embodiments of the present application.
[0435] S804: When the second timer exceeds the second timing duration, the electronic device exits the Touch state.
[0436] If the second timer exceeds the second timing duration, it means that no touch event occurs within the second preset duration or the touch event stops continuing, and the Touch state can be exited.
[0437] In the embodiment of the present application, an interface can be provided to the outside, and touch events can be defined in the interface for application calls. When the application calls the interface, if the user operates a touch event on the layer of the application, the Touch state can be triggered.
[0438] As shown in (c) of Figure 29, in an embodiment of the present application, the electronic device can switch between the IDLE state and the Non-IDLE state.
[0439] S805: When a non-static layer appears on the display screen, the electronic device exits the IDLE state and starts a third timer, where the third timer is set with a third timing duration.
[0440] If the content or properties of a layer change, the layer is considered to be in a non-idle state. Layer properties include, for example, layer transparency, position, size, style, or transition effects, and are not specifically limited in this embodiment of the present application. When a non-idle layer appears on the display screen, the third timer is reset and begins timing, and the electronic device enters a non-idle state.
[0441] In some implementations, the third timing duration may be equal to 200 ms, which is not specifically limited in the embodiments of the present application.
[0442] S806: When the timing of the third timer exceeds the third timing duration, the electronic device enters the IDLE state.
[0443] The electronic device may start a third timer each time a non-idle layer appears on the display screen. If the third timer exceeds the third timer duration, it indicates that no new non-idle layer appears within the third timer duration, and the electronic device may exit the Non-IDLE state and enter the IDLE state.
[0444] It should be noted that if no click events trigger a change in the layer content after the first timer is last reset and counted, the electronic device does not necessarily enter the IDLE state. This is because if no click events trigger a change in the layer content, but the third timer is in a state where the timing does not exceed the third timer duration, the electronic device will still be in the Non-IDLE state. After the third timer exceeds the third timer duration, the electronic device can enter the IDLE state, at which point the first device state will be interrupted.
[0445] FIG30 is a schematic structural diagram of an image display device provided in an embodiment of the present application.
[0446] As shown in FIG30 , in one embodiment, an electronic device can implement corresponding functions using the hardware device shown in FIG30 . The device may include: a touch screen 901, a memory 902, a processor 903, and a communication module 904. Each of the aforementioned components may be connected via one or more communication buses 905. Each of the aforementioned components may be connected via one or more communication buses 905. The touch screen 901 may include a display panel 9011 and a touch sensor 9012. The display panel 9011 is used to display images, and the touch sensor 9012 may transmit detected touch operations to the application processor 903 to determine the type of touch event and provide visual output related to the touch operation via the display panel 9011. The processor 903 may include one or more processing units, such as an application processor, a modem processor, a graphics processor, an image signal processor, a controller, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor. The different processing units may be independent devices or integrated into one or more processors. The memory 902 is coupled to the processor 903 and is used to store various software programs and / or computer instructions. The memory 902 may include a volatile memory and / or a non-volatile memory. When the processor executes the computer instructions, the electronic device may perform the various functions or steps of the above method embodiments.
[0447] When the software program and / or multiple groups of instructions in the memory 902 are executed by the processor 903, the electronic device implements the following method steps: when the electronic device is in the first device state, determining a first refresh rate, the first refresh rate being the maximum refresh rate of the display screen of the electronic device; the triggering conditions for the electronic device to enter the first device state include: the electronic device receiving a first interactive event, or a target animation appearing on the display screen; and refreshing the content displayed on the display screen of the electronic device using the first refresh rate.
[0448] The present application also provides an electronic device, comprising: a processor, a memory and a touch screen; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the image display method in any implementation manner in the above embodiments.
[0449] An embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices. Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0450] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed in the above-mentioned method embodiment.
[0451] The embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the various functions or steps executed in the above method embodiment.
[0452] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0453] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0454] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0455] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0456] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0457] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An image display method, the method being applied to an electronic device, characterized in that: include: When the electronic device is in a first device state, the display screen of the electronic device displays an image at a first refresh rate, wherein the electronic device being in the first device state includes: the electronic device receiving a target interaction event, the target interaction event including: a click event and a first sliding event, the first sliding event being a sliding event with a sliding speed greater than a first preset threshold; the first refresh rate is the maximum refresh rate of the display screen, or the first refresh rate is greater than or equal to a preset refresh rate threshold.
2. The image display method according to claim 1, characterized in that: The electronic device being in the first device state also includes: the display screen is playing a target motion effect, wherein the target motion effect is a motion effect image whose change range exceeds a first change value.
3. The image display method according to claim 2, characterized in that: The target motion effect is that the change range of the motion effect image exceeds the first change value, including: the target motion effect is that the change range of the motion effect image within a first preset time period exceeds the first change value.
4. The image display method according to any one of claims 1 to 3, characterized in that: Also includes: When the electronic device is not in the first device state, the display screen displays the image using a refresh rate that matches the image layer.
5. The image display method according to claim 4, characterized in that: When the electronic device is not in the first device state, the display screen displays an image using a refresh rate matching the image layer, including: When the electronic device is not in the first device state and the display screen includes M first target layers, the display screen displays an image at a second refresh rate, wherein the first target layer is an active layer, and the matching frame rate of the first target layer is greater than or equal to a first threshold, the active layer includes a visible layer whose image content has been updated within a first historical time period, and the second refresh rate is determined based on the matching frame rates of the M first target layers; When the electronic device is not in the first device state and the display screen does not include the first target layer, the display screen displays an image at a third refresh rate, and the third refresh rate is a default refresh rate of the display screen.
6. The image display method according to claim 5, characterized in that: The second refresh rate is the largest refresh rate among refresh rate 1 to refresh rate M, wherein refresh rate 1 is the refresh rate expected by the first first target layer, and refresh rate M is the refresh rate expected by the Mth first target layer; The refresh rate 1 is determined based on the matching frame rate of the first target layer and the optional refresh rate supported by the display screen, and the refresh rate M is determined based on the matching frame rate of the Mth first target layer and the optional refresh rate supported by the display screen.
7. The image display method according to claim 5, characterized in that: The default refresh rate is 60 Hz.
8. An image display method, characterized in that: include: Before the electronic device refreshes the content on the display screen each time, determining whether the electronic device is in a first device state, the first device state comprising that the electronic device receives a target interaction event or the display screen is playing a target animation, the target interaction event comprising a click event and / or a first sliding event, the first sliding event being a sliding event with a sliding speed greater than a first preset threshold; When the electronic device is in the first device state, refreshing the content in the display screen at a first refresh rate, where the first refresh rate is a maximum refresh rate of the display screen, or the first refresh rate is greater than or equal to a preset refresh rate threshold; When the electronic device is not in the first device state, determining whether the display screen includes a first target layer, the first target layer is an active layer, and a matching frame rate of the first target layer is greater than or equal to a first threshold, and the active layer includes a visible layer whose image content has been updated within a first historical duration; In a case where the display screen includes at least one of the first target layers, determining at least one expected refresh rate from at least one optional refresh rate based on the matching frame rate of each of the first target layers, and refreshing the content in the display screen at a highest refresh rate among the at least one expected refresh rate; When the display screen does not include the first target layer, the content in the display screen is refreshed at a third refresh rate, where the third refresh rate is a default refresh rate of the display screen.
9. The image display method according to claim 8, characterized in that: Before determining whether the display screen includes the first target layer, the method further includes: Determining whether the display screen includes a second target layer, where the second target layer is an active layer that is playing a motion effect; The determining whether the display screen includes the first target layer includes: In a case where the display screen does not include the second target layer, it is determined whether the display screen includes the first target layer.
10. The image display method according to claim 8, characterized in that: The determining at least one expected refresh rate from at least one optional refresh rate based on the matching frame rate of each of the first target layers, respectively, comprises: For each of the first target layers, when the matching frame rate is less than or equal to a second threshold, determining the selectable refresh rate that is less than or equal to the second threshold as a candidate refresh rate, and the second threshold is greater than the first threshold; For each of the first target layers, when the matching frame rate is greater than the second threshold, determining the optional refresh rate greater than the second threshold as the to-be-selected refresh rate; Scoring each of the selected refresh rates based on the matching frame rate; The candidate refresh rate with the highest score is determined as the expected refresh rate of the first target layer.
11. The image display method according to claim 10, characterized in that: The scoring of each of the selected refresh rates based on the matching frame rate includes: When the refresh rate to be selected is equal to the matching frame rate, determining the refresh rate to be selected to be a first score; When the refresh rate to be selected is not equal to the matching frame rate, determining the refresh rate to be selected to be a second score, The second score is less than the first score; or, When the refresh rate to be selected is an integer multiple of the matching frame rate, determining the refresh rate to be selected as the first score; When the refresh rate to be selected is not an integer multiple of the matching frame rate, the refresh rate to be selected is determined to be the second score.
12. The image display method according to claim 8, characterized in that: Also includes: Before the electronic device refreshes the content on the display screen each time, a cache result is obtained, wherein the cache result includes device state information of the electronic device, layer state information of the active layer, and historical refresh rate information used by the display screen before the content on the display screen was last refreshed, wherein the screen refresh rate when the electronic device last refreshed the content on the display screen was the first historical refresh rate; Determine whether the current number of active layers is the same as the number of active layers before the content on the display screen was last refreshed; In case the number of active layers is different, determining the number of selectable refresh rates; In the case where the number of active layers is the same, determining whether the layer state information of the current active layer is the same as the layer state information of the active layer before the content in the display screen was last refreshed, and determining whether the device state information of the current electronic device is the same as the device state information of the electronic device before the content in the display screen was last refreshed; When the layer state information of the active layer and the device state information of the electronic device are the same, the content in the display screen is refreshed at the first historical refresh rate.
13. The image display method according to claim 12, characterized in that: Also includes: In case the layer state information of the active layer is different or the device state information of the electronic device is different, determining the number of the selectable refresh rates; In the case where only one of the selectable refresh rates is included, the content in the display screen is refreshed at the selectable refresh rate.
14. The image display method according to claim 13, characterized in that: Also includes: In the case of including a plurality of the optional refresh rates, determining whether each layer in the display screen is in a stationary state and the electronic device does not receive a touch event; When all layers in the display screen are in a static state and the electronic device does not receive a touch event, refreshing the content in the display screen at the lowest refresh rate among the multiple optional refresh rates; When at least one layer in the display screen is in a non-static state or the display screen receives a touch event, determining whether the active layer includes only a third target layer; wherein the third target layer includes a wallpaper layer, a layer whose matching frame rate is less than the first threshold, and a status bar layer; In a case where the active layer only includes the third target layer, the content in the display screen is refreshed at a lowest refresh rate among the multiple optional refresh rates.
15. The image display method according to claim 14, characterized in that: The determining whether the electronic device is in the first device state includes: when the active layer includes the third target layer and also includes other layers, determining whether the electronic device is in the first device state.
16. The image display method according to claim 15, characterized in that: Also includes: When the electronic device receives a target interaction event or the display screen is playing a target motion effect, the electronic device enters the first device state and starts a first timer, wherein the first timer is set with a first timing duration; When the timing of the first timer exceeds the first timing duration, and / or when the electronic device receives a second sliding event, and / or when all layers in the display screen are in a static state, and / or when the target animation ends, the electronic device exits the first device state, and the second sliding event is a sliding event with a sliding speed less than or equal to the first preset threshold.
17. The image display method according to claim 12, characterized in that: Before obtaining the cache result, the method further includes: Before the electronic device refreshes the content on the display screen each time, for each of the active layers, determining whether the active layer includes matching frame rate information, where the matching frame rate information is used to indicate the matching frame rate; When the active layer does not include the matching frame rate information, the matching frame rate is determined based on the number of updates of the active layer within the second historical duration and the time interval between updates.
18. The image display method according to claim 17, characterized in that: The determining the matching frame rate based on the number of updates of the active layer within the second historical duration and the update time interval includes: When the number of updates is greater than or equal to the number threshold or the time interval between each update is equal, the matching frame rate is the ratio of the number of updates to the second historical duration; When the number of updates is less than the number threshold and the time intervals between each update are not equal, the matching frame rate is a first preset value.
19. The image display method according to claim 12, characterized in that: Also includes: The device status information, the layer status information, and the refresh rate of the display screen used by the electronic device each time the electronic device refreshes the content on the display screen are stored.
20. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the image display method according to any one of claims 1 to 19.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the image display method according to any one of claims 1 to 19.
22. A computer program product, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to execute the image display method according to any one of claims 1 to 19.