Component loading method and device applied to application program and electronic equipment
Generate and render native component tags through runtime technology, and directly mount them to browser pages using same-layer rendering technology. This solves the problems of high access cost and intrusiveness of HTML5 services in same-layer rendering technology, and improves browser pages. rendering effect.
Patent Information
- Application Number
- CN202310327463.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
When using same-layer rendering technology in web pages developed based on HTML5, the creation, addition, removal and attribute change monitoring of native components require the active participation of the HTML5 business, resulting in high access costs and strong intrusion into the HTML5 business.
The component tags corresponding to the native components of the application are generated through runtime technology, and the same-layer rendering technology is used to directly mount the native components to the browser page for rendering, which reduces the cost of rendering the same-layer components and improves the quality of the browser page. Rendering effect.
It effectively reduces the cost of rendering components at the same layer, improves the rendering effect of the application's browser page, and reduces the intrusion into HTML5 business.
Smart Images

Figure CN118733135A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a component loading method, device, electronic device and storage medium applied to an application program. Background Art
[0002] Currently, when native components are used in web pages developed based on HyperText Markup Language 5 (HTML5), the same-layer rendering technology is usually used to directly mount and render the native components at the browser level.
[0003] In the related technology, the creation, addition, and removal of native components rendered on the same layer all require HTML5 service implementation. When the native components rendered on the same layer monitor the attribute changes of the corresponding component tags, the HTML5 service is required to actively send tag attribute change messages.
[0004] This approach will result in high access costs for the same-layer rendering technology and will be highly invasive to HTML5 services. Summary of the invention
[0005] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0006] To this end, the purpose of the present disclosure is to propose a component loading method, device, electronic device, storage medium and computer program product for application, which can generate component tags corresponding to native components of the application through runtime technology, and use same-layer rendering technology to directly mount the native components into the browser page of the application for rendering, effectively reducing the cost of rendering the same-layer components and effectively improving the rendering effect of the browser page of the application.
[0007] An embodiment of the first aspect of the present disclosure proposes a component loading method applied to an application, the application comprising: a page to be loaded; the method comprising: determining at least one candidate native component of the page to be loaded; determining a registered component identifier and a configured component identifier corresponding to each candidate native component, the registered component identifier being used to identify a candidate native component that has been registered by the application, and the configured component identifier being used to identify a candidate native component that has been configured; determining a target native component from at least one candidate native component based on the registered component identifier and the configured component identifier; and loading the target native component into the page to be loaded.
[0008] The component loading method applied to an application proposed in the embodiment of the first aspect of the present disclosure determines at least one candidate native component of the page to be loaded; determines a registered component identifier and a configured component identifier corresponding to each candidate native component, the registered component identifier is used to identify the candidate native component that has been registered by the application, and the configured component identifier is used to identify the candidate native component that has been configured; determines a target native component from at least one candidate native component according to the registered component identifier and the configured component identifier; and loads the target native component into the page to be loaded, which can generate a component tag corresponding to the native component of the application through runtime technology, and use the same-layer rendering technology to directly mount the native component into the browser page of the application for rendering, effectively reducing the cost of rendering the same-layer components and effectively improving the rendering effect of the browser page of the application.
[0009] A second aspect embodiment of the present disclosure proposes a component loading device applied to an application, the application comprising: a page to be loaded; the device comprising: a first determination module, used to determine at least one candidate native component of the page to be loaded; a second determination module, used to determine a registered component identifier and a configured component identifier corresponding to each candidate native component, the registered component identifier being used to identify a candidate native component that has been registered by the application, and the configured component identifier being used to identify a candidate native component that has been configured; a third determination module, used to determine a target native component from at least one candidate native component based on the registered component identifier and the configured component identifier; and a processing module, used to load the target native component into the page to be loaded.
[0010] The component loading device applied to an application proposed in the second aspect of the embodiment of the present disclosure determines at least one candidate native component of the page to be loaded; determines a registered component identifier and a configured component identifier corresponding to each candidate native component, the registered component identifier is used to identify the candidate native component that has been registered by the application, and the configured component identifier is used to identify the candidate native component that has been configured; determines a target native component from at least one candidate native component according to the registered component identifier and the configured component identifier; and loads the target native component into the page to be loaded. It can generate a component tag corresponding to the native component of the application through runtime technology, and use the same-layer rendering technology to directly mount the native component into the browser page of the application for rendering, effectively reducing the cost of same-layer component rendering and effectively improving the rendering effect of the browser page of the application.
[0011] The third aspect embodiment of the present disclosure proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the component loading method applied to the application proposed in the first aspect embodiment of the present disclosure.
[0012] The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the component loading method applied to an application as proposed in the first aspect embodiment of the present disclosure.
[0013] The fifth aspect of the present disclosure provides a computer program product. When instructions in the computer program product are executed by a processor, the component loading method applied to an application as proposed in the first aspect of the present disclosure is executed.
[0014] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0016] Figure 1 is a flowchart of a component loading method applied to an application program proposed in an embodiment of the present disclosure;
[0017] Figure 2 is a flowchart of a component loading method applied to an application program proposed in another embodiment of the present disclosure;
[0018] Figure 3 is a schematic diagram of the same-layer rendering process in an embodiment of the present disclosure;
[0019] Figure 4 is a flowchart of a component loading method applied to an application program proposed in another embodiment of the present disclosure;
[0020] Figure 5 is a structural diagram of a component loading device applied to an application program proposed in an embodiment of the present disclosure;
[0021] Figure 6 is a structural diagram of a component loading device applied to an application program proposed in another embodiment of the present disclosure;
[0022] Figure 7 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0023] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and are not to be construed as limitations of the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.
[0024] Figure 1 It is a flowchart of a component loading method applied to an application program proposed in an embodiment of the present disclosure.
[0025] It should be noted that the executor of the component loading method applied to the application in this embodiment is a component loading device applied to the application, which can be implemented by software and / or hardware, and can be configured in an electronic device, without limitation.
[0026] The disclosed embodiments can be applied to mobile applications (Application, App), wherein the application includes: a page to be loaded, which refers to a browser page (WebView) to be rendered. Based on the same-layer rendering technology, the native components of the application can be directly mounted on the browser page for rendering.
[0027] like Figure 1 As shown, the component loading method applied to the application includes:
[0028] S101: Determine at least one candidate native component of a page to be loaded.
[0029] The page to be loaded refers to a browser page (WebView) to be rendered, and the page to be loaded is a web page developed based on the hypertext markup language HTML5.
[0030] Among them, the candidate native components refer to the native components to be selected for loading and rendering in the page to be loaded. Components can be selected from the candidate native components, and based on the same-layer rendering technology, the corresponding components can be directly mounted to the page to be loaded developed based on HTML5.
[0031] Among them, the native component refers to the native component of the App. The candidate native component can be, for example, a native video component, a native image component, and a native map component, or can be any other native component of the App, without limitation.
[0032] In the embodiment of the present disclosure, when determining at least one candidate native component of the page to be loaded, the native component to be directly mounted and rendered to the page to be loaded can be determined as a candidate native component. The candidate native component can be a native video component, a native image component, a native map component, etc. The candidate native component can be a component that is currently implemented and supported in the App or a currently available configuration component indicated in the configuration information sent by the server.
[0033] For example, the application scenario is that two components, video component and image component, are registered in the App. If an error occurs in the video component online, the component sent by the server configuration can be changed to only send the image component. At this time, the components that have been implemented and supported in the App are the video component and the image component. The currently available configuration component indicated in the configuration information sent by the server is the image component. At this time, the video component and the image component can be used as candidate native components.
[0034] In an embodiment of the present disclosure, when determining at least one candidate native component, the native business component (such as a picture component, a video component, etc.) of the same-layer rendering base component for accessing the same-layer rendering technology can be first determined. When accessing, the native business components of the respective businesses are based on the same-layer rendering base component, and the components for the same-layer rendering business are developed by inheriting the same-layer rendering base component. At the same time, an embodiment of the present disclosure provides a same-layer rendering registrar for the business accessing the same-layer rendering technology, for registering the same-layer rendering business components developed by it. Then, the developed and registered components for the same-layer rendering business can be used as candidate native components.
[0035] In the disclosed embodiment, the same-layer rendering base component includes five parts: a function registration interface, an attribute registration interface, public functions (Common functions), public attributes (Common attributes) and a same-layer rendering tag, wherein the function registration interface is used to register functions of the same-layer rendering business component that need to be open to HTML5 business use, the attribute registration interface is used to register the attributes of the corresponding custom HTML tags that the same-layer rendering business component needs to monitor, the Common function is used for the public functions of the same-layer rendering base component, such as the grayscale switch function of the same-layer rendering business component, the Common attribute is used for the public attributes of the same-layer rendering base component, such as the src, style, and class attributes, the same-layer rendering tag is used for the life cycle functions (constructor, connectedCallback, disconnectedCallback, observedAttributes, and attributeChangedCallback) of the corresponding custom HTML tags of the same-layer rendering business component, the same-layer rendering business component functions and Common functions registered through the function registration interface, the same-layer rendering business component attributes and Common attributes registered through the attribute registration interface, and the native-js communication function for HTML5 to communicate with the native part of the App.
[0036] The same-layer rendering register function in the embodiment of the present disclosure is divided into two parts: the same-layer rendering register provides a registration interface in the form of a preprocessing macro, and writes the registered information into the data segment of the mach-o file during compilation; the same-layer rendering register registers a dyld_callback function (dyld_callback is a custom function for reading the data segment of the mach-o file) through the function _dyld_register_func_for_add_image (the system calls the function registered by it when the system loads the mach-o file).
[0037] S102: Determine a registered component identifier and a configured component identifier corresponding to each candidate native component, wherein the registered component identifier is used to identify a candidate native component that has been registered by an application program, and the configured component identifier is used to identify a candidate native component that has been configured.
[0038] The registered component identifier refers to a component identifier used to identify a candidate native component that has been registered by an application. The registered component identifier is a component class name of the candidate native component that has been registered by the application.
[0039] The configuration component identifier refers to a component identifier used to identify a candidate native component that has been configured and sent by the server. The configuration component identifier is a component class name of the candidate native component that has been configured and sent by the server.
[0040] After determining at least one candidate native component of the page to be loaded, the embodiment of the present disclosure may determine a registered component identifier and a configured component identifier corresponding to each candidate native component.
[0041] In the disclosed embodiment, when determining the registered component identifier and the configured component identifier corresponding to each candidate native component, the component class name of the candidate native component that has been registered by the application can be determined as the registered component identifier, and the component class name of the candidate native component that has been configured and issued by the server can be determined as the configured component identifier, so as to determine the registered component identifier and the configured component identifier corresponding to each candidate native component.
[0042] S103: Determine a target native component from at least one candidate native component according to the registered component identifier and the configured component identifier.
[0043] The target native component refers to a same-layer rendering component that is to be directly mounted to the page to be loaded of the application program for rendering using the same-layer rendering technology.
[0044] After determining the registration component identifier and the configuration component identifier corresponding to each candidate native component, the embodiment of the present disclosure can determine the target native component from at least one candidate native component according to the registration component identifier and the configuration component identifier.
[0045] In an embodiment of the present disclosure, when determining a target native component from at least one candidate native component based on a registered component identifier and a configured component identifier, the intersection component identifier among the registered component identifier and the configured component identifier can be obtained, and the candidate native component corresponding to the intersection component identifier can be obtained as the target native component, and then the target native component can be directly mounted to the to-be-loaded page of the application based on the same-layer rendering technology.
[0046] For example, when determining the target native component from at least one candidate native component based on the registered component identifier and the configured component identifier, the component class name of the registered same-layer rendering business component and the component class name of the configured same-layer rendering business component in the App cache can be read (the component class name is the component identifier in the embodiment of the present disclosure) to obtain the intersection of the two (the intersection is the available same-layer rendering business component, and the available same-layer rendering component is the target native component in the embodiment of the present disclosure), and then the same-layer rendering business component corresponding to the intersection can be obtained through runtime technology (its essence is to dynamically obtain the class existing in the App through the class name, that is, to obtain the same-layer rendering business component through the class name of the same-layer rendering business component), and then the component tag corresponding to the target native component can be generated, and the generated same-layer rendering tag and whether the same-layer rendering component is available JS can be injected into the HTML file of the page to be loaded.
[0047] S104: Load the target native component into the page to be loaded.
[0048] In the embodiment of the present disclosure, after determining the target native component from at least one candidate native component according to the registered component identifier and the configured component identifier, the target native component can be loaded into the page to be loaded.
[0049] In the disclosed embodiment, when the target native component is loaded into the page to be loaded, the App can be started first, the system loads the mach-o file of the App, the system calls the function registered by _dyld_register_func_for_add_image, and calls the registered custom function dyld_callback, that is, reading the data segment of the mach-o file, searching for the registration information of the target native component, and writing the target component identifier (component class name) of the found target native component into the App cache. The system calls the load function of all classes referenced by the App. At this time, the system will call the load function of the WebView of the page to be loaded, mount the initialization function of the WebView of the page to be loaded in the load function of the WebView of the page to be loaded, add the above-mentioned same-layer rendering tag and whether the same-layer rendering component is available JS to the initialization function of the WebView of the page to be loaded, and after the App is loaded, initiate a network request to the server to obtain the configured target native component, and write the acquisition result into the App cache, and then the App can load the uniform resource locator (uniform resource locator) of the page to be loaded. locator, URL), parses the URL and starts to initialize the WebView of the page to be loaded, and downloads the HTML file corresponding to the page to be loaded. The HTML file contains the component tag of the target native component, parses and renders the HTML file, calls the life cycle function of the target component tag, and sends a life cycle function message (i.e., constructor message) to the native part of the App. After the native part of the App receives the life cycle function message of the same-layer rendering tag, it will generate a corresponding same-layer rendering business component according to the message of the same-layer rendering tag. The same-layer rendering business component is a component object created based on the class of the target native component. When the browser renders, it will create a component node corresponding to the target native component, and add the corresponding target native component to the component node to load the target native component into the page to be loaded.
[0050] Optionally, in some embodiments, when loading the target native component into the page to be loaded, a target component tag of the target native component may be generated, and the target native component may be loaded into the page to be loaded according to the target component tag.
[0051] Among them, the target component tag refers to a component tag that contains the properties and functions required for rendering the target native component. The target native component can be loaded into the page to be loaded according to the target component tag.
[0052] In the disclosed embodiment, when the target native component is loaded into the page to be loaded, a target component tag of the target native component can be generated. The basic component tag of the page to be loaded can be obtained first, and then the component attributes and component functions corresponding to the target native component can be obtained through runtime technology. The obtained attributes are placed in the observedAttributes of the basic component tag corresponding to the target native component, the obtained function is encapsulated and placed in the function JS of the basic component tag corresponding to the target native component, and the component tag after the corresponding write processing is used as the target component tag of the target native component, and the target component tag is injected into the HTML file corresponding to the page to be loaded. When parsing and rendering the HTML file, it is the target component tag, and the target native component is loaded into the page to be loaded.
[0053] In this embodiment, by determining at least one candidate native component of the page to be loaded, determining the registered component identifier and the configured component identifier corresponding to each candidate native component, the registered component identifier is used to identify the candidate native component that has been registered by the application, and the configured component identifier is used to identify the candidate native component that has been configured, and according to the registered component identifier and the configured component identifier, determining the target native component from at least one candidate native component, and loading the target native component into the page to be loaded, it is possible to generate a component tag corresponding to the native component of the application through runtime technology, and use the same-layer rendering technology to directly mount the native component into the browser page of the application for rendering, thereby effectively reducing the cost of rendering the same-layer components and effectively improving the rendering effect of the browser page of the application.
[0054] Figure 2 It is a flowchart of a component loading method applied to an application program proposed in another embodiment of the present disclosure.
[0055] like Figure 2 As shown, the component loading method applied to the application includes:
[0056] S201: Determine at least one candidate native component of a page to be loaded.
[0057] S202: Determine a registered component identifier and a configured component identifier corresponding to each candidate native component, wherein the registered component identifier is used to identify a candidate native component that has been registered by an application program, and the configured component identifier is used to identify a candidate native component that has been configured.
[0058] S203: Determine a target native component from at least one candidate native component according to the registered component identifier and the configured component identifier.
[0059] For the description of S201 to S203 , please refer to the above embodiments, which will not be repeated here.
[0060] S204: Generate a target component tag of the target native component using runtime technology.
[0061] In the disclosed embodiment, when generating the target component tag of the target native component, the basic component tag of the page to be loaded can be obtained first, and then the component attributes and component functions corresponding to the target native component can be obtained based on the runtime technology, and the obtained attributes can be placed in the observedAttributes of the basic component tag corresponding to the target native component, and the obtained function can be encapsulated and placed in the function JS of the basic component tag corresponding to the target native component, and the component tag after the corresponding write processing can be used as the target component tag of the target native component to implement the runtime technology and generate the target component tag of the target native component.
[0062] S205: Obtain an initial page script file corresponding to the page to be loaded.
[0063] Among them, the initial page script file corresponding to the page to be loaded refers to the page script file corresponding to the page to be loaded without writing the target component tag corresponding to the target native component into the page script file. The page script file refers to an HTML script file developed based on Hypertext Markup Language that can be used to parse and render the page to be loaded.
[0064] In the disclosed embodiment, when obtaining the initial page script file corresponding to the page to be loaded, the application program may download the initial page script file corresponding to the page to be loaded from the server.
[0065] S206: writing the target component tag into the initial page script file to obtain the target page script file.
[0066] Among them, the target page script text refers to the page script file corresponding to the page to be loaded, in which the target component tag corresponding to the target native component is written in the page script file.
[0067] After obtaining the initial page script file corresponding to the page to be loaded, the embodiment of the present disclosure may write a target component tag into the initial page script file to obtain a target page script file.
[0068] S207: Parse the target page script file to load the target native component into the page to be loaded.
[0069] In the embodiment of the present disclosure, after obtaining the initial page script file corresponding to the page to be loaded and writing the target component tag into the initial page script file to obtain the target page script file, the target page script file can be parsed to load the target native component into the page to be loaded.
[0070] In the disclosed embodiment, when parsing the target page script file to load the target native component into the page to be loaded, the target page script file can be parsed by a browser, and the target component tag in the target page script file can be parsed to generate a component node corresponding to the target native component, and then the target native component can be loaded into the layer position corresponding to the page to be loaded corresponding to the component node.
[0071] Optionally, in some embodiments, when parsing the target page script file to load the target native component into the page to be loaded, the target page script file can be parsed to obtain a component object and a component node corresponding to the target native component, wherein the component node is used to indicate the layer position of the target component tag in the page to be loaded, and the component object is a component instance corresponding to the target native component, and the target native component is loaded into the page to be loaded according to the component object and the component node.
[0072] Among them, the component node is used to indicate the layer position of the target component tag in the page to be loaded. The component node can be the WKChildScrollView node corresponding to the same-layer rendering tag.
[0073] The component object refers to a component instance corresponding to a target native component created according to a component class of the target native component.
[0074] In the disclosed embodiment, when the target page script file is parsed to load the target native component into the page to be loaded, the target page script file contains a target component tag and a JS message indicating whether the same-layer rendering component is available. If same-layer rendering is available, the target page script file uses the same-layer rendering tag (target component tag) corresponding to the target native component. If same-layer rendering is not available for the target page script file, the component tag supported by HTML5 is used to parse and render the target page script file. At this time, the life cycle function of the target component tag is called. If the tag is a same-layer rendering tag, the same-layer rendering tag sends a life cycle function message to the native part of the App through its life cycle function, and the native part of the App responds according to the same-layer rendering tag. The message of the signature generates the corresponding same-layer rendering business component (the same-layer rendering business component is the component object corresponding to the target native component), and the browser renders. If the target page script file contains the same-layer rendering tag, the browser will create a component node (WKChildScrollView node) corresponding to the same-layer rendering tag during rendering. Since the initialization function of WKChildScrollView is mounted, the logic added to the initialization function of the component node WKChildScrollView will be called at this time, and the target native component corresponding to the same-layer rendering tag will be added to the component node WKChildScrollView, so as to load the target native component into the page to be loaded according to the component object and the component node.
[0075] Optionally, in some embodiments, when the target native component is loaded into the page to be loaded according to the component object and the component node, the component object corresponding to the target native component can be loaded to the layer position indicated by the component node in the page to be loaded, so that the target native component can be accurately rendered to the corresponding position of the page to be loaded according to the component node, thereby ensuring the rendering effect of the native component.
[0076] In the disclosed embodiment, when the target native component is loaded into the page to be loaded according to the component object and the component node, since the component node can confirm the position of the target component tag in the browser rendering layer, the target native component corresponding to the target component tag can be inserted at the position corresponding to the component node.
[0077] For example, Figure 3 As shown, Figure 3It is a flowchart of the same-layer rendering in the embodiment of the present disclosure. The flag variable of whether the initialization function of the component node WKChildScrollView in the App cache is mounted is read. If it has been mounted, the current process branch is terminated. If it has not been mounted, the registered same-layer rendering business component and the configured same-layer rendering business component in the App cache are read to obtain the intersection of the two (the intersection is the available same-layer rendering business component), and it is determined whether the same-layer rendering is available. If it is not available, the current process branch is terminated. If the same-layer rendering is available, the flag variable that the initialization function of the component node WKChildScrollView in the App cache is mounted is written as mounted, and the initialization function of the component node WKChildScrollView is mounted. The addition of the same-layer rendering business component is added to its initialization function. The layer name layer name of the parent layer (superView) of WKChildScrollView can be read. Since the layer name of the parent layer of the component node WKChildScrollView corresponding to the same-layer rendering label contains the class information of the label, the layer name of the parent layer of the component node WKChildScrollView can be obtained through the layer Whether name contains the class information of the same-layer rendering tag is used to determine which same-layer rendering tag the current WKChildScrollView belongs to. If the component node WKChildScrollView does not belong to the same-layer rendering tag, the current process branch is ended. If the component node WKChildScrollView belongs to the same-layer rendering tag, the generated same-layer rendering business component object is obtained, and the target native component is added to the component node WKChildScrollView generated by its corresponding target component tag.
[0078] In the embodiment of the present disclosure, a custom same-layer rendering tag corresponding to a same-layer rendering business component is generated through runtime technology, and the same-layer rendering tag is injected into HTML. The HTML5 business can use the same-layer rendering business component through the same-layer rendering tag. The WKChildScrollView node corresponding to the same-layer rendering tag in WebView is found through runtime technology, and the same-layer rendering business component generated based on the life cycle of the same-layer rendering tag is added to this node. The creation, addition, removal, and attribute monitoring of the same-layer rendering component in the embodiment of the present disclosure do not require the participation of the HTML5 business. The HTML5 business can directly use the same-layer rendering business component function, and there is no short blank area at the same-layer rendering tag position.
[0079] In this embodiment, by determining at least one candidate native component of the page to be loaded; determining the registered component identifier and the configured component identifier corresponding to each candidate native component, the registered component identifier is used to identify the candidate native component that has been registered by the application, and the configured component identifier is used to identify the candidate native component that has been configured; according to the registered component identifier and the configured component identifier, determining the target native component from at least one candidate native component, and loading the target native component into the page to be loaded, it is possible to generate a component tag corresponding to the native component of the application through runtime technology, and use the same-layer rendering technology to directly mount the native component into the browser page of the application for rendering, effectively reducing the cost of rendering the same-layer components, and effectively improving the rendering effect of the browser page of the application; by loading the component object corresponding to the target native component into the layer position indicated by the component node in the page to be loaded, the target native component can be accurately rendered to the corresponding position of the page to be loaded according to the component node, thereby ensuring the rendering effect of the native component.
[0080] Figure 4 It is a flowchart of a component loading method applied to an application program proposed in another embodiment of the present disclosure.
[0081] like Figure 4 As shown, the component loading method applied to the application includes:
[0082] S401: Determine at least one candidate native component of a page to be loaded.
[0083] S402: Determine a registered component identifier and a configured component identifier corresponding to each candidate native component, wherein the registered component identifier is used to identify a candidate native component that has been registered by the application program, and the configured component identifier is used to identify a candidate native component that has been configured.
[0084] The number of registered component identifiers is at least one.
[0085] For the description of S401 and S402 , please refer to the above embodiments, which will not be described in detail here.
[0086] S403: Using the registered component identifier that is the same as the configuration component identifier among at least one registered component identifier as the target component identifier.
[0087] In an embodiment of the present disclosure, when determining a target native component from at least one candidate native component based on the registered component identifier and the configured component identifier, the target component identifier corresponding to the target native component can be first determined from the registered component identifier and the configured component identifier, and a registered component identifier in at least one registered component identifier that is the same as the configured component identifier can be used as the target component identifier.
[0088] S404: Determine, from at least one candidate native component, a candidate native component corresponding to the target component identifier as a target native component.
[0089] In the embodiment of the present disclosure, after taking the registered component identifier that is the same as the configuration component identifier in at least one registered component identifier as the target component identifier, a candidate native component corresponding to the target component identifier can be determined from at least one candidate native component as the target native component.
[0090] In an embodiment of the present disclosure, when a candidate native component corresponding to a target component identifier is determined as a target native component from at least one candidate native component, at least one candidate native component can be matched with the target component identifier, and the candidate native component matching the target component identifier is selected as the target native component.
[0091] S405: Obtain a basic component tag corresponding to a basic page component of the page to be loaded, wherein the basic page component is a component that supports a hypertext markup language corresponding to the page to be loaded.
[0092] Among them, the basic page component is a component that supports the hypertext markup language corresponding to the page to be loaded, the basic component tag is the component tag corresponding to the basic page component, and the target component tag corresponding to the target native component can be generated based on the basic component tag.
[0093] In the disclosed embodiment, when generating a target component tag corresponding to a target native component, a basic component tag corresponding to a basic page component of the page to be loaded may be first generated, and then a target component tag corresponding to the target native component may be generated based on the basic component tag.
[0094] S406: Based on the runtime technology, obtain target component attribute information of the target native component.
[0095] In the implementation of the present disclosure, target component property information of a target native component is obtained based on runtime technology. Property information and function information of the target native component can be obtained based on runtime technology as the target component property information of the target native component.
[0096] Optionally, in some embodiments, when obtaining target component attribute information of a target native component based on runtime technology, registration attribute information and general attribute information corresponding to the target native component can be obtained based on runtime technology, wherein the registration attribute information describes the component attributes corresponding to the target native component that has been registered by the application, and the general attribute information is the component attributes of the general component in the page to be loaded. Based on runtime technology, registration function information and general function information corresponding to the target native component are obtained, wherein the registration function information describes the component function corresponding to the target native component that has been registered by the application, and the general function information describes the component function of the general component in the page to be loaded. The registration attribute information, general attribute information, registration function information and general function information are used as target component attribute information, so that the target component attribute information can be obtained based on runtime technology to generate a target component tag of the target native component corresponding to the target native component, without the participation of HTML5 business, thereby reducing the intrusiveness to HTML5 business.
[0097] S407: Generate a target component tag according to the basic component tag and the target component attribute information.
[0098] After obtaining the basic component tag corresponding to the basic page component of the page to be loaded and obtaining the target component attribute information of the target native component based on runtime technology, the embodiment of the present disclosure can generate a target component tag based on the basic component tag and the target component attribute information.
[0099] In an embodiment of the present disclosure, when a target component tag is generated based on a basic component tag and target component attribute information, the registered component attributes and public attributes described in the target component attribute information can be written into the basic component tag, the registered component functions and public component functions described in the target component attribute information can be encapsulated and written into the basic component tag, and the component tag after the processing is written can be used as the target component tag.
[0100] S408: Load the target native component into the page to be loaded according to the target component tag.
[0101] For the description of S408, please refer to the above embodiment, which will not be repeated here.
[0102] In the disclosed embodiments, HTML tags for same-layer rendering are customized, lifecycle functions such as constructor(), connectedCallback(), and disconnectedCallback() of the customized tags are rewritten, and when the lifecycle function of the HTML5 tag is called by WebView, a lifecycle message of the tag is sent to the native part of the application. After the native part of the application receives and parses the message, it creates and removes same-layer rendering business components. In this way, creation and removal of same-layer rendering components are based on the HTML tag lifecycle, and HTML5 business implementation is no longer required. This solves the technical problem that the creation, addition, and removal of same-layer rendering components require HTML5 business implementation, resulting in high access costs for the same-layer rendering technology and strong invasiveness to HTML5 business.
[0103] By rewriting the attributeChangedCallback() function of the custom tag, the attributes of the same-layer rendering component are obtained through runtime technology, and the obtained attributes are written into the attribute observation list (observedAttributes) of the same-layer rendering tag. Then, the custom same-layer rendering tag is injected when WebView loads HTML. In this way, the attribute changes of the same-layer rendering tag will be synchronized to the same-layer rendering business component through the tag's life cycle function attributeChangedCallback(). This solves the problem that the same-layer rendering component monitors the attribute changes of the same-layer rendering tag, and the HTML5 business needs to actively send the tag attribute change message, resulting in high access cost of the same-layer rendering technology and strong invasiveness to the HTML5 business.
[0104] The function of the same-layer rendering business component is obtained through runtime technology, and the obtained function is encapsulated (encapsulating the window.webkit.messageHandlers communication logic) and written into the function JS of the same-layer rendering tag. The same-layer rendering tag is injected when WebView loads HTML, so that the HTML5 business can directly call the function of the same-layer rendering business component through the JS function of the same-layer rendering tag. This solves the problem that the HTML5 business needs to communicate with the same-layer rendering component through window.webkit.messageHandlers when calling the function of the same-layer rendering component, resulting in high access cost of the same-layer rendering technology and strong invasiveness to HTML5 business.
[0105] By mounting the life cycle function of the component node WKChildScrollView, when the system creates the component node WKChildScrollView, it determines which custom same-layer rendering HTML tag the current WKChildScrollView belongs to by searching the layer name of the superView of the component node WKChildScrollView (the layer name contains the class information of the HTML tag that generates this component node WKChildScrollView). Since the search is performed in the life cycle function of WKChildScrollView, there is no additional performance overhead, which solves the technical problem of searching for the node (WKChildScrollView) where the same-layer rendering component is located by traversing the WebView layer after rendering is completed. Due to the large number of layers and the large depth of the layer tree after WebView rendering, the search performance of the node (WKChildScrollView) where the same-layer rendering component is located is low and time-consuming
[0106] The creation of the same-layer rendering component in the disclosed embodiment is performed when the custom tag calls the constructor (constructor), that is, it is based on the life cycle of the HTML tag; the addition of the same-layer rendering component is performed when WKChildScrollView is initialized (implemented through a hook), that is, it is based on the life cycle of WKChildScrollView. Therefore, the creation and addition of the same-layer rendering component are performed during the rendering process of the HTML5 component, rather than after the rendering of the HTML5 component is completed. This solves the technical problem that the creation and addition of the same-layer rendering component corresponding to the same-layer rendering tag are performed after the rendering of the HTML5 component is completed, and the timing of creation and addition is later than that of the HTML5 component, which easily causes a short blank area on the screen (the blank area is the area where the same-layer rendering tag is located). At the same time, since the addition of the same-layer rendering component is based on the life cycle of WKChildScrollView, this solves the technical problem that the addition of the same-layer rendering component requires HTML5 business implementation.
[0107] In this embodiment, by determining at least one candidate native component of the page to be loaded, determining the registration component identifier and the configuration component identifier corresponding to each candidate native component, the registration component identifier is used to identify the candidate native component that has been registered by the application, and the configuration component identifier is used to identify the candidate native component that has been configured, determining the target native component from at least one candidate native component according to the registration component identifier and the configuration component identifier, and loading the target native component into the page to be loaded, the component tag corresponding to the native component of the application can be generated through the runtime technology, and the native component can be directly mounted to the browser page of the application for rendering using the same-layer rendering technology, which effectively reduces the cost of the same-layer component rendering and effectively improves the rendering effect of the browser page of the application, based on the runtime technology, obtaining the registration attribute information and the general attribute information corresponding to the target native component, based on the runtime technology, obtaining the registration function information and the general function information corresponding to the target native component, and using the registration attribute information, the general attribute information, the registration function information and the general function information as the target component attribute information, so that the target component attribute information can be obtained based on the runtime technology to generate the target component tag of the target native component corresponding to the target native component, without the participation of the HTML5 business, thereby reducing the intrusiveness to the HTML5 business.
[0108] Figure 5 It is a structural diagram of a component loading device applied to an application program proposed in another embodiment of the present disclosure.
[0109] like Figure 5 As shown, the component loading device 50 applied to the application program includes:
[0110] A first determination module 501 is used to determine at least one candidate native component of a page to be loaded;
[0111] A second determination module 502 is used to determine a registered component identifier and a configured component identifier corresponding to each candidate native component, wherein the registered component identifier is used to identify a candidate native component that has been registered by the application program, and the configured component identifier is used to identify a candidate native component that has been configured;
[0112] A third determination module 503 is used to determine a target native component from at least one candidate native component according to the registered component identifier and the configured component identifier; and
[0113] The processing module 504 is used to load the target native component into the page to be loaded.
[0114] In some embodiments of the present disclosure, Figure 6 As shown, Figure 6 is a structural diagram of a component loading device applied to an application program proposed in another embodiment of the present disclosure, wherein a processing module 504 includes:
[0115] A generating submodule 5041 is used to generate a target component tag of a target native component;
[0116] The processing submodule 5042 is used to load the target native component into the page to be loaded according to the target component tag.
[0117] In some embodiments of the present disclosure, the generating submodule 5041 is specifically used to:
[0118] Use runtime technology to generate target component tags for target native components.
[0119] In some embodiments of the present disclosure, the processing submodule 5042 is specifically configured to:
[0120] Get the initial page script file corresponding to the page to be loaded;
[0121] Write the target component tag into the initial page script file to obtain the target page script file;
[0122] Parse the target page script file to load the target native component into the page to be loaded.
[0123] In some embodiments of the present disclosure, the processing submodule 5042 is further configured to:
[0124] Parse the target page script file to obtain the component object and component node corresponding to the target native component, wherein the component node is used to indicate the layer position of the target component tag in the page to be loaded, and the component object is the component instance corresponding to the target native component;
[0125] According to the component object and component node, the target native component is loaded into the page to be loaded.
[0126] In some embodiments of the present disclosure, the processing submodule 5042 includes:
[0127] Load the component object corresponding to the target native component to the layer position indicated by the component node in the page to be loaded.
[0128] In some embodiments of the present disclosure, the number of registered component identifiers is at least one; wherein the third determination module 503 is specifically configured to:
[0129] Using the registered component identifier that is the same as the configuration component identifier among at least one registered component identifier as the target component identifier;
[0130] A candidate native component corresponding to the target component identifier is determined from at least one candidate native component as the target native component.
[0131] In some embodiments of the present disclosure, the generating submodule 5041 is further used to:
[0132] Obtaining a basic component tag corresponding to a basic page component of the page to be loaded, wherein the basic page component is a component supporting a hypertext markup language corresponding to the page to be loaded;
[0133] Based on runtime technology, obtain target component attribute information of target native component;
[0134] Generate a target component label according to the basic component label and target component attribute information.
[0135] In some embodiments of the present disclosure, the generating submodule 5041 is further used to:
[0136] Based on the runtime technology, the registration attribute information and the common attribute information corresponding to the target native component are obtained, wherein the registration attribute information describes the component attributes corresponding to the target native component registered by the application, and the common attribute information is the component attributes of the common component in the page to be loaded;
[0137] Based on runtime technology, obtain registration function information and common function information corresponding to the target native component, wherein the registration function information describes the component function corresponding to the target native component registered by the application, and the common function information describes the component function of the common component in the page to be loaded;
[0138] The registered attribute information, the common attribute information, the registered function information and the common function information are used as the target component attribute information.
[0139] With the above Figures 1 to 4 Corresponding to the component loading method applied to the application provided in the embodiment, the present disclosure also provides a component loading device applied to the application. Figures 1 to 4 The component loading method applied to the application provided in the embodiment corresponds to the embodiment, so the implementation of the component loading method applied to the application is also applicable to the component loading device applied to the application provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.
[0140] In this embodiment, by determining at least one candidate native component of the page to be loaded; determining the registered component identifier and the configured component identifier corresponding to each candidate native component, the registered component identifier is used to identify the candidate native component that has been registered by the application, and the configured component identifier is used to identify the candidate native component that has been configured; according to the registered component identifier and the configured component identifier, determining the target native component from at least one candidate native component, and loading the target native component into the page to be loaded, it is possible to generate a component tag corresponding to the native component of the application through runtime technology, and use the same-layer rendering technology to directly mount the native component into the browser page of the application for rendering, thereby effectively reducing the cost of rendering the same-layer components and effectively improving the rendering effect of the browser page of the application.
[0141] In this embodiment, in order to implement the above embodiment, the present disclosure also proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the component loading method applied to the application as proposed in the above embodiment of the present disclosure.
[0142] In order to implement the above embodiments, the present disclosure further proposes a computer program product. When an instruction processor in the computer program product is executed, the component loading method applied to an application as proposed in the above embodiments of the present disclosure is executed.
[0143] Figure 7 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown.
[0144] Figure 7 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0145] like Figure 7 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0146] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
[0147] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0148] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive").
[0149] although Figure 7 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0150] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0151] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a human body to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0152] The processing unit 16 executes various functional applications and parameter information determination by running the programs stored in the system memory 28, for example, implementing the component loading method applied to the application program mentioned in the above embodiment.
[0153] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0154] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0155] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0156] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0157] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0158] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0159] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0160] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A component loading method applied to an application, characterized in that: The application program includes: a page to be loaded; the method includes: Determine at least one candidate native component of the page to be loaded; Determine a registered component identifier and a configured component identifier corresponding to each of the candidate native components, wherein the registered component identifier is used to identify the candidate native component that has been registered by the application program, and the configured component identifier is used to identify the candidate native component that has been configured; Determine a target native component from the at least one candidate native component according to the registered component identifier and the configured component identifier; and Load the target native component into the page to be loaded.
2. The method according to claim 1, characterized in that The step of loading the target native component into the page to be loaded includes: Generate a target component tag for the target native component; According to the target component tag, the target native component is loaded into the page to be loaded.
3. The method according to claim 2, characterized in that The generating a target component tag of the target native component includes: A target component tag of the target native component is generated using runtime technology.
4. The method according to claim 2, characterized in that The step of loading the target native component into the page to be loaded according to the target component tag includes: Obtaining the initial page script file corresponding to the page to be loaded; Writing the target component tag into the initial page script file to obtain a target page script file; The target page script file is parsed to load the target native component into the page to be loaded.
5. The method according to claim 4, characterized in that The parsing process of the target page script file to load the target native component into the page to be loaded includes: Parsing the target page script file to obtain a component object and a component node corresponding to the target native component, wherein the component node is used to indicate the layer position of the target component tag in the page to be loaded, and the component object is a component instance corresponding to the target native component; According to the component object and the component node, the target native component is loaded into the page to be loaded.
6. The method according to claim 5, characterized in that The step of loading the target native component into the page to be loaded according to the component object and the component node includes: The component object corresponding to the target native component is loaded to the layer position indicated by the component node in the page to be loaded.
7. The method according to claim 1, characterized in that The number of the registered component identifiers is at least one; wherein determining the target native component from the at least one candidate native component according to the registered component identifier and the configured component identifier comprises: Using the registered component identifier that is the same as the configuration component identifier among at least one of the registered component identifiers as the target component identifier; A candidate native component corresponding to the target component identifier is determined from the at least one candidate native component as the target native component.
8. The method according to claim 3, characterized in that The step of using runtime technology to generate a target component tag of the target native component includes: Obtaining a basic component tag corresponding to a basic page component of the page to be loaded, wherein the basic page component is a component supporting a hypertext markup language corresponding to the page to be loaded; Based on the runtime technology, obtaining target component attribute information of the target native component; The target component tag is generated according to the basic component tag and the target component attribute information.
9. The method according to claim 8, characterized in that The acquiring target component attribute information of the target native component based on the runtime technology includes: Based on the runtime technology, obtaining registration attribute information and general attribute information corresponding to the target native component, wherein the registration attribute information describes the component attributes corresponding to the target native component registered by the application, and the general attribute information is the component attributes of the general component in the page to be loaded; Based on the runtime technology, obtaining registration function information and general function information corresponding to the target native component, wherein the registration function information describes the component function corresponding to the target native component registered by the application, and the general function information describes the component function of the general component in the page to be loaded; The registered attribute information, the general attribute information, the registered function information and the general function information are used as the target component attribute information.
10. A component loading device applied to an application, characterized in that: The application program includes: a page to be loaded; the device includes: A first determination module, used to determine at least one candidate native component of the page to be loaded; A second determination module is used to determine a registered component identifier and a configured component identifier corresponding to each of the candidate native components, wherein the registered component identifier is used to identify the candidate native component that has been registered by the application program, and the configured component identifier is used to identify the candidate native component that has been configured; A third determination module is used to determine a target native component from the at least one candidate native component according to the registered component identifier and the configured component identifier; and A processing module is used to load the target native component into the page to be loaded.
11. The device according to claim 10, characterized in that The processing module comprises: A generation submodule, used to generate a target component label of the target native component; The processing submodule is used to load the target native component into the page to be loaded according to the target component tag.
12. The device according to claim 11, characterized in that The generating submodule is specifically used for: A target component tag of the target native component is generated using runtime technology.
13. The device according to claim 11, characterized in that The processing submodule is specifically used for: Obtaining the initial page script file corresponding to the page to be loaded; Writing the target component tag into the initial page script file to obtain a target page script file; The target page script file is parsed to load the target native component into the page to be loaded.
14. The device according to claim 13, characterized in that The processing submodule is further used for: Parsing the target page script file to obtain a component object and a component node corresponding to the target native component, wherein the component node is used to indicate the layer position of the target component tag in the page to be loaded, and the component object is a component instance corresponding to the target native component; According to the component object and the component node, the target native component is loaded into the page to be loaded.
15. The device according to claim 14, characterized in that The processing submodule is further used for: The component object corresponding to the target native component is loaded to the layer position indicated by the component node in the page to be loaded.
16. The device according to claim 10, characterized in that The number of the registered component identifiers is at least one; wherein the third determination module is specifically configured to: Using the registered component identifier that is the same as the configuration component identifier among at least one of the registered component identifiers as the target component identifier; A candidate native component corresponding to the target component identifier is determined from the at least one candidate native component as the target native component.
17. The device according to claim 12, characterized in that The generating submodule is further used for: Obtaining a basic component tag corresponding to a basic page component of the page to be loaded, wherein the basic page component is a component supporting a hypertext markup language corresponding to the page to be loaded; Based on the runtime technology, obtaining target component attribute information of the target native component; The target component tag is generated according to the basic component tag and the target component attribute information.
18. The device according to claim 17, characterized in that The generating submodule is further used for: Based on the runtime technology, obtaining registration attribute information and general attribute information corresponding to the target native component, wherein the registration attribute information describes the component attributes corresponding to the target native component registered by the application, and the general attribute information is the component attributes of the general component in the page to be loaded; Based on the runtime technology, obtaining registration function information and general function information corresponding to the target native component, wherein the registration function information describes the component function corresponding to the target native component registered by the application, and the general function information describes the component function of the general component in the page to be loaded; The registered attribute information, the general attribute information, the registered function information and the general function information are used as the target component attribute information.
19. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
21. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
