Display method and apparatus

Through the inter-process communication mechanism and the method of storing view data in the cache area, the problem of poor display of application components in the prior art is solved, the normal display and function provision of application components are realized, and the user experience is improved.

WO2024222550A9PCT designated stage expired Publication Date: 2025-02-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/088355
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-26
Filing Date
2024-04-17
Publication Date
2025-02-20

AI Technical Summary

Technical Problem

The prior art is difficult to effectively display application components, resulting in poor user experience and the application components cannot display normally or provide the functions required by design.

Method used

Through the inter-process communication mechanism, the user of the application component notifies the provider of the application component to perform rendering of the application component, use the provider's permissions and controls to render the application component, and store the view data of the application component through the cache area.

Benefits of technology

It realizes the normal display and function provision of application components, improves user experience, and reduces system resource overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024088355_20022025_PF_FP_ABST
    Figure CN2024088355_20022025_PF_FP_ABST
Patent Text Reader

Abstract

A display method and apparatus, which are applied to the technical field of communications. The method comprises: when an electronic device (e.g., a host application program of an application component in the electronic device) determines a request for adding a first application component, the electronic device notifying a first application program to render a view of the first application component, wherein the first application component is associated with the first application program; and generating a first page, wherein the first page comprises the view of the first application component. An application component is rendered by a provider application program of the application component, such that the problem of a display effect or a provided service or provided information failing to meet design requirements due to an application component being rendered by a host application program of the application component can be avoided, and thus the application component can be better displayed, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Display method and device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on April 26, 2023, with application number 202310481374.9 and application name “A Display Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of communication technology, and in particular to a display method and device. Background Art

[0004] With the development of intelligent terminal devices, the terminal interface can display not only application icons but also application components, such as service cards (cards) and widgets (Widgets). Compared with application icons, application components not only provide users with access to applications but also display information provided by the applications.

[0005] How to better display application components to make them more attractive to users and improve user experience is a problem that needs to be solved at present.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a display method and apparatus for better displaying application components.

[0008] In a first aspect, a display method is provided. The method can be applied to an electronic device and can be specifically performed by a host application of an application component in the electronic device. In this method, if it is determined that a first application component needs to be added, the first application is notified to render a view of the first application component to generate a first page, which includes the view of the first application component. The first application component is associated with the first application.

[0009] In one possible scenario, the host application of the first application component receives a request to add the first application component. For example, when the electronic device detects a first user operation for requesting to create the first application component, it means that the electronic device receives a request to add the first application component. In response to the request, the host application of the first application component notifies the first application to render the view of the first application component. For example, the host application can notify the first application to render the view of the first application component based on an inter-process communication (IPC) mechanism. In another possible scenario, taking the host application as a desktop application as an example, when the electronic device is started, it can determine that the first application component has been added to the page based on the relevant information of the saved desktop application page, so that it can determine that the first application component needs to be added to the page when the page is loaded or preloaded.

[0010] In the above implementation, the rendering operation of the application component is implemented by the application that provides the application component (such as the above-mentioned first application). In this way, the first application can render the application component based on the permissions obtained by the application and / or the controls supported by the application. Compared with rendering the application component by the user application of the application component (such as the host application of the above-mentioned first application component), it can avoid problems such as the application component being unable to display normally or unable to provide the design required functions due to limited permissions and / or limited supported controls of the host application.

[0011] In a possible implementation, data of the view of the first application component is stored in a first cache area; and the view of the first application component included in the first page is generated based on the data stored in the first cache area.

[0012] In one possible implementation, the first cache area is a cache area shared by a host application of the first application component and the first application, and the first page is a page of the host application. Notifying the first application to render the view of the first application component and generating the first page includes: the host application notifying the first application to render the view of the first application component; and the host application generating the first page.

[0013] One possible implementation further includes: providing a view container on the first page, the view container being used to display the view of the first application component; and associating the first cache area with the view container. By associating the first cache area with the view container, the host application of the application component can display the view of the first application component based on the data in the first cache area based on the association.

[0014] In a possible implementation, associating the first cache area with the view container includes associating an address (such as a virtual address) of the first cache area with the view container.

[0015] In one possible implementation, the first cache area is allocated by request of the first application; or, the first cache area is allocated by request of the host application of the first application component; or, the first cache area is allocated by request of the application component management service. In the above implementations, the allocation of the first cache area by the first application requesting the allocation of the first cache area can reduce the step of the host application of the first application component or the application component management service notifying the first application of the address information of the first cache area, compared to the allocation of the first cache area by the host application of the first application component or the application component management service, thereby reducing system resource overhead.

[0016] In one possible implementation, notifying the first application to render the view of the first application component includes: the host application of the first application component sending first information to the first application, where the first information is used to notify the first application to render the view of the first application component. Optionally, the first information may include an identifier or name of the first application component. Since the identifier or name of the application component can distinguish the style of the application component, the first application can render the first application component with the corresponding style.

[0017] A possible implementation further includes: the host application of the first application component receives first event information, the first event information is used to indicate that the host application of the first application component switches to background operation or the first application component is blocked; the host application responds to the first event information and notifies the first application to stop rendering the view of the first application component. Optionally, the first event may include a screen off event, or an event of a change in the physical state of the foldable display (such as an event of a change to a closed state). This implementation can reduce system resource overhead and reduce power consumption of electronic devices.

[0018] In one possible implementation, the host application of the first application component receives a second event message indicating that the host application of the first application component has switched to the foreground or that the first application component's obstruction has been eliminated. In response to the second event message, the host application notifies the first application component to resume rendering the view of the first application component. Optionally, the second event may include a screen-on event or an event indicating a change in the physical state of the foldable display (e.g., an event indicating a change to the unfolded state).

[0019] One possible implementation further includes: determining to add a second application component, wherein the second application component is associated with the first application; and generating a second page, wherein the second page includes a view of the second application component generated based on the data stored in the first cache. Optionally, the second application component provides the same services as the first application component, and the second application component has the same style as the first application component.

[0020] Optionally, the second page is different from the first page, or the second page is the same as the first page. Optionally, if the first page is the same as the second page, the position of the view of the first application component is different from the position of the view of the second application component.

[0021] In the above implementation, when adding multiple application components to the same application, the multiple application components can share a cache area for storing the view data of the application components, thereby reducing the cache overhead. Furthermore, the overhead of the first host application notifying the first application can be saved, thereby reducing the system resource overhead and improving the processing performance of the electronic device.

[0022] A possible implementation also includes: receiving a request to delete the second application component, and deleting the second application component in the second page in response to the request to delete the second application component; receiving a request to delete the first application component, and in response to the request to delete the first application component, notifying the first application to stop rendering the view of the first application component, deleting the first application component in the first page, and performing the following operations: notifying the first application to release the first cache area; or, releasing the first cache area; or, notifying the application component management service to release the first cache area.

[0023] In a second aspect, a display method is provided, which can be applied to electronic devices, and specifically can be executed by a host application of an application component in the electronic device. The method includes: determining to add a first application component, the first application component is associated with a first application; rendering a view of the first application component, the data of the view of the first application component is stored in a first cache area; generating a first page, the first page including a view of the first application component generated based on the data stored in the first cache area. Determining to add a second application component, the second application component is associated with the first application; generating a second page, the second page including a view of the second application component generated based on the data stored in the first cache area. Optionally, the service provided by the second application component is the same as the service provided by the first application component, and the style of the second application component is the same as the style of the first application component.

[0024] In the above implementation, when application components are added multiple times to an application, the multiple application components can share one cache area, or the view data of the multiple application components all come from one cache area, thereby saving storage overhead of the electronic device.

[0025] In one possible implementation, the method further includes: the host application of the first application component sets a first view container in the first page, and the first view container is used to display the view of the first application component; the first cache area is associated with the first view container; the host application of the second application component sets a second view container in the second page, and the second view container is used to display the view of the second application component; and the first cache area is associated with the second view container.

[0026] In one possible implementation, associating the first cache area with the first view container includes associating the address of the first cache area with the first view container; associating the first cache area with the second view container includes associating the address of the first cache area with the second view container.

[0027] A possible implementation method also includes: receiving a request to delete the second application component, and deleting the second application component in the second page in response to the request to delete the second application component; receiving a request to delete the first application component; in response to the request to delete the first application component, stopping rendering the view of the first application component, deleting the first application component in the first page, and performing the following operations: releasing the first cache area, or notifying the component management service to release the first cache area.

[0028] In a third aspect, a device is provided, which includes a unit or module for executing the method as described in any one of the first aspects above, or includes a unit or module for executing the method as described in any one of the second aspects above.

[0029] In a fourth aspect, a device is provided that can implement any of the methods described in the first aspect. The device may include: a processing unit, and further may include a transceiver unit coupled to the processing unit. The processing unit is configured to determine to add a first application component, the first application component being associated with a first application; notify the first application to render a view of the first application component; and generate a first page, the first page including the view of the first application component.

[0030] In a possible implementation, data of the view of the first application component is stored in a first cache area; and the view of the first application component included in the first page is generated based on the data stored in the first cache area.

[0031] In one possible implementation, the first cache area is a cache area shared by a host application of the first application component and the first application, and the first page is a page of the host application. The processing unit notifies the first application via the transceiver unit to render a view of the first application component; and the host application generates the first page.

[0032] In a possible implementation, the processing unit is further configured to: set a view container in the first page, the view container being configured to display a view of the first application component; and associate the first cache area with the view container.

[0033] In a possible implementation manner, the processing unit is specifically configured to: associate the address of the first cache area with the view container.

[0034] In one possible implementation, the first cache area is allocated by request of the first application; or, the first cache area is allocated by request of the host application of the first application component; or, the first cache area is allocated by request of the application component management service.

[0035] In one possible implementation, the processing unit is specifically configured to: send first information to the first application via the transceiver unit, where the first information is used to notify the first application to render a view of the first application component. Optionally, the first information may include an identifier or name of the first application component. Since the identifier or name of the application component can distinguish styles, the first application can render the first application component in a corresponding style.

[0036] In one possible implementation, the transceiver unit is further used to: receive first event information, where the first event information is used to indicate that the host application of the first application component switches to background operation or the first application component is blocked; the processing unit is further used to: respond to the first event information, notify the first application to stop rendering the view of the first application component.

[0037] In one possible implementation, the transceiver unit is further used to: receive second event information, where the second event information is used to indicate that the host application of the first application component switches to the foreground or the occlusion of the first application component is eliminated; the processing unit is further used to: respond to the second event information, notify the first application to resume rendering the view of the first application component.

[0038] In one possible implementation, the processing unit is also used to: determine to add a second application component, the second application component is associated with the first application; the processing unit is also used to: generate a second page, the second page includes a view of the second application component generated based on the data stored in the first cache area.

[0039] In one possible implementation, the transceiver unit is further used to: receive a request to delete the second application component; the processing unit is further used to: delete the second application component in the second page in response to the request to delete the second application component; the transceiver unit is further used to: receive a request to delete the first application component; the processing unit is further used to: in response to the request to delete the first application component, notify the first application to stop rendering the view of the first application component, delete the first application component in the first page, and perform the following operations: notify the first application to release the first cache area; or, release the first cache area; or, notify the application component management service to release the first cache area.

[0040] In a fifth aspect, a device is provided, which can implement any method described in the second aspect. It includes: a processing unit, and further may include a transceiver unit coupled to the processing unit. The processing unit is used to determine to add a first application component, the first application component is associated with the first application; and, to determine to add a second application component, the second application component is associated with the first application; the processing unit is used to render the view of the first application component, the data of the view of the first application component is stored in the first cache area, generate a first page, the first page includes the view of the first application component generated according to the data stored in the first cache area; and, generate a second page, the second page includes the view of the second application component generated according to the data stored in the first cache area. Optionally, the service provided by the second application component is the same as the service provided by the first application component, and the style of the second application component is the same as the style of the first application component.

[0041] In one possible implementation, the processing unit is further used to: set a first view container in the first page, the first view container being used to display the view of the first application component; associating the first cache area with the first view container; setting a second view container in the second page, the second view container being used to display the view of the second application component; and associating the first cache area with the second view container.

[0042] In a possible implementation, the processing unit is specifically configured to: associate the address of the first cache area with the first view container; and associate the address of the first cache area with the second view container.

[0043] In one possible implementation, the transceiver unit is further configured to receive a request to delete the second application component; and the processing unit is further configured to, in response to the request to delete the second application component, delete the second application component from the second page. The transceiver unit is further configured to receive a request to delete the first application component; and the processing unit is further configured to, in response to the request to delete the first application component, stop rendering the view of the first application component, delete the first application component from the first page, and perform the following operations: release the first cache area, or notify the component management service to release the first cache area.

[0044] In the sixth aspect, a device is provided, comprising: one or more processors, and one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the device to perform the method as described in any one of the first aspects above, or to perform the method as described in any one of the second aspects above.

[0045] In the seventh aspect, a readable storage medium is provided, comprising a computer program, which, when executed on a device, enables the device to execute a method as described in any one of the first aspects above, or to execute a method as described in any one of the second aspects above.

[0046] In an eighth aspect, a computer program product is provided, which, when executed on a device, enables the device to execute the method described in any one of the first aspects above, or to execute the method described in any one of the second aspects above.

[0047] In the ninth aspect, a chip system is provided, comprising: a processor; when the processor calls and runs a computer program from a memory, the device on which the chip system is installed executes a method as described in any one of the first aspects above, or executes a method as described in any one of the second aspects above. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] FIG1 is an example diagram of a music player card displayed on the desktop of a mobile phone in an embodiment of the present application;

[0049] FIG2 is a schematic diagram of an architecture for implementing application component functions applicable to an embodiment of the present application;

[0050] FIG3 is a schematic diagram of cards on various electronic devices according to an embodiment of the present application;

[0051] FIG4 is a schematic diagram of the hardware structure of a possible electronic device in an embodiment of the present application;

[0052] FIG5 is a block diagram of a software system architecture of an electronic device provided in an embodiment of the present application;

[0053] FIG6 a is a schematic diagram of a possible card creation process in an embodiment of the present application;

[0054] FIG6 b is a schematic diagram of another possible card creation process in an embodiment of the present application;

[0055] FIG6 c is a schematic diagram of a possible card deletion process in an embodiment of the present application;

[0056] FIG7a is a schematic diagram of an application component creation principle provided by an embodiment of the present application;

[0057] FIG7 b is a schematic diagram of another application component creation principle provided by an embodiment of the present application;

[0058] FIG8 is a schematic diagram of a flow chart of a display method provided in an embodiment of the present application;

[0059] FIG9 is a schematic diagram of an interactive process of a display method provided in an embodiment of the present application;

[0060] FIG10 is a flow chart of another display method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0062] First, the application components involved in the embodiments of the present application are introduced.

[0063] Application components include but are not limited to service cards (also referred to as cards for short), desktop widgets (or desktop widgets, such as Widgets) and other desktop elements. Among them, cards or widgets are a form of service that can provide a more fine-grained atomic service capability than applications (Apps), and directly present the services or content that users care about most to users in the form of interactive cards. Cards can provide entrances to one or more shortcut functions so that users can easily trigger specific functions included in the application. Cards can also track changes in services or card content over time to display the latest services or content. For example, the card corresponding to the weather application can display real-time weather information, and the card corresponding to the calendar application can display the current date and time (such as hours, minutes, and seconds). Cards can be embedded in various applications or interactive scenarios to better meet user needs. Users can jump to the corresponding application or a service page within the application by clicking on a card, reducing the difficulty of operation.

[0064] In order to understand the cards more intuitively, Figure 1 takes the music player on the mobile phone as an example, and exemplifies an example diagram of a music player card displayed on the desktop of the mobile phone. The desktop of the mobile phone can be divided into a navigation point display area (which can be referred to as the "navigation point area"), a dock bar display area, a status bar display area, and a workspace display area as shown in Figure 1. Among them, the dock bar can include icons of some commonly used applications, such as a camera icon, an address book icon, a phone icon, and a message icon. The application icons included in the dock bar can be set accordingly according to the needs of the user. The navigation point area is used to indicate the desktop page currently displayed on the desktop of the mobile phone, including the number of desktop pages, etc. The workspace display area may also be referred to as the "main viewing area" in the various embodiments of the present application. The main viewing area can be used as the desktop workspace of the mobile phone to display a variety of desktop elements, such as application icons, application folders, shortcuts, and application components. As shown in Figure 1, the desktop of the mobile phone includes card 1 corresponding to the song playing service in the music player 1 application. Card 1 may include a "start / pause playback" control, a "play next song" control, a "play previous song" control, the song's "album cover" element, the song's "song name" and "singer" element and other data.

[0065] The primary viewport is typically divided into grids, such as 4×6, 5×5, or 5×6 grids (where 4×6 means there are 4 grids horizontally and 6 grids vertically on a desktop page, and the same applies to other grid divisions). Different desktop elements can occupy different numbers of grids. For example, application icons and application shortcuts can occupy a 1×1 grid, application folders can occupy a 1×1 grid, or a larger number of grids, such as 2×1 or 2×2, and card-type application components can occupy a 2×2 or 2×4 grid.

[0066] Taking cards as an example, an application can provide one or more cards. Different cards in the multiple cards provided by an application have different styles. The style of a card refers to the elements displayed on the card (such as controls, pictures or text, etc.) and the layout of the elements, and / or the shape and / or size of the card. Cards of different styles may differ in size, shape, etc., or different cards may contain different controls and / or display different content to provide different services, thereby meeting the different needs of users. If a card has multiple styles, users can choose the style they need or like. It will be understood that the number of grids occupied by the card can be determined based on the card style selected by the user.

[0067] Optionally, you can use an identifier (ID) or name to distinguish the styles of application components. For example, a first application component is added to the desktop, and a second application component is added to the negative one screen. Both the first application component and the second application component are associated with the first application, and the ID of the first application component is the same as the ID of the second application component, which indicates that the first application component and the second application component have the same style.

[0068] It is understandable that in actual scenarios, the desktop of the electronic device may also include other information displayed as needed, and the embodiments of the present application do not limit the specific information displayed on the electronic device.

[0069] Figure 2 illustrates an exemplary architecture for implementing application component functionality. As shown in Figure 2, this architecture includes application component users, application component management services, and application component providers. The application component generation process is achieved through the collaborative operation of these three components. These three components are described below.

[0070] (1) Application component users

[0071] An application component consumer is the host application that displays the application component's content and controls the placement of the application component within the host. For example, an application component consumer can be a desktop application (such as the Android launcher), a lock screen application, or a negative screen application. For example, on a mobile phone, a launcher can be used to display an application component on the phone's desktop.

[0072] (2) Application Component Management Service

[0073] The application component management service is a resident agent service in the system that implements management functions for application components. For example, it can include the management and use of application component objects, periodic refresh of application components, etc. Optionally, the application component management service may include but is not limited to the following modules:

[0074] Refresh module: After adding an application component, it starts a scheduled task based on the component's refresh policy to periodically trigger the refresh of the application component. For example, the application component corresponding to a calendar application can be updated daily to display the latest date information.

[0075] Cache module: used to cache the view data of the application component after it is added to the application component management service, so that the cached view data of the application component can be directly returned the next time the application component is obtained to reduce latency.

[0076] Lifecycle Management: When an application component (or its host application) switches to the background or is obscured, the refresh of the application component can be suspended. Optionally, the application component's view data can be updated and cleared when the application component is upgraded or uninstalled.

[0077] Object management module: used to manage the remote procedure call (RPC) objects of the application component users, verify the user's requests and handle callbacks after the application components are updated.

[0078] Communication adaptation layer: responsible for RPC communication with application component users and application component providers.

[0079] (3) Application component provider

[0080] An application component provider is an application that provides display content for an application component. This includes, for example, system applications, third-party applications, or atomic services (atomic services can be understood as installation-free applications) that control the display content, control layout, and control triggering events of the application component. Application component providers may include, but are not limited to, the following modules:

[0081] Application component service module: implemented by the application component provider. Developers can use the onCreateForm instruction to create application components, the onUpdateForm instruction to update application components, and the onDeleteForm instruction to delete application components to enable the developed application to provide corresponding application component services.

[0082] Instance management module: implemented by the application component provider developer, responsible for the persistent management of application component instances allocated by the application component management service.

[0083] Communication Adaptation Layer: Provided by the Software Development Kit (SDK), it is responsible for communicating with the Application Component Management Service and is used to proactively push updated data of application components to the Application Component Management Service.

[0084] Application component users and application component providers do not require resident operation. When an application component user needs to add an application component, delete an application component, or request to update an application component, the application component management service will pull up the application component provider to obtain application component information.

[0085] It can be understood that the embodiments of the present application do not limit the naming method of the above three parts and the modules contained in each part. For example, for cards, "application component management service" can be replaced by "card management service".

[0086] Typically, electronic devices support multiple applications, such as one or more of the following: music players, weather applications, calendar applications, travel applications, game applications, phone applications, video players, shopping applications, browsers, or instant messaging applications. There are many types of instant messaging applications, such as SMS applications, MMS applications, email applications, and chat applications.

[0087] The application components corresponding to these applications can be displayed on the desktop (such as the launcher page or the lock screen page), such as the card corresponding to the song playback service provided by the music player shown in Figure 1, and the card corresponding to the current weather information provided by the weather application. In addition to displaying the application components corresponding to installed applications, electronic devices can also display application components corresponding to applications that are not installed (such as installation-free applications). Electronic devices can also display application components on the negative one screen page, or can also trigger the invocation of application components through user operations, such as swiping up on the application icon.

[0088] Generally speaking, an application component (such as a card) corresponds to a portion of an application's service functionality. An application (such as the application component provider in Figure 1) can split its services into multiple service modules, each corresponding to an application component. These modules can then push different application components to users based on different service scenarios. Alternatively, a single application can push multiple application components to provide different services.

[0089] In the embodiments of the present application, one or more application components provided by an application can be understood as an association between the one or more application components and the application, or as an association (or binding) between the one or more application components and the application, or as an application component corresponding to the application. It is understood that this association relationship can be reflected in the one or more application components being able to display information or data provided by the application, or implementing services provided by the application, or being able to serve as a portal to enter the application or a corresponding page of the application.

[0090] For ease of understanding, using cards as an example, Figure 3 illustrates schematic diagrams of cards on different electronic devices. When the electronic device is a mobile phone, as shown in interface 31 of Figure 3, commonly used cards displayed on the phone's negative first screen interface may include, but are not limited to: a card 3101 indicating the phone's usage time, a card 3102 indicating the number of steps the phone has taken today, a card 3103 displaying the date and schedule, and a card 3104 displaying weather information. The phone's negative first screen display interface may also include other displayed information, such as a status bar, search box, and user avatar. The status bar may include carrier information, wireless network information, battery level information, and time information. When the electronic device is a tablet, as shown in interface 32 of Figure 3, the cards displayed on the tablet's desktop main interface 32 may include, but are not limited to: a card 3201 indicating direct services for the full-scenario communication application (full-scenario communication is an application that enables communication between electronic devices and the Internet of Things), a card 3202 displaying notes from the memo application, and a card 3203 indicating direct services pushed to the user by the tablet's voice assistant. The desktop display interface of the tablet computer may also include other display information, such as a status bar, other application icons, etc. Among them, other application icons may be, for example, a clock icon, a calendar icon, a memo icon, a file management icon, a gallery icon, and a calculator icon included in the display interface 32.

[0091] Based on the architecture for implementing application components shown in FIG2 and the examples of application components described in FIG1 or FIG3, each application can act as an application component provider to provide application component services to users as needed. The electronic device used by the user or the application in the electronic device can act as an application component consumer and, in response to user operations, create, delete, or request updates to application components on the desktop.

[0092] For example, if a first application is the provider of an application component and a desktop process (such as the launcher's host process) is the user of the application component, the process for displaying the application component corresponding to the first application on the electronic device's desktop currently includes: the desktop process reading the layout description file of the first application's application component and rendering the application component according to the layout described in the layout description file. The desktop process is also responsible for refreshing the application component.

[0093] Rendering application components by the desktop process may result in the display effects of the application components not meeting the design requirements of the application components. For example, the designed display effects cannot be presented, or the required services or information cannot be provided, which affects the user experience and even affects user usage. This is mainly caused by at least one of the following two reasons:

[0094] The first aspect: compared with the first application, the permissions supported by the desktop process are limited. In order to meet user needs, application components may use specific permissions to provide corresponding services to users. The first application can obtain specific permissions by applying to the system or by user settings, such as providing a permission setting interface for the user during the installation or use of the first application, so as to allow the user to open some specific permissions to the first application, such as the permission to access the Internet or the permission to access the photo gallery in the electronic device or the permission to access device information or the permission to access the user operation history (such as browser usage records). The desktop process may not support the above permissions, so if the desktop process renders the application component corresponding to the first application, the application component will not be able to provide the corresponding service due to permission restrictions.

[0095] The second aspect: Compared with the first application, the controls supported by the desktop process are limited. In order to meet user needs, application components may use specific controls to achieve corresponding display effects or provide corresponding services, such as some more attractive or more complex animations. The first application can introduce this specific control when designing. The desktop process may not be able to support the above controls. Therefore, when the desktop process renders the application component corresponding to the first application, the view of the application component cannot meet the design requirements due to control limitations, and may even cause the view of the application component to not be displayed normally.

[0096] In addition, having the desktop process responsible for rendering and refreshing application components will also cause the desktop process to occupy a large amount of system resource overhead, which may lead to problems such as the stability of the desktop process, affecting the desktop display of the electronic device and thus affecting the user experience.

[0097] Based on this, an embodiment of the present application provides a display method, through the inter-process communication (IPC) mechanism, the user of the application component (the host application of the application component) notifies the provider of the application component (the application) to perform rendering of the application component, thereby making full use of the capabilities of the provider (application) of the application component, such as supported permissions and / or supported controls, to ensure that the application component can be displayed normally (for example, it can be displayed according to design requirements), better provide services to users, and thus improve the user experience.

[0098] In order to facilitate understanding of the display method provided by the present application, the implementation process of the method provided by the present application is introduced below in combination with the contents shown in Figures 4, 5, 6a, 6b, 6c, 7a, 7b, 8, 9 and 10.

[0099] It should be understood that in the embodiments of the present application, "at least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple. "Multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. 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. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0100] In addition, it should be understood that, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0101] The method provided in the embodiment of the present application can be applied to electronic devices. The electronic device can be any device that supports the application component function. For example, the electronic device can be an electronic device such as a mobile phone, a tablet computer, a wearable device (for example, a watch, a bracelet, etc.), an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device (for example, a smart TV, a smart speaker, etc.) that can display a card on the desktop. It will be understood that the embodiment of the present application does not impose any restrictions on the specific type of electronic device.

[0102] The electronic devices to which the embodiments of the present application can be applied include, but are not limited to, Or electronic devices with other operating systems. The electronic device may also be other electronic devices, such as a laptop computer (Laptop) with a touch-sensitive surface (eg, a touch panel).

[0103] Figure 4 shows a schematic diagram of the hardware structure of a possible electronic device. As shown in Figure 4, the electronic device 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 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0104] 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, 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. The controller may serve as the nerve center and command center of the electronic device 100. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. When the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces the processor 110's waiting time, and thus improves system efficiency.

[0105] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with a network and other devices via wireless communication technologies. Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), the fifth generation (5G) mobile communication system, future communication systems such as the sixth generation (6G) system, BT, GNSS, WLAN, NFC, FM and / or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).

[0106] The display screen 194 is used to display the display interface of the application, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N (N is a positive integer greater than 1) display screens 194. For example, the electronic device 100 may be a mobile phone with a foldable display screen having at least two display screens. In an embodiment of the present application, the display screen 194 can be used to display a page (or interface) including at least one application component, such as interface 31 or interface 32 shown in Figure 3.

[0107] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 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, and the software code of at least one application, etc. The data storage area can store data (such as images, videos, etc.) generated during the use of the electronic device 100. 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.

[0108] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194. In an embodiment of the present application, the touch sensor 180K can detect user operations and can pass the information of the detected user operations to the upper layer, so that the electronic device can respond to the user operation to achieve the addition, deletion or update of application components.

[0109] It is understood that the components shown in FIG4 do not constitute a specific limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine or separate some components, or arrange the components differently. In the following embodiments, the electronic device 100 shown in FIG4 is used as an example for description.

[0110] The operating system (OS) involved in the embodiments of the present application is the most basic system software running on the electronic device 100. The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application use an operating system with a layered architecture as an example to illustrate the software system architecture of the electronic device 100.

[0111] Figure 5 is a block diagram of the software system architecture of an electronic device provided in an embodiment of the present application. As shown in Figure 5, the software system architecture of the electronic device can be a layered architecture. For example, the software can be divided 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 operating system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (framework, FWK), the runtime and system library, the kernel layer, and the hardware layer.

[0112] The application layer may include a series of application packages. As shown in Figure 5, the application layer may include a camera, settings, skin modules, a user interface (UI), third-party applications, etc. Among them, third-party applications may include wireless local area network (WLAN), music, calls, Bluetooth, video, memos, notes, etc. In the embodiment of the present application, some applications in the application layer may provide application component functions, that is, corresponding application components may be set for some applications on interfaces such as the desktop, lock screen, or negative one screen.

[0113] In one possible implementation, applications can be developed using Java by calling the application programming interface (API) provided by the application framework layer. Developers can use the application framework layer to interact with the underlying operating system layers (e.g., the hardware layer, kernel layer, etc.) to develop their own applications. The application framework layer primarily provides a series of services and management systems for the operating system.

[0114] The application framework layer provides an application programming interface and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 5, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and so on. In the embodiments of the present application, the application framework layer may also include an application component management service for implementing management functions for application components. For further explanation, please refer to the relevant content above.

[0115] The activity manager is used to manage the life cycle of each application and provide common navigation back functions, providing an interactive interface for all program windows.

[0116] The window manager manages windowed applications. It can determine the display size, determine whether a status bar is present, lock the screen, take screenshots, and more. Content providers store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book.

[0117] 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.

[0118] The phone manager is used to provide communication functions for electronic devices, such as call status management (including answering, hanging up, etc.).

[0119] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc.

[0120] 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.

[0121] The runtime consists of a core library and a virtual machine. The runtime is responsible for operating system scheduling and management. The core library consists of two parts: one for the Java language's callable functions and the other for the operating system's core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine performs functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0122] The system library may include multiple functional modules. For example: surface manager, media framework, three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional graphics engine (for example: SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of two-dimensional and three-dimensional layers for multiple applications. The media framework supports a variety of commonly used audio and video format playback and recording, as well as static image files, etc. The media framework can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc. The two-dimensional graphics engine is a drawing engine for two-dimensional drawing. In some embodiments, the three-dimensional graphics processing library can be used to draw three-dimensional motion trajectory images, and the two-dimensional graphics engine can be used to draw two-dimensional motion trajectory images.

[0123] 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.

[0124] The hardware layer can include various sensors, such as accelerometers, gravity sensors, touch sensors, etc.

[0125] Typically, the electronic device 100 can run multiple applications at the same time. In a simpler case, one application can correspond to one process, and in a more complex case, one application can correspond to multiple processes. Each process has a process number (process ID). In some embodiments of the present application, for example, when a desktop application (such as Android's launcher) is running, the host process can notify the provider application of the application component to render the application component; for another example, when a negative one-screen application is running, the host process can also notify the provider application of the application component to render the application component.

[0126] It should be understood that the hardware structure of the electronic device can be as shown in Figure 4, and the software system architecture can be as shown in Figure 5, wherein the software programs and / or modules corresponding to the software system architecture in the electronic device can be stored in the internal memory 121, and the processor 110 can run the software programs and applications stored in the internal memory 121 to execute the process of the display method provided in the embodiment of the present application.

[0127] The embodiments of the present application are applicable to scenarios where application components are displayed on pages of electronic devices (such as the desktop, lock screen interface, and negative one screen interface). The following first describes the implementation process of the method provided by the embodiments of the present application through multiple scenarios to facilitate understanding of the interface processing effects that can be achieved based on the method provided by the present application. It is understood that the embodiments of the present application are not limited to the following application scenarios.

[0128] First, taking a mobile phone as an electronic device and a card as an application component as an example, the following is introduced by taking card display on a mobile phone as an example.

[0129] Scenario 1: Create a card.

[0130] Figure 6a illustrates a possible card creation process in an embodiment of the present application. As shown in Figure 6a, the mobile phone detects a user operation for indicating to enter the desktop editing, and in response to the user operation, displays interface 61. In some examples, the user operation can be, for example, a two-finger pinch operation. Interface 61 may include some controls for desktop editing, for example, the control may include: a service card control 6101 for creating or adding a card on the desktop, a layout control 6102 for setting the layout of desktop elements, and a desktop setting control 6103 for setting functions such as the number of grids and icon size in the main viewing area of ​​the desktop.

[0131] When the mobile phone detects a user operation on the control 6101 displayed on the interface 61, the electronic device displays the card setting interface 62 in response to the user operation. In some examples, the user operation can be, for example, a click operation, a double-click operation, or a voice operation. The card setting interface 62 may include some commonly used application cards for user selection, such as the game center service card, the file management service card, and the online payment service card in the interface 62. It may also include an application list (such as application icons) so that the user can select the application for which the card needs to be set.

[0132] Taking the example of a user selecting the "Travel" application, when the mobile phone detects a user operation on the "Travel" application icon in interface 62, the electronic device displays a card setting interface 63 in response to the user operation. In some examples, the user operation may be a click, a double-click, or a voice command. Card setting interface 63 may display a preview of the travel application card, as well as controls 6301 for setting the card to the desktop and 6302 for setting the card to the negative one screen.

[0133] Taking the example of a user selecting to place a card on the desktop, when the mobile phone detects a user operation on control 6301 in interface 63, the electronic device adds a card corresponding to the "Travel" application to the desktop in response to the user operation. In some examples, the user operation may be a click, a double-click, or a voice command. The desktop interface with the added card for the "Travel" application may be shown as desktop interface 64 in FIG6 a.

[0134] The above examples describe an application that provides only one default card style. In other examples, an application can also provide multiple card styles for the user to choose from. Still taking the example of creating a card for the "Travel" application on the mobile phone desktop, as shown in Figure 6b, when the mobile phone detects a user operation on the "Travel" application icon in interface 62, the electronic device displays a card settings interface 65 in response to the user operation. Card settings interface 65 displays preview images of multiple different card styles. These card preview images can be displayed in a vertical stack as shown in Figure 6b, and the user can select a card style by swiping up and down. In other examples, these card preview images can also be displayed in a horizontal stack, and the user can select a card style by swiping left or right, or they can be displayed in a list format, which is not limited in this embodiment of the present application. When the mobile phone detects a user operation on control 6301 (for adding a card to the desktop) in interface 65, the electronic device adds a card for the "Travel" application in the corresponding style to the desktop based on the card style selected by the user.

[0135] In other examples, the user can also enter the card settings interface 62 by operating the "Travel" application icon displayed on the mobile phone desktop. Exemplarily, this user operation may include long pressing the "Travel" application icon on the desktop interface and selecting "Service Card" from the pop-up menu. In other examples, the user can also use voice to make the electronic device enter the card settings interface 62. The embodiments of the present application do not limit the user operation method for entering the card settings interface.

[0136] In other examples, the electronic device may support the function of "combination card". Combination card means that the card services of two or more applications can be integrated into one card for display. The electronic device can provide the user with one or more default combination cards, such as a combination card for providing gallery service functions and a combination card for providing camera service functions. The user can directly select the combination card provided by the electronic device and add it to the desktop or the negative one screen. The electronic device can also provide the user with a combination card setting interface to allow the user to select two or more applications and generate a combination card based on the application selected by the user. Furthermore, the electronic device can also provide a variety of styles of combination cards for the user to choose from. The embodiment of the present application does not limit the setting method of the combination card.

[0137] In other examples, the electronic device may first provide the user with a card style setting interface for the user to select a card style. After detecting that the user has selected a card style, the electronic device may then provide the user with an application (or service) setting interface for the user to select an application or service to be applied to the card of the selected style. The embodiments of the present application do not limit the order of selecting the card style and the application.

[0138] It should be understood that the above only lists several ways to create cards. The creation methods of other types of application components (such as Widgets, etc.) can refer to the creation methods of the above cards. The embodiments of this application do not limit the types of application components and the creation methods of application components.

[0139] In some examples of the embodiments of the present application, compared to the currently used application component creation method, the application component created in the embodiments of the present application can provide richer or more attractive display effects, and / or provide new service functions. For example, the card created by the current card creation method cannot achieve animation display effects or cannot display videos due to limited controls or control types. The card created by the method provided in the embodiments of the present application can display animation effects or display videos. For another example, the card corresponding to the travel application created by the current card creation method is limited in authority (such as being unable to read the browser's history), resulting in the inability to provide travel information or travel service functions of the corresponding location based on the user's recently browsed travel locations. The card of the travel application created by the method provided in the embodiments of the present application can provide travel information or travel service functions of the corresponding location based on the user's recently browsed travel locations.

[0140] Scenario 2: Deleting application components.

[0141] Figure 6c exemplifies a possible card deletion process in an embodiment of the present application. As shown in Figure 6c, the mobile phone detects a user operation for deleting a card on the desktop, and in response to the user operation, deletes the card from the mobile phone desktop. In some examples, the user operation may be, for example, a long press on the card of the travel application in the desktop interface 64, and selecting the option to remove the card in the pop-up menu 65. In response to the above user operation, the card of the travel application is deleted from the desktop, and the desktop after deletion is shown in interface 66 in Figure 6c. It can be understood that the card deletion operation can also be implemented by voice. The embodiment of the present application does not limit the implementation method of deleting the card.

[0142] It should be understood that the above only lists the methods for deleting cards. The methods for deleting other types of application components (such as Widgets, etc.) can refer to the above card deletion methods. The embodiments of the present application do not limit the types of application components and the methods for deleting application components.

[0143] Scenario 3: Editing application components.

[0144] In embodiments of the present application, some application components can be edited, such as by updating the style of the application component. Exemplarily, editing an application component may include updating or adding content displayed by the application component. For example, for a card corresponding to a weather application, the target city may be updated to display the weather for the target city. The size of the application component may be adjusted by selecting a different style of card.

[0145] In some examples, when an electronic device detects a user long-pressing a card in a travel application on a desktop interface and selecting an option to edit the card in a pop-up menu, the electronic device may provide a corresponding settings interface in response to the user's operation to guide the user through the card editing operation. It is understood that the card editing operation may also be implemented via voice. The embodiments of the present application do not limit the implementation method of editing a card.

[0146] It should be understood that the above only lists the ways to edit cards, and the editing methods of other types of application components (such as Widgets, etc.) can refer to the editing methods of the above cards. The embodiments of this application do not limit the types of application components and the editing methods of application components.

[0147] Based on the description of the display effects of application components in the aforementioned multiple scenarios, the following describes the implementation process of the display method based on an electronic device provided in an embodiment of the present application in combination with Figures 7a and 7b to illustrate how to better display application components.

[0148] As shown in Figure 7a, the first application, as an application component service provider, can provide one or more application components. Multiple applications can provide application component services, and the first application can be one of the multiple applications. For example, the first application can be a music player, a weather application, or a travel application. In some examples, when a user downloads a compressed program package of the application on an electronic device, the compressed program package can include an operating program for implementing one or more cards provided by the application.

[0149] The first host application in Figure 7a is the host application of the first application component provided by the first application, wherein the first application component is the only application component provided by the first application, or it can be one of multiple application components provided by the first application. Specifically, the first application component among the multiple application components provided by the first application can be determined based on the user's selection. As the user of the first application component, the first host application can control the position of the first application component displayed on its page and display the content of the first application component on its page. Exemplarily, the first host application can be a desktop application, a lock screen application, a negative one screen application, etc., which is not limited in this embodiment of the present application.

[0150] When the electronic device determines that it is necessary to add (or add) the first application component corresponding to the first application to the page of the first host application, the first host application can set a view container in its page (such as the first page in Figure 7a), which is used to accommodate the view of the first application component and notify the first application to render the view of the first application component. After receiving the notification, the first application applies for a first buffer to store the view data of the first application component. Optionally, the first buffer can be located in a random access memory (RAM) in the hardware layer to ensure the efficiency of data access. The first application performs off-screen rendering and stores the rendered view data of the first application component in the first buffer. The first buffer can be shared with the first host application. During the synthesis of the first page, the first host application can display the view of the first application component in the view container of the first page based on the data stored in the first buffer, thereby obtaining a first page containing the first application component.

[0151] Optionally, in the following scenarios, the electronic device may determine that it is necessary to add a first application component corresponding to the first application to the page of the first host application:

[0152] Scenario 1: The electronic device detects a user request to add (or create) a first component corresponding to a first application on a first host application interface. The user operation process of creating an application component and the interface change process of the electronic device can refer to the relevant content above.

[0153] Scenario 2: After adding the first application component corresponding to the first application to the interface of the first host application (such as adding the first application component to the interface of the first host application based on user operations as described above), the electronic device will update the relevant information of the first host application interface, which may include, for example, relevant information of the first application component (such as the location, size, and corresponding application of the first application component). When the electronic device is restarted, when loading or preloading the page of the first host application, the electronic device can determine that the first application component corresponding to the first application needs to be added to the interface of the first host application based on the saved relevant information of the first host application interface.

[0154] Optionally, the first application can also refresh the first application component and store the view data of the refreshed first application component to the first cache area. The first host application can refresh the view of the first application component in the view container displaying the first page based on the data stored in the first cache area.

[0155] In the above process, the rendering operation of the application component is implemented by the application that provides the application component (such as the above-mentioned first application). In this way, the first application can render the application component based on the permissions obtained by the application and / or the controls supported by the application. Compared with rendering the application component by the user application of the application component (such as the above-mentioned first host application), it can avoid problems such as the application component being unable to display normally or unable to provide the design required functions due to limited permissions and / or limited supported controls of the first host application.

[0156] In one possible implementation, each application component addition process can proceed as shown in FIG. 7a . For example, after adding a first application component to a first page of a first host application, the electronic device detects a user request to create an application component corresponding to the first application on the first host application page (to distinguish it from the first application component, the application component requested to be created again is referred to as a second application component). In response to this user request, the first host application sets a view container on its second page to accommodate the view of the second application component and notifies the first application to render the view of the second application component. Upon receiving this notification, the first application requests a second cache to store the view data of the second application component. Optionally, the second cache can be located in RAM at the hardware level to ensure efficient data access. The first application performs off-screen rendering and stores the rendered view data of the second application component in the second cache. The second cache can be shared with the first host application. During the second page composition process, the first host application can display the view of the second application component in the view container of the second page based on the data stored in the second cache, resulting in a second page containing the second application component.

[0157] In another possible implementation, when creating application components for the same application multiple times, it is not necessary to apply for a cache area each time. Instead, the application components created multiple times can share a cache area to save storage resource overhead on the electronic device. Taking the creation of application components for a first application multiple times as an example, as shown in Figure 7a, after adding the first application component of the first application to the first page of the first host application, when the electronic device detects a user operation of a user requesting to create an application component corresponding to the first application on the page of the first host application (to distinguish it from the above-mentioned first application component, the application component requested to be added again is referred to as the second application component here), in response to the user operation, the first host application sets a view container on its page (the second page in Figure 7a) to accommodate the view of the second application component. Since the second application component and the first application component are both application components provided by the first application, the view of the second application component can be displayed based on the data stored in the first cache area. Accordingly, the first host application does not need to notify the first application to render the second application component. The first host application can display the view of the second application component in the view container of the second page based on the data stored in the first cache area during the synthesis of the second page, thereby obtaining a second page containing the second application component. Optionally, the first application component and the second application component have the same style.

[0158] In the above process, on the one hand, the rendering operation of the application component is implemented by the application that provides the application component (such as the above-mentioned first application). In this way, the first application can render the application component based on the permissions obtained by the application and / or the controls supported by the application. Compared with the rendering of the application component by the user application of the application component (such as the above-mentioned first host application), it can avoid problems such as the application component being unable to display normally or unable to provide the required functions due to the limited permissions and / or limited supported controls of the first host application. On the other hand, when creating multiple application components for the same application, multiple application components can share a cache area for storing the view data of the application components, thereby reducing cache overhead. Furthermore, it can also save the overhead of the first host application notifying the first application, thereby reducing system resource overhead and improving the processing performance of the electronic device.

[0159] It can be understood that the first page and the second page in Figure 7a above are both pages provided by the first host application. The first page and the second page can be the same page. For example, when the workspace area of ​​the first page has enough space to accommodate the first application component and the second application component, the view of the first application component and the view of the second application component can be displayed on the first page. The first page and the second page may also be different pages provided by the first host application. For example, when the workspace area of ​​the first page is already set with the first application component and there is not enough space to accommodate the second application component, the second application component is added to the second page. For example, the second page can be the next page where the first application component is located, or a page that can accommodate the second application component, or a newly created page.

[0160] In another possible implementation, multiple application components can be created for the same application, and the multiple application components can be added to the pages of different host applications, such as one or more application components being added to the desktop and one or more other application components being added to the negative one screen. Taking the creation of application components for a first application multiple times as an example, as shown in FIG7b , after adding the first application component of the first application to the first page of the first host application, when the electronic device detects a user operation requesting to add the application component corresponding to the first application to the page of the second host application (to distinguish it from the above-mentioned first application component, the application component requested to be added again is referred to as the second application component here), in response to the user operation, the second host application sets a view container on its second page to accommodate the view of the second application component. Since the second application component and the first application component are both application components provided by the first application, the view of the second application component can be displayed based on the first cache area for storing the view data of the first application component. Accordingly, the second host application does not need to notify the first application to render the second application component. The second host application can display the view of the second application component in the view container of the second page during the synthesis of the second page, thereby obtaining a second page containing the second application component.

[0161] Based on the principle of creating application components provided by the embodiment of the present application shown in Figures 7a and 7b above, the display method provided by the embodiment of the present application is described below in combination with Figure 8 and the flowchart shown in Figure 9.

[0162] Refer to Figure 8, which is a flow chart of a display method provided in an embodiment of the present application. The process can be applied to electronic devices. In conjunction with the hardware structure of the electronic device shown in Figure 4, the process can be executed by the processor 110, or the process can be implemented on the processor 110. Optionally, the processor 110 may include a CPU and a GPU. In some embodiments of the present application, the process can be implemented by cooperating with the CPU and the GPU. For example, part of the logic of the process is implemented by the CPU, and the CPU can call the GPU to render and draw the page. In conjunction with the software system architecture of the electronic device shown in Figure 5, the process can be implemented by cooperating with the first application (the provider of the application component) and the first host application (the user of the application component), or further combined with the application component management service.

[0163] As shown in FIG8 , the process may include the following steps:

[0164] Step 801: Determine to add a first application component, and the first application component is associated with a first application program.

[0165] It is understood that the association of the first application component with the first application means that the first application component is an application component provided by the first application, or is an application component corresponding to the first application. In other words, the first application is the provider of the first application component, and the first application component is provided by the first application. The first application component may provide access to the first application or part of its functions, or may display data of the first application, or may include controls for implementing corresponding functions of the first application. For a description of the application component and the functions it implements, please refer to the previous content and will not be repeated here.

[0166] In one possible implementation, the electronic device may receive a request to add (or create) a first application component based on a detected first user operation. That is, the electronic device may detect the first user operation and may determine that the first user operation is used to request the creation of the first application component. In other words, the user may request the creation of the first application component through the first user operation. It is understood that the first user operation may include a touch operation on the electronic device and may also include an operation in the form of user voice. The embodiment of the present application does not limit the type of the first user operation. An example of a first user operation may be shown in Figure 6a or Figure 6b.

[0167] In one possible implementation, a first user operation can request a page type (e.g., desktop or negative one screen) on which to create the first application component. In another possible implementation, the page (e.g., desktop or negative one screen) where the application component is located is set by default and cannot be selected or specified by a user operation.

[0168] In another possible implementation, when the electronic device is started, it can obtain relevant information of the page with the first application component added thereto, and determine based on the relevant information that the first application component is added to the page, and therefore determine that the first application component needs to be added to the page.

[0169] 9 , taking the example of adding a first application component based on a first user operation, where the first user operation is the user touch operation shown in FIG. 6 a , the operations corresponding to step 801 may include:

[0170] At 900, the user performs a two-finger pinch operation on the mobile phone screen, selects the service card control 6101 in interface 61, selects the travel application icon in interface 62, and selects the control 6301 in interface 63. These operations request the addition of a first application component corresponding to the travel application (i.e., the first application) to the desktop. The above series of operations can be collectively referred to as the first user operation.

[0171] At 901, relevant components in the hardware layer of the electronic device (e.g., a touch sensor), supported by corresponding drivers in the system layer, may detect the first user operation and transmit information about the detected first user operation to the application framework layer. For example, the information about the first user operation may include the type of the first user operation (e.g., a click operation) and information about the location affected by the first user operation.

[0172] At 902 , the service in the application framework layer may determine, based on the received information about the first user operation, that the intention of the first user operation is to request creation of a first application component of a first application in the desktop.

[0173] At 903, the application framework layer may notify the host application of the first application component (i.e., the desktop application in the figure) to create the first application component of the first application on the desktop. Optionally, the application framework layer may send information such as the type and / or style of the first application component to the host application via an IPC mechanism to notify the desktop application to create the first application component.

[0174] Optionally, the application framework layer can also notify the application component management service of relevant information of the first application component (such as the host application of the first application component, the type of the first application component, the style of the first application component, etc.) so that the application component management service can manage the first application component.

[0175] Optionally, after receiving a notification from the application framework layer, the desktop application may also notify the application component management service of relevant information of the first application component (such as the host application of the first application component, the type of the first application component, the style of the first application component, etc.) so that the application component management service can manage the first application component.

[0176] Still taking Figure 6a as an example, if the electronic device detects that the control selected by the user in interface 63 is control 6301, the application framework layer can determine to add the first application component to the desktop. In this case, the host application of the first application component is the desktop application; if the electronic device detects that the control selected by the user in interface 63 is control 6302, the application framework layer can determine to add the first application component to the negative one screen. In this case, the host application of the first application component is the negative one screen application.

[0177] Returning to the process shown in FIG. 8 , step 802 : notifying the first application program to render the view of the first application component.

[0178] Optionally, data of the view of the first application component may be stored in the first cache area.

[0179] In one possible implementation, the first cache is a cache shared by the host application of the first application component and the first application. Both the host application of the first application component and the first application providing the first application component can access the first cache. For example, as shown in FIG7a , the first application can write data of the first application component's view to the first cache, and the host application of the first application component (i.e., the first host application in FIG7a ) can read data stored in the first cache.

[0180] In one possible implementation, the host application of the first application component and the first application can communicate via an IPC mechanism. Specifically, the host application of the first application component can notify the first application to render the view of the first application component based on the IPC mechanism. Exemplarily, the process corresponding to the host application of the first application component includes a Host process, and the Host process can notify the process of the first application to render the first application component based on the IPC mechanism.

[0181] In a possible implementation, the application method for the first cache area may include:

[0182] Application method 1: The host application of the first application component requests allocation. Exemplarily, the host application of the first application component can respond to the first user operation, such as after receiving the information of the first user operation, and apply to the hardware layer for a first cache area to store the data of the view of the first application component. As another example, during the startup process of the electronic device, if it is determined that the first application component is added to the first page, the application to which the first page belongs (i.e., the host application of the first application component) can apply to the hardware layer for a first cache area to store the data of the view of the first application component.

[0183] Furthermore, the host application of the first application component may also notify the first application of the address information of the first cache area (e.g., the first address and further including the cache area size) so that the first application can store the data of the view of the first application component in the first cache area. Optionally, the host application of the first application component may also notify the application component management service of the address information of the first cache area so that the application component management service can perform cache management.

[0184] Application method 2: Allocation is requested by the application component management service. Exemplarily, after the service in the application framework layer determines, based on the information of the received first user operation, that the first user operation is used to request the creation of the first application component in the desktop, it can send a management request for the first application component to the application component management service. Based on the request, the application component management service can apply to the hardware layer for a first cache area to store the data of the view of the first application component. The request may include information about the first application, style information of the first application component, etc. As another example, during the startup process of the electronic device, if it is determined that the first application component is added to the first page, the application component management service can apply to the hardware layer for a first cache area to store the data of the view of the first application component.

[0185] Furthermore, the application component management service can also send the address information of the first cache area (such as the first address, and further including the cache area size) to the first application and the host application of the first application component, or send it to the first application through the host application, so that the first application can store the data of the view of the first application component in the first cache area.

[0186] Application Method 3: Allocation is requested by the first application. After receiving notification to render the first application component, the first application can request a first cache from the physical layer to store the data of the first application component's view. Furthermore, the first application can also send the address information of the first cache to the host application of the first application component. Compared with the above-mentioned Application Method 1 or Application Method 2, Application Method 3 can reduce the interaction between applications (or processes), thereby reducing system overhead.

[0187] In one possible implementation, the first page includes a view container for accommodating (or displaying) the view of the first application component. The view container occupies a certain area on the first page, and the size of the area (e.g., the length and height of the area) can be adapted to the style of the first application component. The position of the area can be determined based on the size of the workspace space on the current desktop or negative screen of the electronic device and / or the layout of desktop elements (e.g., including application icons, folder icons, and other application components). Exemplarily, the view container can be a view control in which the view of the first application component can be displayed. Optionally, the view container can be set by the host application of the first application component on the page of the host application to occupy the view of the first application component. Exemplarily, the host application of the first application component can determine the size of the application component based on the style of the first application component, determine the page that can accommodate the first application component based on the layout of desktop elements in the current pages of the host application (or based on the size of the workspace space), and set the view container on this page. Optionally, if the workspace of the current page cannot accommodate the first application component, the host application may create a new page and set the view container in the newly created page.

[0188] In one possible implementation, after the host application of the first application component sets a view container in the first page, it can also associate the first cache area with the view container in the first page. Accordingly, based on this association and according to the data stored in the first cache area, the host application can control the display of the view of the first application component in the first view container. Optionally, the host application can establish an association between the address of the first cache area and the view container. Optionally, the address of the first cache area can be a virtual address.

[0189] Referring to FIG. 9 , operations corresponding to step 802 may include:

[0190] At 904 , the host application (ie, desktop application) of the first application component sets a view container on the first page to accommodate the view of the first application component.

[0191] At 905, the host application (i.e., desktop application) of the first application component may send a first message to the first application based on the IPC mechanism to notify the first application to render the first application component. Exemplarily, the first message may include information such as the type and style of the first application component, and may further include instruction information for creating the application component. Exemplarily, the first message may be an instruction or command to create the first application component. In a scenario where the first application provides multiple application components, the first message includes an identifier (ID) or name of the first application component, which may enable the first application to render an application component of a corresponding style.

[0192] At 906 , the first application program requests allocation of a first cache area for storing data of a view of the first application component.

[0193] Optionally, at 907 , the first application may send the address information of the first cache area to a host application (ie, a desktop application) of the first application component.

[0194] Optionally, at 908 , after receiving the address information of the first cache area, the host application may establish an association between the view container and the first cache area.

[0195] Returning to the process shown in FIG. 8 , step 803 : generating a first page, wherein the first page includes a view of the first application component.

[0196] Exemplarily, the first application can render the first application component based on the received notification, and store the rendered view data of the first application component in the first storage area. The host application of the first application component can generate (or synthesize) a first page containing the view of the first application component. Exemplarily, when synthesizing the first page, the host application calls other threads or processes or calls the GPU, so that the called thread or process or GPU draws the view of the first application component in the view container according to the data in the first cache area. The host application can synthesize the page according to the stacking order of the views or layers of the desktop elements (including the first application component and other desktop elements) contained in the first page, and can display the first page through the display screen.

[0197] Optionally, the first application can update data in the view of the first application component based on a set period or based on an event trigger. The updated data can be stored in the first cache area, for example, overwriting the original data in the first cache area. The host application of the first application component can refresh the view of the first application component on the first page based on the data stored in the first cache area.

[0198] Referring to FIG. 9 , operations corresponding to step 803 may include:

[0199] At 909, the first application renders the view of the first application component and stores the view of the first application component in the first buffer. In one possible example, the first application can use EGL (EGL is the interface between OpenGL ES and the native platform window system) operations to create a shareable EGLImageKHR and bind it to a texture for off-screen rendering. The first application then performs rendering and drawing operations on the bound texture. The rendering results of the view of the first application component can then be automatically shared with the host application of the first application component for display processing.

[0200] At 910 , the desktop application generates a first page including a view of a first application component.

[0201] Optional, for In the process shown in FIG8 or FIG9 above, the host application of the first application component, the first application and the application component management service can transmit and communicate information based on the IPC communication mechanism of Binder (Binder is a basic class of remote objects, the core part of which is the remote call mechanism) of AIDL (Android Interface Definition Language). ), information transmission and communication can be carried out between the host application of the first application component, the first application and the application component management service through the IPC communication mechanism of Binder based on IDL (Interface Definition Language).

[0202] For the specific implementation of each step in the process shown in Figure 9, please refer to the relevant content above. It can be understood that the process shown in Figure 9 is only a specific example of the process shown in Figure 8. In this example, the first application applies for the first cache area. In other examples, the first cache area can also be applied by a desktop application or an application component management service.

[0203] According to the process shown in Figure 8 or Figure 9 above, the rendering operation of the application component is implemented by the application that provides the application component (such as the above-mentioned first application). In this way, the first application can render the application component based on the permissions obtained by the application and / or the controls supported by the application. Compared with rendering the application component by the user application of the application component (such as the above-mentioned first host application), it can avoid problems such as the application component being unable to display normally or unable to provide the design required functions due to limited permissions and / or limited supported controls of the first host application.

[0204] In one possible implementation, after creating the first application component, the electronic device may suspend the refresh of the first application component according to the situation to save power consumption of the electronic device. Exemplarily, the host application of the first application component receives the first event information, and the host application responds to the first event information to notify the first application to stop rendering the view of the first application component. For example, the host application may send a second message to the first application to notify the first application to stop rendering the view of the first application component. In this case, the first cache area is retained. The first event is used to indicate that the first application component is switched to the background or is blocked or the display screen where the page displaying the first application component is turned off.

[0205] In a possible implementation of pausing the refresh of the first application component, the first event information is screen-off event information. For example, when the screen of an electronic device is turned off, the hardware layer or system layer of the electronic device can obtain the event information and can notify the application framework layer of the event information. The application framework layer can notify the host application of the first application component of the event information. Optionally, if the electronic device has multiple display screens, after the application framework layer receives the first event information (screen-off event information), it can interact with the application component management service to determine whether the first application component is displayed on the screen where the screen is turned off. If the first application component is displayed, the host application of the first application component is notified to suspend rendering of the first application component.

[0206] In another possible implementation of pausing the refresh of the first application component, the first event information is the physical state event information of the display screen. For an electronic device with a foldable screen, a change in the physical state of the display screen may refer to a change in the unfolding angle of the foldable screen. For example, for an inward-folding foldable screen, when the state of the foldable display screen changes to a closed state, the display screen goes out. In this case, the refresh of the view of the first application component can be suspended. For another example, for an inward-folding foldable screen, when the state of the foldable display screen changes to an unfolded state, the small screen of the electronic device will go out. In this case, the refresh of the view of the first application component can be suspended. The small screen is relative to the main display screen (also called the large screen) of the foldable display screen. The small screen and the large screen are arranged opposite to each other on two planes of the electronic device. When the foldable display screen is unfolded, the small screen may go out. When the foldable display screen is folded, the small screen may light up.

[0207] In another possible implementation of pausing the refresh of the first application component, the first event information is that the first application component is switched to the background, for example, the page containing the first application component is swiped away, or the first application component is blocked by an open application interface.

[0208] In one possible implementation, after pausing the refresh of the first application component, the electronic device can also resume the refresh of the first application component according to the situation. Exemplarily, the host application of the first application component receives the second event information, and the host application responds to the second event information to notify the first application to resume rendering the view of the first application component. For example, the host application can send a third message to the first application to notify the first application to resume rendering the view of the first application component. Corresponding to the first event, the second event is used to indicate that the first application component is switched to the foreground or the obstruction is eliminated or the display screen where the page displaying the first application component is located is lit.

[0209] In a possible implementation method for restoring and refreshing the first application component, the second event information is screen-on event information. For example, when the electronic device turns on the screen, the hardware layer or system layer of the electronic device can obtain the event information and can notify the application framework layer of the event information. The application framework layer can notify the host application of the first application component of the event information. Optionally, if the electronic device has multiple display screens, after the application framework layer receives the second event information (screen-on event information), it can interact with the application component management service to determine whether the first application component is displayed on the screen where the screen turns on. If the first application component is displayed, the host application of the first application component is notified to resume rendering the first application component.

[0210] In another possible implementation of resuming the refresh of the first application component, the second event information is display screen physical state event information. For electronic devices with foldable screens, a change in the physical state of the display screen may refer to a change in the unfolded angle of the foldable screen. For example, for an inward-folding foldable screen, when the state of the foldable display screen changes to the unfolded state, the display screen lights up, in which case the refresh of the view of the first application component can be resumed.

[0211] In another possible implementation of restoring and refreshing the first application component, the second event information is that the first application component is switched to the foreground, for example, the page containing the first application component is slid back, or the application interface that blocks the first application component is closed.

[0212] In one possible implementation, the electronic device may delete the first application component according to the user's request. Exemplarily, after the host application of the first application component receives the request to delete the first application component, it responds to the request by notifying the first application to stop rendering the view of the first application component and delete the first application component. Furthermore, the first cache area may be released to reclaim storage resources. Optionally, the first cache area may be released by the host application of the first application component, or the first application or the application component management service. Exemplarily, if the first cache area is applied for by the first application, the first cache area may be requested to be released by the first application; if the first cache area is applied for by the host application, the host application may request to release the first cache area; if the first cache area is applied for by the application component management service, the application component management service may request to release the first cache area.

[0213] In one possible implementation, multiple application components can be created for the same application (or the application component can be created multiple times). For example, after creating the first application component according to the process shown in Figure 8 or Figure 9, if the electronic device receives a request to create a second application component, the second application component maps the first application, and the electronic device responds to the request by generating a second page, which includes a view of the second application component. The method for creating the second application component can refer to the method for creating the first application component mentioned above, and will not be repeated here.

[0214] Optionally, the electronic device may receive a request to create a second application component based on a detected second user operation. That is, the electronic device may detect a second user operation and may determine that the second user operation is used to request the creation of a second application component. In other words, the user may request the creation of a second application component through a second user operation. It is understood that, similar to the first user operation, the second user operation may include a touch operation on the electronic device and may also include an operation in the form of user voice. The embodiment of the present application does not limit the type of the second user operation. An example of a second user operation may be shown in Figure 6a or Figure 6b.

[0215] In one possible scenario, the two requests for creating application components are both used to request adding an application component corresponding to the first application to the desktop. Adding the first application component and the second application component to the page provided by the desktop application can include the following three situations:

[0216] Case 1: The second page containing the second application component is the same page as the first page containing the first application component. For example, if the workspace area of ​​the first page has enough space to accommodate the first application component and the second application component, the first application component and the second application component can be displayed on the same page (i.e., the first page mentioned above).

[0217] Case 2: The second page containing the second application component is not the same page as the first page containing the first application component. For example, after accommodating the first application component, there is not enough space in the workspace area of ​​the first page to accommodate the second application component. If there is enough space in the second page provided by the desktop application to accommodate the second application component, the second application component can be added to the second page.

[0218] Case 3: The second page containing the second application component is a newly created page. For example, if the workspace area of ​​the first page does not have enough space for the second application component after accommodating the first application component, and no other pages currently provided by the desktop application have enough space to accommodate the second application component, the desktop application can create a new page and add the second application component to the newly created page.

[0219] In another possible implementation, of the two requests to create application components, one request is for adding a first application component of a first application to the desktop, and the other request is for adding a second application component of the first application to the negative one screen. In this case, the first application component is added to the page of the desktop application, and the second application component is added to the page provided by the negative one screen. The implementation method for adding the first application component to the page provided by the desktop application is as described above and will not be repeated here.

[0220] In one possible implementation, multiple application components for the same application can share a single cache. That is, the data for the views of these multiple application components all come from this cache, thereby saving storage resource overhead. For example, after creating a first application component according to the process shown in Figures 8 or 9, if the electronic device receives a request to create a second application component, the second application component is mapped to the first application. In response to this request, the electronic device generates a second page that includes a view of the second application component generated based on the data stored in the first cache. In other words, there is no need to request a new cache for the second application component; the host application of the second application component can use the data in the first cache to display the second application component. For example, in the case where the application component provider application requests the cache, upon receiving the request to create the second application component, the host application of the second application component does not need to notify the provider application. In another example, in the case where the host application requests the cache, upon receiving the request to create the second application component, the host application of the second application component does not need to request a new cache for the second application component.

[0221] Optionally, after receiving a request to create the second application component, or after completing the creation of the second application component, the host application of the second application component may send relevant information about the second application component to the application component management service so that the application component management service can manage the second application component. Optionally, if the application component management service requests a cache area, and the application component management service determines, based on the relevant information about the second application component, that both the second application component and the first application component are application components corresponding to the first application, then there is no need to request allocation of a new cache area for the second application component.

[0222] Taking into account that the application components provided by some applications may include application components of multiple styles, and the service functions and / or information provided by application components of different styles are different, for this application, if the style of the second application component is the same as that of the first application component, the first application component and the second application component can share the same cache area based on the above method; if the style of the second application component is different from that of the first application component, a new cache area can be requested to be allocated for the second application component to store the data of the view of the second application component.

[0223] In one possible implementation, when multiple application components are created for an application and the multiple application components share a cache area, when one or some of the application components are deleted, the cache area is retained, and the application continues to render the application components to ensure that the application components that have not been deleted can be displayed normally. When the last application component of the multiple application components is deleted, the cache area is released to save storage resources.

[0224] Taking the creation of a first application component and a second application component for a first application as an example, in one possible scenario, when the host application of the second application component receives a request to delete the second application component, in response to the request, the second application component in the second page is deleted; when the host application of the first application component receives a request to delete the first application component, in response to the request, the first application is notified to stop rendering the view of the first application component, the first application component in the first page is deleted, and the following operations are performed: notifying the first application to release the first cache area, or the host application to release the first cache area, or notifying the application component management service to release the first cache area. In another possible scenario, the request to delete the first application component is received by the electronic device before the request to delete the second application component, so the operation of deleting the first application component is performed first, and then the operation of deleting the second application component is performed. The implementation method of the specific operations is similar to the above implementation method and will not be repeated.

[0225] Optionally, after receiving the request to delete the application component, the host application of the application component may interact with the application component management service to obtain whether the application component currently requested to be deleted is the last application component among the application components created for the first application.

[0226] In a possible implementation, the electronic device may further edit the application component in response to a user's editing operation on the application component.

[0227] In one possible implementation, a host application of a first application component receives a request to edit the first application component, where the request is used to request that a first style of the first application component (the first style is the current style of the first application component) be updated to a second style. For example, the first-style application component occupies a 2×2 grid, and the second-style application component occupies a 1×2 grid. In response to the request, the host application of the first application component may update the size of a first view container (i.e., a container for accommodating the view of the first application component) and establish a mapping relationship between the updated view container and a first cache area. More specifically, the host application of the first application component establishes a mapping relationship between each pixel within the area occupied by the first view container and a storage unit in the first cache area, so that the application component with the updated style can be displayed on the page. Optionally, an alternative implementation of the operation performed by the host application of the first application component in response to the request is: the host application of the first application component deletes the first view container, creates a new view container in the page provided by the host application to accommodate the application component with the updated style, the size of the view container matching the second style, and then establishes a relationship between the new view container and the first cache area.

[0228] It can be understood that the display method provided in the above embodiments of the present application can be applicable to multiple application components, such as application components corresponding to a single application, or to combined application components corresponding to multiple applications, and the embodiments of the present application do not limit this.

[0229] The embodiments of the present application also provide a display method that allows application components to be added and displayed in the current manner. When a request is made to add an application component again for the same application, the application component can be displayed based on the cache corresponding to the already added application component, rather than requesting a cache area for the newly requested application component. Figure 10 illustrates an exemplary process of this method.

[0230] Refer to Figure 10, which is a flow chart of a display method provided in an embodiment of the present application. The process can be applied to electronic devices. In conjunction with the hardware structure of the electronic device shown in Figure 4, the process can be executed by the processor 110, or the process can be implemented on the processor 110. Optionally, the processor 110 may include a CPU and a GPU. In some embodiments of the present application, the process can be implemented by cooperating with the CPU and the GPU. For example, part of the logic of the process is implemented by the CPU, and the CPU can call the GPU to render and draw the page. In conjunction with the software system architecture of the electronic device shown in Figure 5, the process can be executed by the host application of the application component (i.e., the user of the application component), or further implemented in conjunction with the application component management service.

[0231] As shown in Figure 10, the process may include the following steps:

[0232] Step 1001: Determine to add a first application component, render a view of the first application component, store data of the view of the first application component in a first cache, and generate a first page, the first page including the view of the first application component generated based on the data stored in the first cache. The first application component is associated with a first application program.

[0233] For example, in one possible scenario, after the host application of the first application component receives a request to create (or add) the first application component, it can obtain the layout description file of the application component of the first application, and render the application component according to the layout described in the layout description file. For example, the electronic device can receive a request to create the first application component based on a detected first user operation. That is, the electronic device can detect the first user operation and can determine that the first user operation is used to request the creation of the first application component. In other words, the user can request the creation of the first application component through the first user operation. It can be understood that the first user operation can include touch operations on the electronic device, and can also include operations in the form of user voice. The embodiment of the present application does not limit the type of the first user operation. An example of a first user operation can be shown in Figure 6a or Figure 6b.

[0234] In one possible implementation, a first user operation can request a page type (e.g., desktop or negative one screen) on which to create the first application component. In another possible implementation, the page (e.g., desktop or negative one screen) where the application component is located is set by default and cannot be selected or specified by a user operation.

[0235] For example, in another possible scenario, when a first application component has been added to the first page, when the electronic device is restarted, when loading or preloading the first page, the electronic device can determine that the first application component corresponding to the first application needs to be added to the interface of the first host application based on the relevant information of the saved first host application interface (the first host application is the application to which the first page belongs).

[0236] Step 1002: Determine to add a second application component and generate a second page, wherein the second page includes a view of the second application component generated based on the data stored in the first cache area, wherein the second application component maps to the first application program.

[0237] Optionally, the first application component and the second application component have the same style.

[0238] For example, in one possible scenario, after the host application of the second application component receives a request to create the second application component, since the second application component and the first application component belong to the application components corresponding to the same application, it is not necessary to request allocation of a new cache area for the second application component. Instead, the second application component uses the data stored in the previously created first cache area for display, thereby reducing storage resource overhead.

[0239] As another example, in another possible scenario, when a first application component has been added to a first page and a second application component has been added to a second page, when the electronic device is restarted, when loading or preloading the first page and the second page, the electronic device can determine that the first application component needs to be added to the first page and the second application component needs to be added to the second page based on the saved relevant information of the first page and the second page, and the provider application of the first application component and the second application component is the same. Therefore, there is no need to request allocation of a new cache area for the second application component. Instead, the second application component uses the data stored in the previously created first cache area for display, thereby reducing storage resource overhead.

[0240] In one possible scenario, the host application of the first application component and the host application of the second application component can be the same, for example, both are desktop applications. That is, the request to create the first application component and the request to create the second application component are both used to request to add application components to the desktop. The host application of the first application component and the host application of the second application component can also be different. For example, the request to create the first application component is used to request to add the first application component to the desktop, and the request to create the second application component is used to request to add the second application component to the negative one screen.

[0241] In one possible scenario, if the host application of the first application component and the host application of the second application component are the same application, and if the first page can accommodate the first and second application components, the first and second application components can be added to the first page, that is, the first and second pages are the same page. If the first page does not have enough space to accommodate the second application component after accommodating the first application component, the second application component can be accommodated on another page or a new page, that is, the first and second pages are different pages.

[0242] In one possible implementation, after receiving a request to create the first application component, the host application of the first application component can interact with the component management service to determine whether an application component has already been created for the first application. Similarly, after receiving a request to create the second application component, the host application of the second application component can interact with the component management service to determine whether an application component has already been created for the first application. If the host application determines that the application component has not yet been created for the first application, a request is made to allocate a cache area for storing data of the application component's view. If the host application determines that the application component has already been created for the first application, the request to allocate a cache area is not necessary.

[0243] In one possible implementation, the host application of the first application component can set a first view container on the first page, and the first view container is used to display the view of the first application component; the first application component can associate the first cache area with the first view container. Similarly, the host application of the second application component can set a second view container on the second page, and the second view container is used to display the view of the second application component; the host application of the second application component can associate the first cache area with the second view container. The association method between the view container and the cache area can be referred to the relevant content above and will not be repeated here.

[0244] In one possible implementation, when the host application of the first application component receives first event information, such as a screen-off event or a physical state change event of a foldable display, the host application of the first application component can suspend rendering of the first application component. Similarly, when the host application of the second application component receives first event information, such as a screen-off event or a physical state change event of a foldable display, the host application of the second application component can suspend rendering of the first application component. For the description of the first event, please refer to the relevant content above.

[0245] In one possible implementation, when the host application of the first application component receives a second event message, such as a screen-on event or a physical state change event of a foldable display, the host application of the first application component can resume rendering the first application component. Similarly, when the host application of the second application component receives a second event message, such as a screen-on event or a physical state change event of a foldable display, the host application of the second application component can resume rendering the first application component. For the description of the second event, please refer to the relevant content above.

[0246] In one possible implementation, when multiple application components are created for an application and the multiple application components share a cache area, when one or some of the application components are deleted, the cache area is retained, and the application continues to render the application components to ensure that the application components that have not been deleted can be displayed normally. When the last application component of the multiple application components is deleted, the cache area is released to save storage resources.

[0247] Taking the creation of the first application component and the second application component for the first application as an example, in one possible scenario, when the host application of the second application component receives a request to delete the second application component, in response to the request, the second application component in the second page is deleted; when the host application of the first application component receives a request to delete the first application component, in response to the request, it stops rendering the view of the first application component, deletes the first application component in the first page, and performs the following operations: the host application releases the first cache area, or notifies the application component management service to release the first cache area. In another possible scenario, the request to delete the first application component is received by the electronic device before the request to delete the second application component, so the operation of deleting the first application component is performed first, and then the operation of deleting the second application component is performed. The implementation method of the specific operation is similar to the above implementation method and will not be repeated.

[0248] Optionally, after receiving the request to delete the application component, the host application of the application component may interact with the application component management service to obtain whether the application component currently requested to be deleted is the last application component among the application components created for the first application.

[0249] Optional, for In the process shown in FIG10 above, the host application of the first application component, the first application and the application component management service can transmit and communicate information based on the IPC communication mechanism of AIDL Binder. ), information transmission and communication can be carried out between the host application of the first application component, the first application and the application component management service based on the IDL Binder IPC communication mechanism.

[0250] In the process shown in FIG10 , when application components are created multiple times for an application, the multiple application components can share a cache area, or the view data of the multiple application components all come from a cache area, thereby saving storage overhead of the electronic device.

[0251] Based on the above embodiments, the present application further provides an electronic device, which includes multiple functional modules; the multiple functional modules interact with each other to implement the functions performed by the electronic device in each method described in the embodiments of the present application. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation. For example, the method steps performed by the electronic device in the embodiments shown in Figures 8, 9, or 10 are executed.

[0252] Based on the above embodiments, the present application further provides an electronic device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor performs the functions performed by the electronic device in each method described in the embodiments of the present application. For example, the method steps performed by the electronic device in the embodiments shown in Figures 8, 9, or 10 are performed.

[0253] Based on the above embodiments, the present application also provides a computer program product, which includes: a computer program (also referred to as code, or instructions), which enables the various methods described in the embodiments of the present application to be executed when the computer program is run.

[0254] Based on the above embodiments, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program (also referred to as code or instructions), which, when executed by a computer, causes the computer to perform the methods described in the embodiments of the present application.

[0255] Based on the above embodiments, the present application further provides a chip, which is used to read a computer program stored in a memory and implement the methods described in the embodiments of the present application.

[0256] Based on the above embodiments, the present application provides a chip system, which includes a processor for supporting a computer device to implement the various methods described in the embodiments of the present application. In a possible embodiment, the chip system also includes a memory, which is used to store the necessary programs and data for the computer device. The chip system can be composed of a chip, or it can include chips and other discrete devices. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0257] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.

[0258] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0259] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0260] Obviously, those skilled in the art may make various modifications and variations to this application without departing from the scope of protection of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A display method, characterized in that: include: Determining to add a first application component, wherein the first application component is associated with a first application program; Notifying the first application to render a view of the first application component; A first page is generated, wherein the first page includes a view of the first application component.

2. The method according to claim 1, characterized in that The data of the view of the first application component is stored in a first cache area; The view of the first application component included in the first page is generated according to the data stored in the first cache area.

3. The method according to claim 2, characterized in that The first cache area is a cache area shared by a host application of the first application component and the first application, and the first page is a page of the host application; The notifying the first application to render the view of the first application component and generate a first page includes: The host application notifies the first application to render a view of the first application component; The host application generates the first page.

4. The method according to claim 2 or 3, characterized in that Also includes: Setting a view container in the first page, wherein the view container is used to display the view of the first application component; Associating the first cache area with the view container.

5. The method according to claim 4, characterized in that The associating the first cache area with the view container includes: The address of the first buffer area is associated with the view container.

6. The method according to any one of claims 2 to 5, characterized in that: The first cache area is allocated by request of the first application program; or The first cache area is allocated by request of a host application of the first application component; or The first cache area is allocated by the application component management service request.

7. The method according to any one of claims 1 to 6, characterized in that: The notifying the first application to render the view of the first application component includes: The host application of the first application component sends first information to the first application, where the first information is used to notify the first application to render a view of the first application component.

8. The method according to any one of claims 1 to 7, characterized in that: Also includes: The host application of the first application component receives first event information, where the first event information is used to indicate that the host application of the first application component switches to background operation or that the first application component is blocked; The host application notifies the first application to stop rendering the view of the first application component in response to the first event information.

9. The method according to claim 8, characterized in that Also includes: The host application of the first application component receives second event information, where the second event information is used to indicate that the host application of the first application component is switched to the foreground or that the shielding of the first application component is eliminated; The host application notifies the first application to resume rendering the view of the first application component in response to the second event information.

10. The method according to any one of claims 2 to 9, characterized in that: Also includes: Determining to add a second application component, wherein the second application component is associated with the first application program; A second page is generated, wherein the second page includes a view of the second application component generated according to the data stored in the first cache area.

11. The method according to claim 10, characterized in that The service provided by the second application component is the same as the service provided by the first application component, and the style of the second application component is the same as the style of the first application component.

12. The method according to claim 10 or 11, characterized in that Also includes: receiving a request to delete the second application component, and deleting the second application component in the second page in response to the request to delete the second application component; receiving a request to delete the first application component, and in response to the request to delete the first application component, notifying the first application to stop rendering a view of the first application component, deleting the first application component in the first page, and performing the following operations: Notify the first application to release the first buffer area; or releasing the first buffer area; or Notify the application component management service to release the first cache area.

13. A display method, characterized in that: include: Determining to add a first application component, wherein the first application component is associated with a first application program; Rendering a view of the first application component, where data of the view of the first application component is stored in a first cache area; Generate a first page, wherein the first page includes a view of the first application component generated according to the data stored in the first cache area; Determining to add a second application component, wherein the second application component is associated with the first application program; A second page is generated, wherein the second page includes a view of a second application component generated according to the data stored in the first cache area.

14. The method according to claim 13, characterized in that The service provided by the second application component is the same as the service provided by the first application component, and the style of the second application component is the same as the style of the first application component.

15. The method according to claim 13 or 14, characterized in that The method further comprises: The host application of the first application component sets a first view container in the first page, the first view container being used to display the view of the first application component; and associates the first cache area with the first view container; The host application of the second application component sets a second view container in the second page, and the second view container is used to display the view of the second application component; and the first cache area is associated with the second view container.

16. The method according to claim 15, characterized in that The associating the first cache area with the first view container comprises: associating the address of the first cache area with the first view container; The associating the first cache area with the second view container includes: associating the address of the first cache area with the second view container.

17. The method according to any one of claims 13 to 16, characterized in that: Also includes: receiving a request to delete the second application component, and deleting the second application component in the second page in response to the request to delete the second application component; receiving a request to delete the first application component; In response to the request to delete the first application component, stop rendering the view of the first application component, delete the first application component in the first page, and perform the following operations: release the first cache area, or notify the component management service to release the first cache area.

18. A device, characterized in that: The method comprises a unit or a module for executing the method according to any one of claims 1 to 12, or comprises a unit or a module for executing the method according to any one of claims 13 to 17.

19. A device, characterized in that: include: Processing unit; The processing unit is configured to determine to add a first application component, wherein the first application component is associated with a first application program; Notifying the first application to render a view of the first application component; as well as A first page is generated, wherein the first page includes a view of the first application component.

20. A device, characterized in that: include: Processing unit; The processing unit is configured to determine to add a first application component, wherein the first application component is associated with a first application program; Determining to add a second application component, wherein the second application component is associated with the first application program; as well as Rendering a view of the first application component, wherein data of the view of the first application component is stored in a first cache area, and generating a first page, wherein the first page includes the view of the first application component generated according to the data stored in the first cache area; And, generating a second page, wherein the second page includes a view of a second application component generated according to the data stored in the first cache area.

21. A device, characterized in that: include: One or more processors, and one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the device to perform the method as described in any one of claims 1-12, or perform the method as described in any one of claims 13-17.

22. A readable storage medium, characterized in that: The method comprises a computer program, which, when executed on a device, causes the device to execute the method according to any one of claims 1 to 12, or to execute the method according to any one of claims 13 to 17.

23. A computer program product, characterized in that When the method is executed on a device, the device is caused to execute the method according to any one of claims 1 to 12, or execute the method according to any one of claims 13 to 17.

24. A chip system, characterized in that: include: processor; When the processor calls and runs the computer program from the memory, the device equipped with the chip system executes the method as described in any one of claims 1-12, or executes the method as described in any one of claims 13-17.