Widget display method and electronic equipment
By rendering multiple components of the widget and generating static images, the problem of widgets occupies memory and increasing power consumption in electronic devices is solved, and the effect of reducing power consumption and improving user experience is achieved.
Patent Information
- Application Number
- CN202310956870.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
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 of a 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 CN119440352A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a widget display method and an electronic device. Background Art
[0002] At present, most electronic devices (such as mobile phones) often use widgets to push content to users. For example, a mobile phone displays a widget on the interface, and users can enter the corresponding application through the widget, 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 system application on an electronic device. For example, a clock component, a weather component, and a music component.
[0003] Usually, a widget includes one or more subcomponents. For example, a widget may include a cover subcomponent, a song information subcomponent, a play / pause subcomponent, a next subcomponent, and a previous subcomponent, etc., so as to display the function, content, style, etc. of the widget. In this way, if an electronic device displays a widget including a large number of subcomponents for a long time, it will occupy a certain amount of device memory. In turn, 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] The embodiment of the present application provides a widget display method and electronic device, which renders multiple components corresponding to the widget and generates and displays a static image based on the rendered multiple components, thereby avoiding continuous operation and refreshing of multiple components in the widget and reducing the memory usage of the widget.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a widget display method, which is applied to an electronic device, and 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 multiple components corresponding to the first static widget. And according to the multiple components that have been rendered, a first static image can be generated and displayed, and the first static image is used to display the first resource content corresponding to the first static widget.
[0007] It can be seen that a static widget may correspond to multiple components. In the embodiment of the present application, multiple components corresponding to a static widget may be rendered. And based on the multiple components that have been rendered, a static image is generated and displayed. The 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 that have been rendered, it is possible to avoid continuously running and refreshing multiple components in the static widget while ensuring the normal display of a static widget. Only one static image needs to be displayed, which reduces the memory usage of the widget and reduces the power consumption of the electronic device.
[0008] In an implementation manner of the first aspect, the method further includes: configuring 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 multiple components;
[0009] The interactive area information is used to represent an area position corresponding to at least one interactive response area in the first static image and a service link corresponding to at least one interactive response area.
[0010] Furthermore, 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 may be configured by calling a target application programming interface.
[0011] It can be seen that usually multiple components include at least one interactive component, and users can use the interactive component to implement the interactive function corresponding to the widget. Because the embodiment of the present application does not display the interactive component but displays the first static image during the display of the first static widget. 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 realize the interactive function corresponding to the static widget. In other words, it is possible to give the resource content certain interactive functions on the basis of ensuring that the first static image displays the complete resource content. Furthermore, it is possible to enable the static widget to realize some interactive functions and enhance the user's usage experience.
[0013] In an implementation of the first aspect, the method further includes: receiving a second trigger operation for the first static image, and determining a trigger area corresponding to the second trigger operation in response to the second trigger operation, determining the trigger area to be an interactive response area, and executing a service associated with the service link according to the service link corresponding to the interactive response area.
[0014] Furthermore, in the process of executing the service associated with the service link according to the service link corresponding to the interactive response area, it is possible to jump to the corresponding service interface according to the service link corresponding to the interactive response area;
[0015] Alternatively, the display state of the first static image may be switched from the first display state to the second display state according to the service link corresponding to the interactive response area.
[0016] It can be seen that in the embodiment of the present application, when the trigger area corresponding to the second trigger operation is determined to be the interactive response area according to the received second trigger operation, the corresponding service can be executed according to the service link corresponding to the interactive response area. The executed service can jump to the corresponding service interface or change the display state of the first static image.
[0017] In other words, it is possible to give the resource content certain interactive functions while ensuring that the first static image displays the complete resource content. It also provides more user-friendly interactive functions, such as changing the display state of the first static image, jumping to the service interface, etc. While improving playability, it can also improve the interactivity between users and electronic devices.
[0018] In an implementation of the first aspect, 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. 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 the first static image is generated. The widget thread of the first static widget can also be destroyed after the first static image is displayed. It can be seen that one static widget corresponds to one widget thread. It should be understood that for widgets currently provided by electronic devices such as mobile phones and tablets, when the widget is displayed on the desktop or negative one screen and other applications, the thread corresponding to the widget will be used as a resident thread, occupying a certain memory overhead, and will also increase the system power consumption of the electronic device. The electronic device does not control the thread. However, for the method provided by each implementation of the present application, since a static image is used to replace a static widget for display, after the widget thread corresponding to a static widget completes the corresponding task, the widget thread corresponding to the static widget can be destroyed to avoid occupying the operating resources of the electronic device.
[0020] In an implementation of the first aspect, in a 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 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] In the process of generating the first static image according to the multiple components that have been rendered, the multiple components that have been rendered may be saved as the first static image.
[0022] It can be seen that in the embodiment of the present application, a widget rendering tree corresponding to the multiple components can 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 later, without continuously running the multiple components in the static widget, thereby reducing the memory usage of the widget.
[0023] In an implementation manner of the first aspect, in the process of displaying the first static image, the first static image can 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, a target interface is rendered and displayed, and the target interface includes the first static image.
[0024] The target interface includes one or more of a desktop interface of the electronic device, a negative one-screen interface of the electronic device, or an application interface of an application program in the electronic device.
[0025] It can be seen that in an embodiment of the present application, in 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, the target interface also needs to be rendered. The widget information corresponding to the first static widget includes the first static image, and the 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, in the process of displaying the first static widget in the target interface, the first static widget includes the first static image, and there is no need to continuously run multiple components in the static widget, which reduces the memory usage of the widget.
[0026] In an implementation of the first aspect, the method further includes: detecting that a preset update condition is met, rendering multiple components corresponding to the first static widget, and generating and displaying a second static image based on the rendered multiple components, the second static image being used to display the second resource content corresponding to the first static widget.
[0027] It can be seen that in the embodiment of the present application, when the first static widget is updated or a change event is detected, multiple components corresponding to the first static widget can be rendered. And according to the multiple components that have been rendered, a second static image can be generated and displayed, and the second static image is used to display the second resource content corresponding to the second static widget.
[0028] That is to say, in the process of updating the first static widget, an updated static image will still be generated and displayed according to the rendered multiple components. The rendered multiple components can still be replaced by an updated static image. After the static widget is updated, there is no need to continuously run and refresh the multiple components in the static widget, which reduces the widget memory usage and reduces the power consumption of the electronic device.
[0029] In an implementation manner of the first aspect, the first trigger operation includes a click operation, a voice operation, or a long press operation on a widget icon corresponding to the first static widget.
[0030] In a second aspect, an embodiment of the present application 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.
[0031] 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 corresponds to multiple components.
[0032] The desktop application is further configured to send an adding request to the widget management service in response to the first trigger operation.
[0033] The widget management service is configured to send a obtaining request to the widget provider application according to the adding request, where the obtaining request is used to request obtaining the first component information of the multiple components.
[0034] The widget provider application is configured to send first component information of multiple components to the widget management service according to the acquisition request.
[0035] The widget management service is further configured to send first component information of the multiple components to the widget rendering service.
[0036] The widget rendering service is configured to send first component information and a first rendering request of multiple components to a unified rendering service.
[0037] The unified rendering service is configured to render multiple components according to first component information of the multiple components and a 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 further 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 a first static image.
[0041] The display screen is configured to display a first static image.
[0042] It can be seen that by using a static image instead of multiple rendered components, it is possible to avoid continuously running and refreshing multiple components in a static widget while ensuring the normal display of a static widget. Only one static image needs to be displayed, which reduces the widget memory usage and the power consumption of the electronic device.
[0043] In an implementation manner of the second aspect, the multiple components include at least one interactive component; the unified rendering service is further configured to configure interactive area information corresponding to the first static image according to the area information and service link information of the at least one interactive component.
[0044] The interactive area information is used to represent an area position corresponding to at least one interactive response area in the first static image and a service link corresponding to at least one interactive response area.
[0045] It can be seen that the embodiment 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 realize the interactive function corresponding to the static widget. In other words, it is possible to give the resource content certain interactive functions on the basis of ensuring that the first static image displays the complete resource content. Furthermore, it is possible to enable the static widget to realize some interactive functions and enhance the user's usage experience.
[0046] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a memory, a processor and a display screen, the memory, the display screen and the processor are coupled, the display screen is used to display static images, the memory is used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, the electronic device executes the widget display method 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 described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a related technology provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0051] Figure 4 A flowchart of a widget display method provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of an interface for adding a widget provided in an embodiment of the present application;
[0053] Figure 6 A schematic diagram of a process of adding a widget provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of a process for generating a first static image provided in an embodiment of the present application;
[0055] Figure 8 A schematic diagram of a process of destroying a runtime thread provided in an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of a process of rendering a target interface provided by an embodiment of the present application;
[0057] Fig.10 A schematic diagram of an interface of an interactive response area provided in an embodiment of the present application;
[0058] Fig.11 A schematic diagram of a jump service interface provided in an embodiment of the present application;
[0059] Fig.12 A hardware structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be described below in conjunction with the 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 can represent A or B; "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or its similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects.
[0061] Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in some embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0062] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate 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, people's lives have been brought a lot of convenience and enjoyment. In order to improve the user experience, electronic devices will be configured with applications that implement different functions. And each application can also provide multiple services, and different services can implement different functions. For example, electronic devices are configured with desktop applications, which can provide multiple business modules and implement different functions based on multiple business modules. In order to facilitate users to quickly implement a certain function, electronic devices can generate different components based on different functions and display them in the main screen interface corresponding to the desktop application. For example, shortcuts to users' frequently used services can be generated in the form of widgets.
[0064] It is understood that the above-mentioned widget is a miniature application view that can be embedded in the desktop, supports users to preview functions and perform quick operations on the view, and accepts regular updates. In other words, the widget is the content that the user wants to display 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, users can enter the corresponding application through the widget, quickly view some content or quickly implement a certain function. Among them, the widget can be a small visual component 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.
[0066] See also Figure 1 A solution for generating widgets is provided in the related art. The electronic device of the solution is installed with system, then when displaying widgets on the desktop, electronic devices usually use The widget framework implementation of the native application window widget (App Widget). Among them, the widget framework includes the application widget framework (App Widgetframework), the application widget service (App Widget Service) and the application widget management (App Widget Manager) service. The application widget service is the core class of the framework. It is one of the system services that automatically starts after the device is turned on and is used for the management of widgets. For example, the loading, deletion and timing events of widgets. The application widget management service is used for the actual update and related management of widget views. 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 one-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, a widget may also be a small component, a widget, or a card, which is not limited in the embodiments of the present application. It should be understood that in the embodiments of the present application, a small component and a component are not synonymous, and a small component may be a widget in English, and a component may be a component in English.
[0068] Remote views are mainly used for the development of app widgets, which are implemented through the AppWidget Provider service. The AppWidget Provider service can call functions to perform corresponding operations on the widget. For example, functions may include onEnable(), onDeleted(), onUpdate(), and onDisabled().
[0069] Specifically, the application widget host application receives the message sent by the application widget service, 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 (update App Widget).
[0070] It is understandable that each widget provider application can provide an application widget provider service, and send its component data to the application widget host application through the application widget provider service. After the system is turned 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 component data, or update displayed components through the provider information. Among them, component data can include text resources, image resources, virtual machine resources, etc.
[0071] Based on the above content, if an entire widget is understood as a root component container, then one or more subcomponents will be included in the widget. For example, a widget may include a cover subcomponent, a song information subcomponent, a play / pause subcomponent, a next subcomponent, and a previous subcomponent, etc., so as to display the function, content, style, etc. of the widget. In this way, the application widget provider service provided by the widget provider application needs to send the component data corresponding to the above series of subcomponents to the application widget host application. The application widget host application can obtain the component data corresponding to a series of subcomponents and implement the addition of a series of subcomponents corresponding to the component data, thereby realizing the widget generation and display process. However, if an electronic device displays a widget for a long time and includes a large number of subcomponents, it will occupy a certain amount of device memory. In turn, it causes 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 content, the embodiment of the present application provides a widget display method and device, the method comprising: 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 multiple components corresponding to the first static widget. And according to the multiple components that have been rendered, a first static image can be generated and displayed; 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 may correspond to multiple components. In the embodiment of the present application, multiple components may be rendered. And a static image is generated based on the multiple components that have been rendered. That is, the multiple components that have been rendered may be replaced by a static image, and the static image may be used to display the resource content corresponding to the static widget. Then, the static image may be displayed in the static widget. In this way, on the basis of ensuring the normal display of the static widget, it is possible to avoid continuously running and refreshing multiple components corresponding to the static widget, and only need to display the static image, thereby reducing the memory usage of the widget and reducing the power consumption of the electronic device.
[0074] In some examples, a static widget may include a widget that provides one or more links. For one link, an interface of an application corresponding to the widget may be associated. Multiple links may be associated with multiple interfaces; the multiple interfaces may be different interfaces of different applications, which is not limited in the embodiments of the present application.
[0075] The widget display method provided in the embodiment of the present application can be applied to electronic devices. In some embodiments, the electronic device may 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 embodiment of the present application does not impose any 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. This application does not limit the specific type of electronic equipment and the type of operating system when an operating system is installed.
[0077] For example, taking the electronic device as a mobile phone, 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0079] It is to be understood that the structure illustrated in the embodiment 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 shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0080] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0081] The controller may be the nerve center and command center of the mobile phone 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0082] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0083] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0084] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0085] The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0087] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0088] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0089] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The mobile phone 100 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 100.
[0090] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0091] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, 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 can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In addition, the mobile phone 100 may include 1 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 micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the mobile phone 100.
[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, each with 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: application layer, application framework layer, Runtime (Android runtime) and system libraries, as well as the kernel layer.
[0097] The application layer can include a series of application packages.
[0098] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, WLAN, music, short message, first application and 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 screen.
[0100] The second application may include a provider application, such as a widget provider application (Widget Provider App). The widget provider application is used to provide a layout corresponding to a widget and a widget data update capability.
[0101] It should be noted that the first application and the second application may be system applications or third-party applications. The embodiment of the present application does 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, desktop applications can be resident as core applications The desktop application can perform basic management of installed applications, such as deleting or displaying applications.
[0103] In some examples, the desktop application may display one or more display interfaces as the desktop of the mobile phone 100. The desktop application may display application icons, folders, weather widgets, clock widgets, etc. in the display interface. Of course, the desktop application may also hide the above widgets. For example, when the weather widget displays a preset time, the desktop application may automatically hide the widget.
[0104] In some embodiments of the present application, the mobile phone 100 is provided with a negative one screen. Among them, the negative one screen can be used to provide users with functions such as search, application suggestions, quick services, and smart scenes. The negative one screen can also be used to display notification information that needs to be pushed to the user. For example, application messages subscribed by the user, real-time hot search messages, weather information, and time information. Of course, the above notification information in the negative one screen can also be presented in the form of widgets. The widget has a striking appearance, which can remind the user to pay attention to the information displayed on the widget. In addition, when the user needs to view the negative one screen of the mobile phone 100, the screen of the mobile phone 100 can be slid to make the mobile phone 100 display the negative one screen.
[0105] In some examples, the widget may also have different sizes, such as 1×1, 2×2, or 2×4.
[0106] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0107] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a widget management service, a widget rendering service, a unified rendering service, and the like.
[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] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0110] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0111] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0112] In some embodiments of the present application, the widget management service is used to provide management capabilities and data caching capabilities corresponding to the life cycle of the widget. The widget rendering service is used to load 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 component information corresponding to the multiple components.
[0114] The runtime includes the core library and the virtual machine. The runtime is responsible for scheduling and management of the Android system.
[0115] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0116] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0117] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0118] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0119] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0120] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0121] A 2D graphics engine is a drawing engine for 2D drawings.
[0122] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0123] The following embodiments will be combined with the accompanying drawings and continue to use electronic devices as Figure 2 Taking the mobile phone with the structure shown in the figure as an example, the widget display method provided by the embodiment of the present application is described. Figure 4 , the method may include:
[0124] S401. A mobile phone receives a first trigger operation of a user. The first trigger operation is used to add a first static widget. 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. When the mobile phone displays a dynamic widget, the display content and / or display effect (such as display position, display size and display state) corresponding to the dynamic widget may change over time.
[0126] For example, 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 dynamic cover component and the lyrics information component will change as the music is played.
[0127] When the mobile phone is displaying a static widget, if the static widget is not updated, the display content and display effect corresponding to the static widget will not change with time.
[0128] For example, a weather widget may correspond to a weather component (such as "sunny 23℃") and a picture component (such as a picture of the sun) after the Nth update and before the N+1th update, and the display content and display effect corresponding to the weather component and the picture component will not change over 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+1th update (such as 10:11), the time widget may correspond to a time component (such as "10:10") and an image component (such as an image corresponding to a clock), and the display content and display effect corresponding to the time component and the image component will not change over time.
[0130] In some embodiments of the present application, the mobile phone may receive a first trigger operation of the user, wherein the first trigger operation may represent an operation for adding a first static widget.
[0131] In an implementable manner, the user may input a first trigger operation on the widget page of the mobile phone to add the first static widget. The first trigger operation may include a click operation, a voice operation, or a long press operation on the widget icon corresponding to the first static widget.
[0132] In some examples, the first static widget is used to implement the target function and / or display the first resource content, and the first static widget may correspond to multiple components. The components may include one or more of the layout components, basic components, or extended components provided by the mobile phone APP; the basic components include at least one of the text components, date components, picture components, and table components; the extended components include at least one of the attachment components, address components, and signature components. 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] Furthermore, the APPs on the mobile phone may include system APPs, third-party APPs, etc. The specific functions and displayed resource contents of the first static widget may be preset, or may be adjusted or set according to user needs.
[0134] In some embodiments of the present application, the mobile phone may provide the user with access to various widget display functions, and the user may enable the mobile phone to display the first static widget in various ways.
[0135] For example, in some possible scenarios, see Figure 5 In (A), the user can perform input operations on the screen of the mobile phone, for example, long press, click, double click, and slide on a blank position or a non-functional position on the screen, and the mobile phone can respond to the user's input operation and display, for example Figure 5The function page (B) in the function interface may include function controls corresponding to the wallpaper function, function controls corresponding to the widget function, function controls corresponding to the layout function, function controls corresponding to the switching effect function, and function controls corresponding to the desktop setting function.
[0136] In some examples, the user can click on the function control corresponding to the widget function, and the mobile phone responds to the user's click operation and displays, for example, Figure 5 The widget details page in (C) in the figure. The widget details page includes application icons corresponding to the applications installed in the mobile phone. For example, application icons corresponding to the information application, application icons corresponding to the music application, application icons corresponding to the weather application, application icons corresponding to the theme application, and icons corresponding to other widgets. The user can click 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 adding page (D) in FIG. 1 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 pre-added first static widget. For example, the user performs a first trigger operation on the first static widget, and the mobile phone receives the first trigger operation of the user, triggering a subsequent process of adding the first static widget.
[0138] For example, in some possible scenarios, the user may input a first voice control command to the mobile phone, such as "Xiaoyi Xiaoyi, I want to add a weather widget", "Xiaoyi Xiaoyi, I want to add a weather widget", etc. Thus, the mobile phone responds to the first voice control command and displays the above-mentioned Figure 5 Then, the user can input a second voice control command into 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 command 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 triggering operation.
[0140] It should be noted that the first trigger operation may include one or more of long press, click, drag, move, slide and voice operation. The mobile phone can provide users with multiple ways to add the first static widget, so that users can have a better user experience. The embodiment of the present application does not limit the specific implementation method 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 first trigger operation of the user, and when it is determined that the widget added corresponding to the first trigger operation is a static widget, 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 added corresponding to the first trigger operation. In another exemplary embodiment, the mobile phone can also determine whether it is a static widget according to the widget content of the widget added corresponding to the first trigger operation. If the displayed content in the widget is all static content, it can be determined that the added widget is a static widget. In another exemplary embodiment, the mobile phone can also determine whether it is a static widget according to the widget component type of the widget added corresponding to the first trigger operation. 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 may obtain first component information of multiple components corresponding to the first static widget in response to the first trigger operation. Then, the mobile phone may render multiple components according to the first component information of the multiple components. And based on the rendered multiple components, a first static image is generated, and the first static image is used to display the first resource content corresponding to the multiple components.
[0145] Specifically, see Figure 6 , the desktop application in the mobile phone responds to the first trigger operation and sends an add request to the widget management service. The add request is used to add the first static widget. After receiving the add request, the widget management service sends a get request to the widget provider application. The get request is used to obtain the first component information of the multiple components corresponding to the first static widget. The widget provider application receives the get request and sends the first component information of the 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 the multiple components corresponding to the weather widget may include layout information and resource information of the components.
[0147] In some examples, layout information includes but is not limited to component position, height, width, color, style (square, circle, diamond, etc.), refresh interval, region information, and service link information, etc.; resource information may include but is not limited to location information, weather information, and time information, etc. It is understandable that the resource information may be implemented in the form of text and / or pictures, and the resource information may be real-time information or historical information.
[0148] It is understandable that the first component information may be preset by the mobile phone or a third-party APP, or may be determined based on the user's choice.
[0149] In some examples, the resource information in the component information may be local resources from 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. In addition, the resource information may 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 achievable manners, the first component information may further 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, the widget management service may also pull up a widget rendering service in the process of obtaining the first component information, and send the first component information of the multiple components to the widget rendering service. The widget rendering service may create a widget thread, which may be used as a runtime thread. Based on the widget thread, the first component information of the multiple components and the first rendering request may be sent to the unified rendering service, so that the unified rendering service performs the subsequent rendering task of the widget content.
[0152] The unified rendering service generates a widget rendering tree corresponding to the multiple components according to the received first rendering request and the first component information of the multiple components. The widget rendering tree includes at least one rendering node, each rendering node corresponding 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 rendering task of the widget content through the widget rendering service, which is a system service. In other words, 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. For example, a text component is displayed on a picture component. Components can also be connected. For example, a text component is connected at the bottom of a picture component. In the embodiment of the present application, each component can be used as a rendering node, and a tree-structured data model is generated based on the connection relationship between each component to realize the rendering process of the entire first static widget.
[0155] For some examples, see Figure 7The unified rendering service renders the multiple components based on the widget rendering tree corresponding to the 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 to take the weather widget as the first static 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 December 3rd Thursday", 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 to sunny", and a first picture component and the weather picture content corresponding to the first picture component, such as the picture corresponding to cloudy to sunny.
[0157] In some examples, the unified rendering service may convert multiple components rendered in the widget rendering tree into a first static image. That is, the multiple components rendered are saved as the first static image. The static image may display the first resource content corresponding to the component. For example, the first static image may include weather text content, location text content, time text content, temperature text content, and weather picture content.
[0158] In some other embodiments of the present application, after receiving the add request, the widget management service sends a get request to the widget provider application. The get request can also be used to obtain the layout information in the first component information corresponding to multiple components. The widget provider application receives the get request and sends the layout information of the first component information corresponding to the multiple components to the widget management service. In the process of obtaining the layout information, the widget management service can also pull up 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 first rendering request of the multiple components to the unified rendering service, so that the unified rendering service performs the subsequent rendering tasks of the widget content.
[0159] It should be noted that the embodiment of the present application does not specifically limit the method for obtaining the first component information corresponding to multiple components.
[0160] It can be seen that in the embodiment of the present application, the rendered multiple components are converted into a static image according to the first component information of the multiple components, that is, the rendered multiple components are replaced by a static image. And the static image can be used to display the first resource content corresponding to the multiple components. In this way, on the basis of being able to ensure the normal display of the static widget in the future, it is possible to avoid continuously running and refreshing a series of components in the static widget, and only the first static image needs to be displayed, which reduces the memory usage of the widget and reduces the power consumption of the electronic device.
[0161] S403: The mobile phone displays a first static image.
[0162] In some embodiments of the present application, the mobile phone may display the first static image after generating the first static image.
[0163] See also Figure 8 After generating the first static image, the unified rendering service in the mobile phone 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, the embodiment of the present application can display the first static image in the first static widget, and 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 embodiment of the present application, only the first static image is displayed during the display of the first static widget. Compared with the related art, it can not only ensure that the widget content corresponding to the first static widget is fully displayed to the user, but also eliminate the need to continuously run and refresh a large number of components in the first static widget. The power consumption of static widgets and the overall power consumption of electronic devices are reduced, thereby improving the user experience.
[0166] In some embodiments of the present application, when the mobile phone displays the first static widget, the mobile phone displays the first static widget in a preset area of the entire screen interface. In this way, the mobile phone needs to render the target interface after rendering the first static widget, and then display the first static image 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, and 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 a target interface according to the interface rendering tree. And display the target interface corresponding to the first static widget.
[0168] In some examples, the target interface includes one or more of a desktop interface of a mobile phone, a negative one screen interface of a mobile phone, or an application interface of an application in the mobile phone.
[0169] It is understandable 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 components to be displayed corresponding to other contents to be displayed in the target interface.
[0170] For example, see Fig. 9 After the desktop application uses the first static image as the first resource content that needs 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 target interface includes the first static widget.
[0171] That is to say, after the desktop application controls the unified rendering service to complete rendering for the first static widget, it will also control the unified rendering service to perform subsequent rendering tasks 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, the widget management service may also send a destruction request to the widget rendering service during the process of receiving the first static image, 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 embodiments of the present application do not specifically limit the implementation time and implementation method of destroying the runtime thread.
[0174] That is to say, in the process of generating and displaying a static widget, a static widget corresponds to a runtime thread. The runtime thread can be created by the electronic device in response to the user's operation. After the runtime thread corresponding to a static widget completes the corresponding task, the runtime thread corresponding to the static widget can 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 interactive components, and the number of components of the interactive components may be one or more. The layout information in the first component information corresponding to the interactive component may include area information and service link information. Among them, the area information is used to characterize the location 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 location area of the interactive component in the first static widget. In other words, when the user inputs a preset operation to the location 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 the embodiment of the present application does not display the interactive component but displays the first static image during the process of displaying the first static widget, the embodiment 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 represent an area position corresponding to at least one interactive response area in the first static image and a service link corresponding to at least one interactive response area.
[0178] That is to say, the embodiment of the present application can configure one or more corresponding response interaction areas in the first static image according to the area information and service link information of the interactive component, and each response interaction area corresponds to the interaction area information. In this way, the user can input a preset operation on the first static image, triggering the first static widget to execute the corresponding service or trigger jumping to the corresponding service interface.
[0179] For example, see Fig.10 , taking the navigation widget 1001 corresponding to the navigation application as the first static widget as an example. The first static widget can provide users with content with interactive functions. For example, the user can click on the area 1002 corresponding to the check-in seat selection in the first static image in the first static widget to trigger the use of the check-in seat selection function in the subsequent navigation application. In other words, the area 1002 corresponding to the check-in seat selection corresponds to an interactive control during the rendering process. In this way, the mobile phone can configure the area 1002 corresponding to the check-in seat selection 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 detecting that the user clicks on the area 1002 corresponding to the check-in seat selection, the mobile phone jumps to the service interface corresponding to the check-in seat selection function.
[0180] In some embodiments of the present application, the user may input a second trigger operation on the first static image to implement a service function corresponding to the first static widget.
[0181] Specifically, the mobile phone may receive a second trigger operation for the first static image, and in response to the second trigger operation, determine a trigger area corresponding to the second trigger operation. Then, the mobile phone may determine that the trigger area is an interactive response area, and execute a corresponding service according to a service link corresponding to the interactive response area.
[0182] In one achievable manner, when the mobile phone is executing the corresponding service according to the service link corresponding to the interactive response area, it can jump to the corresponding service interface according to the service link corresponding to the interactive response area.
[0183] For example, see Fig.11 In (A), the mobile phone receives a user's click operation on the area corresponding to the check-in seat selection in the first static image, and determines whether the area corresponding to the check-in seat selection is an interactive response area. In the case where the area corresponding to the check-in seat selection is determined to be an interactive response area, the mobile phone jumps to the service interface according to the service link of the area corresponding to the check-in seat selection, such as Fig.11 (B) in.
[0184] In another achievable 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 rotation change in a clockwise or counterclockwise direction. In another exemplary embodiment, the first static widget can also be switched to a highlight dynamic display, that is, the first static image presents a cyclic change from expansion to contraction and from contraction to expansion. In another exemplary embodiment, the first static widget can also be switched to a tilted dynamic display, that is, the first static image presents a tilt change in the horizontal direction and / or vertical direction within a preset angle.
[0185] Specifically, in the process of executing the corresponding service according to the service link corresponding to the interactive 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 interactive response area. The first display state is the current static state, and the second display state may include a tilted display state, a rotated display state, or a highlighted display state, etc.
[0186] Exemplarily, the mobile phone receives a user's click operation on a blank area in the first static image, and determines whether the blank area is an interactive response area. If the blank area is determined to be an interactive response area, the current display state of the first static image is switched to a tilted display state, a rotated display state, or a highlighted display state according to the service link of the blank area.
[0187] It should be noted that the embodiment of the present application does not limit the specific service executed by the mobile phone according to the service link corresponding to the interactive response area. At the same time, the second display state can be any display state that can be achieved by the first static image.
[0188] In some embodiments of the present application, the click event for the user input can be triggered by the first static image according to the configured interactive area information. That is, for the first static widget, its internal code does not support onClick customization, that is, it does not support the event occurring when the object is clicked. Jump links, etc. must be performed through the configured interactive area information.
[0189] The methods provided in the embodiments of the present application can call the target application programming interface to configure the interactive 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 a service link to enable the static image to have an interactive function. Based on this, for the first static image displayed on the desktop application, the negative one-screen application, etc., the user can interact by clicking, double-clicking, etc., and implement the corresponding function through the service link. For example, the target application programming interface may include a Link interface.
[0190] In one achievable manner, the corresponding partial code content in the first static widget is as follows:
[0191]
[0192]
[0193] It should be noted that in the embodiment of the present application, the interactive area information may also include an interactive area identifier and an event identifier corresponding to the service link information. The event identifier may uniquely identify any information of each event, and the event type may be a click, long press, and other events. For example, a click operation on the first area in the first static image and a click operation on the second area in the first static image may correspond to different events. A click operation on the first area may jump to the user's personal homepage. A click operation on the second area may realize the function of following a certain user.
[0194] It can be seen that the embodiment of the present application can configure the interactive area information for the first static image in the first static widget, and can give the resource content certain interactive functions on the basis of ensuring that the first static widget displays the complete resource content. Furthermore, the static image can realize some interactive functions and enhance the user's experience. At the same time, it also provides more humanized interactive functions, such as changing the display state of the first static image. While improving 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 updates the first static widget in response to the first static image satisfying the update condition.
[0196] Specifically, in response to the first static image satisfying the update condition, the mobile phone renders multiple components. The mobile phone can generate a second static image based on the multiple components that have been rendered; the second static image is used to display the second resource content corresponding to the multiple components. The mobile phone can also display the second static image. The second static image is an image after updating the first static image.
[0197] In some examples, the update condition may include a preset period of time or a change event of resource content in the provider application, etc., which is not limited in the embodiments of the present application.
[0198] That is, when the mobile phone triggers the update of the first static widget or detects a change event, the desktop application continues to send the latest add request to the widget management service; the widget management service continues to send the latest get request to the widget provider application according to the latest add request, and the latest get request is used to request to obtain the second component information of multiple components. The widget provider application sends the second component information of multiple components to the widget management service according to the latest get request. The widget management service sends the second component information of multiple components to the widget rendering service. The widget rendering service recreates the runtime thread to facilitate the subsequent rendering process of the latest static widget. The widget rendering service sends the second component information of 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 multiple components and the latest first rendering request; and generates a second static image according to the latest multiple components that have been rendered; 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 can display the second static image.
[0199] It can be seen that in the process of updating the first static widget, the embodiment of the present application will still generate and display an updated static image based on the multiple components that have been rendered. That is, the multiple components that have been rendered can be replaced by the updated static image, 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, which reduces the memory usage of the widget and reduces the power consumption of the electronic device.
[0200] In some schemes, multiple embodiments of the present application may be combined, and the combined scheme may be implemented. Optionally, some operations in the process of each method embodiment may be optionally combined, and / or the order of some operations may be optionally changed. Furthermore, 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, and other execution orders may be used between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed.
[0201] A person skilled in the art will be able to think of many 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 also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0202] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.
[0203] Furthermore, the various method embodiments may be implemented separately or in combination.
[0204] The present application also provides an electronic device, such as the mobile phone described above. Fig.12 As 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, the communication interface 1930 and the processor 1910 may be coupled together via a bus 1940.
[0206] The communication interface 1930 is used for data transmission with other devices. The memory 1920 stores computer program codes. The computer program codes include computer instructions. When the computer instructions are executed by the processor 1910, the electronic device executes the posture detection method in the embodiment of the present application.
[0207] Processor 1910 may be a processor or a controller, for example, a central processing unit (CPU), a general 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 may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the present disclosure. The processor may 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 the like.
[0208] The bus 1940 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 1940 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only 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 add request to the widget management service in response to the first trigger operation;
[0212] The widget management service is configured to send a obtaining request to the widget provider application according to the adding request, where the obtaining request is used to request obtaining the first component information of the plurality of components;
[0213] The widget provider application is configured to send first component information of the plurality of components to the widget management service according to the acquisition request;
[0214] The widget management service is further configured to send first component information of the plurality of components to the widget rendering service;
[0215] The widget rendering service is configured to send first component information and a first rendering request of the plurality of components to a unified rendering service;
[0216] A unified rendering service is configured to render the plurality of components according to the first component information of the plurality of components and the first rendering request;
[0217] 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;
[0218] The unified rendering service is further configured to send the first static image to the desktop application;
[0219] The desktop application is also configured to display the first static image.
[0220] In some examples, the unified rendering service is further configured to configure interactive area information corresponding to the first static image based on area information and service link information of at least one interactive component among the multiple components; 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.
[0221] An embodiment of the present application also provides an electronic device, which includes: a memory, a camera and a display screen, wherein the camera includes a processor, the memory and the display screen are coupled to the processor, the display screen is used to display a first static image, 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 relevant method steps in the above method embodiment.
[0222] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the processor executes the computer program code, the electronic device executes the relevant method steps in the method embodiment.
[0223] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the relevant method steps in the above method embodiment.
[0224] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program 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 may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0226] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0227] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller 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 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 repeated here.
[0229] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0230] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0231] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, which may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0232] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0233] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0234] The above contents are only specific implementation methods 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 shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A widget display method, characterized in that: Applied to electronic equipment, the method comprises: 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; Rendering the multiple components corresponding to the first static widget; 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; The first static image is displayed.
2. The method according to claim 1, characterized in that: The method further comprises: According to the area information and service link information of at least one interactive component among the multiple components, configure the interactive area information corresponding to the first static image; The interactive area information is used to represent an area position corresponding to at least one interactive response area in the first static image and a service link corresponding to the at least one interactive response area.
3. The method according to claim 2, characterized in that The configuring the interactive area information corresponding to the first static image includes: The target application programming interface is called to configure the interactive area information corresponding to the first static image.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: receiving a second triggering operation for the first static image; In response to the second trigger operation, determining a trigger area corresponding to the second trigger operation; The triggering area is determined to be the interactive response area, and according to the service link corresponding to the interactive response area, a service associated with the service link is executed.
5. The method according to claim 4, characterized in that Executing a service associated with the service link according to the service link corresponding to the interactive response area includes: Jump to the corresponding service interface according to the service link corresponding to the interactive response area; or, According to the service link corresponding to the interactive response area, the display state of the first static image is switched from a first display state to a second display state.
6. The method according to any one of claims 1 to 5, 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: The widget thread of the first static widget is destroyed.
7. The method according to any one of claims 1 to 6, characterized in that: The rendering of the multiple components corresponding to the first static widget includes: Generate a widget rendering tree corresponding to the multiple components according to first component information of the multiple components; the first component information includes layout information and resource information; Rendering the multiple components based on the widget rendering trees corresponding to the multiple components; Generating a first static image according to the plurality of components that have been rendered includes: The rendered components are saved as the first static image.
8. The method according to any one of claims 1 to 7, characterized in that: The displaying of the first static image comprises: adding the first static image to the widget information corresponding to the first static widget; Generate 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, wherein the target interface includes the first static image; The target interface includes a desktop interface of the electronic device, a negative one screen interface of the electronic device, or an application interface of an application program in the electronic device.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: In response to the first static image satisfying an update condition, rendering a plurality of components corresponding to the first static widget; Generate a second static image according to the multiple components that have been rendered; the second static image is used to display the second resource content corresponding to the first static widget; The second still image is displayed.
10. The method according to any one of claims 1 to 9, characterized in that: The first trigger operation includes a click operation, a voice operation, or a long press operation on a 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 of a user; the first trigger operation is used to add a first static widget, and the first static widget corresponds to multiple components; The desktop application is further configured to send an add request to the widget management service in response to the first trigger operation; The widget management service is configured to send a obtaining request to the widget provider application according to the adding request, wherein the obtaining request is used to request obtaining the first component information of the multiple components; The widget provider application is configured to send first component information of the multiple components to the widget management service according to the acquisition request; The widget management service is further configured to send first component information of the plurality of components to the widget rendering service; The widget rendering service is configured to send first component information and a first rendering request of the plurality of components to the unified rendering service; The unified rendering service is configured to render the multiple components according to the first component information and the first rendering request of the multiple components; 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; The unified rendering service is further configured to send the first static image to the desktop application; The desktop application is also configured to display the first static image.
12. The display device according to claim 11, characterized in that: 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 multiple components; The interactive area information is used to represent an area position corresponding to at least one interactive response area in the first static image and a 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 a static image, the memory is used to store computer-readable instructions, and 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 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program, and when the computer program is executed on an electronic device, the electronic device executes the widget display method according to any one of claims 1 to 10.
Citation Information
Cited By
Widget display method and electronic device
EP4693010A1
Widget display method and electronic device
WO2025025938A1