Widget display method and electronic device
By rendering multiple components of the widget in electronic devices and generating static images, the widget's memory occupancy and increased power consumption are solved, achieving lower power consumption and more efficient display effects.
Patent Information
- Application Number
- PCT/CN2024/102097
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-28
- Filing Date
- 2024-06-27
- Publication Date
- 2025-02-06
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 footprint by rendering multiple components of a widget, generating and displaying static images to replace the components that are continuously running and refreshed.
It effectively reduces the memory usage of widgets and the power consumption of electronic devices, while maintaining the normal display and interaction functions of static widgets.
Smart Images

Figure CN2024102097_06022025_PF_FP_ABST
Abstract
Description
Widget display method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on July 28, 2023, with application number 202310956870.5 and application name “A Widget Display Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a widget display method and electronic device. Background Art
[0003] Currently, 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, allowing users to access the corresponding application, quickly view some content, or quickly perform a certain function. A widget can be understood as a component provided by a third-party application or system application on an electronic device. Examples include a clock component, a weather component, and a music component.
[0004] Typically, 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 song subcomponent, and a previous song subcomponent, to showcase the widget's functionality, content, and style. Therefore, if an electronic device displays a widget with a large number of subcomponents for a long period of time, it will occupy a certain amount of device memory. This, in turn, will cause the electronic device to consume background power, increasing its power consumption.
[0005] Summary of the Invention
[0006] The present invention provides a widget display method and electronic device that renders multiple components corresponding to a widget and generates and displays a static image based on the rendered components. This avoids the need to continuously run and refresh multiple components in the widget, thereby reducing the widget's memory usage.
[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, embodiments of the present application provide a widget display method, applied to an electronic device, comprising: receiving a first trigger operation from a user; the first trigger operation being used to add a first static widget, the first static widget corresponding to multiple components; rendering the multiple components corresponding to the first static widget; and generating and displaying a first static image based on the rendered multiple components, the first static image being used to display first resource content corresponding to the first static widget.
[0009] It can be seen that a static widget can correspond to multiple components. In the embodiment of the present application, multiple components corresponding to a static widget can 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.
[0010] In an implementation 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 plurality of components;
[0011] 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.
[0012] 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.
[0013] As can be seen, multiple components typically include at least one interactive component, and users can use the interactive component to implement the interactive functions corresponding to the widget. Since the embodiment of the present application does not display the interactive component during the display of the first static widget but instead displays the first static image, the target application programming interface is a newly added interface. Therefore, the interactive area information corresponding to the first static image can be configured based on the area information and service link information of the interactive component and the target application programming interface.
[0014] In this way, users can utilize the interactive response area within the first static image to implement the corresponding interactive functions of the static widget. In other words, while ensuring that the first static image displays the complete resource content, it can also grant the resource content certain interactive functions. Furthermore, this allows the static widget to implement some interactive functions, enhancing the user experience.
[0015] In one possible implementation of the first aspect, the method further includes receiving a second triggering operation for the first static image, and determining, in response to the second triggering operation, a triggering area corresponding to the second triggering operation. The triggering area is determined to be an interactive response area, and a service associated with the service link is executed according to the service link corresponding to the interactive response area.
[0016] 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;
[0017] 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.
[0018] As can be seen, in the embodiment of the present application, when the trigger area corresponding to the second trigger operation is determined to be an interactive response area based on 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.
[0019] In other words, while ensuring that the first static image displays the complete resource content, it can also be given certain interactive functions. Furthermore, more user-friendly interactive functions are provided, such as changing the display state of the first static image and jumping to a service interface. This improves playability while also enhancing the interactivity between the user and the electronic device.
[0020] In one implementation of the first aspect, before rendering the multiple components corresponding to the first static widget, the method further includes: creating a widget thread for the first static widget. After generating the first static image, the method further includes destroying the widget thread for 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.
[0021] 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 the negative one screen, the thread corresponding to the widget will be a resident thread, occupying a certain amount of memory overhead, and will also increase the system power consumption of the electronic device. The electronic device will not control this thread. However, for the methods provided by various implementations 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.
[0022] In one implementation of the first aspect, during rendering of multiple components corresponding to the first static widget, a widget rendering tree corresponding to the multiple components may be generated based on first component information of the multiple components, where the first component information includes layout information and resource information. Furthermore, the multiple components are rendered based on the widget rendering tree corresponding to the multiple components.
[0023] 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.
[0024] As can be seen, in the embodiments of the present application, a widget rendering tree corresponding to the multiple components can be generated based on the first component information of the multiple components. The multiple components can then be rendered based on the widget rendering tree corresponding to the multiple components. The rendered multiple components can then be directly saved as a first static image. This facilitates the subsequent direct display of the first static image without the need to continuously run the multiple components in the static widget, thereby reducing widget memory usage.
[0025] In one implementation of the first aspect, during the display of the first static image, the first static image can be added to the widget information corresponding to the first static widget. Based on the widget information, an interface rendering tree corresponding to the first static widget is generated. The interface rendering tree includes a target node corresponding to the first static widget. Based on the interface rendering tree, a target interface is rendered and displayed, the target interface including the first static image.
[0026] 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.
[0027] 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 needs to be rendered. The widget information corresponding to the first static widget includes the first static image, and based on the widget information, an interface rendering tree corresponding to the first static widget is generated. 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.
[0028] In one implementation of the first aspect, the method further includes: upon detecting that a preset update condition is satisfied, 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 second resource content corresponding to the first static widget.
[0029] As can be seen, 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. A second static image can be generated and displayed based on the rendered multiple components. The second static image is used to display the second resource content corresponding to the second static widget.
[0030] In other words, during the update of the first static widget, an updated static image is still generated and displayed based on the rendered components. The rendered components can still be replaced by the updated static image. After the static widget is updated, there is no need to continuously run and refresh the multiple components within the static widget, which reduces widget memory usage and reduces power consumption of the electronic device.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] The desktop application is further configured to send an add request to the widget management service in response to the first trigger operation.
[0035] The widget management service is configured to send an acquisition request to the widget provider application according to the add request, where the acquisition request is used to request to acquire first component information of the multiple components.
[0036] The widget provider application is configured to send first component information of multiple components to the widget management service according to the acquisition request.
[0037] The widget management service is further configured to send first component information of the multiple components to the widget rendering service.
[0038] 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.
[0039] 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.
[0040] The unified rendering service is further configured to generate a first static image based on the rendered components; the first static image is used to display the first resource content corresponding to the first static widget.
[0041] The unified rendering service is further configured to send the first static image to the desktop application.
[0042] The desktop application is further configured to control the display screen to display a first static image.
[0043] The display screen is configured to display a first static image.
[0044] It can be seen that by using a static image to replace 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.
[0045] 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 based on the area information and service link information of the at least one interactive component.
[0046] 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.
[0047] As can be seen, the embodiments of the present application can configure the interactive area information corresponding to the first static image based on the interactive component's area information and service link information. In this way, users can utilize the interactive response area within the first static image to implement the interactive functions corresponding to the static widget. In other words, while ensuring that the first static image displays the complete resource content, it can also grant the resource content certain interactive functions. Furthermore, it can enable the static widget to implement certain interactive functions, enhancing the user experience.
[0048] In a third aspect, an embodiment of the present application provides an electronic device, which includes: a memory, a processor, and a display screen. The memory and the display screen are coupled to the processor. The display screen is used to display static images. The memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the electronic device executes the widget display method described in the first aspect above.
[0049] 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
[0050] FIG1 is a schematic diagram of a process flow of a related technology provided by an embodiment of the present application;
[0051] FIG2 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;
[0052] FIG3 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;
[0053] FIG4 is a schematic flow chart of a widget display method provided in an embodiment of the present application;
[0054] FIG5 is a schematic diagram of an interface for adding a widget provided in an embodiment of the present application;
[0055] FIG6 is a schematic diagram of a process of adding a widget according to an embodiment of the present application;
[0056] FIG7 is a schematic diagram of a process for generating a first static image according to an embodiment of the present application;
[0057] FIG8 is a schematic diagram of a process for destroying a runtime thread according to an embodiment of the present application;
[0058] FIG9 is a schematic diagram of a process of rendering a target interface provided by an embodiment of the present application;
[0059] FIG10 is a schematic diagram of an interface of an interactive response area provided in an embodiment of the present application;
[0060] FIG11 is a schematic diagram of a jump service interface provided in an embodiment of the present application;
[0061] FIG12 is a hardware structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] 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 description of the association relationship of 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. In addition, 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 similar expressions refers to any combination of these items, including any combination of single 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 facilitate a clear description of 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 identical or similar items with basically the same functions and effects.
[0063] Those skilled in the art will understand 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 differences. 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 explanations. 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 design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0064] 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. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0065] The rapid popularization of electronic devices such as mobile phones, computers, and televisions has brought a lot of convenience and enjoyment to people's lives. To improve the user experience, electronic devices are equipped with applications that implement different functions. In addition, each application can provide multiple services, and different services can implement different functions. For example, an electronic device is equipped with a desktop application, which can provide multiple service modules and implement different functions based on these modules. To facilitate users to quickly implement a certain function, the electronic device can generate different components based on different functions and display them on 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.
[0066] It is understood that the aforementioned widgets are miniature application views that can be embedded in the desktop, allowing users to preview functions and perform quick operations within the view, and receive regular updates. In other words, widgets are content that users wish to display permanently on the desktop. For example, widgets on the desktop can be determined by the device or specified by the user.
[0067] In this way, users can use widgets to enter corresponding applications, quickly view some content, or quickly perform a certain function. Among them, widgets can be small visual components provided by third-party applications or system applications on electronic devices. For example, clock widgets, weather widgets, and music widgets.
[0068] Referring to FIG1 , a solution for generating a widget is provided in the related art. 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 App Widget framework, the App Widget Service, and the App Widget Manager service. The App Widget Service is the core class of the framework and is one of the system services that automatically starts after the device is turned on. It is used for the management of widgets. For example, the loading, deletion, and timing events of widgets. The App Widget Management Service is used for the actual update and related management of widget views. The App Widget Host application is used to actually control the App Widget. The App Widget Host application can include a desktop application or a negative one-screen application. The App Widget Host View is used to accommodate the view of the App Widget. The view of the App Widget can be created according to the description of the Remote View.
[0069] In some examples, a widget can also be a small component, widget, or card, which is not limited in the embodiments of this application. It should be understood that in the embodiments of this application, the meanings of small component and component are not the same. The English word for small component can be widget, and the English word for component can be component.
[0070] Remote views are primarily used for developing app widgets, which are implemented through the App Widget Provider service. The App Widget Provider service can call functions to perform widget operations. For example, functions such as onEnable(), onDeleted(), onUpdate(), and onDisabled() can be used.
[0071] Specifically, the App Widget host application receives a message from the App Widget service, creates an App Widget host view, queries the remote view corresponding to the App Widget ID through the App Widget service, and finally passes the remote view to the App Widget host view to update the App Widget.
[0072] It is understood that each widget provider application can provide an application widget provider service, through which its component data is sent to the application widget host application. After the system is booted, the application widget service automatically collects 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 use the provider information to obtain component data, add components corresponding to the component data, or update displayed components. Component data can include text resources, image resources, virtual machine resources, and so on.
[0073] Based on the above content, if an entire widget is understood as a root component container, then the widget will include 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, 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 that 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.
[0074] Based on the above, embodiments of the present application provide a widget display method and device, comprising: receiving a first trigger operation from a user; the first trigger operation being used to add a first static widget, the first static widget corresponding to multiple components; rendering the multiple components corresponding to the first static widget; and generating and displaying a first static image based on the rendered multiple components; the first static image being used to display first resource content corresponding to the first static widget.
[0075] It can be seen that a static widget can correspond to multiple components. In the embodiment of the present application, multiple components can 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 can be replaced by a static image, and the static image can be used to display the resource content corresponding to the static widget. Then, the static image can be displayed in the static widget. In this way, on the basis of ensuring the normal display of the static widget, it is possible to avoid continuously running and refreshing the multiple components corresponding to the static widget. It is only necessary to display the static image, which reduces the memory usage of the widget and reduces the power consumption of the electronic device.
[0076] In some examples, a static widget may include a widget that provides one or more links. Each link may be associated with a single interface of the application corresponding to the widget. Multiple links may be associated with multiple interfaces; these multiple interfaces may be different interfaces of different applications, and this is not a limitation of the present invention.
[0077] The widget display method provided in the embodiments of the present application can be applied to electronic devices. In some embodiments, the electronic devices may include, for example, mobile phones, tablet computers, smart screens, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, and smart cars, etc. The embodiments of the present application do not impose any particular restrictions on the specific form of the electronic devices.
[0078] The operating system installed on the electronic device includes but is not limited to This application does not limit the specific type of electronic device and the type of operating system when an operating system is installed.
[0079] For example, taking the electronic device as a mobile phone as an example, FIG2 shows a schematic structural diagram of the mobile phone 100 .
[0080] 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 can 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.
[0081] It should be understood that the illustrated structure of 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, or some components may be combined or separated, or arranged differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0082] 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 processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0083] 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.
[0084] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0085] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0086] 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.
[0087] Mobile phone 100 implements display functionality through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0088] 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 data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0089] 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.
[0090] The mobile phone 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0091] Keys 190 include a power button, a volume button, etc. Keys 190 may be mechanical keys or touch keys. Mobile phone 100 may receive key inputs and generate key signal inputs related to user settings and function control of mobile phone 100.
[0092] 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.
[0093] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0094] In some embodiments of the present application, the display screen 194 is used to display images, videos, and widgets. 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), a MiniLED, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In addition, the mobile phone 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0095] FIG3 is a block diagram of the software structure of the mobile phone 100 according to an embodiment of the present application.
[0096] The software system of the mobile phone 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the mobile phone 100.
[0097] FIG3 is a block diagram of the software structure of the mobile phone 100 according to an embodiment of the present invention.
[0098] 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.
[0099] The application layer can include a series of application packages.
[0100] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, WLAN, music, short message, first application, and second application.
[0101] 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.
[0102] 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 the layout corresponding to the widget and the update capability of the widget data.
[0103] 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.
[0104] 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.
[0105] In some examples, the desktop application can display one or more display interfaces as the desktop of the mobile phone 100. The desktop application can display application icons, folders, weather widgets, clock widgets, etc. in the display interface. Of course, the desktop application can also hide the above widgets. For example, when the weather widget displays a preset time, the desktop application can automatically hide the widget.
[0106] 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, etc. Of course, the above notification information can also be presented in the form of widgets in the negative one screen. 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 display the negative one screen on the mobile phone 100.
[0107] In some examples, the widget may have different sizes, such as 1×1, 2×2, or 2×4.
[0108] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0109] As shown in FIG3 , 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, and a unified rendering service, etc.
[0110] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0111] 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.
[0112] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0113] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0114] In some embodiments of the present application, the widget management service is used to provide widget lifecycle management capabilities and data caching capabilities. 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 can render the multiple components.
[0115] The unified rendering service is used to render multiple components according to component information corresponding to the multiple components.
[0116] The runtime includes the core library and the virtual machine. The runtime is responsible for scheduling and management of the Android system.
[0117] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0118] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0119] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0120] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0121] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0122] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0123] A 2D graphics engine is a drawing engine for 2D drawings.
[0124] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0125] The following embodiments will be combined with the accompanying drawings, and continue to use the electronic device as an example of a mobile phone having the structure shown in Figure 2 to illustrate the widget display method provided by the embodiment of the present application. Referring to Figure 4, the method may include:
[0126] S401. A mobile phone receives a first trigger operation from a user. The first trigger operation is used to add a first static widget. The first static widget corresponds to multiple components.
[0127] 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.
[0128] 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 plays.
[0129] 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 over time.
[0130] For example, a weather widget may correspond to a weather component (such as "sunny 23℃") and an image component (such as an image of the sun) between the Nth update and the N+1th update, and the display content and display effects corresponding to the weather component and the image component will not change over time.
[0131] For another example, a time widget is updated every minute. From the time of the Nth update (e.g., 10:10) to the time of the N+1th update (e.g., 10:11), the time widget may correspond to a time component (e.g., "10:10") and an image component (e.g., an image corresponding to a clock). The display content and display effects of the time component and the image component do not change over time.
[0132] In some embodiments of the present application, the mobile phone may receive a first trigger operation from the user, where the first trigger operation may represent an operation for adding a first static widget.
[0133] In one implementation, 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.
[0134] In some examples, the first static widget is used to implement a target function and / or display the first resource content. The first static widget may correspond to multiple components. Components may include one or more of a layout component, a basic component, or an extended component provided by the mobile phone app. Basic components include at least one of a text component, a date component, an image component, and a table component. Extended components include at least one of an attachment component, an address component, and a signature component. Furthermore, embodiments of the present application may also include other types of components, which are not listed in detail in the embodiments of the present application.
[0135] Furthermore, the APPs on the mobile phone may include system APPs, third-party APPs, etc. The specific functions and displayed resource content of the first static widget may be preset, or may be adjusted or set according to user needs.
[0136] In some embodiments of the present application, the mobile phone may provide the user with access to multiple widget display functions, and the user may enable the mobile phone to display the first static widget in multiple ways.
[0137] For example, in some possible scenarios, referring to (A) in FIG5 , a user may perform input operations on the screen of a mobile phone, such as long pressing, clicking, double-clicking, and sliding on a blank area or a non-functional area on the screen. The mobile phone may respond to the user's input operation by displaying a function page such as (B) in FIG5 . The function interface may include function controls corresponding to the wallpaper function, the widget function, the layout function, the transition effect function, and the desktop settings function.
[0138] 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 by displaying a widget details page such as (C) in Figure 5. The widget details page includes application icons corresponding to the applications installed in the mobile phone. For example, application icons corresponding to information applications, application icons corresponding to music applications, application icons corresponding to weather applications, application icons corresponding to theme applications, 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 a widget addition page such as (D) in Figure 5. The widget addition page includes at least one static widget corresponding to the weather application.
[0139] The user can select any one of the at least one static widgets 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 user's first trigger operation, triggering a subsequent process of adding the first static widget.
[0140] As another example, in some possible scenarios, a user may input a first voice control command into the phone, such as "Xiaoyi Xiaoyi, I want to add a weather widget," "Xiaoyi Xiaoyi, I want to add a weather widget," etc. The phone then responds to the first voice control command by displaying the widget addition page shown in (D) of FIG. 5 . The user may then input a second voice control command into the phone, such as "Xiaoyi Xiaoyi, I want to add the first weather widget," and the phone responds to the second voice control command, triggering the subsequent process of adding the first static widget.
[0141] In some examples, the voice control instruction input by the user can be regarded as the first triggering operation.
[0142] It should be noted that the above-mentioned first triggering operation may include one or more of long pressing, clicking, dragging, moving, sliding, and voice operation. The mobile phone can provide users with multiple ways to add the first static widget, which also allows users to have a better user experience. The embodiment of the present application does not limit the specific implementation method of adding the first static widget.
[0143] In some embodiments of the present application, the first trigger operation can also be used to add a widget. The mobile device receives the user's first trigger operation, 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.
[0144] Exemplarily, the mobile phone can determine whether the widget added by the first trigger operation is a static widget based on the widget type. Furthermore, the mobile phone can determine whether the widget added by the first trigger operation is a static widget based on the widget content. If the displayed content in the widget is all static content, the added widget can be determined to be a static widget. Furthermore, the mobile phone can determine whether the widget added by the first trigger operation is a static widget based on the widget component type. If the widget component types are all text components, the added widget can be determined to be a static widget.
[0145] 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.
[0146] In some embodiments of the present application, a mobile phone may, in response to a first trigger operation, obtain first component information of multiple components corresponding to a first static widget. The mobile phone may then render the multiple components based on the first component information. Furthermore, based on the rendered multiple components, a first static image is generated, where the first static image is used to display the first resource content corresponding to the multiple components.
[0147] Specifically, referring to Figure 6 , in response to a first trigger operation, the desktop application on the mobile phone sends an add request to the widget management service. The add request is used to add a 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 first component information of multiple components corresponding to the first static widget. Upon receiving the get request, the widget provider application sends the first component information of multiple components corresponding to the first static widget to the widget management service.
[0148] For example, taking the first static widget as a weather widget as an example, the first component information corresponding to the multiple components of the weather widget may include layout information and resource information of the components.
[0149] 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; resource information may include, but is not limited to, location information, weather information, and time information. It is understood that resource information may be implemented in the form of text and / or images, and may be real-time or historical information.
[0150] 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.
[0151] In some examples, the resource information in the component information can be local resources from the phone, such as photos in the local gallery, text in the memo, etc., or network resources obtained by the phone from a server, such as real-time weather information, real-time location information, and real-time time information. In addition, the resource information can be resources provided by the phone's system apps or resources provided by third-party apps on the phone.
[0152] In some implementations, 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.
[0153] In some examples, while obtaining the first component information, the widget management service can also launch a widget rendering service and send the first component information of multiple components to the widget rendering service. The widget rendering service can create a widget thread, which can serve as a runtime thread. Based on this widget thread, the first component information of multiple components and the first rendering request can be sent to the unified rendering service, so that the unified rendering service performs subsequent rendering tasks for the widget content.
[0154] 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.
[0155] 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, a system service. In other words, the rendering process of the first static widget is implemented by the unified rendering service.
[0156] In some embodiments of the present application, components have certain connections. Components can be stacked. For example, a text component can be displayed on an image component. Components can also be connected. For example, a text component can be connected to the bottom of an image component. In embodiments of the present application, each component can be treated as a rendering node, and a tree-structured data model generated based on the connection relationships between the components can be used to implement the rendering process of the entire first static widget.
[0157] In some examples, as shown in FIG7 , a unified rendering service renders multiple components based on the widget render 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.
[0158] For example, continuing to use 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 image component and the weather image content corresponding to the first image component, such as an image corresponding to "Cloudy to Sunny".
[0159] In some examples, the unified rendering service can convert multiple rendered components in the widget render tree into a first static image. Specifically, the multiple rendered components are saved as the first static image. The static image can display the first resource content corresponding to the components. For example, the first static image can include weather text content, location text content, time text content, temperature text content, and weather image content.
[0160] In 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 of 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 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 multiple components to the widget rendering service. After receiving the layout information of multiple components, the widget rendering service can load the resource information of the first component information corresponding to 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 multiple components to the unified rendering service, so that the unified rendering service performs the subsequent rendering tasks of the widget content.
[0161] 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.
[0162] It can be seen that in the embodiment of the present application, the rendered multiple components are converted into a static image based on 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 need to display the first static image, thereby reducing the memory usage of the widget and reducing the power consumption of the electronic device.
[0163] S403: The mobile phone displays a first static image.
[0164] In some embodiments of the present application, the mobile phone may display the first static image after generating the first static image.
[0165] Referring to 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 it to the desktop application. The desktop application can use the first static image to replace the first static widget to display the resource content required by the first static widget.
[0166] That is, in the embodiment of the present application, the first static image can be displayed in the first static widget. The first static widget can be equivalent to an image component, and the resource content corresponding to the image component is the first static image.
[0167] As can be seen, in the embodiment of the present application, only the first static image is displayed during the display of the first static widget. Compared to related technologies, this not only ensures that the widget content corresponding to the first static widget is fully displayed to the user, but also eliminates the need to continuously run and refresh the numerous components in the first static widget. This reduces the power consumption of the static widget and the overall power consumption of the electronic device, improving the user experience.
[0168] In some embodiments of the present application, when a mobile phone displays a first static widget, the mobile phone displays the first static widget in a predetermined area of the entire screen interface. Thus, after rendering the first static widget, the mobile phone needs to render the target interface, thereby displaying the first static image in the target interface.
[0169] Specifically, the mobile phone can add the first static image to the widget information corresponding to the first static widget. Furthermore, the mobile phone can render the first static widget based on the widget information and generate an interface rendering tree corresponding to the first static widget. The interface rendering tree includes a target node, which corresponds to the first static widget. The mobile phone can also render a target interface based on the interface rendering tree and display the target interface corresponding to the first static widget.
[0170] 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.
[0171] It is understood that the interface rendering tree corresponding to the first static widget may also include at least one rendering node. One 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 content to be displayed in the target interface.
[0172] For example, referring to Figure 9, after the desktop application uses the first static image as the first resource content to be displayed by the first static widget, it sends a second rendering request and widget information to the unified rendering service. The second rendering request is used to render the target interface, and the widget information includes the layout information corresponding to the first static widget and the first static image. The unified rendering service generates an interface rendering tree corresponding to the target interface based on the second rendering request and the widget information. Then, the unified rendering service renders and displays the target interface based on the interface rendering tree, and the target interface includes the first static widget.
[0173] That is, 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.
[0174] In some embodiments of the present application, the mobile phone may further destroy the runtime thread of the first static widget.
[0175] Specifically, during the process of receiving the first static image, the widget management service may also send a destruction request to the widget rendering service, where the destruction request is used to destroy the runtime thread in the widget rendering service. The widget rendering service destroys the runtime thread in accordance with 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 this application do not specifically limit the implementation time and implementation method of destroying the runtime thread.
[0176] That is, during the process of generating and displaying a static widget, each static widget corresponds to a runtime thread. This runtime thread can be created by the electronic device in response to a user's operation. After the runtime thread corresponding to a static widget completes its corresponding task, the runtime thread corresponding to the static widget can be destroyed to avoid occupying the electronic device's operating resources.
[0177] 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 component 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. That is to say, when the user inputs a preset operation to the location area corresponding to the interactive control in the first static widget, it can trigger the first static widget to execute the corresponding service or trigger a jump to the corresponding service interface.
[0178] Since 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 embodiment of the present application can configure the interactive area information corresponding to the first static image based on the area information of the interactive component and the service link information.
[0179] In some examples, the interaction area information is used to represent an area position corresponding to at least one interaction response area in the first static image and a service link corresponding to the at least one interaction response area.
[0180] In other words, the embodiment of the present application can configure one or more corresponding responsive interaction areas in the first static image based on the area information and service link information of the interactive component, and each responsive 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 a jump to the corresponding service interface.
[0181] For example, referring to FIG10 , the first static widget is taken as the navigation widget 1001 corresponding to the navigation application. 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 has corresponding interactive controls 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 based on 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.
[0182] 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.
[0183] Specifically, the mobile phone may receive a second triggering operation for the first static image and, in response to the second triggering operation, determine a triggering area corresponding to the second triggering operation. The mobile phone may then determine that the triggering area is an interactive response area and execute a corresponding service according to a service link corresponding to the interactive response area.
[0184] 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.
[0185] For example, referring to FIG11(A), the mobile phone receives a user 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. If 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, as shown in FIG11(B).
[0186] 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 rotates in a clockwise or counterclockwise direction. In another exemplary embodiment, the first static widget can be switched to a highlight dynamic display, that is, the first static image cyclically changes from expansion to contraction and from contraction to expansion. In another exemplary embodiment, the first static widget can be switched to a tilt dynamic display, that is, the first static image tilts in the horizontal direction and / or vertical direction within a preset angle.
[0187] Specifically, when the mobile phone executes the corresponding service according to the service link corresponding to the interactive response area, the display state of the first static image can be switched from a first display state to a 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 can include a tilted display state, a rotated display state, a highlighted display state, etc.
[0188] For example, the mobile phone receives a user click operation on a blank area of 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.
[0189] 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.
[0190] In some embodiments of the present application, a click event in response to user input can be triggered by the first static image based on the configured interactive area information. In other words, the internal code of the first static widget does not support onClick customization, meaning that events do not occur when an object is clicked. Jump links, etc., must be executed based on the configured interactive area information.
[0191] The methods provided in the various embodiments of the present application can call a 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 interactive functions. Based on this, for the first static image displayed on a desktop application, a negative one-screen application, etc., the user can interact by clicking, double-clicking, etc., and implement the corresponding functions through the service link. For example, the target application programming interface may include a Link interface.
[0192] In one achievable manner, the corresponding partial code content in the first static widget is as follows:
[0193] It should be noted that in the embodiments 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 can uniquely identify any information of each event, and the event type can be an event such as a click or a long press. For example, a click operation on the first area of the first static image and a click operation on the second area of 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 specific user.
[0194] As can be seen, the embodiment of the present application can configure interactive area information for the first static image in the first static widget, which can give the resource content certain interactive functions while ensuring that the first static widget displays the complete resource content. Furthermore, it can enable static images to implement some interactive functions, improving the user experience. At the same time, it also provides more user-friendly interactive functions, such as changing the display state of the first static image. While improving playability, it can also enhance the interactivity between users and electronic devices.
[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 meeting the update condition, the mobile phone renders the multiple components. The mobile phone may generate a second static image based on the rendered multiple components; the second static image is used to display the second resource content corresponding to the multiple components. The mobile phone may also display the second static image. The second static image is an updated version of 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 a scheduled 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. Based on the latest add request, the widget management service continues to send the latest get request to the widget provider application. The latest get request requests the second component information of the multiple components. Based on the latest get request, the widget provider application sends the second component information of the multiple components to the widget management service. The widget management service sends the second component information of the multiple components to the widget rendering service. The widget rendering service recreates the runtime thread to facilitate the subsequent rendering of the latest static widget. The widget rendering service sends the second component information of the multiple components and the latest first rendering request to the unified rendering service. The unified rendering service renders the latest multiple components based on the second component information and the latest first rendering request. Based on the rendered latest multiple components, a second static image is generated. 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, causing the desktop application to control the display screen to display the second static image. The display screen can then display the second static image.
[0199] As can be seen, during the update of the first static widget, the embodiment of the present application still generates and displays an updated static image based on the rendered multiple components. That is, the rendered multiple components 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 the series of components in the static widget, which reduces the widget's memory usage and reduces the power consumption of the electronic device.
[0200] In some embodiments, multiple embodiments of the present application may be combined and the combined embodiments may be implemented. Optionally, some operations in the processes of the various method embodiments 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 merely exemplary and does not constitute a limitation on the execution order between the steps. Other execution orders may also be used between the steps. This is not intended to indicate that the execution order is the only order in which these operations may be performed.
[0201] Those skilled in the art will appreciate various ways to reorder the operations described in the embodiments of the present application. In addition, it should be noted that the process details involved in a certain embodiment of the present application are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0202] Furthermore, some steps in the method embodiments may be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiments.
[0203] Furthermore, the various method embodiments may be implemented separately or in combination.
[0204] An embodiment of the present application also provides an electronic device, such as the above-mentioned mobile phone. As shown in FIG12 , 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 to transmit data to other devices. The memory 1920 stores computer program code. The computer program code includes 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] The processor 1910 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the 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] Bus 1940 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Bus 1940 can be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, FIG12 shows only one thick line, 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 from 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 get request to the widget provider application based on the add request, where the get request is used to request to obtain 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 based on the get request; the widget management service is further configured to send the first component information of the multiple components to the widget rendering service; the widget rendering service is configured to send the first component information of the multiple components and a first rendering request to the unified rendering service; the unified rendering service is configured to render the multiple components based on the first component information of the multiple components and the first rendering request; the unified rendering service is further configured to generate a first static image based on the rendered multiple components; the first static image is used to display first resource content corresponding to the first static widget; the unified rendering service is further configured to send the first static image to the desktop application; the desktop application is further configured to display the first static image.
[0211] 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 multiple components; the interactive area information is used to represent the area position corresponding to at least one interactive response area in the first static image and the service link corresponding to at least one interactive response area.
[0212] An embodiment of the present application also provides an electronic device, which includes: a memory, a camera and a display screen, the camera includes a processor, the memory and the display screen are coupled to the processor, the display screen is used to display 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.
[0213] An embodiment of the present application further provides a computer-readable storage medium, in which computer program code is stored. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiment.
[0214] An embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the relevant method steps in the above method embodiment.
[0215] 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, and when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0216] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0217] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, 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 provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.
[0218] Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central 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.
[0219] 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.
[0220] 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.
[0221] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0222] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, located in one place or distributed across multiple locations. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0223] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0224] 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 contributing part or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0225] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. 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
Patent Citations
Widget display method and electronic equipment
CN119440352A
Widget loading method and device, equipment and storage medium
CN115309470A
Rendering method and electronic equipment
CN115686700A
Widget component processing method and device, equipment, storage medium and program product
CN115801777A
Widget display method and electronic equipment
CN118244950A