CN115309470A - Method, device and equipment for loading widgets and storage medium - Google Patents

Method, device and equipment for loading widgets and storage medium Download PDF

Info

Publication number
CN115309470A
CN115309470A CN202210820930.6A CN202210820930A CN115309470A CN 115309470 A CN115309470 A CN 115309470A CN 202210820930 A CN202210820930 A CN 202210820930A CN 115309470 A CN115309470 A CN 115309470A
Authority
CN
China
Prior art keywords
widget
interactive
displayed
rendering result
configuration data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210820930.6A
Other languages
Chinese (zh)
Other versions
CN115309470B (en
Inventor
周航
袁弼黎
陈铭
高炜
陈宗远
师帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210820930.6A priority Critical patent/CN115309470B/en
Publication of CN115309470A publication Critical patent/CN115309470A/en
Priority to PCT/CN2023/075396 priority patent/WO2024011899A1/en
Application granted granted Critical
Publication of CN115309470B publication Critical patent/CN115309470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Abstract

The disclosure provides a widget loading method, a widget loading device, widget loading equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of clients. The specific implementation scheme is as follows: acquiring code data, layout information and style resources corresponding to the target widget; determining a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information and the style resources; converting the rendering result into a target form matched with the terminal equipment to obtain an object to be displayed; determining interactive configuration data corresponding to the object to be displayed according to the interactive response information; and loading the target widget according to the object to be displayed and the interactive configuration data. The present disclosure also provides a program product.

Description

Method, device and equipment for loading widget and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of client technology.
Background
In recent years, with the development of the internet, smart devices such as smart phones and tablet computers have become more and more popular. A user may obtain various services through an Application (APP) in the smart device. A Widget is an application plug-in, and can be used to display various information of an application, such as weather, news, pictures, and the like. The Widget may be exposed on a desktop, an application interface, or a website page. The Widget can have the effects of improving the efficiency of obtaining value information by a user, meeting the requirement of beautifying the desktop of the user, optimizing the retention of the user and the like. Therefore, many applications have introduced Widget functionality.
Disclosure of Invention
The disclosure provides a method, a device, equipment, a storage medium and a program product for loading a widget.
According to an aspect of the present disclosure, there is provided a method for loading a widget, including: acquiring code data, layout information and style resources corresponding to the target widget; determining a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information and the style resources; converting the rendering result into a target form matched with the terminal equipment to obtain an object to be displayed; according to the interactive response information, determining interactive configuration data corresponding to the object to be displayed; and loading the target widget according to the object to be displayed and the interactive configuration data.
According to another aspect of the present disclosure, there is provided a widget loading apparatus including: the acquisition module is used for acquiring code data, layout information and style resources corresponding to the target widget; the first determining module is used for determining a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information and the style resources; the conversion module is used for converting the rendering result into a target form matched with the terminal equipment to obtain an object to be displayed; the second determining module is used for determining interactive configuration data corresponding to the object to be displayed according to the interactive response information; and the loading module is used for loading the target widget according to the object to be displayed and the interactive configuration data.
Another aspect of the present disclosure provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of the embodiments of the present disclosure.
According to another aspect of the disclosed embodiments, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method shown in the disclosed embodiments.
According to another aspect of an embodiment of the present disclosure, a computer program product is provided, which includes computer programs/instructions, and is characterized in that when being executed by a processor, the computer programs/instructions implement the steps of the method shown in the embodiment of the present disclosure.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 schematically illustrates an exemplary system architecture of a loading method and apparatus to which widgets may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a method of loading widgets according to an embodiment of the present disclosure;
FIG. 3 schematically shows a flow chart of a method of rendering results and interaction response information according to an embodiment of the disclosure;
FIG. 4 schematically shows a schematic diagram of the loading of a widget, according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of a method for loading widgets according to another embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of a widget loading apparatus according to another embodiment of the present disclosure; and
FIG. 7 schematically shows a block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The system architecture of the loading method and apparatus to which the present disclosure can apply widgets will be described below with reference to fig. 1.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which the loading method and apparatus of widgets may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The backend management server may analyze and process the received data such as the user request, and feed back a processing result (for example, a web page, information, or data obtained or generated according to the user request) to the terminal device.
The Server 105 may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a conventional physical host and a VPS service (Virtual Private Server, or VPS for short). The server 105 may also be a server of a distributed system, or a server incorporating a blockchain.
According to an embodiment of the present disclosure, the terminal devices 101, 102, 103 may send widget loading requests to the server 105. The server 105, in response to receiving a widget loading request from a terminal device, may acquire code data, layout information, and style resources corresponding to the widget loading request. The code data, layout information and style resources are then transmitted to the terminal devices 101, 102, 103. The terminal devices 101, 102, 103 may load corresponding widgets according to the code data, layout information and style resources.
However, the terminal devices 101, 102, 103 may each be based on a different operating system, wherein the operating systems may include, for example, android, harmony os, iOS, and so on. Widgets supported by different operating systems are not the same. Therefore, in the related art, it is necessary to respectively develop corresponding widgets for different operating systems, and the development threshold and the development cost are high.
Based on this, according to the embodiment of the present disclosure, when receiving a widget loading request from a terminal device, the server 105 parses a target widget for which the widget loading request is directed. Code data, layout information, and style resources corresponding to the target widget may then be retrieved. The code data, layout information and style resources are then transmitted to the terminal device. The terminal device may determine a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information, and the style resource. And then converting the rendering result into a target form matched with the terminal equipment to obtain the object to be displayed. And determining interactive configuration data corresponding to the object to be displayed according to the interactive response information. The target widget may then be loaded according to the object to be presented and the interactive configuration data.
The code data, the layout information and the style resources corresponding to the target widget are converted into the object to be displayed and the interactive configuration data which can be adapted to the terminal equipment, so that the target widget can be compatible with different operating systems. Repeated development is not needed, and the development threshold and the development cost are reduced.
In the related art, a widget is directly developed in an Application program through an Application Programming Interface (API), and the Application program needs to be updated when the widget is updated.
According to the embodiment of the disclosure, the code data, the layout information and the style resources issued to the terminal equipment are controlled by the server, so that the terminal equipment can generate the corresponding widgets according to the code data, the layout information and the style resources, the widgets can be updated without updating an application program, and the widgets can be dynamically updated at any time.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure, application and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations, necessary confidentiality measures are taken, and the customs of the public order is not violated.
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
The method for loading the widget provided by the present disclosure will be described below with reference to fig. 2.
Fig. 2 schematically shows a flowchart of a method of loading a widget according to an embodiment of the present disclosure.
As shown in FIG. 2, the method 200 for loading a widget includes operations S210-S250. The method 200 for loading the widget may be performed by the terminal device shown above, for example.
In operation S210, code data, layout information, and style resources corresponding to the target widget are acquired.
According to an embodiment of the present disclosure, a Widget (Widget) is an application plug-in, and may be used to display various types of information of an application, such as weather, news, pictures, and the like. The widget may be exposed in a desktop, application interface, or website page. The target widget is a widget which the terminal device intends to load.
According to the embodiment of the disclosure, the code data can be used for realizing the business logic corresponding to the widget. The code data may include, for example, code developed by a scripting language such as JavaScript. The layout information may be used to describe the layout of the widget. The layout information may include, for example, an HTML (HyperText Markup Language) file or the like. The Style resource may be used to describe a Style of the widget, and may include, for example, CSS (Style Sheets), pictures, and the like.
According to an embodiment of the present disclosure, a terminal device may acquire code data, layout information, and style resources corresponding to a target widget from a server, for example.
Then, in operation S220, a rendering result and interactive response information corresponding to the rendering result are determined according to the code data, the layout information, and the style resource.
According to the embodiment of the disclosure, for example, rendering can be performed according to the layout information and the style resources, and the original widget is obtained as a rendering result. The interactive response information may be used to describe an interactive response function of the rendered original widget. The interaction response information may include, for example, a web page DOM (document object model) tree, a structured native view tree, and the like.
Illustratively, for example, the layout information is HTML, and the style resource is CSS, rendering may be performed according to the HTML and the CSS, to obtain a widget in the form of a web page as a rendering result.
In operation S230, the rendering result is converted into a target form matched with the terminal device, so as to obtain the object to be displayed.
According to the embodiment of the disclosure, the terminal equipment is the terminal equipment needing to load the widgets. Since the terminal device may be based on different types of operating systems, some terminal devices may not support direct loading of the original widget because of operating system compatibility issues. Based on the method, the rendering result can be converted into a target form matched with the terminal equipment, and the object to be displayed is obtained.
According to an embodiment of the present disclosure, the target form may be determined according to an operating system type of the terminal device. The target form may include, for example, pictures, text, lists, and the like.
In operation S240, interactive configuration data corresponding to the object to be displayed is determined according to the interactive response information.
According to an embodiment of the present disclosure, the interaction configuration data may be used to describe an interaction response function corresponding to an object to be presented.
In operation S250, a target widget is loaded according to an object to be displayed and the interactive configuration data.
According to the embodiment of the disclosure, the terminal device can display the object to be displayed in the widget display area. And then, setting an interactive response function for the widget display area according to the interactive configuration data, thereby realizing the loading of the target widget.
For example, in this embodiment, a display container may be disposed in the widget display area, and the object to be displayed is added to the display container for displaying. The display container may, for example, include a view component. The View component may include, for example, a View component in an Android system, a UIView component in an iOS system, and the like.
The operating system of the terminal device limits the types of view components that can be used in the widget presentation area, and therefore the rendering result needs to be converted into a target form matching the terminal device. For example, for Android, harmony os, iOS, and the like, a view component (WebView) for presenting a web page is not allowed to be used in the widget presentation area. Therefore, the widget in the form of the web page cannot be displayed in the widget display area, so that the rendering result in the form of the web page can be converted into a form that can be supported by an operating system such as a picture.
According to the embodiment of the disclosure, code data, layout information and style resources of the target widget are converted into the object to be displayed and the interactive configuration data which can be adapted to the terminal equipment aiming at the terminal equipment based on different operating systems, and then the target widget is loaded according to the object to be displayed and the interactive configuration data, so that the terminal equipment of different operating systems can be supported, corresponding widgets do not need to be developed aiming at different operating systems respectively, and development threshold and development cost are reduced.
In addition, according to the embodiment of the present disclosure, the server controls the code data, the layout information, and the style resources issued to the terminal device, so that the terminal device generates the corresponding widget according to the code data, the layout information, and the style resources, the widget can be updated without updating the application program, and the widget can be dynamically updated at any time.
According to the embodiment of the disclosure, a user can trigger widget adding operation through the terminal device, and the adding operation can be used for adding widgets to a desktop of the terminal device. The user may then manually specify the services provided by the widget or may be automatically operated by the application to set the services provided by the widget. The services may include, for example, displaying examination information, displaying weather information, displaying lottery information, and the like. And then storing the mapping relation among the widget identification of the widget, the summary information and the service identification of the corresponding service. The summary information of the widget may include, for example, a width, a height, a page address of the acquired content data, a theme color, an update interval, a configuration page address, and the like. For example, in this embodiment, corresponding summary information may be set in advance for each widget according to actual needs.
According to the embodiment of the disclosure, when the widget is loaded, the terminal device may query the corresponding service identifier and the summary information according to the identifier information of the widget, and send a request to the corresponding server according to the service identifier and the summary information to obtain the content data of the widget. And then generating a rendering result according to the layout information, the style resources and the content data. And loading the widget based on the rendering result. The content data may include data displayed in the widget, such as examination information, weather information, lottery information, news information, and the like. And then generating a rendering result according to the layout information, the style resources and the content data.
According to the embodiment of the disclosure, when the widget needs to be refreshed, the terminal device may query the corresponding service identifier and summary information according to the identifier information of the widget, and send a request to the corresponding server according to the service identifier and the summary information to acquire new content data. And then generating a new rendering result according to the layout information, the style resources and the new content data. The widget is then updated based on the new rendering results. The refreshing of the widget can be triggered periodically according to user configuration or automatically, or can be triggered by setting an alarm clock by an application program.
According to the embodiment of the disclosure, for example, all the widget services supported by each application program can be managed in a cloud aggregation manner. When the cloud receives a content acquisition request from the terminal equipment, the latest content data specified by the parameters can be issued to the terminal equipment according to the parameters in the request. The parameters may include, for example, service information such as city information, examination type, and the like.
For example, a plurality of servers may be disposed at the cloud, and each widget service may have a corresponding server module for providing content data for the widget.
The method for determining rendering results and interactive response information provided by the present disclosure will be described below with reference to fig. 3.
Fig. 3 schematically shows a flowchart of a method of rendering results and interactive response information according to an embodiment of the present disclosure.
As shown in fig. 3, the method 320 of rendering a result and interacting response information includes generating an original page according to layout information and style resources in operation S321.
According to an embodiment of the present disclosure, an original page of an original widget may be generated, for example, according to layout information and style resources.
In operation S322, the code data is executed, resulting in an execution result.
According to the embodiment of the disclosure, the data which needs to be dynamically generated in the original widget can be generated as the execution result by executing the code data. For example, part of the elements in the original widget require dynamic calculation of element sizes, based on which the element sizes of these elements can be generated as a result of execution by executing the code data.
According to another embodiment of the present disclosure, the content data in the external server may also be acquired as an execution result by executing the code data. For example, weather information is required to be exposed in the original widget, and based on this, the weather information can be acquired from the server by executing the code data as a result of the execution.
In operation S323, a target page is generated as a rendering result according to the execution result and the original page.
According to the embodiment of the present disclosure, for example, the target page may be obtained by adding dynamically generated data and/or content data from an external server to the original page.
For example, the dynamically generated element size may replace a corresponding element size in the original page to obtain the target page.
For another example, the weather information from the external server may be added to the corresponding position in the original page to obtain the target page.
According to an embodiment of the present disclosure, a destination page may include at least one interactive element. The interactive element has an interactive response function and can respond to the interactive operation to trigger a corresponding response event. The interactive elements may include, for example, buttons, text, pictures, and the like. The interaction may include, for example, a click, a long press, and the like. The response event may include, for example, jumping to a corresponding application program interface or web page, executing a program instruction opened by the target application program through the interface, and so on.
In operation S324, an interactive response code corresponding to at least one interactive element in the code data is determined as interactive response information.
According to embodiments of the present disclosure, an interactive response code corresponding to an interactive element may be used to indicate which interactive operations the interactive element will respond to, and what the corresponding response event is.
According to the embodiment of the present disclosure, after the interactive response information is determined, for example, an element region corresponding to at least one interactive element in the object to be presented may be determined. And then, according to the interactive response information, determining interactive configuration data of each element area.
Correspondingly, according to the embodiment of the disclosure, after receiving the interaction configuration data, the terminal device may divide the widget presentation area into at least one sub-presentation area according to at least one element area indicated by the interaction configuration data. At least one sub-presentation area corresponds to at least one element area one to one. A view component is disposed in each of the at least one sub-presentation area. And then configuring an interactive response function for the view component corresponding to each element area according to the interactive configuration data of each element area.
According to another embodiment of the present disclosure, the terminal device may also set a main view component in the widget display area, where the main view component includes at least one sub-view component, and the at least one sub-view component corresponds to the at least one element area one to one. And then configuring an interactive response function for the child view component corresponding to each element area according to the interactive configuration data of each element area.
The method for loading the widget shown above is further described with reference to fig. 4. Those skilled in the art will appreciate that the following example embodiments are only for the understanding of the present disclosure, and the present disclosure is not limited thereto.
Illustratively, in this embodiment, the code data of the widget includes JavaScript data, the layout information of the widget includes HTML, and the style resource of the widget includes CSS.
Fig. 4 schematically shows a schematic diagram of the loading of a widget according to an embodiment of the present disclosure.
In fig. 4, it is shown that the terminal device may load and render a page of a widget according to HTML and CSS based on a browser technology, resulting in a rendering result r1 and interactive response information t1. The rendering result r1 may then be processed as a picture as the object p1 to be presented. For example, a screenshot can be taken of a page of the widget to obtain a picture. The form of the picture can be supported by mainstream operating systems such as Android, harmonyOS and iOS.
Illustratively, in the present embodiment, the rendering result r1 includes a vehicle detection button 41, a travel policy button 42, a vehicle service place button 43, a news report column 44, a city column 45, and other elements. Wherein the vehicle detection applet is invoked when the vehicle detection button 41 is clicked. And invokes the administration search results page when the travel policy button 42 is clicked. The vehicle service map page is called up when the vehicle service place button 43 is clicked. The newscast bar 44, when clicked, invokes up the local newscast page. The city bar 45, when clicked, invokes the city switch settings page. Other elements invoke the search results page when clicked.
Based on this, p1 may be divided into multiple grid regions, each of which may respond to interaction events separately, and the interaction responses may support including but not limited to invoking host application pages, other application pages, and triggering other custom instructions. Then, the area t11 corresponding to the vehicle detection button 41, the area t12 corresponding to the travel policy button 42, the area t13 corresponding to the vehicle service place button 43, the area t14 corresponding to the news bulletin board 44, and the area t15 corresponding to the city board 45 may be specified in p1. The other elements correspond to other regions than the regions t11, t12, t13, t14, t15.
And then determines the interactive response information t1 according to the interactive response codes of the vehicle detection button 41, the travel policy button 42, the vehicle service place button 43, the news bulletin board 44 and the city board 45.
After receiving the object p1 to be displayed and the interaction configuration data t1, the terminal device may display the object p1 to be displayed in the widget display area, and then divide the widget display area into t11, t12, t13, t14, t15 and other areas according to the element area indicated by the interaction configuration data t1. And configures an interactive response function for each zone. For example, the vehicle detection applet is invoked when region t11 is clicked. When area t12 is clicked, the administrative search results page is invoked. The vehicle service map page is called up when region t13 is clicked. The local news report page is called up when the area t14 is clicked. And calling up the city switch setting page when the area t15 is clicked. And calling up a search result page when other areas except the areas t11, t12, t13, t14 and t15 in the widget display area are clicked.
According to another embodiment of the present disclosure, for example, a layout template file supporting presentation of pictures may be set in advance according to APIs of various operating systems. The layout template file may be published with the application. The picture content displayed in the layout template file supports arbitrary settings. Based on this, the rendering result may be converted into at least one picture. And then determining an object to be displayed according to the template file and the at least one picture corresponding to the terminal equipment. For example, the rendering result may be converted into a picture and then set in the layout template file to obtain the object to be displayed. Particularly, for pictures with longer height and exceeding the widget display area, a list view component can be arranged in the widget display area, and then the pictures are divided according to the size of the widget display area and are longitudinally arranged and placed in the list view component to support the pictures.
The method for loading the widget shown above is further described with reference to the specific embodiments. It will be appreciated by those skilled in the art that the following example embodiments are only for the understanding of the present disclosure, and the present disclosure is not limited thereto.
Exemplarily, in this embodiment, it is assumed that Widget instances w1 and w2 exist on a mobile phone of a user, where w1 is added to a desktop and automatically configured to use a service s1 after a Widget adding operation is triggered on an in-application page p1 by the user, and there is content correlation between the p1 page and the service s 1. w2 is manually added on the desktop by a user and manually selected as the service s2, s2 is one of the services supported by the server corresponding to the application program, and the service supported by the server can be newly added at any time so as to realize expansion.
For example, in this embodiment, the terminal device may configure information shown in table 1 in the Widget configuration storage module in advance.
Figure 768322DEST_PATH_IMAGE001
When an operating system or an application program triggers the refresh of the Widget instance w1, or a user manually triggers the refresh of the Widget instance w1, the terminal device may query the server module s1 corresponding to the unique identifier i1 of w1 from the Widget configuration storage module, and initiate a request for obtaining Widget content to s 1. And s1 returns Widget content c1, wherein c1 comprises code data, layout information, style resources and the like written by a dynamic scripting language.
The terminal device may parse and execute the code data included in c1, and output the rendering result r1 and the interactive response information t1 in combination with the layout information, the style resource, and the like.
Then, the terminal device may convert r1 into a content form supported by the terminal device, where the content form is, for example, a picture, and the content supported by the terminal device is presented in the desktop Widget display container corresponding to the w1 instance.
In addition, the terminal device may convert t1 into an interactive configuration form supported by the terminal device. For example, the entire Widget region may be divided into sequentially numbered meshed sub-regions, and independent interactive responses may be configured for each sub-region using a sub-view of the mesh type view control using the mesh type view control. Alternatively, several independent views, each configured with an independent interactive response, may be used, arranged in a grid.
Through the steps, the user can see the Widget rendering content generated after the dynamic logic processing, and the user can click the area on the Widget to trigger the specific interactive response of the area. Wherein the interactive response may support including but not limited to invoking a host application page, other application pages, and triggering other custom instructions. In this embodiment, both the rendering content and the interactive response information support dynamic modification along with any program logic.
When an operating system or an application program triggers the refresh of a Widget instance w2, or a user manually triggers the refresh of the Widget instance w2, the terminal device queries a server module s2 corresponding to the unique identifier i2 of the Widget 2 from a Widget configuration storage module, initiates a Widget content acquisition request to s2, and returns Widget content c2 to s2, wherein c2 comprises code data written by a dynamic scripting language, layout information, style resources and the like.
The terminal device may analyze and execute the service logic code included in c2, and output the layout rendering result r2 and the interactive response information t2 in combination with the layout information, the style resource, and the like.
Then, the terminal device may convert r2 into a content format supported by the terminal device, such as a picture, and present the content supported by the terminal device in a desktop Widget display container corresponding to the w2 instance.
In addition, the terminal device can convert t2 into an interactive configuration form supported by the terminal device. For example, the entire Widget region may be divided into sequentially numbered meshed sub-regions, and independent interactive responses may be configured for each sub-region using a sub-view of the mesh type view control using the mesh type view control. Alternatively, several independent views, each configured with an independent interactive response, may be used, arranged in a grid.
Through the steps, the user can see the Widget rendered content generated after the dynamic logic processing, and can click the area on the Widget to trigger the specific interactive response of the area. Wherein the interactive response may support including but not limited to invoking host application pages, other application pages, and triggering other custom instructions. In this embodiment, both the rendering content and the interactive response information support dynamic modification along with any program logic.
When the Widget instance w1 needs to be upgraded, s1 returns updated Widget content c11 to the terminal device when receiving the Widget content acquisition request, wherein c11 contains upgraded code data, layout information, style resources and the like.
Rendering by the terminal equipment according to the c11, wherein the subsequent flow is the same as the previous flow. Thus, the user can see the upgraded widget. The same applies when the interactive response information needs to be upgraded.
When a Widget service class s3 needs to be added to the application program, the developer may submit the service class s3 to the server. The activated usage pattern of s3 may include, for example: when the application program accesses the page related to the s3 content, a button for automatically adding and configuring the Widget corresponding to the s3 service can be provided, and after clicking the button, the user newly generates a Widget instance w3 on the desktop and provides the s3 service.
After manually adding the Widget instance w3 on the desktop, the user may present a configuration service list to the user, where the configuration service list includes s3 service, and the user may manually select s3, so as to set w3 to use s3 service.
Fig. 5 schematically shows a flowchart of a method for loading a widget according to another embodiment of the present disclosure.
As shown in fig. 5, the loading method 500 of the widget includes the server acquiring code data, layout information, and style resources of the original widget in operation S510.
Then, the server determines a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information, and the style resource in operation S520.
According to the embodiment of the present disclosure, for example, reference may be made to the foregoing description for a specific method for determining a rendering result and interactive response information corresponding to the rendering result, which is not described again.
In operation S530, the server converts the rendering result into a target form matched with the terminal device, and obtains an object to be displayed.
According to the embodiment of the present disclosure, for example, reference may be made to the foregoing description for a specific method for converting a rendering result into a target form matched with a terminal device, and details are not described again.
In operation S540, the server determines the interactive configuration data corresponding to the object to be displayed according to the interactive response information.
According to the embodiment of the present disclosure, for example, reference may be made to the above description for a specific method for determining the interactive configuration data corresponding to the object to be displayed, and details are not repeated again.
In operation S550, the server transmits the object to be displayed and the interactive configuration data to the terminal device.
In operation S560, the terminal device receives the object to be presented and the interactive configuration data from the server.
In operation S570, the terminal device loads the target widget according to the object to be displayed and the interactive configuration data.
According to the embodiment of the present disclosure, for example, reference may be made to the above for a specific method for loading a target widget according to an object to be displayed and interactive configuration data, which is not described again.
The operating system and/or browser of some terminal devices have compatibility problems, which results in that rendering results and interactive response information cannot be generated according to code data, layout information and style resources.
According to the embodiment of the disclosure, the server executes the operation of determining the rendering result and the interactive response information and converting the rendering result and the interactive response information into the object to be displayed and the interactive configuration data which are matched with the terminal equipment, so that the compatibility problem of operating systems and/or browsers of different terminal equipment can be avoided.
And the terminal equipment executes the operations of determining the rendering result and the interactive response information and converting the rendering result and the interactive response information into the object to be displayed and the interactive configuration data which are matched with the terminal equipment, so that the calculation pressure of the server can be reduced. In addition, the terminal equipment can acquire unique parameter information of the terminal equipment, and determines a rendering result and/or interactive response information according to the parameter information, so that richer functions can be realized in the widget. For example, the terminal device may obtain its own geographic location parameter, determine content data matching the geographic location parameter, add the content data to the rendering result, and thereby display the content data matching the geographic location of the terminal device in the widget.
The loading device of the widget provided by the present disclosure will be described below with reference to fig. 6.
Fig. 6 schematically shows a block diagram of a loading apparatus of a widget according to an embodiment of the present disclosure.
As shown in fig. 6, the widget loading device 600 includes an obtaining module 610, a first determining module 620, a converting module 630, and a second determining module 640.
The obtaining module 610 is configured to obtain code data, layout information, and style resources corresponding to the target widget.
And a first determining module 620, configured to determine, according to the code data, the layout information, and the style resource, a rendering result and interactive response information corresponding to the rendering result.
And a conversion module 630, configured to convert the rendering result into a target form matched with the terminal device, so as to obtain the object to be displayed.
The second determining module 640 is configured to determine, according to the interaction response information, interaction configuration data corresponding to the object to be displayed.
And the loading module 650 is configured to load the target widget according to the object to be displayed and the interactive configuration data.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 7 schematically illustrates a block diagram of an example electronic device 700 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701 which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The calculation unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 701 executes the respective methods and processes described above, such as the loading method of the widget. For example, in some embodiments, the loading method of the widget may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the loading method of the widget described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured in any other suitable manner (e.g., by way of firmware) to perform the loading method of the widget.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (11)

1. A method for loading a widget comprises the following steps:
acquiring code data, layout information and style resources corresponding to the target widget;
determining a rendering result and interactive response information corresponding to the rendering result according to the code data, the layout information and the style resources;
converting the rendering result into a target form matched with the terminal equipment to obtain an object to be displayed;
according to the interactive response information, determining interactive configuration data corresponding to the object to be displayed; and
and loading the target widget according to the object to be displayed and the interactive configuration data.
2. The method of claim 1, wherein the determining, from the code data, the layout information, and the style resources, a rendering result and interactive response information corresponding to the rendering result comprises:
generating an original page according to the layout information and the style resources;
executing the code data to obtain an execution result;
generating a target page as the rendering result according to the execution result and the original page, wherein the target page comprises at least one interactive element; and
and determining an interactive response code corresponding to the at least one interactive element in the code data as the interactive response information.
3. The method according to claim 2, wherein the determining, according to the interactive response information, interactive configuration data corresponding to the object to be displayed includes:
determining at least one element area corresponding to the at least one interactive element in the object to be displayed; and
and determining interaction configuration data of each element area in the at least one element area according to the interaction response information.
4. The method according to any one of claims 1-3, wherein the converting the rendering result into a target form matched with the terminal device to obtain the object to be displayed comprises:
converting the rendering result into at least one picture; and
and determining the object to be displayed according to the layout template file corresponding to the terminal equipment and the at least one picture.
5. The method of claim 3, wherein the loading the target widget according to the object to be presented and the interactive configuration data comprises:
displaying the object to be displayed in a widget display area; and
and setting an interactive response function for the widget display area according to the interactive configuration data.
6. The method of claim 5, wherein the setting of the interactive response function for the widget presentation area according to the interactive configuration data comprises:
dividing the widget display area into at least one sub-display area according to the at least one element area;
setting a view component in each of the at least one sub-presentation area; and
and configuring an interactive response function for the view component corresponding to each element area according to the interactive configuration data of each element area.
7. The method of claim 5, wherein the setting of the interactive response function for the widget presentation area according to the interactive configuration data comprises:
setting a main view component in the widget display area, wherein the main view component comprises at least one sub-view component, and the at least one sub-view component corresponds to the at least one element area one by one; and
and configuring an interactive response function for the sub-view component corresponding to each element area according to the interactive configuration data of each element area.
8. A widget loading apparatus comprising:
the acquisition module is used for acquiring code data, layout information and style resources corresponding to the target widget;
a first determining module, configured to determine, according to the code data, the layout information, and the style resource, a rendering result and interactive response information corresponding to the rendering result;
the conversion module is used for converting the rendering result into a target form matched with the terminal equipment to obtain an object to be displayed;
the second determining module is used for determining interactive configuration data corresponding to the object to be displayed according to the interactive response information; and
and the loading module is used for loading the target widget according to the object to be displayed and the interactive configuration data.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
11. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method according to any of claims 1-7.
CN202210820930.6A 2022-07-13 2022-07-13 Method, device, equipment and storage medium for loading widget Active CN115309470B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210820930.6A CN115309470B (en) 2022-07-13 2022-07-13 Method, device, equipment and storage medium for loading widget
PCT/CN2023/075396 WO2024011899A1 (en) 2022-07-13 2023-02-10 Widget loading method and apparatus, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210820930.6A CN115309470B (en) 2022-07-13 2022-07-13 Method, device, equipment and storage medium for loading widget

Publications (2)

Publication Number Publication Date
CN115309470A true CN115309470A (en) 2022-11-08
CN115309470B CN115309470B (en) 2023-07-28

Family

ID=83857378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210820930.6A Active CN115309470B (en) 2022-07-13 2022-07-13 Method, device, equipment and storage medium for loading widget

Country Status (2)

Country Link
CN (1) CN115309470B (en)
WO (1) WO2024011899A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074435A (en) * 2022-12-23 2023-05-05 深圳前海百递网络有限公司 Method and device for updating small component, electronic equipment and computer storage medium
WO2024011899A1 (en) * 2022-07-13 2024-01-18 百度在线网络技术(北京)有限公司 Widget loading method and apparatus, device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886435A (en) * 2017-01-04 2017-06-23 乐视控股(北京)有限公司 The loading method and device of widget
CN112395027A (en) * 2019-08-14 2021-02-23 腾讯科技(深圳)有限公司 Widget interface generation method and device, storage medium and electronic equipment
CN113127091A (en) * 2021-03-17 2021-07-16 北京达佳互联信息技术有限公司 Widget display method, device, equipment, storage medium and program product
CN113220176A (en) * 2021-04-13 2021-08-06 Oppo广东移动通信有限公司 Display method and device based on widget, electronic equipment and readable storage medium
CN113268305A (en) * 2021-06-01 2021-08-17 中兴通讯股份有限公司 Display method and device of widget, terminal and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866283B (en) * 2009-04-14 2013-03-27 华为技术有限公司 Widget transplanting method and device
CN103605527A (en) * 2013-12-06 2014-02-26 普元信息技术股份有限公司 System and method for realizing cloud computing application interface integration and unified style display
US10268460B2 (en) * 2017-01-25 2019-04-23 Walmart Apollo, Llc Systems, method, and non-transitory computer-readable storage media for generating code for displaying a webpage
CN115309470B (en) * 2022-07-13 2023-07-28 百度在线网络技术(北京)有限公司 Method, device, equipment and storage medium for loading widget

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886435A (en) * 2017-01-04 2017-06-23 乐视控股(北京)有限公司 The loading method and device of widget
CN112395027A (en) * 2019-08-14 2021-02-23 腾讯科技(深圳)有限公司 Widget interface generation method and device, storage medium and electronic equipment
CN113127091A (en) * 2021-03-17 2021-07-16 北京达佳互联信息技术有限公司 Widget display method, device, equipment, storage medium and program product
CN113220176A (en) * 2021-04-13 2021-08-06 Oppo广东移动通信有限公司 Display method and device based on widget, electronic equipment and readable storage medium
CN113268305A (en) * 2021-06-01 2021-08-17 中兴通讯股份有限公司 Display method and device of widget, terminal and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024011899A1 (en) * 2022-07-13 2024-01-18 百度在线网络技术(北京)有限公司 Widget loading method and apparatus, device, and storage medium
CN116074435A (en) * 2022-12-23 2023-05-05 深圳前海百递网络有限公司 Method and device for updating small component, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
WO2024011899A1 (en) 2024-01-18
CN115309470B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN106991154B (en) Webpage rendering method and device, terminal and server
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
EP3518124A1 (en) Webpage rendering method and related device
CN109683998B (en) Internationalization realization method, device and system
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN110032324B (en) Text selection method and terminal
CN106874519B (en) Page display method and device
US10951486B2 (en) Terminal device, UI expansion method, and UI expansion program
CN112395027A (en) Widget interface generation method and device, storage medium and electronic equipment
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN111079048B (en) Page loading method and device
CN111783019A (en) Browser sub-page creation method and device, computer equipment and storage medium
US11151314B2 (en) Extensible grid layout
CN107918552B (en) Light application calling method and device, client device and electronic equipment
CN112395535A (en) Image lazy loading method and device, medium and electronic equipment
RU2634221C2 (en) Method and device for drawing presentation of electronic document on screen
US11438403B2 (en) Page presentation method and system, computer system, and computer readable medium
CN114398023A (en) File generation method and page configuration method and device
CN110309454B (en) Interface display method, device, equipment and storage medium
CA3093640A1 (en) Systems and methods for providing a web application to a computing device
US11874890B2 (en) Multi-entry point navigation for user interfaces
JP2014059700A (en) Screen control display system and screen control display program
WO2022113315A1 (en) User interface extension system, user interface extension method, and user interface extension program
CN114065077A (en) Webpage display method and device, electronic equipment and storage medium
CN108268297B (en) Application interface display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant