Display method and device, electronic equipment and storage medium
The cache mechanism reduces the frequency of image data generation, solves the problem of increasing device power consumption caused by visual effects such as background blur, and achieves a smooth display effect with low power consumption.
Patent Information
- Application Number
- CN202510240367.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-07-18
AI Technical Summary
In modern display technology, rendering display of visual effects such as background blur will lead to increased device power consumption, because the layers need to be processed and redrawed in real time, consuming a lot of resources.
Using a cache mechanism, image data is generated and updated through the first frequency and stored in the cache. The second frequency reads the cache data for rendering and displaying. The first frequency is smaller than the second frequency, reducing the regeneration frequency of image data.
It reduces the power consumption of the device, optimizes the smoothness of user operations, reduces the amount of computing, and improves system performance.
Smart Images

Figure CN120339039A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a display method, apparatus, electronic device, and storage medium. Background Art
[0002] In modern display technologies, a display screen usually has multiple layers for rendering and display, such as a background, foreground, pop-up menu, notification bar, etc. In some scenarios, the rendering and display of some layers depend on other layers. For example, in the background blur effect, the background layer is blurred, and the blur operation usually requires additional blur processing in combination with the background image, which requires real-time acquisition and blur processing of the background. These additional layer operations will cause the device to require more graphics processing resources, thereby increasing the power consumption of the device. Summary of the Invention
[0003] The present disclosure provides a display method, apparatus, electronic device, and storage medium to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present disclosure, a display method is provided, the method including:
[0005] In response to an instruction to display a first layer, generating and updating image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer;
[0006] Reading the image data stored in the first cache at a second frequency to render and display the first layer;
[0007] Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
[0008] According to a second aspect of the present disclosure, a display apparatus is provided, the apparatus including:
[0009] A first processing module, configured to generate and update image data stored in a first cache at a first frequency in response to an instruction to display a first layer; the first cache is used to store the image data of the first layer;
[0010] A second processing module, configured to read the image data stored in the first cache at a second frequency to render and display the first layer;
[0011] Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
[0012] According to a third aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute:
[0013] In response to an instruction indicating to display a first layer, generate and update image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer;
[0014] Read the image data stored in the first cache at a second frequency to render and display the first layer;
[0015] Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
[0016] According to a fourth aspect of the present disclosure, there is provided an electronic device, including: at least one processor, a display screen;
[0017] The at least one processor is capable of executing:
[0018] In response to an instruction indicating to display a first layer, generate and update image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer;
[0019] Read the image data stored in the first cache at a second frequency to render and display the first layer on the display screen;
[0020] Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer. Description of the Drawings
[0021] By referring to the drawings and reading the following detailed description, the above and other objects, features, and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the drawings, several embodiments of the present disclosure are shown in an exemplary rather than restrictive manner, wherein:
[0022] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0023] Figure 1 Shows the implementation process schematic of a display method according to an embodiment of the present disclosure Figure 1 ;
[0024] FIG. 2(a) shows a schematic diagram of a multi-layer according to an embodiment of the present disclosure;
[0025] FIG. 2(b) shows a schematic diagram of a blur effect according to an embodiment of the present disclosure;
[0026] Figure 3Shows the second schematic diagram of the implementation process of a display method according to an embodiment of the present disclosure;
[0027] Figure 4 Shows the schematic structural diagram of a display device according to an embodiment of the present disclosure;
[0028] Figure 5 Shows the schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners
[0029] To make the objectives, features, and advantages of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present disclosure.
[0030] In the following description, "some embodiments" are involved, which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0031] In the following description, the terms "first / second" involved are only used to distinguish similar objects, and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present disclosure described here can be implemented in an order other than that illustrated or described here.
[0032] Unless otherwise defined, all technical and scientific terms used in the present disclosure have the same meaning as commonly understood by those skilled in the technical field to which the present disclosure belongs. The terms used in the present disclosure are only for the purpose of describing the embodiments of the present disclosure, and are not intended to limit the present disclosure.
[0033] Background Blur is a visual effect commonly used in the user interface (UI) design of electronic devices such as mobile phones and tablets. By drawing a semi-transparent and blurred layer at the bottom of UI components, the high-class sense of UI components is enhanced, and the user experience is improved. By blurring the interface background, Background Blur can provide users with a high-class interface texture and make foreground elements more prominent.
[0034] In modern mobile phone UI design, background blur is widely applied to elements such as pop-up menus, notification bars, and dialog boxes. When the user interacts with the interface, the background blur effect can reduce background interference, and the user will not overly focus on the blurred content, helping the user to focus more on the current operation content. For example, when switching applications or opening a menu, background blur can make the interface more concise and clear, while enhancing the transition effect, making the interface look more modern and design-sense.
[0035] However, background blur is not just a simple visual effect. It usually requires the device to perform in-depth processing and real-time updates on layers. When multiple layers overlap and one of the layers needs to apply complex visual effects (such as background blur), the device needs to continuously redraw and render these layers, which will increase the burden and power consumption of the device. During the process of drawing background blur, generally a large amount of resources are consumed for layer drawing and rendering. Therefore, although the background blur effect improves the visual experience, it often leads to an increase in device power consumption, especially more obvious during long-term use.
[0036] Based on this, the embodiments of the present disclosure provide a display method. In response to an instruction indicating to display a first layer, image data stored in a first cache is generated and updated at a first frequency; the first cache is used to store the image data of the first layer; the image data stored in the first cache is read at a second frequency to render and display the first layer; wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer. In this way, it is realized that the generation of image data is reduced by using the first cache, so that the image rendering of the first layer does not have to regenerate the entire content every time, thereby reducing the amount of calculation and reducing device power consumption.
[0037] It should be understood that in various embodiments of the present disclosure, the magnitudes of the sequence numbers of each implementation process do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present disclosure.
[0038] Figure 1 Shows the implementation process schematic of a display method according to an embodiment of the present disclosure Figure 1 as Figure 1 shown, the display method includes:
[0039] Step 101, in response to an instruction indicating to display a first layer, generate and update the image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer;
[0040] Step 102, read the image data stored in the first cache at a second frequency to render and display the first layer;
[0041] Among them, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of the target layer.
[0042] In some embodiments, the display method can be applied to electronic devices such as mobile phones, tablet computers, laptops, etc., which have a display screen, a display interface or an operation interface.
[0043] Here, the instruction to display the first layer is an instruction for informing the electronic device to perform interface rendering, specifically used to indicate that a specific layer (i.e., the first layer) needs to be displayed and rendered.
[0044] The instruction to display the first layer can be triggered when the user performs a certain operation, so as to update the display content on the display screen according to the trigger operation and ensure that the user sees the expected interface change.
[0045] The first layer is a layer that applies a certain visual effect to the image data of the target layer.
[0046] The visual effect can be background blur. By blurring the image data of the target layer, the image data of the target layer is made less prominent, so that the user's attention is more focused on the main elements of the interface.
[0047] The visual effect can also be a stylized effect, which means transforming the visual style of the image data of the target layer to create a unique artistic effect. The stylized effect can be various ways of changing colors, textures, artistic styles, etc. to make the interface present a more personalized appearance. For example, transforming the video data of the target layer into a soft artistic style.
[0048] The visual effect can also be texture display, which means applying some special texture effects to the image data of the target layer to make it look like a certain specific material or substance, such as glass, paper, wood, etc. Through the texture effect, the layer presents a physical sense. Of course, it can also be other visual effects, which will not be elaborated here one by one.
[0049] The above visual effects can obtain image data of a certain specific style, can change the style of the image data of the target layer, or can reduce the prominence of the image data of the target layer, thereby helping the user to focus on the main interaction elements of the interface.
[0050] Here, the target layer can be the basis for generating the image data of the first layer.
[0051] For example, the target layer can be a layer that presents an application program, an interaction area, etc. Correspondingly, the image data of the first layer is the image data obtained by applying a visual effect to the image presenting the application program, the interaction area, etc.
[0052] In some scenarios, the target layer can also be described as the underlying layer, which refers to the layer that is covered by the first layer after visual effects are applied. That is, part of the interface was originally an application, an interaction area, etc., where the content that the user directly interacts with is located. However, after receiving an instruction to display the first layer, it will be covered by the first layer.
[0053] In one example, taking background blur as the visual effect, a specific application scenario example is provided. When the user performs an operation of pulling down the notification bar or the control center on a mobile phone or tablet device, the electronic device detects that this is a target sliding operation that triggers the rendering of the first layer. To display the content of the notification bar or the control center, the electronic device generates an instruction to display the first layer, instructing the device to render and display the first layer. The first layer can be obtained by performing background blur on the image of the underlying layer, and then the first layer is covered on the target layer. In this way, the visibility of the content of the notification bar or the control center can be enhanced through the generated first layer.
[0054] In another example, taking any one of the visual effects as an example, a specific application scenario example is provided. In some application scenarios, when the user performs a certain sliding operation or clicks on a specific area, a menu or a dialog box may pop up. For example, in a chat application, when the user clicks on a certain message, a detailed message option menu may pop up. At this time, the electronic device can generate an instruction to display the first layer, which can perform special processing on the image data of the target layer, such as blur processing or stylized effects (such as converting the background into a soft artistic style) or texture display (such as simulating a glass texture display), etc., making the popped-up menu or dialog box more prominent and having a background effect with a special style, improving the user experience.
[0055] Here, the first cache for storing image data can be memory or a buffer. The image data stored in the first cache can accelerate the reading and rendering processes. The first frequency is less than the second frequency, indicating that the frequency of generating and updating the image data stored in the first cache is lower than the frequency of reading the image data stored in the first cache to render and display the first layer. For example, the second frequency is A, and A can be 100 fps (frames per second) or 120 fps, then the first frequency is a value less than A, such as 50 fps or 60 fps, etc.
[0056] In this way, the image data stored in the first cache (i.e., the image data of the first layer) is read at the second frequency to render and display the first layer, and the first frequency for generating and updating the image data of the first layer stored in the first cache is less than the second frequency. This realizes reducing the generation of image data by using the first cache, reducing unnecessary data updates, so that the image rendering of the first layer does not have to regenerate the entire content every time. Moreover, it also reduces the sampling of the image data of the target layer, thereby reducing the computational load and allocating more resources to other core animations or interactions, optimizing the user's smooth feeling of the main operations.
[0057] In some embodiments, the method further includes:
[0058] Generating and updating the image data stored in the second cache at the second frequency; the second cache is used to store the image data of the second layer;
[0059] Reading the image data stored in the second cache at the second frequency to render and display the second layer.
[0060] Here, the second frequency can be the frequency for generating and updating the second cache and for rendering and displaying the second layer, which is a unit for measuring the image update speed. For example, if the second frequency is 120fps, it means that 120 frames of images are displayed per second, and each frame is a static picture of the displayed image. Therefore, 120fps means 120 consecutive image frames are displayed per second.
[0061] The image data that the second cache is used to store can be memory or a buffer area. The image data stored in the second cache can accelerate the reading and rendering processes. For example, if the displayed content does not need to be changed, the image data of the second layer is stored in the cache and read from the cache during rendering. In this way, it is possible to avoid regenerating data every time and present a very smooth visual effect.
[0062] In some embodiments, there may be an overlay relationship among the first layer, the second layer, and the target layer.
[0063] As shown in Figure 2(a), taking background blur as an example, the second layer can be located at the topmost layer, the first layer is located between the second layer and the target layer, and the target layer is located at the bottommost layer. Here, the first layer can be described as the background blur layer, the target layer can be described as the bottom layer, and the second layer can be described as the top layer, that is, at the very top of the entire interface and covering other layers. It can present UI components such as notifications, pop - up windows, floating buttons, etc. that are located at the topmost layer of the interface.
[0064] The target layer was originally the main interaction area for the application, and the content with which the user directly interacts is usually located on this layer. However, in some special cases, the content of the target layer will be covered by the first layer (background blur layer). This kind of coverage may occur when there are hierarchical changes in the user interface (such as pulling down the notification bar, popping up a menu, etc.). For example, taking the scenario of pulling down the notification bar while playing a video in a video application as an example, when pulling down the notification bar, the target layer is the interface for playing the video, and the first layer is used to blur the background of the target layer, which is located above the current playing video interface; and the top layer is the interface for presenting the notification bar, which is located above all interfaces. As shown in Figure 2(b), a comparison diagram of background blur is provided; the left side of Figure 2 is the interface before background blur, and the right side of Figure 2 is the interface with background blur effect after pulling down the notification bar.
[0065] In this way, through the sequential coverage of the first layer, the second layer in Figure 2, and the target layer, the layering of the interface can be guaranteed, and at the same time, the user's interaction operations will not be completely blocked or interfered with.
[0066] In some embodiments, generating and updating the image data stored in the first cache at the first frequency includes:
[0067] Determine the duration between the current moment and the moment when the image data stored in the first cache was last updated;
[0068] If the duration reaches the target duration corresponding to the first frequency, generate and update the image data stored in the first cache.
[0069] Here, record the time of each generation and update of the image data in the first cache. Each time the first cache is generated and updated, by calculating the time difference (i.e., the duration) from the last update time to the current time, it is judged whether the update condition is met through this time difference.
[0070] If the duration reaches the target duration corresponding to the first frequency, generate and update the image data stored in the first cache, that is, if the calculated duration has reached the time interval required by the first frequency, the update can be triggered, that is, generate new image data as the image data of the first layer, and store the new image data in the first cache.
[0071] If the duration has not reached the target duration corresponding to the first frequency, the image data updated to the first cache last time can be obtained from the first cache as the image data of the first layer.
[0072] For example, if the first frequency is 30fps, then it should be updated 30 times per second, that is, the target duration is 1 / 30 second; if the first frequency is 60fps, then it should be updated 60 times per second, and the target duration is 1 / 60 second.
[0073] In this way, it is ensured that the image data is continuously generated and updated in the first cache at the specified frequency, ensuring smooth display of the image.
[0074] In some embodiments, the method further includes:
[0075] In response to a change in the generation parameters for generating the image data of the first layer, update the image data of the first layer stored in the first cache.
[0076] Wherein, the generation parameters may include: a blur coefficient and / or the image data of the target layer.
[0077] Here, the generation parameters refer to certain settings or variables used to generate the image data. A change in the generation parameters will trigger an update of the image data. That is, when the generation parameters change, the image data can be regenerated according to the new settings or variables.
[0078] In one example, the blur coefficient can be a parameter representing the degree of image blur. The blur coefficient determines the clarity of the image. The larger the value, the higher the degree of image blur, and the smaller the value, the clearer the image. If the blur coefficient changes, the image data can be regenerated according to the new blur coefficient.
[0079] For example, in the scenario of pulling down the notification bar, during the pulling-down process, the blur coefficient can increase as the pulling-down position goes lower. First, the first blur coefficient and the second blur coefficient corresponding to the pulling-down operation can be determined. The first blur coefficient changes with the change in the sliding distance corresponding to the pulling-down operation, and the second blur coefficient is the blur coefficient of the latest image data in the first cache. Detect whether the first blur coefficient and the second blur coefficient are the same. If the first blur coefficient and the second blur coefficient are different, generate and update the image data stored in the first cache; if the first blur coefficient and the second blur coefficient are the same, do not trigger the operation of generating and updating the image data stored in the first cache.
[0080] In this way, the image data can gradually become blurred as it is pulled down. If the pulling-down distance is large enough, the degree of blur will increase, and the image data will be generated and updated to reflect this change. If the pulling-down is not much, the degree of blur changes little, and the image data may not be regenerated, thus avoiding unnecessary resource consumption caused by frequent image updates in the case of no obvious change.
[0081] It should be noted that if the applied visual effect is a stylized effect (such as transforming the background into a soft artistic style) or a texture display (such as simulating a glass texture display), etc., the blur parameter can characterize the degree of applying a certain style or the degree of applying a certain texture.
[0082] In another example, the image data of the target layer may also change.
[0083] For example, the image data of the target layer is a video being played by a certain video player software. As the video plays, the image data of the target layer also changes accordingly. It is possible to detect whether the image of the current target layer is similar to the image of the target layer on which the latest image data in the first cache is based. If the similarity is lower than a certain set threshold, the image data stored in the first cache can be generated and updated; if the similarity is higher than a certain set threshold, the operation of generating and updating the image data stored in the first cache is not triggered.
[0084] In this way, by intelligently judging the degree of change of the image of the target layer, unnecessary update operations of the image data of the first layer are reduced, thereby saving system resources, improving performance, optimizing the user experience, and reducing the burden and energy consumption of the device.
[0085] In some embodiments, the method further includes:
[0086] Determining the first frequency according to the frame rate of the image data of the target layer.
[0087] Here, the frame rate of the image data of the target layer refers to how many frames of images are displayed on this layer within a specific time period (usually one second). The frame rate is usually measured in fps (frames per second).
[0088] Setting the first frequency according to the frame rate of the image data of the target layer. Specifically, a value lower than the frame rate of the image data of the target layer can be set as the first frequency. For example, if the frame rate of the image data of the target layer is 120 fps, the first frequency can be half of it, that is, 60 fps. Of course, the specific first frequency adopted can also be other values. The above 60 fps is only one example and is not limited.
[0089] In this way, by setting the first frequency to half of the frame rate of the image data of the target layer (60 fps), the calculation and resource consumption can be reduced by reducing the update frequency, the use of memory and bandwidth can be reduced, and the burden on the system caused by graphics processing and video rendering can be reduced. Although the update frequency is reduced, 60 fps can still provide a smooth visual experience, avoiding over-rendering and performance waste. In addition, reducing excessive updates can also reduce image processing latency and improve the system response speed, balancing image quality and performance in terms of the presented effect and optimizing the user experience.
[0090] It should be noted that considering the influence of background blur, it is difficult for users to perceive the subtle changes in the blurred content, which will not cause a significant impact on the visual experience, especially in static or semi-static blurred scenarios. Therefore, the cache of the background blur layer (i.e., the first cache) is proposed to reduce its refresh frequency. When the blur effect remains unchanged, the image of the first cache is used to replace the real-time sampling, thereby reducing the calculation amount, allocating high-refresh-rate resources to core animations or interactions, and optimizing the smoothness of the user's main operations.
[0091] In some embodiments, the image data stored in the first cache includes:
[0092] Blur the image data of the target layer according to the blur coefficient to obtain the blurred image data of the target layer.
[0093] Here, by blurring the image data of the target layer, the blur effect is applied to the image data of the target layer, and the image data of the target layer with the applied blur effect is obtained as the image data of the first layer.
[0094] In this way, the rendering of the background blur layer can be realized according to the image data of the first layer, which helps to reduce background interference and make the content of the second layer in the foreground more prominent.
[0095] In some embodiments, the method further includes:
[0096] Render and display the target layer;
[0097] In response to detecting a target sliding operation, generate an instruction to indicate the display of the first layer.
[0098] Here, the target sliding operation can be an operation that triggers the rendering of the first layer. For example, pulling down the notification bar, pulling down the control center, and popping up a menu, a dialog box, or other floating layers, etc. Of course, it can also be other scenarios that require background blur, such as when the user is interacting with a specific area (for example, viewing detailed information, editing content, etc.), background blur is required to help separate the background from the current operation area, etc., which will not be elaborated here one by one.
[0099] Here, the relationship between the first layer, the second layer, and the target layer changes with the user's operation. In some cases, there is only one layer, such as when a normal application plays a video, browses the web, etc. At this time, the image data of the second layer (i.e., the top layer) is actually the currently played video or browsed web page, and this second layer is actually also the target layer (i.e., the bottom layer).
[0100] When the user performs an operation, multiple layers are triggered to be generated. In cases such as the above-mentioned drop-down notification bar and pop-up dialog box, the second layer (i.e., the top layer) can be displayed, and the image data of the first layer (i.e., the background blur layer) is generated and rendered by combining the layer data of the target layer (i.e., the bottom layer).
[0101] Therefore, during the process of rendering and displaying the target layer, it can be detected whether a target sliding operation is received. If the target sliding operation is detected, an instruction for indicating the display of the first layer is generated, and then, according to the instruction for indicating the display of the first layer, operations such as generating and updating the image data stored in the first cache at a first frequency and reading the image data stored in the first cache at a second frequency to render and display the first layer are performed.
[0102] Figure 3 FIG. 2 shows a schematic diagram of the implementation process of a display method according to an embodiment of the present disclosure. As Figure 3 shown, the method includes:
[0103] Step 301, receiving an instruction for indicating the display of a blurred layer;
[0104] Here, the instruction for indicating the display of the blurred layer can be determined according to a target sliding operation, and the target sliding operation can be an operation for triggering the rendering of the background blur layer. For example, dropping down the notification bar, dropping down the control center, and popping up a menu, dialog box, or other floating layer, etc.
[0105] Here, the method may further include: Step 300, initializing the cache and setting the blur refresh frequency; here, the cache may include: the first cache for storing background blur image data (which is an example of the image data of a first layer); and may also include a second cache for storing top layer image data (which is an example of the image data of a second layer).
[0106] The blur refresh frequency can be an example of a first frequency, and this blur refresh frequency can also represent the frequency of updating the first cache.
[0107] Step 302, calculating the time interval between two blur calculations;
[0108] Here, the interval duration is 1 / blur refresh frequency; the blur refresh frequency is used to indicate the frequency of generating and updating the background blur image data in the first cache;
[0109] Step 303, determining whether the time interval exceeds the interval duration and / or whether the blur coefficient is updated; if the time interval exceeds the interval duration and / or the blur coefficient is updated, then enter Step 304; if the time interval does not exceed the interval duration and the blur coefficient is not updated, then enter Step 305;
[0110] Here, it can be determined whether new background blurred image data needs to be generated currently by judging whether the time interval exceeds the interval duration. If it exceeds, it is considered that new background blurred image data needs to be generated, that is, enter step 304; if it does not exceed, it is considered that new background blurred image data does not need to be generated, and the background blurred image data can be directly read from the first cache, that is, enter step 305;
[0111] Meanwhile, considering that if the blur coefficient changes, it will affect the blur effect. Therefore, it is also considered whether the blur coefficient is updated. If the blur coefficient is updated, it is considered that new background blurred image data needs to be generated, that is, enter step 304; if the blur coefficient is not updated, it is considered that new background blurred image data does not need to be generated, and the background blurred image data can be directly read from the first cache, that is, enter step 305.
[0112] Step 304: Generate background blurred image data and update the image data stored in the first cache;
[0113] Among them, the background blurred image data is generated by adding a blur effect to the underlying layer data based on the blur coefficient.
[0114] Step 305: Read the background blurred image data from the first cache;
[0115] Step 306: Render the background blurred image data.
[0116] Here, the background blurred image data can be rendered at the second frequency, and the blur refresh frequency for generating and updating the image data stored in the first cache is less than the second frequency, which realizes reducing the generation of image data by using the first cache, reducing unnecessary data updates, so that the rendering of the background blurred image data does not need to regenerate the entire content every time, thereby reducing the calculation amount, allocating more resources to other core animations or interactions, and optimizing the fluency of the user's main operations.
[0117] Here, taking the scenario of pulling down the notification bar when playing a video in a video software as an example, assuming that the screen refresh frequency or the second frequency is 120fps and the blur refresh frequency is 30fps, it can be achieved that during the drawing process, the rendering time shows obvious regularity. When the blurred content is stable and the blur coefficient does not change, only one frame is drawn every four frames, that is, one background blurred frame is obtained by resampling, and the cached background blurred content is used at other times, greatly reducing the sampling of the underlying image data, reducing the calculation amount of the background blurred image data, and allocating more resources to other core animations or interactions, and optimizing the fluency of the user's main operations.
[0118] Figure 4 shows a schematic structural diagram of a display device according to an embodiment of the present disclosure; as Figure 4 shown, the device includes:
[0119] A first processing module, configured to generate and update, in response to an instruction indicating to display a first layer, the image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer;
[0120] A second processing module, configured to read the image data stored in the first cache at a second frequency to render and display the first layer;
[0121] Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
[0122] In some embodiments, the first processing module is further configured to generate and update, at the second frequency, the image data stored in a second cache; the second cache is used to store the image data of a second layer;
[0123] The second processing module is further configured to read the image data stored in the second cache at the second frequency to render and display the second layer.
[0124] In some embodiments, the first processing module is configured to determine the duration between the current moment and the moment when the image data stored in the first cache was last updated;
[0125] If the duration reaches the target duration corresponding to the first frequency, generate and update the image data stored in the first cache.
[0126] In some embodiments, the first processing module is configured to update the image data of the first layer stored in the first cache in response to a change in the generation parameters for generating the image data of the first layer.
[0127] In some embodiments, the generation parameters include: a blur coefficient and / or the image data of the target layer.
[0128] In some embodiments, the first processing module is configured to determine the first frequency according to the frame rate of the image data of the target layer.
[0129] In some embodiments, the first processing module is configured to perform a blur process on the image data of the target layer according to the blur coefficient to obtain the blurred image data of the target layer.
[0130] In some embodiments, the second processing module is configured to render and display the target layer;
[0131] The first processing module is configured to generate the instruction indicating to display the first layer in response to detecting a target sliding operation.
[0132] It can be understood that when implementing the corresponding display method, the display device provided in the above embodiments can allocate the above processing to different program modules as needed to complete all or part of the processing described above. In addition, the device provided in the above embodiments and the embodiments of the corresponding method belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.
[0133] The embodiments of the present disclosure provide a computer-readable storage medium storing executable instructions, where the executable instructions, when executed by a processor, will trigger the processor to execute the display method provided by the embodiments of the present disclosure.
[0134] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or CD-ROM, etc.; it may also be various devices including one or any combination of the above memories.
[0135] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, model, subroutine, or other unit suitable for use in a computing environment.
[0136] As an example, the executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected through a communication network.
[0137] The embodiments of the present disclosure provide a computer program product, where the computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the display method described in the present disclosure is implemented.
[0138] Figure 5 The structural schematic diagram of an electronic device according to the embodiments of the present disclosure is shown; as Figure 5As shown, the electronic device 50 includes: a display screen, a processor 501, and a memory 502 for storing a computer program that can run on the processor; when the processor 501 runs the computer program, it executes the display method provided by the embodiments of the present disclosure.
[0139] In actual application, the electronic device 50 may further include: at least one network interface 503. Each component in the electronic device 50 is coupled together through a bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 5 all kinds of buses are labeled as the bus system 504. Among them, the number of the processors 501 can be at least one. The network interface 503 is used for the communication between the electronic device 50 and other devices in a wired or wireless manner.
[0140] The memory 502 in the embodiments of the present disclosure is used to store various types of data to support the operation of the electronic device 50.
[0141] The method disclosed in the above embodiments of the present disclosure can be applied to the processor 501 or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 501 or the instructions in the form of software. The above-mentioned processor 501 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the method disclosed in the embodiments of the present disclosure, it can be directly embodied as being executed by the hardware decoding processor, or executed by the combination of the hardware and software modules in the decoding processor. The software module may be located in the storage medium, and this storage medium is located in the memory 502. The processor 501 reads the information in the memory 502 and combines its hardware to complete the steps of the foregoing method.
[0142] In some embodiments, the electronic device 50 may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general purpose processors, controllers, microcontroller units (MCUs), microprocessors, or other electronic components, and is used to execute the foregoing method.
[0143] It should be understood that various forms of the processes shown above may be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this is not limited herein.
[0144] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise specifically defined.
[0145] As described above, the foregoing are only specific embodiments of this disclosure, but the protection scope of this disclosure is not limited thereto. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in this disclosure, and all such changes or substitutions should be covered by the protection scope of this disclosure. Therefore, the protection scope of this disclosure shall be subject to the protection scope of the claims.
Claims
1. A display method, the method comprising: In response to an instruction to display a first layer, generating and updating the image data stored in a first cache at a first frequency; The first cache is used to store the image data of the first layer; Reading the image data stored in the first cache at a second frequency to render and display the first layer; Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
2. The method according to claim 1, the method further comprising: Generating and updating the image data stored in a second cache at the second frequency; The second cache is used to store the image data of a second layer; Reading the image data stored in the second cache at a second frequency to render and display the second layer.
3. The method according to claim 1, wherein generating and updating the image data stored in the first cache at the first frequency comprises: Determining the duration between the current moment and the moment when the image data stored in the first cache was last updated; If the duration reaches the target duration corresponding to the first frequency, generating and updating the image data stored in the first cache.
4. The method according to claim 2, the method further comprising: In response to a change in the generation parameters for generating the image data of the first layer, updating the image data of the first layer stored in the first cache.
5. The method according to claim 4, wherein the generated parameters include: Blur coefficient and / or the image data of the target layer.
6. The method according to claim 2, the method further comprising: Determining the first frequency according to the frame rate of the image data of the target layer.
7. The method according to claim 1, wherein generating the image data stored in the first cache comprises: Performing blur processing on the image data of the target layer according to a blur coefficient to obtain the blurred image data of the target layer.
8. The method according to claim 1, the method further comprising: Rendering and displaying the target layer; In response to detecting a target sliding operation, generating the instruction to display the first layer.
9. A display device, the device comprising: A first processing module, configured to generate and update the image data stored in a first cache at a first frequency in response to an instruction to display a first layer; The first cache is used to store the image data of the first layer; A second processing module, configured to read the image data stored in the first cache at a second frequency to render and display the first layer; Wherein, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of a target layer.
10. An electronic device, comprising: At least one processor, a display screen; The at least one processor is capable of executing: In response to an instruction to display a first layer, generating and updating the image data stored in a first cache at a first frequency; the first cache is used to store the image data of the first layer; Reading the image data stored in the first cache at a second frequency to render and display the first layer on the display screen; Among them, the first frequency is less than the second frequency, and the image data of the first layer is generated based on the image data of the target layer.