Interface generation method and electronic equipment
By combining the unified rendering mode and the separated rendering mode in electronic devices, and dynamically switching according to the status, the rendering lag problem of electronic devices when displaying multiple application interfaces is solved, the rendering efficiency and effect are improved, and better user experience is achieved. experience.
Patent Information
- Application Number
- CN202310225183.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
When an electronic device displays the interface of multiple applications, it takes a long time to render and generate the display content, causing the device to display lag. The existing technology only supports one rendering mode, resulting in low rendering efficiency and poor effects in some cases.
Using a combination of unified rendering mode and separated rendering mode, the rendering mode is dynamically switched according to the status of the application and the device. In the unified rendering mode, the merged rendering tree is directly submitted to the GPU. In the separated rendering mode, the application is independently rendered and summarized by the system, and the best selection is selected. Suitable rendering modes to improve efficiency and effectiveness.
By dynamically switching rendering modes, the GPU load is reduced, the efficiency of the graphics rendering pipeline is optimized, and smoother interface rendering and cross-window dynamic effects are achieved, which facilitates development and avoids the problem of low rendering efficiency.
Smart Images

Figure CN118567764A
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to an interface generation method and an electronic device. Background Art
[0002] With the development of electronic technology, more and more electronic devices are involved in the daily life of users. In addition, as the resolution and size of the screens of electronic devices are getting higher and higher, more and more content can be displayed on the electronic devices.
[0003] However, before an electronic device displays an application interface, each application needs to render and generate display content by itself, and then the synthesizer synthesizes the display content of each application to obtain a user interface. When the load of each application is high, it takes a long time to generate the display content, resulting in a freeze in the electronic device display. Summary of the invention
[0004] An embodiment of the present application provides an interface generation method and an electronic device, wherein the electronic device includes a unified rendering mode and a separate rendering mode. Wherein, when the electronic device is in the unified rendering mode, the rendering trees of one or more applications can be merged, and an interface including one or more application interfaces can be generated through one rendering based on the merged target rendering tree, thereby reducing the number of rendering times and reducing the power consumption of the electronic device. When the electronic device is in the separate rendering mode, the rendering trees of one or more applications can be rendered to generate interfaces of one or more applications, and then the interfaces of the one or more applications can be merged to generate an interface including one or more application interfaces, thereby improving the rendering speed. The electronic device can select a suitable rendering mode based on the state of the electronic device, so that the electronic device can select a rendering mode suitable for the electronic device according to the state of the electronic device, thereby bringing a better user experience.
[0005] In a first aspect, an embodiment of the present application provides an interface generation method, comprising:
[0006] The electronic device generates a first interface by rendering in a first rendering mode;
[0007] The electronic device displays a first interface;
[0008] The electronic device receives a first input to open a first application;
[0009] The electronic device obtains, in response to the first input, first running state information of one or more application programs and first device state information of the electronic device, wherein the one or more application programs include a first application;
[0010] The electronic device determines a second rendering mode based on the first operating state information and the first device state information;
[0011] The electronic device renders and generates a second interface through a second rendering mode, where the second interface includes display content of the first application;
[0012] The electronic device displays the second interface.
[0013] In this way, when the state of the electronic device changes, the electronic device selects the corresponding rendering mode based on the state of the application and the state of the electronic device. The electronic device switches the rendering mode of the electronic device without the user's perception, so that the electronic device selects an applicable rendering mode based on the situation of the electronic device, providing the user with a better rendering service experience. It can also avoid the situation where the electronic device only supports one rendering mode, and due to the limitation of the rendering mode, the rendering efficiency is low and the rendering effect is poor in some cases.
[0014] In a possible implementation manner, the first rendering mode is a unified rendering mode or a separate rendering mode, the second rendering mode is a unified rendering mode or a separate rendering mode, and the first rendering mode is the same as or different from the second rendering mode.
[0015] In this way, after the state of the electronic device changes, the rendering mode determined again by the electronic device may be the same as or different from the rendering mode currently in which the electronic device is located.
[0016] In a possible implementation, after the electronic device displays the second interface, the method further includes:
[0017] The electronic device obtains second running state information of one or more application programs and second device state information of the electronic device, wherein the one or more application programs include the first application program;
[0018] The electronic device determines a third rendering mode based on the second operating state information and the second device state information;
[0019] The electronic device renders and generates a third interface through a third rendering mode, where the third interface includes display content of the first application;
[0020] The electronic device displays the third interface.
[0021] In this way, when the electronic device is running the first application, if the state of the electronic device changes, the electronic device changes the rendering mode of the electronic device accordingly to implement the interface generation operation.
[0022] In a possible implementation, the third rendering mode is a unified rendering mode or a separate rendering mode.
[0023] In a possible implementation, the second rendering mode is a unified rendering mode; before the electronic device renders and generates the second interface through the second rendering mode, the method further includes:
[0024] The first application generates a first rendering tree, where the first rendering tree is used to draw display content of the first application;
[0025] The first application sends the first rendering tree to a system rendering service of the electronic device;
[0026] The system rendering service renders and generates a second interface based on the first rendering tree.
[0027] In this way, the electronic device can generate a second interface through the system rendering service in the unified rendering mode. The electronic device directly submits the rendering tree to the GPU, without calling the GPU multiple times, reducing the GPU load and optimizing the drawing and rendering energy efficiency ratio of the graphics rendering pipeline. In addition, the unified rendering mode makes it easier for electronic devices to achieve cross-window dynamic effects, making the development of cross-window dynamic effects more convenient and unified.
[0028] In a possible implementation, the second rendering mode is a separate rendering mode; before the electronic device renders and generates the second interface through the second rendering mode, the method further includes:
[0029] The first application generates a first rendering tree;
[0030] The first application generates display content of the first application based on the first rendering tree rendering;
[0031] The first application sends the display content of the first application to the system rendering service of the electronic device;
[0032] The system rendering service generates a second interface based on the display content of the first application.
[0033] In this way, in the separate rendering mode, the application of the electronic device performs the rendering operation by itself. When the electronic device generates a user interface in the separate rendering mode, the application independently completes the rendering of the layer, and then the system rendering service aggregates and renders the layers of each application, and finally refreshes the interface to the terminal display screen for display. Each application runs independently, with a high degree of parallelism.
[0034] In one possible implementation, the first running status information includes one or more of the window display type of one or more applications, the rendering load of one or more applications, the task load of one or more applications, and whether they are in an animation process; the first device status information includes one or more of the load of the CPU of the electronic device, the load of the system rendering service of the electronic device, the GPU load of the electronic device, the hardware performance of the electronic device, and the power of the electronic device.
[0035] In this way, the electronic device jointly determines the rendering mode of the electronic device based on multiple parameters, and the multiple parameters can enable the electronic device to obtain a rendering mode that is more suitable for the state of the electronic device.
[0036] In a possible implementation, the method further includes: the electronic device is provided with first operating status information and weight values of various parameters in the first device status information, and the electronic device determines the second rendering mode based on the values of various parameters and the weight values of various parameters.
[0037] In this way, the electronic device sets weight values for each parameter, and sets larger weight values for more important parameters, so that the electronic device can obtain a rendering mode that is more suitable for the state of the electronic device.
[0038] In a possible implementation manner, the electronic device determines the second rendering mode based on the first operating state information and the first device state information, specifically including:
[0039] The electronic device obtains an application rendering mode corresponding to the one or more application programs based on the first running state information of the one or more application programs, where the application rendering mode is a separate rendering mode or a unified rendering mode;
[0040] The electronic device obtains a device rendering mode based on the first device state information, where the device rendering mode is a separate rendering mode or a unified rendering mode;
[0041] The electronic device sets a rendering mode with a larger number as the second rendering mode based on one or more application rendering modes and the number of separate rendering modes and the number of unified rendering modes in the device rendering mode.
[0042] In this way, when an electronic device runs multiple applications, the rendering mode of the electronic device can be jointly determined based on the status of each application and the status of the device, so that the resulting rendering mode is more suitable for the electronic device.
[0043] In a second aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes a method described in any possible implementation method in the first aspect above.
[0044] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute a method as described in any possible implementation of the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method described in any possible implementation method in the first aspect above.
[0046] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute a method as described in any possible implementation manner in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1A A schematic diagram of a process for an electronic device to generate a target bitmap in a separate rendering mode provided in an embodiment of the present application;
[0048] Figure 1B A schematic diagram of a scenario in which an electronic device generates a target bitmap in a separate rendering mode provided by an embodiment of the present application;
[0049] Figure 2A A schematic diagram of a process for an electronic device to generate a target bitmap in a unified rendering mode provided in an embodiment of the present application;
[0050] Figure 2B A schematic diagram of a scenario in which an electronic device generates a target bitmap in a unified rendering mode provided by an embodiment of the present application;
[0051] Figure 3 A schematic diagram of a flow chart of an interface generation method provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of a module flow provided for an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0054] Figure 6 A software architecture diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0055] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "the", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0056] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0057] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can include visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0058] For ease of understanding, the following first introduces the relevant terms and concepts involved in the embodiments of the present application. The terms used in the embodiments of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0059] When generating a user interface, the electronic device may use a specified rendering mode to implement a rendering operation of the user interface to obtain a user interface displayed on a display screen. The specified rendering mode may be a separate rendering mode or a unified rendering mode. The electronic device may use a separate rendering mode or a unified rendering mode to render the user interface.
[0060] When the electronic device generates a user interface in the separate rendering mode, the application of the electronic device can render and generate a bitmap of the application interface. Afterwards, the system rendering service of the electronic device can aggregate and render the bitmaps of each application, and finally refresh the obtained image to the display screen of the electronic device for display.
[0061] Specifically, the interface displayed on the display screen of the electronic device may include interfaces of one or more applications, that is, the electronic device needs to generate interfaces for one or more applications, and synthesize the interfaces to obtain the synthesized interface displayed on the screen.
[0062] In this process, the application of the electronic device can generate a rendering tree, and then render the rendering tree to obtain a bitmap through the graphics processing unit (GPU), and place the bitmap on the surface corresponding to the application. After that, the application can store the generated surface in the buffer of the buffer queue (BufferQueue) provided by the surface compositor (SurfaceFlinger). The surface compositor can obtain the bitmaps generated by each application from the BufferQueue and synthesize the bitmaps of each application. The electronic device can display the synthesized bitmaps. In some examples, the surface compositor can determine the bitmap of the application visible on the display screen through the window management service (Window Manager Service, WMS). After determining the visible bitmap, the surface compositor can also determine the synthesis method of the bitmap to the hardware compositor (HWC), such as the Client synthesis method, the Device synthesis method, etc. In some examples, when an electronic device implements complex animation effects, such as launching an application, exiting an application, gesture navigation, color conversion, displaying multiple windows, screen recording, and other animation effects, the surface compositor can use OpenGL ESshader to pre-draw part of the bitmap (referred to as a layer here) content to an off-screen buffer, and then send the remaining layers together to HWComposer for composite rendering. This process can be called "off-screen rendering."
[0063] For example, Figure 1A As shown, the application includes a UI thread and a rendering thread. The UI thread of the application can be used to generate a rendering tree of the application and pass the rendering tree to the rendering thread of the application. The rendering thread can render a bitmap based on the rendering tree. After that, the surface compositor can synthesize the bitmap of the application and render the synthesized bitmap on the display screen.
[0064] For example, take application 1 and application 2 of an electronic device as an example. Application 1 generates rendering tree 1, and then generates bitmap 1 based on rendering tree 1. Application 2 generates rendering tree 2, and then generates bitmap 2 based on rendering tree 2. After receiving bitmap 1 and bitmap 2, the surface synthesizer synthesizes bitmap 1 and bitmap 2 to obtain a target bitmap. Figure 1B As shown in FIG. 1 , if application 1 is an application that provides a status bar and application 2 is a calculator application, application 1 can generate a status bar as shown in FIG. Figure 1B The rendering tree 1 shown in FIG. 1 is used to render the bitmap 1 based on the rendering tree 1. The application 2 can generate the following Figure 1B The rendering tree 2 shown in FIG. 1 is used to render bitmap 2, and bitmap 2 is obtained based on rendering tree 2. After that, the system rendering service synthesizes bitmap 1 and bitmap 2 to obtain Figure 1B The target bitmap shown.
[0065] In this way, when the electronic device generates a user interface in the separate rendering mode, the application independently completes the rendering of the layer, and then the system rendering service (RenderService) will summarize and render the layers of each application, and finally refresh the interface to the terminal display screen for display. Each application runs independently, with a high degree of parallelism.
[0066] However, in a multi-window scenario, starting from the generation of rendering trees by the UI threads of multiple applications to the synthesis of layers of multiple applications by the surface compositor, since the process of calling the GPU in the electronic device is constantly changing, for example, application 1, application 2, ..., application N, surface compositor, etc., the electronic device needs to start the GPU separately at least N+1 times, where N is the number of applications. In addition, since the surface compositor is responsible for synthesizing multiple layers, high requirements are placed on the performance of the surface compositor. If the interface displayed by the electronic device includes high-level special effects across windows (for example, application switching, small window display, etc.), the system rendering service is required to process the layers provided by each application based on the animation effects of each window, increasing the memory overhead and computing overhead of the electronic device.
[0067] When an electronic device generates a user interface under a unified rendering framework, an application of the electronic device can generate a rendering tree. The system rendering service can obtain the rendering trees of one or more applications, and reassemble the one or more rendering trees to generate a target rendering tree. The system rendering service can directly render based on the target rendering tree to directly obtain a bitmap carrying the image information of the one or more application interfaces, so that the electronic device does not need to perform layer synthesis operations.
[0068] In the process of merging the target rendering trees of one or more applications into a target rendering tree, the system rendering service can determine the animation effect of each layer and change the child nodes in the target rendering tree according to the animation effect of each application, so that the system rendering service can directly generate a target bitmap based on the target rendering tree without off-screen rendering. In addition, the application does not need to generate a rendering thread, but instead lets the system rendering service perform unified rendering, which helps to improve the speed of interface rendering.
[0069] It should be noted that, when the number of rendering trees is one, the rendering tree is the target rendering tree; when the number of rendering trees is greater than one, the electronic device may synthesize the multiple rendering trees to obtain a target rendering tree.
[0070] Furthermore, compared with the separate rendering mode, the electronic device in the unified rendering mode merges the rendering trees of one or more applications into a target rendering tree, and it is not necessary to pre-generate multiple bitmaps as layers for synthesis. The system rendering service can obtain the Z order of the layers corresponding to the rendering trees of each application in the process of rendering and generating bitmaps according to the target rendering tree, and use the Z order as the Z order of the rendering tree, wherein the Z order can be used to identify the hierarchical relationship of each layer.
[0071] Optionally, the electronic device can delete the child nodes corresponding to the bitmaps that are not displayed or do not affect the display, thereby avoiding over-drawing. Among them, after the application generates the rendering tree, it can send the rendering tree to the system rendering service. The system rendering service can traverse the child nodes of each rendering tree, determine the position of the view view corresponding to each child node in the surface, and determine the completely obscured view and the child nodes of the completely obscured view in combination with the Z order of the rendering tree. The system rendering service can delete the child nodes corresponding to the completely obscured view in the rendering tree.
[0072] For example, Figure 2A As shown, the UI thread of application 1 generates rendering tree 1, and the UI thread of application 2 generates rendering tree 2. Application 1 and application 2 can pass their respective rendering trees to the system rendering service. The system rendering service can generate a new root node, and then connect rendering tree 1 and rendering tree 2 with the root node to obtain a target rendering tree. Afterwards, the system rendering service can render a target bitmap based on the target rendering tree, and the electronic device can display the target bitmap. Figure 2B As shown in FIG. 1 , if application 1 is an application that provides a status bar and application 2 is a calculator application, application 1 can generate a status bar as shown in FIG. Figure 2B Rendering tree 1 is shown. Application 2 can generate Figure 2BRendering tree 2 is shown. Afterwards, the system rendering service synthesizes rendering tree 1 and rendering tree 2 to obtain the target rendering tree. Based on the target rendering tree, the rendering is obtained Figure 2B The target bitmap shown.
[0073] In this way, the electronic device submits the rendering tree directly to the GPU, and there is no need to call the GPU multiple times, which reduces the GPU load and optimizes the drawing and rendering energy efficiency ratio of the graphics rendering pipeline. In addition, the unified rendering mode makes it easier for electronic devices to achieve cross-window dynamic effects, and the development of cross-window dynamic effects is more convenient and unified. However, compared with the separate rendering mode, since the unified rendering mode adds inter-process communication between the application and the rendering service for synchronizing rendering instructions, the rendering tasks of all applications are handed over to the system rendering service, which increases the burden on the system rendering service.
[0074] The embodiment of the present application provides an interface generation method. The electronic device supports a separate rendering mode and a unified rendering mode. The electronic device selects a corresponding rendering mode based on the state of the application and the state of the electronic device.
[0075] In this way, the electronic device is provided with a rendering mode selection strategy, and the electronic device can select a suitable rendering mode according to the state of the application providing the display content and the state of the electronic device. For example, the electronic device can adopt a unified rendering mode when the application load is high and the system load is low, and adopt a separate rendering mode when the application load is low and the system load is high. For another example, the electronic device can adopt a unified rendering mode when the battery is low. The electronic device can also adopt a unified rendering mode when implementing complex animation effects.
[0076] The electronic device can switch the rendering mode of the electronic device without the user's perception, so that the electronic device can select an appropriate rendering mode based on the situation of the electronic device to provide the user with a better rendering service experience. It can also avoid the situation where the electronic device only supports one rendering mode, and due to the limitation of the rendering mode, the rendering efficiency is low and the rendering effect is poor in some cases.
[0077] In some examples, the electronic device can determine the rendering mode of the electronic device based on the state of the application (e.g., the window display type of the application, whether the application is in the animation process, the task load of the application, the rendering load of the application, etc.) and the state of the electronic device (e.g., the load of the system rendering service, the load of the CPU, the load of the GPU, the hardware performance of the electronic device, the power of the electronic device, etc.). For example, when the load of the system rendering service is high, the electronic device can adopt a separate rendering mode to reduce the burden of the system rendering service, allowing the applications to render their own bitmaps, and also improve rendering efficiency. For another example, when there are many application tasks, the electronic device can adopt a unified rendering mode to allow the system rendering service to perform rendering tasks, reduce the rendering overhead of the application, and ensure that the electronic device can smoothly display the interface including the display content of the application when the application is busy.
[0078] like Figure 3 As shown, the interface generation method includes the following steps:
[0079] S301. The rendering mode of the electronic device is the first rendering mode, and the electronic device receives an input to open a first application.
[0080] When the electronic device receives an input to open the first application, it can trigger the electronic device to execute step S302. The first application is an application provided by the electronic device, and the electronic device can display an icon of the first application on the display screen, and the icon can be used to trigger the electronic device to display a page of the first application. For example, the first application can be an application installed on the electronic device, or the first application can also be an application provided by a cloud server, etc.
[0081] S302. The electronic device determines a second rendering mode based on status information of one or more applications and status information of the electronic device, the one or more applications include a first application, and the first rendering mode is different from the second rendering mode.
[0082] After receiving the input to open the first application, the electronic device can obtain the state information of one or more application programs of the electronic device and the state information of the electronic device in response to the input, wherein the one or more application programs are application programs that provide visible display content to the display screen.
[0083] The status information of the application may include, but is not limited to, one or more of the window display type of the application, the task load of the application, the rendering load of the application, whether it is in the animation process, and the like.
[0084] Among them, the window display type of the application can be used to indicate whether the window of the application is maximized or displayed in a small window. Among them, when the window display type of the application is a small window display, the window of the application can be a floating window or a split screen window. When the window display type of the application is maximized, this parameter does not affect the electronic device's choice of rendering mode. When the window display type of the application is a small window display, this parameter tends to cause the electronic device to set the rendering mode to a unified rendering mode.
[0085] Among them, whether it is in the animation process can be used to indicate whether the application is in the animation process. For example, the application in the animation process may include the animation process of starting the application, or the animation process of the application window size change, etc. When the application is in the animation process (or, a complex animation effect needs to be achieved), the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode. When the application is not in the animation process, the parameter does not affect the electronic device's choice of rendering mode.
[0086] The rendering load of the application can be used to represent the load of the bitmap rendered by the application. When the rendering load of the application is higher than the rendering load threshold (for example, the rendering load threshold is 70% of the peak rendering load), the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode. When the rendering load of the application is lower than the rendering load threshold, the parameter does not affect the electronic device's choice of rendering mode.
[0087] Among them, the task load of the application can be used to represent the load of the application performing tasks other than rendering. When the task load of the application is higher than the task load threshold (for example, the task load threshold is 70% of the task load peak), the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode. When the task load of the application is lower than the task load threshold, the parameter does not affect the electronic device's decision on the rendering mode.
[0088] The status information of the electronic device may include, but is not limited to, one or more of the load of the system rendering service, the load of the CPU, the load of the GPU, the hardware performance of the electronic device, the power of the electronic device, and the like.
[0089] Among them, when the load of the system rendering service is higher than the system load threshold (for example, the system load threshold is 70% of the peak load of the system rendering service), the parameter tends to cause the electronic device to set the rendering mode to the separate rendering mode. When the load of the system rendering service is lower than the system load threshold, the parameter does not affect the electronic device's decision on the rendering mode.
[0090] When the CPU load is higher than the CPU load threshold (for example, the CPU load threshold is 70% of the CPU load peak), the parameter tends to cause the electronic device to set the rendering mode to the separate rendering mode. When the CPU load is lower than the CPU load threshold, the parameter does not affect the electronic device's choice of rendering mode.
[0091] When the GPU load is higher than the GPU load threshold (for example, the GPU load threshold is 70% of the GPU load peak), the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode. When the GPU load is lower than the GPU load threshold, the parameter does not affect the electronic device's choice of rendering mode.
[0092] Among them, the hardware performance of the electronic device may refer to the synthesizer performance of the electronic device. Different electronic devices have different synthesizer performances. If the synthesizer performance installed in the electronic device is good, the parameter tends to cause the electronic device to set the rendering mode to the separate rendering mode. If the hardware (e.g., synthesizer) performance of the electronic device is poor, the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode. In this way, it is possible to avoid the situation where the synthesis of the bitmap takes too long in the separate mode.
[0093] When the power level of the electronic device is higher than the power threshold (for example, the power threshold is 30% power), the parameter does not affect the electronic device's decision on the rendering mode. When the power level of the electronic device is lower than the power threshold, the parameter tends to cause the electronic device to set the rendering mode to the unified rendering mode.
[0094] In this way, when the task load and rendering load of one or more applications are low and are not in the animation process, the second rendering mode is a separate rendering mode, and the electronic device can complete the rendering operation more quickly. Among them, when at least one application among one or more applications is in the animation process, the second rendering mode is a unified rendering mode, and the electronic device can take advantage of rendering cross-window animation under unified rendering. Among them, when the task load or rendering load of at least one application in one or more applications is high, the second rendering mode is a unified rendering mode, and the electronic device can hand over the rendering task to a unified system rendering service to reduce the load of the application process. When the GPU load of the electronic device is high, the second rendering mode is a unified rendering mode, and the electronic device uses a GPU submission in the unified rendering mode to reduce the load of the GPU. When the load of the system rendering service is high and / or the CPU load is high, the second rendering mode is a separate rendering mode, which allows each application process to share the balanced rendering load. When the power of the electronic device is low (for example, the power is less than 30%), the second rendering mode is a unified rendering mode. Since the power consumption of the electronic device in the unified rendering mode is lower than the power consumption of the electronic device in the unified rendering mode, the power consumption of the electronic device can be saved and the system energy efficiency ratio can be optimized. In some examples, since the hardware performance of the electronic device remains unchanged and is more important than other parameters, when the hardware performance (e.g., synthesizer) of the electronic device has better performance and lower power, the second rendering mode is the separate rendering mode.
[0095] In other examples, the electronic device may set different weights for the application state information of the application and the device state information of the electronic device. The electronic device may obtain the application rendering mode of each application based on the application state information of each application and the weight of the application state information, and obtain the device rendering mode based on the device state information and the weight of the device state information. Afterwards, the electronic device may obtain the final rendering mode based on the application rendering mode of each application and the device rendering mode.
[0096] For example, the weight ratio of the window display type, whether it is in the animation process, the task load of the application, and the rendering load of the application in the application status information is 2:4:2:2. The weight ratio of the load of the system rendering service, the load of the CPU, the load of the GPU, the hardware performance of the electronic device, and the power of the electronic device in the device status information is 2:2:2:3:1.
[0097] When one or more applications of an electronic device include application 1 and application 2. If the window display type of application 1 is small window display, it is not in the animation process, the task load of the application is higher than the task load threshold, and the rendering load of the application is higher than the rendering load threshold, the results corresponding to each parameter can be obtained as unified rendering mode, no impact, unified rendering mode, and unified rendering mode, so that the application rendering mode of application 1 is unified rendering mode. If the window display type of application 2 is maximized display, it is not in the animation process, the task load of the application is higher than the task load threshold, and the rendering load of the application is lower than the rendering load threshold, the results corresponding to each parameter can be obtained as no impact, no impact, unified rendering mode, and no impact, so that the application rendering mode of application 2 is unified rendering mode. If the load of the system rendering service in the device status information is higher than the system load threshold, the CPU load is higher than the CPU load threshold, the GPU load is higher than the GPU load threshold, the hardware performance of the electronic device is good, and the power of the electronic device is higher than the power threshold, the results corresponding to each parameter can be obtained as separate rendering mode, separate rendering mode, unified rendering mode, separate rendering mode, and no impact, so that the device rendering mode is separate rendering mode. Since the application rendering mode of application 1 is a unified rendering mode, the application rendering mode of application 2 is a unified rendering mode, and the device rendering mode is a separate rendering mode, the number of results tending to the unified rendering mode is greater, and the electronic device can obtain the second rendering mode as a unified rendering mode. It can be understood that the various parameters of the second rendering mode determined by the electronic device here are only examples and should not constitute a specific limitation. It should be noted that if the electronic device cannot obtain the final rendering mode based on the various parameters, for example, the number of two rendering modes is equal, the electronic device can keep the rendering mode of the electronic device unchanged, that is, the obtained second rendering mode is the same as the first rendering mode.
[0098] It should also be noted that after the electronic device determines the second rendering mode, it can notify all applications of the electronic device and the system rendering service to perform rendering operations in the second rendering mode.
[0099] Optionally, the electronic device may also detect the status of the one or more applications and the electronic device in real time, and determine the rendering mode of the electronic device based on the acquired status information. In some examples, in order to save power consumption of the electronic device, the electronic device may determine whether the rendering mode of the electronic device is a unified rendering mode or a separate rendering mode every preset time (e.g., 16ms).
[0100] S303. The electronic device renders, in the second rendering mode, an interface including display contents of the first application.
[0101] After determining the second rendering mode, the electronic device can render an interface including the display content of the first application in the second rendering mode. Among them, the electronic device first switches from the first rendering mode to the second rendering mode, and then performs the operation of rendering to obtain the interface including the display content of the first application. Specifically, when the first rendering mode is a separate rendering mode and the second rendering mode is a unified rendering mode, when the electronic device switches the rendering mode to the second rendering mode, the electronic device can notify the one or more applications and the system rendering service to switch the rendering mode to the unified rendering mode. The one or more applications (including the first application) can send the data to be rendered to the system rendering service after receiving the notification. The system rendering service can render the user interface based on the data to be rendered. When the first rendering mode is a unified rendering mode and the second rendering mode is a separate rendering mode, when the electronic device switches the rendering mode to the second rendering mode, the electronic device can notify the one or more applications and the system rendering service to switch the rendering mode to the separate rendering mode. The one or more applications can render their respective bitmaps, and then transmit the bitmaps to the system rendering service for operations such as bitmap synthesis to obtain a user interface.
[0102] It should be noted that, here, only the situation where the first rendering mode is different from the second rendering mode is described. If the second rendering mode determined by the electronic device is the same as the first rendering mode, the electronic device does not need to switch the rendering mode.
[0103] In other examples, in order to save power consumption of the electronic device, the electronic device can determine whether the rendering mode of the electronic device is a unified rendering mode or a separate rendering mode every preset time (e.g., 16ms). In this way, the electronic device can monitor the status of the application and the electronic device in real time and switch the rendering mode in time.
[0104] In some examples, the electronic device may include, but is not limited to, a device state perception module, an application state perception module, a rendering mode decision module, and the like. The application state perception module may be used to monitor the state of each application and pass the state information of each application to the rendering mode decision module. The device state perception module may be used to monitor the state of the electronic device and pass the state information of the electronic device to the rendering mode decision module. The state information of the application and the state information of the electronic device may refer to Figure 3 The illustrated embodiments will not be described in detail here.
[0105] The rendering mode decision module can determine the rendering mode of the electronic device based on the information fed back by the application state perception module and the device state perception module. After determining the rendering mode, the rendering mode decision module can also notify the application program and the system rendering service of the electronic device of the determined rendering mode. Specifically, the rendering mode decision module determines the rendering mode based on the state of the application program and the state of the device. Figure 3 The illustrated embodiments will not be described in detail here.
[0106] In some examples, after determining the rendering mode, the rendering mode decision module can notify each application and the system rendering service of the determined rendering mode through a message mechanism. After receiving the notification of switching the rendering mode, each application and the system rendering service can prepare for data synchronization before switching the rendering mode. For example, each application can send the rendering tree to the system rendering service when switching from the separate rendering mode to the unified rendering mode. When the data synchronization of the electronic device is completed, the two rendering modes can be switched imperceptibly.
[0107] In some examples, the rendering mode decision module may notify each application and the system rendering service to switch the rendering mode through a message mechanism only when the rendering mode needs to be switched. In this way, the electronic device may not notify the application and the system rendering service when the rendering mode does not need to be switched.
[0108] For example, Figure 4 The data interaction process between the various modules of the electronic device is shown. Figure 4 As shown, the application status perception module of the electronic device can obtain application status information from the application program, and pass the application status information to the rendering mode decision module. The device status perception module can obtain device status information from the system rendering service, and pass the device status information to the rendering mode decision module. The rendering mode decision module can determine the rendering mode of the electronic device based on the application status information and the device status information according to the preset rendering mode selection rules. The rendering mode decision module can also send the determined rendering mode to the application program and the system rendering service. After receiving the rendering mode information sent by the rendering mode decision module, the application program and the system rendering service can set the rendering mode to the rendering mode determined by the rendering mode decision module. Among them, the flow of data between each module can be seen in Figure 4 The solid arrow in .
[0109] In some examples, the rendering mode of the application and the system rendering service is a separate rendering mode. After determining that the rendering mode is a unified rendering mode, the rendering mode decision module notifies the application and the system rendering service to set the rendering mode to the unified rendering mode. The application can send a rendering message to the system rendering service, such as Figure 4As shown by the dotted arrow in FIG. , the rendering message may include the rendering tree generated by the application. In this way, the system rendering service can implement the rendering operation in the unified rendering mode.
[0110] It should be noted that the device state perception module here obtains the device state information from the system rendering service module is only an example. Since the state information of the electronic device may also include the GPU load, the CPU load, the power of the electronic device, etc. The system rendering service cannot provide this state information to the device state perception module. The device state perception module can obtain this state information from the corresponding service. For example, the device state perception module can obtain the power of the electronic device from the power management module of the electronic device.
[0111] In some examples, the rendering mode decision module can detect the startup status of each application. When the rendering mode decision module detects that an application is started, the rendering mode of the electronic device can be determined according to the above steps, and the application is notified of the determined rendering mode.
[0112] It can be understood that when the rendering mode decision module determines that the rendering mode has changed, it notifies all applications and the system rendering service to perform a rendering mode switching operation.
[0113] The electronic device provided by the embodiments of the present application is introduced below.
[0114] See also Figure 5 , Figure 5 The hardware structure diagram of the electronic device provided in the embodiment of the present application is exemplarily shown.
[0115] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0116] It is to be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device. In other examples of the present application, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0117] 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 graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0118] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0119] The processor 110 may also be provided with a memory for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0120] In some examples, processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0121] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other examples of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0122] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of an electronic device. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0123] 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 supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other examples, the power management module 141 can also be set in the processor 110. In other examples, the power management module 141 and the charging management module 140 can also be set in the same device.
[0124] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0125] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other examples, the antenna can be used in combination with a tuning switch.
[0126] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. 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 examples, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some examples, 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.
[0127] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some examples, the modem processor may be an independent device. In other examples, 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.
[0128] 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 electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0129] In some examples, the antenna 1 of the electronic device 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 can communicate with the network and other devices through wireless communication technology. The wireless communication technology 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, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0130] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0131] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some examples, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0132] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0133] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and brightness of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some examples, ISP can be set in camera 193.
[0134] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some examples, the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0135] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.
[0136] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0137] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0138] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0139] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 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 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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.
[0140] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0141] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also called a "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0142] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. When a touch operation is applied to the display screen 194, the electronic device detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. The gyroscope sensor 180B can be used to determine the motion posture of the electronic device. The air pressure sensor 180C is used to measure the air pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (for example, the direction of the three axes in the x, y, and z three-axis coordinate system of the electronic device). The distance sensor 180F is used to measure the distance. The electronic device can measure the distance by infrared or laser. The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other examples, the touch sensor 180K can also be set on the surface of the electronic device, which is different from the position of the display screen 194. The bone conduction sensor 180M can obtain vibration signals. In some examples, the bone conduction sensor 180M can obtain vibration signals of vibrating bones of the human vocal part and blood pressure pulsation signals. The button 190 can be a mechanical button or a touch button. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
[0143] Next, a software architecture diagram provided by an embodiment of the present application is introduced.
[0144] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some examples, the system is divided into four layers, from top to bottom: application layer, application framework layer, system library layer, and kernel layer.
[0145] like Figure 6 As shown, the application layer may include a series of application packages, which may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0146] In an embodiment of the present application, the application can be used to generate a rendering tree. In a separate rendering mode, the application can also render a displayed bitmap based on the rendering tree.
[0147] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0148] The application framework layer may include window management services, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
[0149] The window management service is used to manage window programs. For example, the window starts, adds, and deletes. The window management service can also determine the application displayed on the window and the creation, destruction, and dynamic effects of the application's layer. The window management service can also be used to determine whether there is a status bar, lock the screen, and capture the screen.
[0150] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0151] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0152] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0153] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications from applications running in the background, or a notification that appears on the screen in the form of a dialogue interface. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0154] The system rendering service can be used to obtain the user interface. In the separate rendering mode, the system rendering service can be responsible for layer synthesis, animation effects, etc. In the unified rendering mode, the system rendering service can obtain the target rendering tree based on the rendering tree of one or more applications, and obtain the user interface based on the target rendering tree. Among them, the system rendering service can synchronize layer information such as layer creation, destruction, property changes, etc. through the window management service. The system rendering service can synchronize the display area information, such as the size of the screen, from the display management service.
[0155] The application state sensing module can be used to monitor the state of the application. In some examples, the application state sensing module only monitors the state of the application that provides visible display content. The device state sensing module can be used to monitor the state of the electronic device. The rendering mode decision module can be used to determine the rendering mode of the electronic device.
[0156] The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.
[0157] The core library consists of two parts: one part is the function that the Java language needs to call, and the other part is the core library.
[0158] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0159] The system library may include multiple functional modules, such as a surface manager, a media library, and a graphics processing library, wherein the graphics processing library includes a 3D graphics processing library (such as OpenGLES), a 2D graphics engine (such as SGL), and the like.
[0160] The surface manager is used to manage the display subsystem and provides the fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.
[0161] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0162] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, layer synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0163] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, sensor driver, and virtual card driver.
[0164] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A method for generating an interface, It is characterized in that include: The electronic device generates a first interface by rendering in a first rendering mode; The electronic device displays the first interface; The electronic device receives a first input to open a first application; In response to the first input, the electronic device acquires first running state information of one or more application programs and first device state information of the electronic device, the one or more application programs including the first application; The electronic device determines a second rendering mode based on the first operating state information and the first device state information; The electronic device generates a second interface by rendering in the second rendering mode, where the second interface includes display content of the first application; The electronic device displays the second interface.
2. The method according to claim 1, It is characterized in that The first rendering mode is a unified rendering mode or a separate rendering mode, the second rendering mode is the unified rendering mode or the separate rendering mode, and the first rendering mode is the same as or different from the second rendering mode.
3. The method according to claim 1 or 2, It is characterized in that After the electronic device displays the second interface, the method further includes: The electronic device acquires second running state information of one or more application programs and second device state information of the electronic device, the one or more application programs including the first application; The electronic device determines the third rendering mode based on the second operating state information and the second device state information; The electronic device generates a third interface by rendering in the third rendering mode, where the third interface includes the display content of the first application; The electronic device displays the third interface.
4. The method according to claim 3, It is characterized in that The third rendering mode is a unified rendering mode or a separate rendering mode.
5. The method according to any one of claims 1 to 4, It is characterized in that The second rendering mode is a unified rendering mode; Before the electronic device generates a second interface by rendering in the second rendering mode, the method further includes: The first application generates a first rendering tree, where the first rendering tree is used to draw display content of the first application; The first application sends the first rendering tree to a system rendering service of the electronic device; The system rendering service renders and generates the second interface based on the first rendering tree.
6. The method according to any one of claims 1 to 4, It is characterized in that The second rendering mode is a separate rendering mode; Before the electronic device generates a second interface by rendering in the second rendering mode, the method further includes: The first application generates a first rendering tree; The first application generates display content of the first application based on the first rendering tree rendering; The first application sends the display content of the first application to the system rendering service of the electronic device; The system rendering service generates the second interface based on the display content of the first application.
7. The method according to claims 1 to 6, It is characterized in that The first running status information includes one or more of the window display type of the one or more applications, the rendering load of the one or more applications, the task load of the one or more applications, and whether they are in an animation process; the first device status information includes one or more of the load of the CPU of the electronic device, the load of the system rendering service of the electronic device, the GPU load of the electronic device, the hardware performance of the electronic device, and the power of the electronic device.
8. The method according to claim 7, It is characterized in that The method further comprises: The electronic device is provided with the first operating state information and weight values of various parameters in the first device state information, and the electronic device determines the second rendering mode based on the values of various parameters and the weight values of various parameters.
9. The method according to claim 7, It is characterized in that The electronic device determines a second rendering mode based on the first operating state information and the first device state information, specifically including: The electronic device obtains, based on the first running state information of the one or more applications, an application rendering mode corresponding to the one or more applications, where the application rendering mode is a separate rendering mode or a unified rendering mode; The electronic device obtains a device rendering mode based on the first device state information, where the device rendering mode is the separate rendering mode or the unified rendering mode; The electronic device sets a rendering mode with a larger number as the second rendering mode based on the one or more application rendering modes and the number of the separate rendering modes and the number of the unified rendering modes in the device rendering mode.
10. An electronic device, It is characterized in that The electronic device comprises: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as described in any one of claims 1-9.
11. A computer-readable storage medium comprising instructions, It is characterized in that When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Cited By
Layer synthesis method and device, vehicle and storage medium
CN119179543A
Method and apparatus for processing user interface, device, medium, and product
WO2026184296A1
