A method and device for native rendering based on information flow
By using the load trigger operation of the target application in the H5 page to obtain configuration files and information flow, and creating and rendering native controls, the performance and security issues of H5 pages are solved, development costs are reduced, and native rendering effects are achieved.
Patent Information
- Application Number
- CN202010980206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-17
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2040-09-17
AI Technical Summary
In the prior art, the performance of H5 pages is poor and have security problems, such as browser hijacking, and the cost of developing native applications is high.
By responding to the load trigger operation for the target link address in the target application, obtain the configuration file and obtain the information flow, create a native control, and bind the information flow to the native control, render it on the current page according to the template information, realizing native rendering.
It solves the performance and security issues of H5 pages, reduces the learning and development costs of developers, and allows developers to focus on presenting information flow.
Smart Images

Figure CN112241499B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a technology for native rendering based on information flow. Background Art
[0002] In the prior art, web pages are usually presented in the form of H5 (HTML5) or Native app. The H5 implementation has the advantages of being cross-platform, low development cost, available online at any time, and suitable for rapid iteration. However, since it needs to be rendered based on the browser kernel, the performance of this implementation is poor and there are security issues such as browser hijacking. The native application implementation is based on the native operating system of the user's device for rendering, with better performance and security, but higher development costs. Summary of the invention
[0003] One objective of the present application is to provide a method and device for native rendering based on information flow.
[0004] According to one aspect of the present application, a method for native rendering based on information flow is provided, the method comprising:
[0005] In response to a load trigger operation for a target link address in a target application, a configuration file corresponding to the target link address is obtained, and at least one information stream corresponding to the target link address is obtained according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information stream;
[0006] Creating all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information;
[0007] The at least one information stream is bound to the at least one native control, and all the native controls are rendered on a current page generated based on the loading trigger operation according to the one or more template information.
[0008] According to one aspect of the present application, a user device based on native rendering of information flow is provided, the device comprising:
[0009] A module, configured to, in response to a load trigger operation for a target link address in a target application, obtain a configuration file corresponding to the target link address, and obtain at least one information stream corresponding to the target link address according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information stream;
[0010] A module 12, configured to create all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information;
[0011] A module 3 is used to bind the at least one information flow to the at least one native control, and render all the native controls on the current page generated based on the loading trigger operation according to the one or more template information.
[0012] According to one aspect of the present application, a device for native rendering based on information flow is provided, wherein the device includes:
[0013] Processor; and
[0014] A memory arranged to store computer executable instructions which, when executed, cause the processor to perform the following operations:
[0015] In response to a load trigger operation for a target link address in a target application, a configuration file corresponding to the target link address is obtained, and at least one information stream corresponding to the target link address is obtained according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information stream;
[0016] Creating all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information;
[0017] The at least one information stream is bound to the at least one native control, and all the native controls are rendered on a current page generated based on the loading trigger operation according to the one or more template information.
[0018] According to one aspect of the present application, a computer readable medium storing instructions is provided, wherein when the instructions are executed, the system performs the following operations:
[0019] In response to a load trigger operation for a target link address in a target application, a configuration file corresponding to the target link address is obtained, and at least one information stream corresponding to the target link address is obtained according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information stream;
[0020] Creating all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information;
[0021] The at least one information stream is bound to the at least one native control, and all the native controls are rendered on a current page generated based on the loading trigger operation according to the one or more template information.
[0022] Compared with the prior art, the present application can obtain one or more template information according to the configuration file corresponding to the target link address, and then obtain one or more native controls from each template information, and obtain one or more information streams corresponding to at least one of the one or more native controls according to the configuration file, and then create the one or more native controls, bind the one or more information streams to the at least one native control, and render the one or more native controls on the current page according to the template information, thereby realizing native rendering of the information stream in the H5 page through the native controls, thereby displaying the H5 page in a native form, which can solve the performance and security issues of H5, and also enable developers to have an experience close to native applications without learning the native language, thereby reducing the learning and development costs of developers; further, it can also reduce the development costs of developers on the UI, so that developers can focus on the information stream they want to present. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0024] Figure 1 A flow chart of a method for native rendering based on information flow according to an embodiment of the present application is shown;
[0025] Figure 2 A structural diagram of a user device based on native rendering of information flow according to an embodiment of the present application is shown;
[0026] Figure 3 An exemplary system is shown that can be used to implement the various embodiments described in this application.
[0027] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0028] The present application is described in further detail below in conjunction with the accompanying drawings.
[0029] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (eg, a central processing unit (CPU)), an input / output interface, a network interface and a memory.
[0030] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory. Memory is an example of a computer-readable medium.
[0031] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, Phase-Change Memory (PCM), Programmable Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0032] The devices referred to in this application include but are not limited to user devices, network devices, or devices formed by integrating user devices and network devices through a network. The user devices include but are not limited to any mobile electronic products that can interact with users (for example, interact with users through a touchpad), such as smart phones, tablet computers, etc. The mobile electronic products can use any operating system, such as Android operating system, iOS operating system, etc. Among them, the network device includes an electronic device that can automatically perform numerical calculations and information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field Programmable Gate Array, FPGA), digital signal processors (Digital Signal Processor, DSP), embedded devices, etc. The network devices include but are not limited to computers, network hosts, single network servers, multiple network server sets or multiple servers. The cloud is composed of a large number of computers or network servers based on cloud computing (Cloud Computing), wherein cloud computing is a type of distributed computing, a virtual supercomputer composed of a group of loosely coupled computer sets. The network includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless self-organizing network (Ad Hoc network), etc. Preferably, the device may also be a program running on the user device, the network device, or a device formed by integrating the user device and the network device, the network device, the touch terminal, or the network device and the touch terminal through a network.
[0033] Of course, those skilled in the art should understand that the above-mentioned devices are only examples, and other existing or future devices that are applicable to the present application should also be included in the scope of protection of the present application and are included here by reference.
[0034] In the description of the present application, “plurality” means two or more, unless otherwise clearly and specifically defined.
[0035] Figure 1A flowchart of a method for native rendering based on information flow according to an embodiment of the present application is shown, and the method includes step S11, step S12 and step S13. In step S11, the user device responds to the load trigger operation for the target link address in the target application, obtains a configuration file corresponding to the target link address, and obtains at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information flow; in step S12, the user device creates all native controls corresponding to all the native control description information included in the one or more template information, wherein all the native controls include at least one native control corresponding to the at least one native control description information; in step S13, the user device binds the at least one information flow to the at least one native control, and renders all the native controls on the current page generated based on the load trigger operation according to the one or more template information.
[0036] In step S11, the user device responds to the load trigger operation for the target link address in the target application, obtains the configuration file corresponding to the target link address, and obtains at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information of all the native control description information included in the one or more template information corresponds to the at least one information flow. In some embodiments, the load trigger operation can be that the user enters the target link address in the target application, or that the user clicks the target link address in the target application, or that the user clicks the target link address in other applications to jump to the target application, and no restrictions are imposed on the load trigger operation. In some embodiments, the configuration file can be a file in any format, and preferably, the configuration file can be a file in json format. In some embodiments, the configuration file can be obtained from a server corresponding to the target link address, or the configuration file can be obtained from a server that the target should correspond to, or the configuration file can be obtained locally from the user device, or the target link address can contain the storage address of the configuration file (for example, a third-party server address), and the configuration file can be obtained according to the storage address of the configuration file. In some embodiments, the current page generated based on the load trigger operation for the target link address includes one or more display areas, and the one or more displayed areas include multiple types, wherein the first type of display area is directly rendered on the current page, the second type of display area will not be rendered on the current page at the beginning, and needs to respond to the access trigger operation (e.g., click operation, etc.) performed on the native control in the first type of display area before it is rendered on the current page, and the third type of display area will not be rendered on the current page at the beginning, and needs to respond to the access trigger operation (e.g., click operation, etc.) performed on the native control in the first type or second type of display area, jump from the current page to a new second page, and render on the second page. In some embodiments, the configuration file includes one or more template information, and each display area can correspond to one template information or multiple template information. In some embodiments, each display area can correspond to different template information, or multiple display areas can correspond to the same template information. In some embodiments, the template information may be the layout style information of the corresponding display area, the layout style information includes one or more native control description information, the native control description information is used to describe the type and properties of the native control that needs to be rendered in the corresponding display area. According to the template information, one or more native controls corresponding to the template information can be rendered in the corresponding display area.In some embodiments, the native control can be a view preset by the user device system (for example, Button, TextView, RecyclerView, etc.), or a viewgroup preset by the user device system (the viewgroup includes one or more views or viewgroups, for example, LinearLayout, RelativeLayout, etc.), or a custom view or custom viewgroup. In some embodiments, at least one of the one or more template information needs to obtain the corresponding information flow. At this time, for each of the at least one template information, at least one of the one or more native control description information included in the template information needs to obtain the information flow to bind to the native control corresponding to the at least one native control description information. The configuration file defines how to obtain the one or more information flows that need to be bound to the native control corresponding to the native control description information for each of the at least one native control description information (information flow parsing rules). In some embodiments, the configuration file includes one or more interface addresses (for example, ajax interface addresses), and multiple native control description information can correspond to the same interface address or to different interface addresses respectively. The interface data information (for example, json format data) corresponding to a native control description information is obtained by requesting (for example, ajax request) the interface address corresponding to the native control description information, and then the information flow parsing rule information in the configuration file is used. The information flow parsing rule information includes which interface address in the configuration file each native control description information corresponds to, and one or more field path information (for example, the path of one or more keys in json format data). One or more information streams corresponding to the one or more field path information (for example, the value corresponding to one or more keys in json format data) are parsed from the interface data information corresponding to the native control description information, and the one or more information streams are used as the information flow that needs to be bound to the native control corresponding to the native control description information. In some embodiments, based on the HTML page information corresponding to the target link address, the Document information corresponding to the native control description information can be obtained. The Document is the root node of the HTML page information. All tags in the HTML page information can be accessed through the Document. Then, through the information flow parsing rule information in the configuration file, the information flow parsing rule information includes one or more tag path information. The one or more tags corresponding to the one or more tag path information are parsed from the Document corresponding to the native control description information, and the information flow corresponding to the one or more tags is used as the information flow that needs to be bound to the native control corresponding to the native control description information.
[0037] In step S12, the user device creates all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information. It should be noted here that there is no strict order between obtaining the information stream and creating the native control. The information stream can be obtained first and then the native control can be created, or the native control can be created first and then the information stream can be obtained. In some embodiments, creating a native control includes but is not limited to creating a new native control object (for example, calling the Button constructor to create a new TextView object), initializing the native control object according to the native control description information (for example, calling the init method of TextView, or, according to the attribute information of TextView in the native control description information, calling the relevant method of TextView (such as the setTextSize method) or directly setting the relevant attributes of TextView), etc.
[0038] In step S13, the user device binds the at least one information stream to the at least one native control, and renders all the native controls on the current page generated based on the loading trigger operation according to the one or more template information. In some embodiments, for each native control in at least one native control to which the information stream needs to be bound, one or more information streams corresponding to the native control are obtained through a configuration file, and the one or more information streams are bound to the native control. Here, the binding can be to call the relevant method corresponding to the native control object (for example, call the setTextSize method of TextView) to transfer the one or more information streams into the native control object, or the relevant attributes in the native control object can also be directly assigned to the one or more information streams. In some embodiments, according to one or more template information, one or more native controls corresponding to the one or more native control description information included in each template information are rendered on the current page generated based on the loading trigger operation, wherein the rendering method is based on the native rendering of the user device operating system, rather than based on the rendering of the browser kernel. It should be noted here that the android system is used as an example in each embodiment of the present application, and those skilled in the art should understand that the scheme of the present application can also be applied to other systems, such as IOS systems.
[0039] The present application can obtain one or more template information according to the configuration file corresponding to the target link address, and then obtain one or more native controls from each template information, and obtain one or more information streams corresponding to at least one of the one or more native controls according to the configuration file, and then create the one or more native controls, bind the one or more information streams to the at least one native control, and render the one or more native controls on the current page according to the template information, thereby realizing native rendering of the information stream in the H5 page through the native controls, thereby presenting the H5 page in a native form, which can solve the performance and security issues of H5, and also enable developers to have an experience close to native applications without having to learn the native language, thereby reducing the learning and development costs of developers; further, it can also reduce the development costs of developers on the UI, so that developers can focus on the information stream they want to present.
[0040] In some embodiments, obtaining the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address from a server corresponding to the target link address.
[0041] In some embodiments, the target link address includes a configuration file address; wherein, obtaining the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address according to the configuration file address. In some embodiments, the target link address includes a storage address of the configuration file, which can be a storage path of the configuration file on the local user device, or an address of a third-party server storing the configuration file, for example, the end of the target link address includes "@ configuration file storage address".
[0042] In some embodiments, obtaining the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address from a server corresponding to the target application.
[0043] In some embodiments, the obtaining of the configuration file corresponding to the target link address from the server corresponding to the target application includes: sending the host information of the target link address to the server corresponding to the target application so that the server queries the configuration file corresponding to the host information; receiving the configuration file corresponding to the host information returned by the server, and using the configuration file corresponding to the host information as the configuration file corresponding to the target link address. In some embodiments, the host information is the HOST information of the target link address, and the server corresponding to the target application maintains the mapping relationship between the HOST information and the configuration file. The user device sends the HOST information corresponding to the target link address to the server corresponding to the target application, and the server queries the configuration file corresponding to the HOST information according to the mapping relationship between the HOST information and the configuration file and returns it to the user device as the configuration file corresponding to the target link address. In some embodiments, the file name of the configuration file is the HOST information of the link address corresponding to the configuration file. The user device sends the HOST information corresponding to the target link address to the server corresponding to the target application, matches the HOST information with the file names of all configuration files, obtains the configuration file matching the HOST information and returns it to the user device as the configuration file corresponding to the target link address.
[0044] In some embodiments, the configuration file includes at least one second link address; wherein, the obtaining of at least one information flow corresponding to the target link address according to the configuration file includes: obtaining at least one template information corresponding to the at least one second link address from the configuration file, obtaining one or more native control description information corresponding to the at least one second link address from the at least one template information, and obtaining at least one information flow corresponding to at least one of the one or more native control description information according to the configuration file, wherein each second link address corresponds to one or more template information, and each of the one or more template information includes one or more native control description information. In some embodiments, the current page includes one or more display areas, and the one or more displayed areas include multiple types, wherein the first type of display area is directly rendered on the current page, the second type of display area is not rendered on the current page at first, and needs to respond to an access trigger operation performed on the native control in the first type of display area before it is rendered on the current page, and the third type of display area is not rendered on the current page at first, and needs to respond to an access trigger operation performed on the native control in the first type or the second type of display area, jump from the current page to a new second page, and render on the second page. In some embodiments, one or more display areas correspond to a second link address. For example, the current page includes two display areas, a movie channel display area and a TV channel display area. Each display area corresponds to a second link address. The second link address corresponding to the movie channel display area is "https: / / m.douban.com / movie / ", and the second link address corresponding to the TV channel display area is "https: / / m.douban.com / tv / ". In some embodiments, each second link address may correspond to one template information or may correspond to multiple template information. In some embodiments, the configuration file includes at least one second link address. For each second link address in the at least one second link address, one or more template information corresponding to the second link address is obtained from the configuration file. The template information may be the layout style information of the one or more display areas corresponding to the second link address, and the one or more native control description information corresponding to the second link address is obtained from the layout style information. The native control description information is used to describe the type and properties of the native control that needs to be rendered on the corresponding display area. According to the template information, the one or more native controls corresponding to the template information can be rendered on the corresponding display area.In some embodiments, for each second link address, according to the configuration file, one or more information streams that need to be bound to at least one native control corresponding to at least one of the one or more native control description information corresponding to the second link address are obtained, one or more native controls corresponding to the one or more native control description information are created, and the one or more information streams are bound to the corresponding at least one native control, and then the one or more native controls are rendered on the current page according to the one or more template information corresponding to the second link address.
[0045] In some embodiments, the configuration file further includes at least one rule information; wherein, the step of obtaining at least one template information corresponding to the at least one second link address from the configuration file, obtaining one or more native control description information corresponding to the at least one second link address from the at least one template information, and obtaining at least one information flow corresponding to at least one of the one or more native control description information according to the configuration file includes the following operations performed for each of the at least one second link address: obtaining the rule information corresponding to the second link address from the configuration file, obtaining one or more template information corresponding to the second link address from the rule information, and obtaining one or more native control description information corresponding to the second link address from the one or more template information; obtaining one or more information flows corresponding to at least one of the one or more native control description information according to the rule information. In some embodiments, the configuration file further includes at least one rule information, and each second link address corresponds to a rule information, and the rule information includes one or more template information corresponding to the second link address, and how to obtain one or more information flows corresponding to at least one native control description information in at least one of the one or more native control description information in the one or more template information that needs to be bound to the one or more information flows in the at least one native control corresponding to the at least one native control description information in the one or more template information.For example, the current page includes two display areas, a movie channel display area and a TV channel display area. Each display area corresponds to a second link address. The second link address corresponding to the movie channel display area is "https: / / m.douban.com / movie / ", and the second link address corresponding to the TV series channel display area is "https: / / m.douban.com / tv / ". The rule information corresponding to the second link address "https: / / m.douban.com / movie / " is "movie_rule", and the rule information corresponding to the second link address "https: / / m.douban.com / tv / " is "tv_rule". "movie_rule" includes a template information (for example, template identification information (such as template ID, "template": 1) , according to the template identification information, specific template information can be obtained from the local user device, the server corresponding to the target application, or the server corresponding to the target link address) and the corresponding information flow acquisition method, "tv_rule" contains a template information (for example, "template": 2), according to the template identification information, specific template information can be obtained from the local user device, the server corresponding to the target application, or the server corresponding to the target link address) and the corresponding information flow acquisition method, according to the respective corresponding information flow acquisition methods, respectively obtain one or more information flows that need to be bound to at least one native control corresponding to at least one native control description information in the one or more native control description information corresponding to the second link address "https: / / m.douban.com / movie / " and "https: / / m.douban.com / tv / ".
[0046] In some embodiments, the configuration file further includes a mapping relationship between at least one link-related information and the at least one rule information; wherein, the obtaining the rule information corresponding to the second link address from the configuration file includes: matching the second link address with the at least one link-related information to obtain the link-related information matching the second link address, and according to the mapping relationship, using the rule information corresponding to the link-related information as the rule information corresponding to the second link address. In some embodiments, the link-related information may be the second link address itself, or may be a regular expression of the second link address. In some embodiments, the configuration file includes a mapping relationship between at least one link-related information and at least one rule information, and different link-related information may correspond to different rule information, or several different link-related information may correspond to the same rule information, and a certain second link address may be matched with at least one link-related information in the configuration file to obtain the link-related information matching the second link address, and the rule information mapped by the link-related information may be used as the rule information corresponding to the second link address. For example, the mapping relationship in the configuration file is ("rule_regex":[{"regex":"https: / / m.douban.com / movie / ","rule":"movie_rule"},{"regex":"https: / / m.douban.com / tv / ","rule":"tv_rule"}]), and the second link address is "https: / / m.douban.com / movie / ," then according to the mapping relationship, it can be determined that the rule information corresponding to the second link address "https: / / m.douban.com / movie / " is "movie_rule".
[0047] In some embodiments, the step of obtaining one or more information streams corresponding to at least one of the one or more native control description information according to the rule information includes: for each of the native control description information in at least one of the one or more native control description information, obtaining the document object information corresponding to the native control description information, and obtaining the information stream parsing rule information corresponding to the native control description information from the rule information, and parsing the document object information according to the information stream parsing rule information to obtain the one or more information streams corresponding to the native control description information. In some embodiments, the document object information is a carrier of the information stream, and the rule information includes the information stream parsing rule information corresponding to one or more native control description information in the one or more template information corresponding to the rule information, and the information stream parsing rule information corresponding to each native control description information is used to define how to parse from the document object information to obtain one or more information streams that need to be bound to the native control corresponding to the native control description information. In some embodiments, one rule information may correspond to one document object information, and all the native control description information corresponding to each rule information may share the document object information corresponding to the rule information, or one rule information may correspond to multiple document object information, and multiple native control description information corresponding to each rule information may correspond to different document object information. In some embodiments, document object information may be interface data information. In this case, the rule information includes one or more interface addresses. Multiple native control description information in the template information corresponding to the rule information may correspond to the same interface address or may correspond to different interface addresses respectively. The interface data information corresponding to the native control description information is obtained by requesting the interface address corresponding to a certain native control, and then the information flow parsing rule information corresponding to the native control description information in the rule information is used. The information flow parsing rule information includes which interface address in the rule information corresponds to the native control description information, and one or more field path information. One or more information flows corresponding to the one or more field path information are obtained by parsing the interface data information corresponding to the native control description information, and the one or more information flows are used as the information flow corresponding to the native control description information.In some embodiments, the document object information may be Document information. The Document information corresponding to the native control description information may be obtained based on the HTML page information of the target link address or the HTML page information of the second link address corresponding to the rule information. Then, the rule information is parsed through the information flow in the rule information. The information flow parsing rule information includes obtaining the corresponding Document information and one or more tag path information based on the target link address or the second link address corresponding to the rule information. One or more tags corresponding to the one or more tag path information are parsed from the Document corresponding to the native control description information, and the information flow corresponding to the one or more tags is used as the information flow corresponding to the native control description information.
[0048] In some embodiments, the document object information is interface data information, and the information flow parsing rule information includes one or more field path information; wherein, obtaining the document object information corresponding to the native control description information includes: obtaining the interface address information corresponding to the native control description information; according to the interface address information, requesting to obtain the interface data information corresponding to the native control description information; wherein, parsing the one or more information flows corresponding to the native control description information from the document object information according to the information flow parsing rule information includes: for each field path information in the one or more field path information, parsing the information flow corresponding to the field path information from the interface data information corresponding to the native control description information. In some embodiments, the document object information is interface data information (for example, json data obtained according to an ajax interface request), the rule information includes one or more interface addresses (for example, ajax interface address), and multiple native control description information in the template information corresponding to the rule information can correspond to the same interface address or respectively correspond to different interface addresses. The interface data information corresponding to a certain native control description information is obtained by requesting (for example, an ajax request) an interface address corresponding to the native control description information, and then the information flow parsing rule information corresponding to the native control description information in the rule information is used. The information flow parsing rule information includes which interface address in the rule information the native control description information corresponds to, and one or more field path information (for example, the path of one or more keys in json format data). One or more information streams corresponding to the one or more field path information (for example, the value corresponding to one or more keys in json format data) are parsed from the interface data information corresponding to the native control description information, and the one or more information streams are used as the information flow corresponding to the native control description information. For example, the template information corresponding to the rule information includes the native control TextViewA, and the interface address information in the rule information corresponding to the native control TextViewA is "https: / / m.douban.com / rexxar / api / v2 / movie / suggestion." An ajax request is initiated to the interface address information to obtain the interface data information in json format corresponding to the native control TextViewA, and then the rule information is parsed through the information flow corresponding to the native control TextViewA in the rule information ("title":{"selector":"title>value"}), and the information flow corresponding to the field path information "title>value" is obtained from the interface data information in json format corresponding to the native control TextViewA, and the information flow is transferred to the native control TextViewA by calling the setTitle method of the native control TextViewA.
[0049] In some embodiments, the document object information is Document information, and the information flow parsing rule information includes one or more tag path information; wherein, obtaining the document object information corresponding to the native control description information includes: obtaining the Document information corresponding to the native control description information according to the HTML page information corresponding to the first link address, wherein the first link address is the target link address or the second link address; wherein, parsing the one or more information flows corresponding to the native control description information from the document object information according to the information flow parsing rule information includes: for each tag path information in the one or more tag path information, parsing the information flow corresponding to the tag path information from the HTML information corresponding to the native control description information. In some embodiments, the document object information is Document information. The Document information corresponding to the native control description information can be obtained according to the HTML page information of the target link address or the HTML page information of the second link address corresponding to the rule information. Document is the root node of the HTML page information. All tags in the HTML page information can be accessed through Document. Then, the rule information is parsed through the information flow corresponding to the native control description information in the rule information. The information flow parsing rule information includes obtaining the corresponding Document information and one or more tag path information according to the target link address or the second link address corresponding to the rule information. The tag path information can be the path information of the tag in the DOM tree, or the id attribute, className attribute or other attributes corresponding to the tag. One or more tags corresponding to the one or more tag path information are parsed from the Document corresponding to the native control description information, and the information flow corresponding to the one or more tags is used as the information flow corresponding to the native control description information. For example, the template information corresponding to the rule information includes the native control TextViewB. The rule information corresponding to the native control TextViewB corresponds to the target link address " https: / / m.douban.com / movie / ", according to the target link address" https: / / m.douban.com / movie / "The HTML page information corresponding to the native control TextViewB is obtained, and then the Document information corresponding to the native control TextViewB is obtained. Then, the rule information ("title":{"className":"myTitle"}) is parsed through the information flow corresponding to the native control TextViewB in the rule information, and the information flow corresponding to the label with className "myTitle" is obtained from the Document corresponding to the native control. The information flow is then passed to the native control TextViewB by calling the setTitle method of the native control TextViewB.
[0050] In some embodiments, the configuration file also includes one or more third link addresses and at least one second rule information; wherein, the method also includes: the user device responds to an access trigger operation for a target third link address in the one or more third link addresses in the current page, obtains the second rule information corresponding to the target third link address from the configuration file, obtains one or more second template information corresponding to the target third connection address from the second rule information, and obtains one or more second native control description information corresponding to the target third link address from the one or more second template information; according to the second rule information, obtains one or more information streams corresponding to at least one second native control description information in the one or more second native control description information; creates one or more second native controls corresponding to the one or more second native control description information, wherein the one or more second native controls include at least one second native control corresponding to the at least one second native control description information; binds the one or more information streams to the at least one second native control, and renders the one or more second native controls on the current page according to the one or more second template information. In some embodiments, the configuration file also includes one or more third link addresses and at least one second rule information, each third link address corresponds to a second rule information, and the second rule information corresponding to each third link address includes the second template information corresponding to the third link address and how to obtain one or more information streams corresponding to at least one second native control description information that needs to be bound to the second template information. In some embodiments, the access trigger operation includes any operation for triggering access to a target third link address in one or more third link addresses. For example, the target first information stream bound to the target first native control that has been rendered on the current page includes the target third link address, and the access trigger operation (for example, a click operation) performed by the user on the target first native control is an access trigger operation for the target third link address.In some embodiments, one or more second native controls corresponding to one or more second native control description information in one or more second template information corresponding to the target third link address are not initially rendered on the current page. In response to an access trigger operation for the target third link address in the current page, one or more information streams corresponding to at least one second native control description information in the one or more second native control description information are obtained, one or more second native controls corresponding to the one or more second native control description information are created, the one or more information streams are bound to at least one second native control corresponding to the at least one second native control description information, and according to the one or more second template information, the one or more second native controls are rendered on the current page, and the current page is updated so as to be presented on the updated current page.
[0051] In some embodiments, the configuration file also includes one or more fourth link addresses and at least one third rule information; wherein the method also includes: the user device jumps from the current page to the second page corresponding to the target fourth link address in response to an access trigger operation for a target fourth link address in the one or more fourth link addresses in the current page; obtains the third rule information corresponding to the target fourth link address from the configuration file, and obtains one or more third template information corresponding to the target fourth link address from the third rule information, and obtains one or more third native control description information corresponding to the target fourth link address from the one or more third template information; according to the third rule information, obtains one or more information streams corresponding to at least one third native control description information in the one or more third native control description information; creates one or more third native controls corresponding to the one or more third native control description information, wherein the one or more third native controls include at least one third native control corresponding to the at least one third native control description information; binds the one or more information streams to the at least one third native control, and renders the one or more third native controls on the second page according to the one or more third template information. In some embodiments, the configuration file also includes one or more fourth link addresses and at least one third rule information, each fourth link address will correspond to a third rule information, and the third rule information corresponding to each fourth link address includes the third template information corresponding to the fourth link address and how to obtain the one or more information streams in at least one fourth native control corresponding to at least one fourth native control description information that needs to be bound to the third template information. In some embodiments, the access trigger operation includes any operation for triggering access to the target fourth link address in one or more fourth link addresses, for example, the target first information stream or the target second information stream bound to the target first native control or the target second native control that has been rendered on the current page includes the target fourth link address, and the access trigger operation (for example, a click operation) performed by the user on the target first native control or the target second native control is the access trigger operation for the target fourth link address.In some embodiments, one or more third native controls corresponding to one or more third native control description information in one or more third template information corresponding to the target fourth link address are not initially rendered on the current page. In response to an access trigger operation for the target fourth link address in the current page, the current page is jumped to the second page corresponding to the target fourth link address, and then one or more information streams corresponding to at least one third native control description information in the one or more third native control description information are obtained, one or more third native controls corresponding to the one or more third native control description information are created, the one or more information streams are bound to at least one third native control corresponding to the at least one third native control description information, and the one or more third native controls are rendered on the second page according to the one or more third template information so as to be presented on the second page.
[0052] In some embodiments, the obtaining of one or more template information corresponding to the second link address from the rule information includes: obtaining one or more template identification information corresponding to the second link address from the rule information, and obtaining one or more template information corresponding to the one or more template identification information. In some embodiments, the template identification information may be a template name or a template ID, for example, the template identification information may be ("template": 1). In some embodiments, based on the template identification information, specific template information may be obtained from a local user device, a server corresponding to a target application, or a server corresponding to a target link address.
[0053] In some embodiments, the step of obtaining one or more template identification information corresponding to the second link address from the rule information, and obtaining one or more template information corresponding to the one or more template identification information, includes: obtaining one or more template identification information corresponding to the second link address and one or more template style extension information corresponding to at least one of the one or more template identification information from the rule information, and obtaining one or more initial template information corresponding to the one or more template identification information; obtaining one or more template information corresponding to the second link address according to the one or more template style extension information and the one or more initial template information. In some embodiments, the standard initial template information can be obtained from the local user device, the server corresponding to the target application, or the server corresponding to the target link address according to the template identification information. In some embodiments, the template style extension information is used to customize the style of the extended standard initial template, for example, the background, inner margin, outer margin and other styles of the standard initial template can be extended. In some embodiments, the one or more template identification information and one or more template style extension information corresponding to the second link address are obtained from the rule information, and at least one of the one or more standard initial templates corresponding to the one or more template identification information is extended according to the one or more template style extension information, so as to obtain the one or more template information corresponding to the second link address. For example, the template style extension information may be ("template":"id":2,"background":"#ff00ff","margin":"10,5,10,5","padding":"5,5,5,5"}), thereby extending the background, inner margin and outer margin of the standard initial template with id 2, thereby obtaining the final template information.
[0054] Figure 2A user device structure diagram based on native rendering of information flow according to an embodiment of the present application is shown, and the device includes a first module 11, a second module 12 and a third module 13. The first module 11 is used to respond to a load trigger operation for a target link address in a target application, obtain a configuration file corresponding to the target link address, and obtain at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information flow; the first module 12 is used to create all native controls corresponding to all the native control description information included in the one or more template information, wherein all the native controls include at least one native control corresponding to the at least one native control description information; the first module 13 is used to bind the at least one information flow to the at least one native control, and render all the native controls on the current page generated based on the load trigger operation according to the one or more template information.
[0055] Module 11, used in some embodiments, the loading trigger operation can be that the user enters the target link address in the target application, or the user clicks the target link address in the target application, or the user clicks the target link address in other applications to jump to the target application, and no restrictions are imposed on the loading trigger operation. In some embodiments, the configuration file can be a file in any format, and preferably, the configuration file can be a file in json format. In some embodiments, the configuration file can be obtained from a server corresponding to the target link address, or the configuration file can be obtained from a server that the target should correspond to, or the configuration file can be obtained locally from the user device, or the target link address can include the storage address of the configuration file (for example, a third-party server address), and the configuration file can be obtained according to the storage address of the configuration file. In some embodiments, the current page generated based on the load trigger operation for the target link address includes one or more display areas, and the one or more displayed areas include multiple types, wherein the first type of display area is directly rendered on the current page, the second type of display area will not be rendered on the current page at the beginning, and needs to respond to the access trigger operation (e.g., click operation, etc.) performed on the native control in the first type of display area before it is rendered on the current page, and the third type of display area will not be rendered on the current page at the beginning, and needs to respond to the access trigger operation (e.g., click operation, etc.) performed on the native control in the first type or second type of display area, jump from the current page to a new second page, and render on the second page. In some embodiments, the configuration file includes one or more template information, and each display area can correspond to one template information or multiple template information. In some embodiments, each display area can correspond to different template information, or multiple display areas can correspond to the same template information. In some embodiments, the template information may be the layout style information of the corresponding display area, the layout style information includes one or more native control description information, the native control description information is used to describe the type and properties of the native control that needs to be rendered in the corresponding display area, and according to the template information, one or more native controls corresponding to the template information may be rendered in the corresponding display area. In some embodiments, the native control may be a view preset by the user device system (for example, Button, TextView, RecyclerView, etc.), or a viewgroup preset by the user device system (the viewgroup includes one or more views or viewgroups, for example, LinearLayout, RelativeLayout, etc.), or a custom view or custom viewgroup.In some embodiments, at least one of the one or more template information needs to obtain the corresponding information stream. At this time, for each of the at least one template information, at least one of the one or more native control description information included in the template information needs to obtain the information stream to be bound to the native control corresponding to the at least one native control description information. The configuration file defines how to obtain the one or more information streams that need to be bound to the native control corresponding to the native control description information for each of the at least one native control description information (information flow parsing rules). In some embodiments, the configuration file includes one or more interface addresses (for example, ajax interface addresses), and multiple native control description information can correspond to the same interface address or to different interface addresses respectively. The interface data information (for example, json format data) corresponding to a native control description information is obtained by requesting (for example, ajax request) the interface address corresponding to the native control description information, and then the information flow parsing rule information in the configuration file is used. The information flow parsing rule information includes which interface address in the configuration file each native control description information corresponds to, and one or more field path information (for example, the path of one or more keys in json format data). One or more information streams corresponding to the one or more field path information (for example, the value corresponding to one or more keys in json format data) are parsed from the interface data information corresponding to the native control description information, and the one or more information streams are used as the information flow that needs to be bound to the native control corresponding to the native control description information. In some embodiments, based on the HTML page information corresponding to the target link address, the Document information corresponding to the native control description information can be obtained. The Document is the root node of the HTML page information. All tags in the HTML page information can be accessed through the Document. Then, through the information flow parsing rule information in the configuration file, the information flow parsing rule information includes one or more tag path information. The one or more tags corresponding to the one or more tag path information are parsed from the Document corresponding to the native control description information, and the information flow corresponding to the one or more tags is used as the information flow that needs to be bound to the native control corresponding to the native control description information.
[0056] Module 12 is used to create all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information. It should be noted here that there is no strict order between obtaining the information flow and creating the native control. The information flow can be obtained first and then the native control can be created, or the native control can be created first and then the information flow can be obtained. In some embodiments, creating a native control includes but is not limited to creating a new native control object (for example, calling the Button constructor to create a new TextView object), initializing the native control object according to the native control description information (for example, calling the init method of TextView, or, according to the attribute information of TextView in the native control description information, calling the relevant method of TextView (such as the setTextSize method) or directly setting the relevant attributes of TextView), etc.
[0057] A three-module 13 is used to bind the at least one information stream to the at least one native control, and render all the native controls on the current page generated based on the loading trigger operation according to the one or more template information. In some embodiments, for each native control in at least one native control to which an information stream needs to be bound, one or more information streams corresponding to the native control are obtained through a configuration file, and the one or more information streams are bound to the native control. Here, the binding can be to call the relevant method corresponding to the native control object (for example, call the setTextSize method of TextView) to transfer the one or more information streams into the native control object, or the relevant attributes in the native control object can also be directly assigned to the one or more information streams. In some embodiments, according to one or more template information, one or more native controls corresponding to the one or more native control description information included in each template information are rendered on the current page generated based on the loading trigger operation, wherein the rendering method is based on the native rendering of the user device operating system, rather than based on the rendering of the browser kernel. It should be noted here that the android system is used as an example in each embodiment of the present application, and those skilled in the art should understand that the scheme of the present application can also be applied to other systems, such as IOS systems.
[0058] The present application can obtain one or more template information according to the configuration file corresponding to the target link address, and then obtain one or more native controls from each template information, and obtain one or more information streams corresponding to at least one of the one or more native controls according to the configuration file, and then create the one or more native controls, bind the one or more information streams to the at least one native control, and render the one or more native controls on the current page according to the template information, thereby realizing native rendering of the information stream in the H5 page through the native controls, thereby presenting the H5 page in a native form, which can solve the performance and security issues of H5, and also enable developers to have an experience close to native applications without having to learn the native language, thereby reducing the learning and development costs of developers; further, it can also reduce the development costs of developers on the UI, so that developers can focus on the information stream they want to present.
[0059] In some embodiments, the obtaining of the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address from a server corresponding to the target link address. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0060] In some embodiments, the target link address includes a configuration file address; wherein obtaining the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address according to the configuration file address. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0061] In some embodiments, the obtaining of the configuration file corresponding to the target link address includes: obtaining the configuration file corresponding to the target link address from a server corresponding to the target application. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0062] In some embodiments, the step of obtaining the configuration file corresponding to the target link address from the server corresponding to the target application includes: sending the host information of the target link address to the server corresponding to the target application, so that the server queries the configuration file corresponding to the host information; receiving the configuration file corresponding to the host information returned by the server, and using the configuration file corresponding to the host information as the configuration file corresponding to the target link address. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0063] In some embodiments, the configuration file includes at least one second link address; wherein, obtaining at least one information stream corresponding to the target link address according to the configuration file includes: obtaining at least one template information corresponding to the at least one second link address from the configuration file, obtaining one or more native control description information corresponding to the at least one second link address from the at least one template information, and obtaining at least one information stream corresponding to at least one of the one or more native control description information according to the configuration file, wherein each second link address corresponds to one or more template information, and each of the one or more template information includes one or more native control description information. Here, the related operations are as follows: Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0064] In some embodiments, the configuration file also includes at least one rule information; wherein, obtaining at least one template information corresponding to the at least one second link address from the configuration file, obtaining one or more native control description information corresponding to the at least one second connection address from the at least one template information, and obtaining at least one information stream corresponding to at least one of the one or more native control description information according to the configuration file, includes the following operations performed on each of the at least one second link address: obtaining the rule information corresponding to the second link address from the configuration file, obtaining one or more template information corresponding to the second link address from the rule information, and obtaining one or more native control description information corresponding to the second link address from the one or more template information; obtaining one or more information streams corresponding to at least one of the one or more native control description information according to the rule information. Here, the relevant operations are the same as Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0065] In some embodiments, the configuration file further includes a mapping relationship between at least one link-related information and the at least one rule information; wherein, obtaining the rule information corresponding to the second link address from the configuration file includes: matching the second link address with the at least one link-related information to obtain link-related information matching the second link address, and according to the mapping relationship, using the rule information corresponding to the link-related information as the rule information corresponding to the second link address. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0066] In some embodiments, the step of obtaining one or more information streams corresponding to at least one of the one or more native control description information according to the rule information includes: for each native control description information in at least one of the one or more native control description information, obtaining document object information corresponding to the native control description information, and obtaining information stream parsing rule information corresponding to the native control description information from the rule information, and parsing the document object information according to the information stream parsing rule information to obtain one or more information streams corresponding to the native control description information. Here, the related operations are the same as Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0067] In some embodiments, the document object information is interface data information, and the information flow parsing rule information includes one or more field path information; wherein, obtaining the document object information corresponding to the native control description information includes: obtaining the interface address information corresponding to the native control description information; according to the interface address information, requesting to obtain the interface data information corresponding to the native control description information; wherein, according to the information flow parsing rule information, parsing the document object information to obtain one or more information flows corresponding to the native control description information includes: for each field path information in the one or more field path information, parsing the interface data information corresponding to the native control description information to obtain the information flow corresponding to the field path information. Here, the related operations are as follows Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0068] In some embodiments, the document object information is Document information, and the information flow parsing rule information includes one or more tag path information; wherein, obtaining the document object information corresponding to the native control description information includes: obtaining the Document information corresponding to the native control description information according to the HTML page information corresponding to the first link address, wherein the first link address is the target link address or the second link address; wherein, parsing the one or more information flows corresponding to the native control description information from the document object information according to the information flow parsing rule information includes: for each tag path information in the one or more tag path information, parsing the information flow corresponding to the tag path information from the HTML information corresponding to the native control description information. Here, the related operations are the same as Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0069] In some embodiments, the configuration file also includes one or more third link addresses and at least one second rule information; wherein the device is also used to: in response to an access trigger operation for a target third link address in the one or more third link addresses in the current page, obtain the second rule information corresponding to the target third link address from the configuration file, obtain one or more second template information corresponding to the target third connection address from the second rule information, and obtain one or more second native control description information corresponding to the target third link address from the one or more second template information; according to the second rule information, obtain one or more information streams corresponding to at least one second native control description information in the one or more second native control description information; create one or more second native controls corresponding to the one or more second native control description information, wherein the one or more second native controls include at least one second native control corresponding to the at least one second native control description information; bind the one or more information streams to the at least one second native control, and render the one or more second native controls on the current page according to the one or more second template information. Here, the related operations are as follows: Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0070] In some embodiments, the configuration file also includes one or more fourth link addresses and at least one third rule information; wherein the device is further used to: in response to an access trigger operation in the current page for a target fourth link address in the one or more fourth link addresses, jump from the current page to a second page corresponding to the target fourth link address; obtain the third rule information corresponding to the target fourth link address from the configuration file, and obtain one or more third template information corresponding to the target fourth link address from the third rule information, and obtain one or more third native control description information corresponding to the target fourth link address from the one or more third template information; according to the third rule information, obtain one or more information streams corresponding to at least one third native control description information in the one or more third native control description information; create one or more third native controls corresponding to the one or more third native control description information, wherein the one or more third native controls include at least one third native control corresponding to the at least one third native control description information; bind the one or more information streams to the at least one third native control, and render the one or more third native controls on the second page according to the one or more third template information. Here, the related operations are as follows: Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0071] In some embodiments, the step of obtaining one or more template information corresponding to the second link address from the rule information includes: obtaining one or more template identification information corresponding to the second link address from the rule information, and obtaining one or more template information corresponding to the one or more template identification information. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0072] In some embodiments, the step of obtaining one or more template identification information corresponding to the second link address from the rule information and obtaining one or more template information corresponding to the one or more template identification information includes: obtaining one or more template identification information corresponding to the second link address and one or more template style extension information corresponding to at least one of the one or more template identification information from the rule information, and obtaining one or more initial template information corresponding to the one or more template identification information; obtaining one or more template information corresponding to the second link address according to the one or more template style extension information and the one or more initial template information. Here, the related operations are the same as Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.
[0073] Figure 3 An exemplary system is shown that can be used to implement the various embodiments described in this application.
[0074] like Figure 3 In some embodiments shown, the system 300 can be used as any of the devices in the various described embodiments. In some embodiments, the system 300 may include one or more computer-readable media (e.g., system memory or NVM / storage device 320) with instructions and one or more processors (e.g., (one or more) processors 305) coupled to the one or more computer-readable media and configured to execute instructions to implement modules to perform the actions described in this application.
[0075] For one embodiment, system control module 310 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 305 and / or any suitable device or component in communication with system control module 310 .
[0076] The system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315. The memory controller module 330 may be a hardware module, a software module, and / or a firmware module.
[0077] The system memory 315 may be used, for example, to load and store data and / or instructions for the system 300. For one embodiment, the system memory 315 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the system memory 315 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0078] For one embodiment, system control module 310 may include one or more input / output (I / O) controllers to provide interfaces to NVM / storage device 320 and communication interface(s) 325 .
[0079] For example, NVM / storage device 320 may be used to store data and / or instructions. NVM / storage device 320 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0080] NVM / storage device 320 may include storage resources that are physically part of the device on which system 300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 320 may be accessed over a network via communication interface(s) 325.
[0081] Communication interface(s) 325 may provide an interface for system 300 to communicate over one or more networks and / or with any other suitable devices. System 300 may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.
[0082] For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 (e.g., the memory controller module 330). For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310. For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310 to form a system on chip (SoC).
[0083] In various embodiments, the system 300 may be, but is not limited to: a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the system 300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the system 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and a speaker.
[0084] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer code. When the computer code is executed, the method described in any of the preceding items is executed.
[0085] The present application also provides a computer program product. When the computer program product is executed by a computer device, the method described in any of the preceding items is executed.
[0086] The present application also provides a computer device, the computer device comprising:
[0087] one or more processors;
[0088] a memory for storing one or more computer programs;
[0089] When the one or more computer programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any of the preceding items.
[0090] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0091] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0092] Communication media include media by which communication signals containing, for example, computer readable instructions, data structures, program modules, or other data are transmitted from one system to another. Communication media may include guided transmission media such as cables and wires (e.g., fiber optic, coaxial, etc.) and wireless (unguided transmission) media that can propagate energy waves, such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data may be embodied as a modulated data signal in, for example, a wireless medium such as a carrier wave or similar mechanism such as embodied as part of spread spectrum technology. The term "modulated data signal" refers to a signal whose one or more characteristics are changed or set in such a manner as to encode information in the signal. Modulation may be analog, digital, or a hybrid modulation technique.
[0093] By way of example and not limitation, computer-readable storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and non-volatile memory, such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other media now known or later developed that can store computer-readable information / data for use by a computer system.
[0094] Here, according to an embodiment of the present application, a device is included, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions based on the aforementioned multiple embodiments of the present application.
[0095] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for native rendering based on information flow, applied to a user device, wherein: The method comprises: In response to a load trigger operation for a target link address in a target application, a configuration file corresponding to the target link address is obtained, and at least one information stream corresponding to the target link address is obtained according to the configuration file, wherein the configuration file includes one or more template information, each of the one or more template information includes one or more native control description information, and at least one native control description information among all the native control description information included in the one or more template information corresponds to the at least one information stream; Creating all native controls corresponding to all native control description information included in the one or more template information, wherein all native controls include at least one native control corresponding to the at least one native control description information; The at least one information stream is bound to the at least one native control, and all the native controls are rendered on a current page generated based on the loading trigger operation according to the one or more template information.
2. The method according to claim 1, wherein: The step of obtaining a configuration file corresponding to the target link address includes: Obtain a configuration file corresponding to the target link address from a server corresponding to the target link address.
3. The method according to claim 1, wherein: The target link address includes a configuration file address; Wherein, obtaining the configuration file corresponding to the target link address includes: According to the configuration file address, obtain the configuration file corresponding to the target link address.
4. The method according to claim 1, wherein: The step of obtaining a configuration file corresponding to the target link address includes: Obtain a configuration file corresponding to the target link address from a server corresponding to the target application.
5. The method according to claim 4, wherein: The step of obtaining a configuration file corresponding to the target link address from a server corresponding to the target application includes: Sending the host information of the target link address to the server corresponding to the target application, so that the server queries the configuration file corresponding to the host information; The configuration file corresponding to the host information returned by the server is received, and the configuration file corresponding to the host information is used as the configuration file corresponding to the target link address.
6. The method according to any one of claims 1 to 5, wherein: The configuration file includes at least one second link address; Wherein, acquiring at least one information flow corresponding to the target link address according to the configuration file includes: Obtain at least one template information corresponding to the at least one second link address from the configuration file, obtain one or more native control description information corresponding to the at least one second link address from the at least one template information, and obtain at least one information stream corresponding to at least one native control description information among the one or more native control description information according to the configuration file, wherein each second link address corresponds to one or more template information, and each of the one or more template information includes one or more native control description information.
7. The method according to claim 6, wherein: The configuration file also includes at least one rule information; Wherein, the obtaining of at least one template information corresponding to the at least one second link address from the configuration file, obtaining one or more native control description information corresponding to the at least one second connection address from the at least one template information, and obtaining at least one information stream corresponding to at least one native control description information in the one or more native control description information according to the configuration file include the following operations performed for each second link address in the at least one second link address: Obtaining rule information corresponding to the second link address from the configuration file, obtaining one or more template information corresponding to the second link address from the rule information, and obtaining one or more native control description information corresponding to the second link address from the one or more template information; According to the rule information, one or more information streams corresponding to at least one native control description information among the one or more native control description information are obtained.
8. The method according to claim 7, wherein: The configuration file further includes a mapping relationship between at least one link related information and the at least one rule information; Wherein, obtaining the rule information corresponding to the second link address from the configuration file includes: Matching the second link address with the at least one link-related information to obtain link-related information matching the second link address; According to the mapping relationship, the rule information corresponding to the link related information is used as the rule information corresponding to the second link address.
9. The method according to claim 7 or 8, wherein: The acquiring, according to the rule information, one or more information streams corresponding to at least one of the one or more native control description information comprises: For each native control description information in at least one of the one or more native control description information, obtain the document object information corresponding to the native control description information, and obtain the information flow parsing rule information corresponding to the native control description information from the rule information, and according to the information flow parsing rule information, parse from the document object information to obtain one or more information flows corresponding to the native control description information.
10. The method according to claim 9, wherein: The document object information is interface data information, and the information flow parsing rule information includes one or more field path information; Wherein, the obtaining of the document object information corresponding to the native control description information includes: Get the interface address information corresponding to the native control description information; According to the interface address information, request to obtain the interface data information corresponding to the native control description information; The step of parsing the document object information according to the information flow parsing rule information to obtain one or more information flows corresponding to the native control description information includes: For each field path information in the one or more field path information, the information flow corresponding to the field path information is obtained by parsing the interface data information corresponding to the native control description information.
11. The method according to claim 9, wherein: The document object information is Document information, and the information flow parsing rule information includes one or more label path information; Wherein, the obtaining of the document object information corresponding to the native control description information includes: Obtaining Document information corresponding to the native control description information according to HTML page information corresponding to the first link address, wherein the first link address is the target link address or the second link address; The step of parsing the document object information according to the information flow parsing rule information to obtain one or more information flows corresponding to the native control description information includes: For each tag path information in the one or more tag path information, an information flow corresponding to the tag path information is obtained by parsing the HTML information corresponding to the native control description information.
12. The method according to claim 7, wherein: The configuration file also includes one or more third link addresses and at least one second rule information; Wherein, the method further comprises: In response to an access trigger operation on a target third link address among the one or more third link addresses in the current page, obtaining second rule information corresponding to the target third link address from the configuration file, obtaining one or more second template information corresponding to the target third link address from the second rule information, and obtaining one or more second native control description information corresponding to the target third link address from the one or more second template information; According to the second rule information, obtaining one or more information streams corresponding to at least one second native control description information among the one or more second native control description information; Creating one or more second native controls corresponding to the one or more second native control description information, wherein the one or more second native controls include at least one second native control corresponding to the at least one second native control description information; The one or more information streams are bound to the at least one second native control, and the one or more second native controls are rendered on the current page according to the one or more second template information.
13. The method according to claim 7, wherein: The configuration file also includes one or more fourth link addresses and at least one third rule information; Wherein, the method further comprises: In response to an access triggering operation on the current page for a target fourth link address among the one or more fourth link addresses, jumping from the current page to a second page corresponding to the target fourth link address; Obtaining third rule information corresponding to the target fourth link address from the configuration file, obtaining one or more third template information corresponding to the target fourth link address from the third rule information, and obtaining one or more third native control description information corresponding to the target fourth link address from the one or more third template information; According to the third rule information, obtaining one or more information streams corresponding to at least one third native control description information among the one or more third native control description information; Creating one or more third native controls corresponding to the one or more third native control description information, wherein the one or more third native controls include at least one third native control corresponding to the at least one third native control description information; The one or more information streams are bound to the at least one third native control, and the one or more third native controls are rendered on the second page according to the one or more third template information.
14. The method according to claim 7 or 8, wherein: The acquiring one or more template information corresponding to the second link address from the rule information includes: Acquire one or more template identification information corresponding to the second link address from the rule information, and acquire one or more template information corresponding to the one or more template identification information.
15. The method according to claim 14, wherein: The acquiring one or more template identification information corresponding to the second link address from the rule information, and acquiring one or more template information corresponding to the one or more template identification information, includes: Acquire one or more template identification information corresponding to the second link address and one or more template style extension information corresponding to at least one of the one or more template identification information from the rule information, and acquire one or more initial template information corresponding to the one or more template identification information; According to the one or more template style extension information and the one or more initial template information, one or more template information corresponding to the second link address is obtained.
16. A device for native rendering based on information flow, wherein: The device comprises: Processor; and A memory arranged to store computer executable instructions which, when executed, cause the processor to perform a method as claimed in any one of claims 1 to 15.
17. A computer readable medium storing instructions which, when executed, cause a system to perform the operations of the method of any one of claims 1 to 15.
Citation Information
Patent Citations
Method and equipment for providing information flow
CN110519250A
Page rendering method and apparatus, computer device, and storage medium
WO2020024399A1