A widget display method and an electronic device
By rendering multiple components of the widget in electronic devices and generating static images, the widgets' memory occupancy and increase power consumption are solved, and the effect of reducing power consumption and improving user experience is achieved.
Patent Information
- Application Number
- CN202410331635.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Widgets in electronic devices that display a large number of subcomponents for a long time will occupy device memory, resulting in increased power consumption and power consumption in the background.
Reduce memory usage and power consumption by rendering multiple components in the widget and generating static images instead of continuously running and refreshing components.
It effectively reduces the memory usage of widgets and reduces the power consumption of electronic devices. At the same time, on the basis of ensuring normal display, it gives static image interaction functions to improve user experience.
Smart Images

Figure CN118244950B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a widget display method and an electronic device. Background Art
[0002] Currently, most electronic devices (such as mobile phones) often use widgets to push content to users. For example, a mobile phone displays widgets on the interface, and users can enter the corresponding application through the widgets, quickly view some content, or quickly implement a certain function. Among them, a widget can be understood as a component provided by a third-party application or a system application on an electronic device. For example, a clock component, a weather component, and a music component, etc.
[0003] Generally, a widget will include one or more sub-components. For example, a widget can include a cover sub-component, a song information sub-component, a play / pause sub-component, a next song sub-component, and a previous song sub-component, etc., so as to display the functions, content, styles, etc. of the widget. In this way, if the widgets displayed by the electronic device for a long time include a large number of sub-components, it will occupy a certain amount of device memory. Furthermore, it will cause the electronic device to consume power in the background, increasing the power consumption of the electronic device. Summary of the Invention
[0004] Embodiments of this application provide a widget display method and an electronic device. By rendering a plurality of components corresponding to a widget, and generating and displaying a static image according to the plurality of rendered components. It avoids continuously running and refreshing the plurality of components in the widget, reducing the memory occupancy of the widget.
[0005] To achieve the above object, the embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of this application provides a widget display method, which is applied to an electronic device. The method includes: receiving a first trigger operation of a user; the first trigger operation is used to add a first static widget, and the first static widget corresponds to a plurality of components. Rendering the plurality of components corresponding to the first static widget. And generating and displaying a first static image according to the plurality of rendered components, where the first static image is used to display first resource content corresponding to the first static widget.
[0007] It can be seen that a static widget can correspond to multiple components. In the embodiments of the present application, multiple components corresponding to a static widget can be rendered. And based on the multiple components after rendering, a static image is generated and displayed. This static image can be used to display the resource content corresponding to the static widget. By using a static image to replace the multiple components after rendering, on the basis of ensuring the normal display of a static widget, it is possible to avoid continuously running and refreshing the multiple components in the static widget, and only need to display a static image, reducing the memory occupancy of the widget and the power consumption of the electronic device.
[0008] In an implementable manner of the first aspect, the method further includes: the interactive area information corresponding to the first static image can be configured according to the area information and service link information of at least one interactive component among the multiple components;
[0009] Wherein, the interactive area information is used to characterize the area positions corresponding to at least one interactive response area in the first static image and the service links corresponding to at least one interactive response area.
[0010] And, in the process of configuring the interactive area information corresponding to the first static image, the interactive area information corresponding to the first static image can be configured by calling the target application programming interface.
[0011] It can be seen that generally at least one interactive component is included in the multiple components, and the user can use the interactive component to implement the interactive function corresponding to the widget. Since in the embodiments of the present application, during the display of the first static widget, the interactive component is not displayed but the first static image is displayed. The target application programming interface is a newly added interface. Therefore, the interactive area information corresponding to the first static image can be configured according to the area information and service link information of the interactive component and the target application programming interface.
[0012] In this way, the user can use the interactive response area in the first static image to implement the interactive function corresponding to the static widget. That is to say, on the basis of ensuring that the first static image displays the complete resource content, a certain interactive function can be given to the resource content. Furthermore, it is possible to enable the static widget to implement some interactive functions and improve the user experience.
[0013] In an implementable manner of the first aspect, the method further includes: a second trigger operation for the first static image can be received. And in response to the second trigger operation, the trigger area corresponding to the second trigger operation is determined. When it is determined that the trigger area is an interactive response area, the service associated with the service link is executed according to the service link corresponding to the interactive response area.
[0014] Moreover, during the process of executing the service associated with the service link according to the service link corresponding to the interaction response area, it is possible to jump to the corresponding service interface according to the service link corresponding to the interaction response area;
[0015] Alternatively, it is also possible to switch the display state of the first static image from the first display state to the second display state according to the service link corresponding to the interaction response area.
[0016] It can be seen that in the embodiment of the present application, when it is determined that the trigger area corresponding to the second trigger operation is the interaction response area according to the received second trigger operation, the corresponding service can be executed according to the service link corresponding to the interaction response area. Among them, the executed service can jump to the corresponding service interface or change the display state of the first static image.
[0017] That is to say, it is possible to endow the resource content with certain interaction functions on the basis of ensuring that the first static image displays the complete resource content. And more user-friendly interaction functions are also provided, such as changing the display state of the first static image, jumping to the service interface, etc. While improving the playability, it can also improve the interactivity between the user and the electronic device.
[0018] In one implementable manner of the first aspect, before rendering the multiple components corresponding to the first static widget, the method further includes: creating a widget thread for the first static widget. After generating the first static image, the method further includes destroying the widget thread of the first static widget. The widget thread can be used to control the rendering process of the multiple components corresponding to the first static widget.
[0019] In some embodiments of the present application, the widget thread of the first static widget can be destroyed after generating the first static image. The widget thread of the first static widget can also be destroyed after displaying the first static image. It can be seen that one static widget corresponds to one widget thread. It should be understood that for the widgets provided by current electronic devices such as mobile phones and tablet computers, when the widget is displayed on applications such as the desktop or the negative first screen, the thread corresponding to the widget will be a resident thread, occupying a certain amount of memory overhead and also increasing the system power consumption of the electronic device. The electronic device will not manage this thread. However, for the methods provided by the various implementation manners of the present application, since the static image is used to replace the static widget for display, after the widget thread corresponding to one static widget finishes executing the corresponding task, the widget thread corresponding to this static widget can be destroyed to avoid occupying the operating resources of the electronic device.
[0020] In an implementable manner of the first aspect, during the process of rendering multiple components corresponding to the first static widget, a widget rendering tree corresponding to the multiple components may be generated according to the first component information of the multiple components; the first component information includes layout information and resource information. And based on the widget rendering tree corresponding to the multiple components, the multiple components are rendered.
[0021] During the process of generating the first static image according to the rendered multiple components, the rendered multiple components may be saved as the first static image.
[0022] It can be seen that in the embodiments of the present application, a widget rendering tree corresponding to multiple components may be generated according to the first component information of the multiple components. And based on the widget rendering tree corresponding to the multiple components, the multiple components are rendered. The rendered multiple components are directly saved as the first static image. It is convenient to directly display the first static image subsequently, without continuously running the multiple components in the static widget, reducing the memory occupation of the widget.
[0023] In an implementable manner of the first aspect, during the process of displaying the first static image, the first static image may be added to the widget information corresponding to the first static widget. And according to the widget information, an interface rendering tree corresponding to the first static widget is generated. The interface rendering tree includes a target node, and the target node corresponds to the first static widget. Based on the interface rendering tree, the target interface is rendered and displayed, and the target interface includes the first static image.
[0024] Among them, the target interface includes one or more of the desktop interface of the electronic device, the negative first screen interface of the electronic device, or the application interface of the application in the electronic device.
[0025] It can be seen that in the embodiments of the present application, during the process of displaying the first static image, it is necessary to display the first static image in a preset area in the entire screen interface. Therefore, it is also necessary to render the target interface. The widget information corresponding to the first static widget includes the first static image, and an interface rendering tree corresponding to the first static widget is generated according to the widget information. Among them, the target node in the interface rendering tree corresponds to the first static widget. Based on the interface rendering tree, the target interface is rendered and displayed, and the target interface includes the first static image. Similarly, during the process of displaying the first static widget in the target interface, the first static widget includes the first static image, without continuously running the multiple components in the static widget, reducing the memory occupation of the widget.
[0026] In an implementable manner of the first aspect, the method further includes: detecting that a preset update condition is satisfied, rendering multiple components corresponding to the first static widget. And according to the rendered multiple components, a second static image is generated and displayed, and the second static image is used to display the second resource content corresponding to the first static widget.
[0027] It can be seen that in the embodiments of the present application, when the first static widget is updated by a timing trigger or a change event is detected, multiple components corresponding to the first static widget can be rendered. And based on the multiple components that have been rendered, a second static image can be generated and displayed, where the second static image is used to display the second resource content corresponding to the second static widget.
[0028] That is to say, during the process of updating the first static widget, an updated static image is still generated and displayed based on the multiple components that have been rendered. The updated static image can still be used to replace the multiple components that have been rendered. After the static widget is updated, it is still not necessary to continuously run and refresh the multiple components in the static widget, reducing the memory occupancy of the widget and the power consumption of the electronic device.
[0029] In one implementable manner of the first aspect, the first trigger operation includes a click operation, a voice operation, or a long-press operation on the widget icon corresponding to the first static widget.
[0030] In a second aspect, embodiments of the present application provide a display device, which includes: a desktop application, a widget provider application, a widget management service, a widget rendering service, a unified rendering service, and a display screen.
[0031] The desktop application is configured to receive a first trigger operation from the user; the first trigger operation is used to add a first static widget, and the first static widget corresponds to multiple components.
[0032] The desktop application is further configured to, in response to the first trigger operation, send an addition request to the widget management service.
[0033] The widget management service is configured to, according to the addition request, send a retrieval request to the widget provider application, where the retrieval request is used to request to obtain the first component information of the multiple components.
[0034] The widget provider application is configured to, according to the retrieval request, send the first component information of the multiple components to the widget management service.
[0035] The widget management service is further configured to send the first component information of the multiple components to the widget rendering service.
[0036] The widget rendering service is configured to send the first component information of the multiple components and a first rendering request to the unified rendering service.
[0037] The unified rendering service is configured to render the multiple components according to the first component information of the multiple components and the first rendering request.
[0038] The unified rendering service is further configured to generate a first static image according to the multiple components that have been rendered; the first static image is used to display the first resource content corresponding to the first static widget.
[0039] The unified rendering service is also configured to send the first static image to the desktop application.
[0040] The desktop application is also configured to control the display screen to display the first static image.
[0041] The display screen is configured to display the first static image.
[0042] It can be seen that by using a static image to replace multiple components after rendering is completed, on the basis of ensuring the normal display of a static widget, continuous operation and refreshing of multiple components in the static widget can be avoided, and only one static image needs to be displayed, reducing the memory occupation of the widget and the power consumption of the electronic device.
[0043] In an implementable manner of the second aspect, the multiple components include at least one interactive component; the unified rendering service is also configured to configure the interactive area information corresponding to the first static image according to the area information and service link information of at least one interactive component.
[0044] Among them, the interactive area information is used to represent the area position corresponding to at least one interactive response area in the first static image and the service link corresponding to at least one interactive response area.
[0045] It can be seen that the embodiments of the present application can configure the interactive area information corresponding to the first static image according to the area information and service link information of the interactive component. In this way, the user can use the interactive response area in the first static image to implement the interactive function corresponding to the static widget. That is to say, on the basis of ensuring that the first static image displays complete resource content, certain interactive functions can be given to the resource content. Furthermore, the static widget can implement some interactive functions, improving the user experience.
[0046] In a third aspect, an embodiment of the present application provides an electronic device, which includes: a memory, a processor, and a display screen. The memory and the display screen are coupled to the processor. The display screen is used to display static images, and the memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the electronic device executes the widget display method as described in the first aspect above.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes the widget display method as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic flowchart of a related technology provided by an embodiment of the present application;
[0049] Figure 2 A schematic diagram of the hardware structure of a mobile phone provided by an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the software structure of an electronic device provided by an embodiment of the present application;
[0051] Figure 4 A schematic flow chart of a widget display method provided by an embodiment of the present application;
[0052] Figure 5 A schematic diagram of an interface for adding a widget provided by an embodiment of the present application;
[0053] Figure 6 A schematic flow chart of a process for adding a widget provided by an embodiment of the present application;
[0054] Figure 7 A schematic flow chart of a process for generating a first static image provided by an embodiment of the present application;
[0055] Figure 8 A schematic flow chart of a process for destroying a runtime thread provided by an embodiment of the present application;
[0056] Figure 9 A schematic flow chart of a process for rendering a target interface provided by an embodiment of the present application;
[0057] Figure 10 A schematic diagram of an interface of an interaction response area provided by an embodiment of the present application;
[0058] Figure 11 A schematic diagram of an interface for jumping to a service interface provided by an embodiment of the present application;
[0059] Figure 12 A hardware structure diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0060] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B may represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. These three situations, where A and B may be singular or plural. And, in the description of the present application, unless otherwise specified, "a plurality" means two or more than two. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c may be single or multiple. In addition, for the convenience of clearly describing the technical solutions in the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles.
[0061] Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily limit being different. At the same time, in some embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific way for easy understanding.
[0062] In addition, the network architecture and business scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions in the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0063] With the rapid popularization of electronic devices such as mobile phones, computers, and televisions, it brings a lot of convenience and enjoyment to people's lives. In order to improve the user experience, applications with different functions are configured in the electronic device. And each application can also provide multiple services, and different services can achieve different functions. For example, a desktop application is configured in the electronic device, and the desktop application can provide multiple service modules and implement different functions based on the multiple service modules. To facilitate the user to quickly implement a certain function, the electronic device can generate different components based on different functions and display them in the main screen interface corresponding to the desktop application. For example, in the form of widgets, shortcuts for the user's frequently used services can be generated.
[0064] It can be understood that the above-mentioned widget is a miniature application program view that can be embedded in the desktop, supports the user to perform function previews and quick operations on the view, and accepts regular updates. That is to say, the widget is the content that the user hopes to be displayed on the desktop for a long time. Exemplarily, the widget on the desktop can be determined by the device or specified by the user.
[0065] In this way, the user can enter the corresponding application program through the widget, quickly view some content, or quickly implement a certain function. Among them, the widget can be a visual widget provided by a third-party application or a system application on the electronic device. For example, a clock widget, a weather widget, and a music widget, etc.
[0066] See Figure 1 In the related art, a widget generation scheme is provided. In the electronic device of this scheme, system is installed. Then, in the case of displaying widgets on the desktop, the electronic device usually uses the widget framework of the native application program window widget (App Widget) to implement. Among them, the widget framework includes an application widget framework (App Widget framework), an application widget service (App Widget Service), and an application widget management (App Widget Manager) service. The application widget service is the core class of the framework and is one of the system services that start automatically after the device is powered on and is used for widget management work. For example, widget loading, deletion, and timed events. The application widget management service is used for the actual update and related management of the widget view. The application widget host (App Widget Host) application is used to actually control the application widget. The application widget host application can include a desktop application or a negative first screen application. The application widget host view (App Widget Host View) is used to accommodate the view of the application widget. The view of the application widget can be created according to the description of the remote view (Remote Views).
[0067] In some examples, the widget can also be a mini-widget, a widget, or a card, and the embodiments of the present application do not limit this. It should be understood that in the embodiments of the present application, the meanings of mini-widget and component are not the same. The English of mini-widget can be widget, and the English of component can be component.
[0068] The remote view is mainly used for the development of application widgets, and the application widget is implemented through the AppWidget Provider service. The AppWidget Provider service can call functions to perform corresponding operations of the widget. For example, the functions can include onEnable(), onDeleted(), onUpdate(), and onDisabled(), etc.
[0069] Specifically, when the application widget host application receives a message sent by the application widget service, it can create an application widget host view, then query the remote view corresponding to the application widget Id through the application widget service, and finally pass the remote view to the application widget host view to update the application widget.
[0070] It can be understood that each widget provider application can provide an AppWidget Provider service, and send its own component data to the application widget host application through the AppWidget Provider service. After the system is powered on, the application widget service will automatically collect the provider information of all widget provider applications. The application widget host application can communicate with the application widget service, obtain the provider information of each widget provider application, and obtain component data, add components corresponding to the component data, or update the displayed components through the provider information. Among them, the component data can include text resources, picture resources, virtual machine resources, and so on.
[0071] Based on the above content, if an entire widget is understood as a root component container, then one or more sub-components will be included in the widget. For example, the widget can include a cover sub-component, a song information sub-component, a play / pause sub-component, a next song sub-component, and a previous song sub-component, etc., so as to display the functions, content, styles, etc. of the widget. In this way, the AppWidget Provider service provided by the widget provider application needs to send the component data corresponding to the above series of sub-components to the application widget host application. The application widget host application can obtain the component data corresponding to a series of sub-components and implement adding a series of sub-components corresponding to the component data, thereby realizing the widget generation and display process. However, if the widgets displayed on the electronic device for a long time include a large number of sub-components, it will occupy a certain amount of device memory. Furthermore, it will cause a large amount of power consumption in the background of the electronic device, increasing the power consumption of the electronic device.
[0072] Based on the above, embodiments of the present application provide a widget display method and device. The method includes: receiving a first trigger operation of a user; the first trigger operation is used to add a first static widget, and the first static widget corresponds to multiple components. Rendering the multiple components corresponding to the first static widget. And a first static image can be generated and displayed according to the rendered multiple components; the first static image is used to display the first resource content corresponding to the first static widget.
[0073] It can be seen that a static widget can correspond to multiple components. In the embodiments of the present application, multiple components can be rendered. And a static image can be generated according to the rendered multiple components. That is, the rendered multiple components can be replaced by the static image, and the static image can be used to display the resource content corresponding to the static widget. Then, the static image can be displayed in the static widget. In this way, on the basis of ensuring the normal display of the static widget, continuous running and refreshing of the multiple components corresponding to the static widget can be avoided, and only the static image needs to be displayed, reducing the memory occupation of the widget and the power consumption of the electronic device.
[0074] In some examples, the static widget may include a widget providing one or more links. For one link, an interface of an application corresponding to the widget can be associated. Multiple links can correspondingly be associated with multiple interfaces; the multiple interfaces can be different interfaces of different applications, and the embodiments of the present application do not limit this.
[0075] The widget display method provided by the embodiments of the present application can be applied to an electronic device. In some embodiments, the electronic device can include, for example, a mobile phone, a tablet computer, a smart screen, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a wearable device, an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, and a smart car, etc. The embodiments of the present application do not make special restrictions on the specific form of the electronic device.
[0076] The operating system installed on the electronic device includes but is not limited to or other operating systems. The present application does not limit the specific type of the electronic device and the type of the operating system when there is an installed operating system.
[0077] Exemplarily, taking the electronic device as a mobile phone as an example, Figure 2 a schematic structural diagram of the mobile phone 100 is shown.
[0078] The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone 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. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.
[0079] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0080] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modulation and demodulation processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0081] Among them, the controller may be the nerve center and command center of the mobile phone 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
[0082] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can hold the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the said memory. This avoids repeated accesses and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0083] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.
[0084] The wireless communication function of the mobile phone 100 can be implemented through antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0085] The mobile phone 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to 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, which execute program instructions to generate or change the display information.
[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0087] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the mobile phone 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0088] The mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0089] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The mobile phone 100 can receive key inputs and generate key signal inputs related to the user settings and function controls of the mobile phone 100.
[0090] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. For example, touch operations on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Touch operations on different areas of the display screen 194 can also correspond to different vibration feedback effects for the motor 191. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0091] The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change in battery power, and can also be used to indicate messages, missed calls, notifications, etc.
[0092] In some embodiments of the present application, the display screen 194 is used to display images, videos, widgets, etc. The display screen 194 includes a display panel. The display panel may adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. Moreover, the mobile phone 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0093] Figure 3 It is a software structure block diagram of the mobile phone 100 according to an embodiment of the present application.
[0094] The software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the Android system with a layered architecture as an example, the software structure of the mobile phone 100 is exemplarily described.
[0095] Figure 3 It is a software structure block diagram of the mobile phone 100 according to an embodiment of the present invention.
[0096] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0097] The application layer may include a series of application packages.
[0098] As Figure 3 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a WLAN, music, a short message, a first application, and a second application.
[0099] In some embodiments of the present application, the first application may include a desktop application, for example, a first desktop application (Host App), a second desktop application (Launcher), or a negative first screen.
[0100] The second application may include a provider application, such as a Widget Provider App. The Widget Provider App is used to provide the layout corresponding to the widget and the update ability of the widget data.
[0101] It should be noted that the above first application and second application may be system applications or third-party applications. The embodiments of the present application do not specifically limit the application types and application sources of the first application and the second application.
[0102] In some embodiments of the present application, After the system starts up, the desktop application can be resident in the system as a core application and run. The desktop application can perform basic management on the installed application programs, such as deleting or displaying the application programs, etc.
[0103] In some examples, the desktop application can display one or more display interfaces as the desktop of the mobile phone 100. The desktop application can display the icons of application programs, folders, weather widgets, clock widgets, etc. in the display interface. Of course, the desktop application can also hide the above widgets. For example, when the weather widget displays for a preset time, the desktop application can automatically hide the widget.
[0104] In some embodiments of the present application, the mobile phone 100 is provided with a negative first screen. Among them, the negative first screen can be used to provide functions such as search, application suggestions, quick services, intelligent scenarios, etc. for users. The negative first screen can also be used to display notification information to be pushed to users. For example, application messages subscribed by users, real-time hot search messages, weather information, time information, etc. Of course, the above notification information can also be presented in the form of widgets in the negative first screen. The widget has a prominent appearance and can remind users to pay attention to the information displayed on the widget. And when the user needs to view the negative first screen of the mobile phone 100, the user can slide the screen of the mobile phone 100 to make the mobile phone 100 display the negative first screen.
[0105] In some examples, the widget can also have different sizes. For example, the size of the widget can include 1×1, 2×2, or 2×4, etc.
[0106] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the application programs in the application layer. The application framework layer includes some predefined functions.
[0107] As Figure 3 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, a widget management service, a widget rendering service, and a unified rendering service, etc.
[0108] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0109] The content provider is used to store and obtain data, and make this data accessible to application programs. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc.
[0110] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
[0111] The notification manager enables application programs to display notification information in the status bar, can be used to convey notification-type messages, can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, 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 a notification of a background-running application program, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device vibrates, the indicator light flashes, etc.
[0112] In some embodiments of the present application, the widget management service is used to provide the management ability and data caching ability for the corresponding life cycle of widgets. The widget rendering service is used to load the component information corresponding to multiple components in the widget, and send the component information corresponding to the multiple components to the unified rendering service, so that the unified rendering service renders the multiple components.
[0113] The unified rendering service is used to render multiple components according to the component information corresponding to the multiple components.
[0114] The Runtime includes a core library and a virtual machine. The Runtime is responsible for the scheduling and management of the Android system.
[0115] The core library contains two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0116] The application layer and the application framework layer run in the 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 the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0117] The system library may include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0118] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0119] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0120] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0121] The 2D graphics engine is a drawing engine for 2D drawing.
[0122] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0123] In the following embodiments, in combination with the accompanying drawings, the mobile phone with the Figure 2 shown structure will be taken as an example to elaborate on the widget display method provided by the embodiments of the present application. Refer to Figure 4 , the method may include:
[0124] S401. The mobile phone receives the user's first trigger operation; the first trigger operation is used to add a first static widget, and the first static widget corresponds to multiple components.
[0125] In some embodiments of the present application, the widget may include a static widget or a dynamic widget. During the process of the mobile phone displaying the dynamic widget, the display content and / or display effect (such as display position, display size, and display state) corresponding to the dynamic widget will change over time.
[0126] Exemplarily, a music widget may correspond to a dynamic cover component, a lyrics information component, a play / pause component, a next song component, and a previous song component, etc. The display content corresponding to the above dynamic cover component and lyrics information component will change as the music plays.
[0127] During the process of the mobile phone displaying the static widget, in the case where the static widget is not updated, the display content and display effect corresponding to the static widget will not change over time.
[0128] For example, after the Nth update and before the (N + 1)th update of a weather widget, the weather widget may correspond to a weather component (such as "Sunny, 23°C") and a picture component (such as a picture corresponding to the sun), and the display content and display effect corresponding to its weather component and picture component will not change with time.
[0129] For another example, the time widget is updated every 1 minute. After the Nth update (such as 10:10) and before the (N + 1)th update (such as 10:11) of the time widget, the time widget may correspond to a time component (such as "10:10") and a picture component (such as a picture corresponding to a clock), and the display content and display effect corresponding to its time component and picture component will not change with time.
[0130] In some embodiments of the present application, the mobile phone can receive a first trigger operation from the user. Among them, the first trigger operation can represent an operation for adding a first static widget.
[0131] In one implementable manner, the user can input a first trigger operation on the widget page of the mobile phone for the first static widget to be added. The first trigger operation can include a click operation, a voice operation, a long-press operation, etc. on the widget icon corresponding to the first static widget.
[0132] In some examples, the first static widget is used to implement a target function and / or display first resource content, and the first static widget can correspond to multiple components. The components can include one or more of a layout component, a basic component provided by the mobile phone, or an extended component provided by an APP on the mobile phone; the basic components include at least one of a text component, a date component, a picture component, and a table component; the extended components include at least one of an attachment component, an address component, and a signature component. In addition, the embodiments of the present application may also include other types of components, which are not listed one by one in the embodiments of the present application.
[0133] Moreover, the APP on the mobile phone can include a system APP, a third-party APP, etc. The specific function and the displayed resource content of the first static widget can be preset or adjusted or set according to the user's needs.
[0134] In some embodiments of the present application, the mobile phone can provide the user with an entry for multiple widget display functions, and the user can use various methods to make the mobile phone display the first static widget.
[0135] Exemplarily, in some possible scenarios, referring to Figure 5 in (A), the user can perform an input operation on the screen of the mobile phone. For example, perform operations such as long-pressing, clicking, double-clicking, and swiping on a blank position or a non-functional position on the screen. The mobile phone can respond to the user's input operation and display, for example, Figure 5The function page of (B) in []. Function controls corresponding to the wallpaper function, widget function, layout function, switching effect function, and desktop setting function may be included in the function interface.
[0136] In some examples, the user can perform a click operation on the function control corresponding to the widget function. In response to the user's click operation, the mobile phone displays, for example, Figure 5 The widget details page of (C) in []. The widget details page includes application icons corresponding to the applications installed in the mobile phone. For example, the application icon corresponding to the messaging application, the application icon corresponding to the music application, the application icon corresponding to the weather application, the application icon corresponding to the theme application, and the icons corresponding to other widgets. The user can perform a click operation on the application icon corresponding to the weather application to trigger the process of adding a static widget corresponding to the weather application. In response to the user's click operation, the mobile phone displays, for example, Figure 5 The widget addition page of (D) in []. The widget addition page includes at least one static widget corresponding to the weather application.
[0137] The user can select any one of the at least one static widget as the first static widget to be pre-added. For example, the user performs a first trigger operation on the first static widget, and the mobile phone receives the user's first trigger operation to trigger the subsequent process of adding the first static widget.
[0138] Exemplarily again, in some possible scenarios, the user can input a first voice control instruction to the mobile phone, such as "Xiaoyi Xiaoyi, I want to add a weather widget", "Xiaoyi Xiaoyi, I want to add a weather micro-widget", etc. Thus, in response to the first voice control instruction, the mobile phone displays the widget addition page of (D) as described above. Figure 5 Subsequently, the user can input a second voice control instruction to the mobile phone, such as "Xiaoyi Xiaoyi, I want to add the first weather widget", and the mobile phone responds to the second voice control instruction to trigger the subsequent process of adding the first static widget.
[0139] In some examples, the voice control instruction input by the user can be regarded as the first trigger operation.
[0140] It should be noted that the above first trigger operation may include one or more of long pressing, clicking, dragging, moving, sliding, and voice operations. The mobile phone can provide the user with multiple ways to add the first static widget, and also gives the user a better user experience. The embodiments of the present application do not limit the specific implementation manner of adding the first static widget.
[0141] In some embodiments of the present application, the first trigger operation can also be used to add a widget. The mobile device receives the user's first trigger operation. When it is determined that the widget to be added corresponding to the first trigger operation is a static widget, the mobile device renders multiple components corresponding to the first static widget.
[0142] Exemplarily, the mobile phone can determine whether it is a static widget according to the widget type of the widget to be added corresponding to the first trigger operation. Additionally, the mobile phone can also determine whether it is a static widget according to the widget content of the widget to be added corresponding to the first trigger operation. For example, if the display content in the widget is all static content, it can be determined that the added widget is a static widget. Additionally, the mobile phone can also determine whether it is a static widget according to the widget component type of the widget to be added corresponding to the first trigger operation. For example, if the widget component types are all text components, it can be determined that the added widget is a static widget.
[0143] S402. The mobile phone renders multiple components corresponding to the first static widget, and generates a first static image according to the rendered multiple components.
[0144] In some embodiments of the present application, the mobile phone can respond to the first trigger operation to obtain the first component information of multiple components corresponding to the first static widget. Then, the mobile phone can render the multiple components according to the first component information of the multiple components. And generate a first static image according to the rendered multiple components. The first static image is used to display the first resource content corresponding to the multiple components.
[0145] Specifically, referring to Figure 6 , the desktop application in the mobile phone responds to the first trigger operation and sends an addition request to the widget management service. The addition request is used to add the first static widget. After receiving the addition request, the widget management service sends a retrieval request to the widget provider application. The retrieval request is used to retrieve the first component information of multiple components corresponding to the first static widget. After receiving the retrieval request, the widget provider application sends the first component information of multiple components corresponding to the first static widget to the widget management service.
[0146] Exemplarily, taking the first static widget as a weather widget as an example. The first component information of multiple components corresponding to the weather widget can include the layout information and resource information of the components.
[0147] In some examples, the layout information includes but is not limited to the position, height, width, color, style (square, round, diamond, etc.), refresh interval, area information, service link information, etc. of the components; the resource information can include but is not limited to location information, weather information, time information, etc. It can be understood that the implementation form of the resource information can be text and / or pictures, and the resource information can be real-time information or historical information.
[0148] It can be understood that the first component information can be pre - set by the mobile phone or a third - party APP, or determined according to the user's selection.
[0149] In some examples, the resource information in the component information can be resources from the local of the mobile phone, such as photos in the local gallery, text in the memo, etc., or network resources obtained by the mobile phone from the server, such as real - time weather information, real - time location information, and real - time time information, etc. Additionally, the resource information can be resources provided by the system APP of the mobile phone or resources provided by a third - party APP on the mobile phone.
[0150] In some implementable ways, the first component information can also include identification information corresponding to the component. The identification information is used to distinguish each component, including but not limited to letters and / or numbers.
[0151] In some examples, during the process of obtaining the first component information, the widget management service can also launch the widget rendering service and send the first component information of multiple components to the widget rendering service. The widget rendering service can create a widget thread, and this widget thread can be used as a runtime thread. Based on this widget thread, the first component information of multiple components and the first rendering request can be sent to the unified rendering service, so that the unified rendering service can perform the subsequent widget content rendering task.
[0152] The unified rendering service generates a widget rendering tree corresponding to multiple components according to the received first rendering request and the first component information of multiple components. The widget rendering tree includes at least one rendering node, and each rendering node corresponds to each component corresponding to the first component information.
[0153] It should be noted that the widget rendering service can be a system service, and the widget management service can control the unified rendering service to perform the widget content rendering task through this system service of the widget rendering service. That is to say, the rendering process of the first static widget is implemented by the unified rendering service.
[0154] In some embodiments of the present application, there is a certain connection relationship between components. Components can be stacked on each other. For example, a text component is displayed on a picture component. Components can also be connected. For example, a text component is connected to the bottom of a picture component. Embodiments of the present application can use each component as a rendering node and generate a data model in a tree - like structure according to the connection relationship between each component to implement the rendering process of the entire first static widget.
[0155] In some examples, see Figure 7, The unified rendering service renders multiple components based on the widget rendering trees corresponding to multiple components, and saves the rendered multiple components as a first static image. The first static image is used to display the first resource content corresponding to the multiple components.
[0156] Exemplarily, continuing with the first static widget as the weather widget. The widget rendering tree corresponding to the weather widget may include a first text component and the location text content corresponding to the first text component, such as "Haidian", a second text component and the time text content corresponding to the second text component, such as "08:23 Thursday, December 3rd", a third text component and the temperature text content corresponding to the third text component, such as "23°C", a fourth text component and the weather text content corresponding to the fourth text component, such as "cloudy turning to sunny", and a first image component and the weather image content corresponding to the first image component, such as the image corresponding to cloudy turning to sunny.
[0157] In some examples, the unified rendering service can convert the rendered multiple components in the widget rendering tree into a first static image, that is, save the rendered multiple components as a first static image. The first resource content corresponding to the components can be shown in this static image. For example, the first static image may include weather text content, location text content, time text content, temperature text content, and weather image content.
[0158] In some other embodiments of the present application, after receiving an addition request, the widget management service sends a fetch request to the widget provider application. The fetch request can also be used to obtain the layout information in the first component information corresponding to the multiple components. After receiving the fetch request, the widget provider application sends the layout information of the first component information corresponding to the multiple components to the widget management service. During the process of obtaining the layout information, the widget management service can also launch the widget rendering service and send the layout information of the multiple components to the widget rendering service. After receiving the layout information of the multiple components, the widget rendering service can load the resource information in the first component information corresponding to the multiple components from the widget provider application. Then, the widget rendering service can create a runtime thread to send the layout information, resource information, and a first rendering request of the multiple components to the unified rendering service, so that the unified rendering service can execute the subsequent widget content rendering task.
[0159] It should be noted that the present application embodiments do not specifically limit the manner of obtaining the first component information corresponding to the multiple components.
[0160] It can be seen that in the embodiments of the present application, according to the first component information of multiple components, the rendered multiple components are converted into a static image, that is, a static image is used to replace the rendered multiple components. And this static image can be used to display the first resource content corresponding to the multiple components. In this way, on the basis of ensuring the normal display of the static widget in the subsequent process, it is possible to avoid continuously running and refreshing a series of components in the static widget, and only need to display the first static image, which reduces the memory occupancy of the widget and reduces the power consumption of the electronic device.
[0161] S403. The mobile phone displays the first static image.
[0162] In some embodiments of the present application, the mobile phone can display the first static image after generating the first static image.
[0163] See Figure 8 , after the unified rendering service in the mobile phone generates the first static image, it sends the first static image to the widget management service. After receiving the first static image, the widget management service sends the first static image to the desktop application. The desktop application can use the first static image to replace the first static widget to display the resource content that the first static widget needs to display.
[0164] That is to say, in the embodiments of the present application, the first static image can be displayed in the first static widget. The first static widget can be equivalent to a picture component, and the resource content corresponding to the picture component is the first static image.
[0165] It can be seen that in the process of displaying the first static widget in the embodiments of the present application, only the first static image is displayed. Compared with the related art, it can not only ensure that the widget content corresponding to the first static widget is completely displayed to the user, but also does not need to continuously run and refresh a large number of components in the first static widget. It reduces the power consumption of using the static widget and the overall power consumption of the electronic device, and improves the user experience.
[0166] In some embodiments of the present application, when the mobile phone is displaying the first static widget, the mobile phone displays the first static widget in a preset area of the entire screen interface. In this way, after the rendering of the first static widget is completed, the mobile phone also needs to render the target interface. Then, the first static image is displayed in the target interface.
[0167] Specifically, the mobile phone can add the first static image to the widget information corresponding to the first static widget. And the mobile phone can render the first static widget according to the widget information to generate an interface rendering tree corresponding to the first static widget. The interface rendering tree includes a target node, and the target node corresponds to the first static widget. The mobile phone can also render the target interface according to the interface rendering tree. And display the target interface including the first static widget.
[0168] In some examples, the target interface includes one or more of the desktop interface of the mobile phone, the negative first screen interface of the mobile phone, or the application interface of an application in the mobile phone.
[0169] It can be understood that the interface rendering tree corresponding to the first static widget may also include at least one rendering node. A rendering node in the interface rendering tree may correspond to the first static widget corresponding to the widget information. Other rendering nodes may correspond to multiple display components corresponding to other content to be displayed in the target interface.
[0170] Exemplarily, refer to Figure 9 , after the desktop application uses the first static image as the first resource content to be displayed by the first static widget, it sends a second rendering request and widget information to the unified rendering service. The second rendering request is used to render the target interface, and the widget information includes the layout information corresponding to the first static widget and the first static image. The unified rendering service generates an interface rendering tree corresponding to the target interface according to the second rendering request and the widget information. Then, the unified rendering service renders and displays the target interface according to the interface rendering tree, and the first static widget is included in the target interface.
[0171] That is to say, after the desktop application controls the unified rendering service to complete the rendering of the first static widget, it will also control the unified rendering service to execute the subsequent rendering task for the entire screen interface.
[0172] In some embodiments of the present application, the mobile phone may also destroy the runtime thread of the first static widget.
[0173] Specifically, during the process of the widget management service receiving the first static image, it may also send a destruction request to the widget rendering service, and the destruction request is used to destroy the runtime thread in the widget rendering service. The widget rendering service destroys the runtime thread according to the destruction request. Of course, the widget management service may also destroy the runtime thread after sending the first static image to the desktop application or after the desktop application displays the first static image. The present application embodiments do not specifically limit the implementation time and implementation method of destroying the runtime thread.
[0174] That is to say, during the process of generating and displaying a static widget, a static widget corresponds to a runtime thread. The runtime thread may be created by the electronic device in response to a user operation. After the runtime thread corresponding to a static widget completes the corresponding task, the runtime thread corresponding to the static widget may be destroyed to avoid occupying the operating resources of the electronic device.
[0175] In some embodiments of the present application, some content in the widget is content with interactive functions. In order to enable the target widget to implement some interactive functions, the first static widget may include an interactive component, and the number of components of the interactive component may be one or more. The layout information corresponding to the interactive component in the first component information may include area information and service link information. Among them, the area information is used to characterize the position area of the interactive component in the first static widget, and the service link information is used to characterize the service link corresponding to the position area of the interactive component in the first static widget. That is to say, when the user inputs a preset operation to the position area corresponding to the interactive control in the first static widget, the first static widget can be triggered to execute the corresponding service or trigger a jump to the corresponding service interface.
[0176] Since, in the process of displaying the first static widget in the embodiments of the present application, the interactive component is not displayed but the first static image is displayed. Therefore, the embodiments of the present application can configure the interactive area information corresponding to the first static image according to the area information and service link information of the interactive component.
[0177] In some examples, the interactive area information is used to characterize the area position corresponding to at least one interactive response area in the first static image and the service link corresponding to at least one interactive response area.
[0178] That is to say, the embodiments of the present application can configure one or more corresponding response interactive areas in the first static image according to the area information and service link information of the interactive component, and each response interactive area corresponds to interactive area information. In this way, the user can input a preset operation to the first static image to trigger the first static widget to execute the corresponding service or trigger a jump to the corresponding service interface.
[0179] Exemplarily, referring to Figure 10 , taking the first static widget as the navigation widget 1001 corresponding to the navigation application as an example. The first static widget can provide the user with content with interactive functions. For example, the user can click on the area 1002 corresponding to seat selection during check-in in the first static image of the first static widget to trigger the use of the seat selection function in the subsequent navigation application. That is to say, the area 1002 corresponding to seat selection during check-in is corresponding to an interactive control during the rendering process. In this way, the mobile phone can configure the area 1002 corresponding to seat selection during check-in in the first static image as an interactive response area according to the area information and service link information of the interactive control, and carry the corresponding interactive area information. Furthermore, after the mobile phone detects that the user clicks on the area 1002 corresponding to seat selection during check-in, it jumps to the service interface corresponding to the seat selection function.
[0180] In some embodiments of the present application, the user can input a second trigger operation to the first static image to implement the service function corresponding to the first static widget.
[0181] Specifically, the mobile phone can receive a second trigger operation for the first static image, and in response to the second trigger operation, determine the trigger area corresponding to the second trigger operation. Then, the mobile phone can determine the trigger area as the interaction response area and execute the corresponding service according to the service link corresponding to the interaction response area.
[0182] In an implementable manner, during the process of the mobile phone executing the corresponding service according to the service link corresponding to the interaction response area, the mobile phone can jump to the corresponding service interface according to the service link corresponding to the interaction response area.
[0183] Exemplarily, referring to Figure 11 (A) in, the mobile phone receives a click operation from the user on the area corresponding to check-in seat selection in the first static image, and determines whether the area corresponding to check-in seat selection is the interaction response area. When it is determined that the area corresponding to check-in seat selection is the interaction response area, according to the service link of the area corresponding to check-in seat selection, it jumps to the service interface, such as Figure 11 (B) in.
[0184] In another implementable manner, the mobile phone can also change the display state of the first static widget. Exemplarily, the first static widget can be switched to a rotating dynamic display, that is, the first static image presents a rotational change in the clockwise or counterclockwise direction. Additionally, it can also be switched to a prominent dynamic display, that is, the first static image presents a cyclic change from expansion to contraction and from contraction to expansion. Further exemplarily, it can also be switched to a tilted dynamic display, that is, the first static image presents a tilting change in the horizontal direction and / or the vertical direction within a preset angle.
[0185] Specifically, during the process of the mobile phone executing the corresponding service according to the service link corresponding to the interaction response area, the mobile phone can switch the display state of the first static image from the first display state to the second display state according to the service link corresponding to the interaction response area. The first display state is the current static state, and the second display state can include a tilted display state, a rotating display state, a prominent display state, etc.
[0186] Exemplarily, the mobile phone receives a click operation from the user on the blank area in the first static image, and determines whether the blank area is the interaction response area. When it is determined that the blank area is the interaction response area, according to the service link of the blank area, the current display state of the first static image is switched to a tilted display state, a rotating display state, or a prominent display state.
[0187] It should be noted that the embodiments of the present application do not limit the specific services executed by the mobile phone according to the service link corresponding to the interaction response area. At the same time, the second display state can be any display state that the first static image can achieve.
[0188] In some embodiments of the present application, the click event input by the user can be triggered by the first static image according to the configured interaction area information. That is to say, for the first static widget, its internal code does not support onClick customization, that is, it does not support events occurring when the object is clicked. Jumping links, etc. must be performed through the configured interaction area information.
[0189] The methods provided in the embodiments of the present application can call the target application programming interface to configure the interaction area information corresponding to the first static image. It should be understood that the target application programming interface can be an interface provided by the framework layer or the application framework layer, and can provide service links to enable the static image to have interaction functions. Based on this, for the first static image displayed on the desktop application, the negative first screen application, etc., the user can interact by clicking, double-clicking, etc. and implement the corresponding functions through the service links. For example, the target application programming interface can include the Link interface.
[0190] In an implementable manner, the corresponding partial code content in the first static widget is as follows:
[0191]
[0192]
[0193] It should be noted that the interaction area information in the embodiments of the present application may further include an interaction area identifier and an event identifier corresponding to the service link information. The event identifier can be any kind of information that uniquely identifies each event, and the event type can be events such as clicking and long pressing. For example, the click operation on the first area of the first static image and the click operation on the second area of the first static image may correspond to different events. The click operation on the first area can jump to the user's personal homepage. The click operation on the second area can implement the function of following a certain user.
[0194] It can be seen that the embodiments of the present application can configure the interaction area information for the first static image in the first static widget, and can endow the resource content with certain interaction functions on the basis of ensuring that the first static widget displays the complete resource content. Furthermore, it can enable the static image to implement some interaction functions and improve the user experience. At the same time, more user-friendly interaction functions are also provided, such as changing the display state of the first static image, etc. While improving the playability, it can also improve the interactivity between the user and the electronic device.
[0195] In some embodiments of the present application, the mobile phone will update the first static widget in response to the first static image satisfying the update condition.
[0196] Specifically, in response to the first static image meeting the update condition, the mobile phone renders multiple components. The mobile phone may generate a second static image based on the rendered multiple components; the second static image is used to display second resource content corresponding to the multiple components. The mobile phone may also display the second static image. The second static image is an updated image of the first static image.
[0197] In some examples, the update condition may include after a preset duration or a change event of the resource content in the provider application, etc., and the embodiments of the present application do not limit this.
[0198] That is to say, when the mobile phone periodically triggers an update of the first static widget or detects a change event, the desktop application continues to send the latest addition request to the widget management service; the widget management service, according to the latest addition request, continues to send the latest acquisition request to the widget provider application, and the latest acquisition request is used to request the acquisition of second component information of multiple components. The widget provider application sends the second component information of the multiple components to the widget management service according to the latest acquisition request. The widget management service sends the second component information of the multiple components to the widget rendering service. The widget rendering service will recreate a runtime thread to facilitate the subsequent rendering process of the latest static widget. The widget rendering service sends the second component information of the multiple components and the latest first rendering request to the unified rendering service. The unified rendering service renders the latest multiple components according to the second component information of the multiple components and the latest first rendering request; and generates a second static image according to the rendered latest multiple components; the second static image is used to display the second resource content corresponding to the first static widget. The unified rendering service sends the second static image to the desktop application so that the desktop application controls the display screen to display the second static image. The display screen may display the second static image.
[0199] It can be seen that in the process of updating the first static widget in the embodiments of the present application, a updated static image is still generated and displayed according to the rendered multiple components. That is, the updated static image can be used to replace the rendered multiple components, and the updated static image can be used to display the resource content corresponding to the updated first static widget. The widget does not need to continuously run and refresh a series of components in the static widget, reducing the memory occupancy of the widget and the power consumption of the electronic device.
[0200] In some solutions, multiple embodiments of the present application may be combined and the combined solution may be implemented. Optionally, some operations in the processes of the method embodiments are optionally combined, and / or the order of some operations is optionally changed. And, the execution order between the steps of each process is only exemplary and does not constitute a limitation on the execution order between the steps. The steps may also be in other execution orders. It is not intended to indicate that the execution order is the only order in which these operations can be performed.
[0201] Those of ordinary skill in the art will think of various ways to reorder the operations described in the embodiments of the present application. In addition, it should be noted that the process details involved in a certain embodiment of the present application are equally applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0202] In addition, some steps in the method embodiments can be equivalently replaced by other possible steps. Or, some steps in the method embodiments can be optional and can be deleted in some usage scenarios. Or, other possible steps can be added to the method embodiments.
[0203] Moreover, the method embodiments can be implemented independently or in combination.
[0204] The embodiments of the present application also provide an electronic device, which can be, for example, the above-mentioned mobile phone, as Figure 12 shown, the electronic device may include one or more processors 1910, a memory 1920, and a communication interface 1930.
[0205] The memory 1920 and the communication interface 1930 are coupled to the processor 1910. For example, the memory 1920 and the communication interface 1930 can be coupled to the processor 1910 through a bus 1940.
[0206] The communication interface 1930 is used for data transmission with other devices. The memory 1920 stores computer program code. The computer program code includes computer instructions, and when the computer instructions are executed by the processor 1910, the electronic device executes the posture detection method in the embodiments of the present application.
[0207] The processor 1910 can be a processor or a controller. For example, it can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the present disclosure. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0208] The bus 1940 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The above-mentioned bus 1940 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 12 it is only represented by a thick line in Figure 12 , but it does not mean that there is only one bus or one type of bus.
[0209] An embodiment of the present application further provides a display device, which includes: a desktop application, a widget provider application, a widget management service, a widget rendering service, a unified rendering service, and a display screen.
[0210] The desktop application is configured to receive a first trigger operation of a user; the first trigger operation is used to add a first static widget, and the first static widget corresponds to multiple components;
[0211] The desktop application is further configured to send an addition request to the widget management service in response to the first trigger operation;
[0212] The widget management service is configured to send a retrieval request to the widget provider application according to the addition request, and the retrieval request is used to request to retrieve the first component information of the multiple components;
[0213] The widget provider application is configured to send the first component information of the multiple components to the widget management service according to the retrieval request;
[0214] The widget management service is further configured to send the first component information of the multiple components to the widget rendering service;
[0215] The widget rendering service is configured to send the first component information of the multiple components and a first rendering request to the unified rendering service;
[0216] The unified rendering service is configured to render the multiple components according to the first component information of the multiple components and the first rendering request;
[0217] The unified rendering service is further configured to generate a first static image according to the rendered multiple components; the first static image is used to display the first resource content corresponding to the first static widget;
[0218] The unified rendering service is further configured to send the first static image to the desktop application;
[0219] The desktop application is further configured to display the first static image.
[0220] In some examples, the unified rendering service is further configured to configure interaction area information corresponding to the first static image according to area information and service link information of at least one interaction component among multiple components; the interaction area information is used to characterize the area positions corresponding to at least one interaction response area in the first static image and the service links corresponding to at least one interaction response area.
[0221] An embodiment of the present application further provides an electronic device, which includes: a memory, a camera, and a display screen. The camera includes a processor. The memory and the display screen are coupled to the processor. The display screen is used to display the first static image. The memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the electronic device executes the relevant method steps in the above method embodiment.
[0222] An embodiment of the present application further provides a computer-readable storage medium, in which computer program code is stored. When the above processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiment.
[0223] An embodiment of the present application further provides a computer program product. When the computer program product runs on a computer, the computer executes the relevant method steps in the above method embodiment.
[0224] An embodiment of the present application further provides a chip system, which includes: a processor. The processor is coupled to a memory. The memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0225] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements by reading software code stored in the memory.
[0226] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately arranged from the processor. The embodiments of the present application do not limit this. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip or can be separately arranged on different chips. The embodiments of the present application do not specifically limit the type of the memory and the setting manner of the memory and the processor.
[0227] Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0228] The electronic device, computer storage medium, or computer program product provided in this application is all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.
[0229] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0230] In several embodiments provided in this application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0231] The unit described as a separated component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0232] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0233] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that makes a contribution, or all or part of the technical solution, may be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which may be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0234] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A widget display method, characterized in that, Applied to an electronic device, the method includes: Receiving a first trigger operation from a user; the first trigger operation is used to add a first static widget, and the first static widget includes multiple components; wherein, the component information of the first static widget includes layout information and resource information corresponding to the multiple components; Generating a widget rendering tree corresponding to the multiple components according to the first component information of the multiple components; Rendering the multiple components based on the widget rendering tree corresponding to the multiple components; Generating a first static image according to the multiple components after rendering; the first static image is used to display first resource content corresponding to the first static widget; Displaying the first static image.
2. The method according to claim 1, characterized in that, The method further includes: Configuring interaction area information corresponding to the first static image according to area information and service link information of at least one interactive component among the multiple components; Wherein, the interaction area information is used to characterize area positions corresponding to at least one interaction response area in the first static image and service links corresponding to the at least one interaction response area.
3. The method according to claim 2, wherein The configuring the interaction area information corresponding to the first static image includes: Invoking a target application programming interface to configure the interaction area information corresponding to the first static image.
4. The method according to claim 2 or 3, characterized in that, The method further includes: Receiving a second trigger operation for the first static image; In response to the second trigger operation, determining a trigger area corresponding to the second trigger operation; Determining that the trigger area is the interaction response area, and executing a service associated with the service link according to the service link corresponding to the interaction response area.
5. The method according to claim 4, characterized in that, Executing the service associated with the service link according to the service link corresponding to the interaction response area includes: Jumping to a corresponding service interface according to the service link corresponding to the interaction response area; or, Switching a display state of the first static image from a first display state to a second display state according to the service link corresponding to the interaction response area.
6. The method according to any one of claims 1 - 3, characterized in that Before rendering the multiple components corresponding to the first static widget, the method further includes: Creating a widget thread of the first static widget; After generating the first static image, the method further includes: Destroying the widget thread of the first static widget.
7. The method according to any one of claims 1 - 3, characterized in that The generating a first static image according to the multiple components after rendering includes: Saving the multiple components after rendering as the first static image.
8. The method according to any one of claims 1-3, characterized in that, The displaying the first static image includes: Adding the first static image to widget information corresponding to the first static widget; Generating an interface rendering tree corresponding to the first static widget according to the widget information; the interface rendering tree includes a target node, and the target node corresponds to the first static widget; Rendering a target interface based on the interface rendering tree; Displaying the target interface, and the target interface includes the first static image; Among them, the target interface includes the desktop interface of the electronic device, the negative first screen interface of the electronic device, or the application interface of an application in the electronic device.
9. The method according to any one of claims 1-3, characterized in that The method further includes: In response to the first static image satisfying the update condition, rendering a plurality of components corresponding to the first static widget; Generating a second static image according to the rendered plurality of components; the second static image is used to display second resource content corresponding to the first static widget; Displaying the second static image.
10. The method according to any one of claims 1-3, characterized in that, The first trigger operation includes a click operation, a voice operation, or a long-press operation on the widget icon corresponding to the first static widget.
11. A display device, characterized in that, The display device includes: a desktop application, a widget provider application, a widget management service, a widget rendering service, and a unified rendering service; The desktop application is configured to receive a first trigger operation from a user; the first trigger operation is used to add a first static widget, and the first static widget includes a plurality of components; the component information of the first static widget includes layout information and resource information corresponding to the plurality of components; The desktop application is further configured to send an addition request to the widget management service in response to the first trigger operation; The widget management service is configured to send a retrieval request to the widget provider application according to the addition request, and the retrieval request is used to request to retrieve first component information of the plurality of components; The widget provider application is configured to send the first component information of the plurality of components to the widget management service according to the retrieval request; The widget management service is further configured to send the first component information of the plurality of components to the widget rendering service; The widget rendering service is configured to send the first component information of the plurality of components and a first rendering request to the unified rendering service; The unified rendering service is configured to generate a widget rendering tree corresponding to the plurality of components according to the first component information of the plurality of components; based on the widget rendering tree corresponding to the plurality of components, rendering the plurality of components; The unified rendering service is further configured to generate a first static image according to the rendered plurality of components; the first static image is used to display first resource content corresponding to the first static widget; The unified rendering service is further configured to send the first static image to the desktop application; The desktop application is further configured to display the first static image.
12. The display device according to claim 11, wherein: The unified rendering service is further configured to configure interactive area information corresponding to the first static image according to area information and service link information of at least one interactive component among the plurality of components; Among them, the interactive area information is used to characterize the area position corresponding to at least one interactive response area in the first static image and the service link corresponding to the at least one interactive response area.
13. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a display screen. The memory and the display screen are coupled to the processor. The display screen is used to display static images. The memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the electronic device executes the widget display method according to any one of claims 1-10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program. When the computer program runs on an electronic device, the electronic device executes the widget display method according to any one of claims 1-10.
Citation Information
Patent Citations
Widget component processing method and device, equipment, storage medium and program product
CN115801777A