CN112241499A - Native rendering method and device based on information flow - Google Patents

Native rendering method and device based on information flow Download PDF

Info

Publication number
CN112241499A
CN112241499A CN202010980206.0A CN202010980206A CN112241499A CN 112241499 A CN112241499 A CN 112241499A CN 202010980206 A CN202010980206 A CN 202010980206A CN 112241499 A CN112241499 A CN 112241499A
Authority
CN
China
Prior art keywords
information
link address
native
native control
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010980206.0A
Other languages
Chinese (zh)
Inventor
苏勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lianshang Network Technology Co Ltd
Original Assignee
Shanghai Lianshang Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lianshang Network Technology Co Ltd filed Critical Shanghai Lianshang Network Technology Co Ltd
Priority to CN202010980206.0A priority Critical patent/CN112241499A/en
Publication of CN112241499A publication Critical patent/CN112241499A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application aims to provide a method and equipment for native rendering based on information flow, wherein the method comprises the following steps: responding to a loading trigger operation aiming at a target link address in a target application, acquiring a configuration file corresponding to the target link address, and acquiring at least one information flow corresponding to the target link address according to the configuration file; creating all native controls corresponding to all native control description information included in the one or more template information; and binding the at least one information flow on the at least one native control, and rendering all native controls on a current page generated based on the loading trigger operation according to the one or more template information. The native rendering of the information flow in the H5 page can be achieved through the native control, so that the H5 page is displayed in a native form, and the performance problem and the safety problem of the H5 can be solved.

Description

Native rendering method and device based on information flow
Technical Field
The present application relates to the field of communications, and more particularly, to a technique for native rendering based on information flow.
Background
In the prior art, a web page is usually presented by using an implementation mode of H5(HTML5) or Native app (Native application), and an implementation mode of H5 has the advantages of being cross-platform, low in development cost, on-line at any time and suitable for fast iteration, but the implementation mode has poor performance and security problems such as browser hijacking due to the fact that rendering is required based on a browser kernel, and the Native application implementation mode is rendered based on a Native operating system of user equipment, so that the performance and the security are good, but the development cost is high.
Disclosure of Invention
An object of the present application is to provide a method and apparatus for native rendering based on information flow.
According to an aspect of the present application, there is provided a method of native rendering based on information flow, the method comprising:
responding to a loading trigger operation aiming at a target link address in a target application, acquiring a configuration file corresponding to the target link address, and acquiring at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file comprises one or more template information, each template information in the one or more template information comprises one or more native control description information, and at least one native control description information in all the native control description information included in the one or more template information corresponds to the at least one information flow;
creating all native controls corresponding to all native control description information included in the one or more template information, wherein the all native controls include at least one native control corresponding to the at least one native control description information;
and binding the at least one information flow on the at least one native control, and rendering all native controls on a current page generated based on the loading trigger operation according to the one or more template information.
According to an aspect of the present application, there is provided a user device for native rendering based on information flow, the device comprising:
a one-to-one 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 flow corresponding to the target link address according to the configuration file, where the configuration file includes one or more pieces of template information, each piece of the one or more pieces of template information includes one or more pieces of native control description information, and at least one piece of native control description information in all pieces of native control description information included in the one or more pieces of template information corresponds to the at least one information flow;
a second module, configured to create all native controls corresponding to all native control description information included in the one or more template information, where all native controls include at least one native control corresponding to the at least one native control description information;
a third module for binding the at least one information flow to the at least one native control and rendering the all native controls according to the one or more template information on a current page generated based on the load trigger operation.
According to an aspect of the present application, there is provided an apparatus for native rendering based on information flow, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
responding to a loading trigger operation aiming at a target link address in a target application, acquiring a configuration file corresponding to the target link address, and acquiring at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file comprises one or more template information, each template information in the one or more template information comprises one or more native control description information, and at least one native control description information in all the native control description information included in the one or more template information corresponds to the at least one information flow;
creating all native controls corresponding to all native control description information included in the one or more template information, wherein the all native controls include at least one native control corresponding to the at least one native control description information;
and binding the at least one information flow on the at least one native control, and rendering all native controls on a current page generated based on the loading trigger operation according to the one or more template information.
According to one aspect of the application, there is provided a computer-readable medium storing instructions that, when executed, cause a system to:
responding to a loading trigger operation aiming at a target link address in a target application, acquiring a configuration file corresponding to the target link address, and acquiring at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file comprises one or more template information, each template information in the one or more template information comprises one or more native control description information, and at least one native control description information in all the native control description information included in the one or more template information corresponds to the at least one information flow;
creating all native controls corresponding to all native control description information included in the one or more template information, wherein the all native controls include at least one native control corresponding to the at least one native control description information;
and binding the at least one information flow on the at least one native control, and rendering all native controls on a current page generated based on the loading trigger operation according to the one or more template information.
Compared with the prior art, the method and the device have the advantages that one or more template information can be obtained according to the configuration file corresponding to the target link address, one or more native controls are obtained from each template information, one or more information streams corresponding to at least one of the one or more native controls are obtained according to the configuration file, then the one or more native controls are created, the one or more information streams are bound on the at least one native control, the one or more native controls are rendered on the current page according to the template information, accordingly, native rendering can be achieved on the information streams in the H5 page through the native controls, the H5 page is displayed in a native form, the performance problem and the safety problem of the H5 can be solved, and a developer can have experience close to native application on the premise of not learning a native language, the learning and development cost of developers is reduced; further, the development cost of the developer on the UI can also be reduced, so that the developer can concentrate on the information stream itself that is desired to be presented.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method for native rendering based on information flow according to one embodiment of the present application;
FIG. 2 illustrates a user device structure diagram based on native rendering of information streams, according to one embodiment of the present application;
FIG. 3 illustrates an exemplary system that can be used to implement the various embodiments described in this application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (e.g., Central Processing Units (CPUs)), input/output interfaces, network interfaces, and memory.
The Memory may include forms of volatile Memory, Random Access Memory (RAM), and/or non-volatile Memory in a computer-readable medium, such as Read Only Memory (ROM) or Flash Memory. Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 cassette tape, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by the computing device.
The device referred to in this application includes, but is not limited to, a user device, a network device, or a device formed by integrating a user device and a network device through a network. The user equipment includes, but is not limited to, any mobile electronic product, such as a smart phone, a tablet computer, etc., capable of performing human-computer interaction with a user (e.g., human-computer interaction through a touch panel), and the mobile electronic product may employ any operating system, such as An android operating system, An iOS operating system, etc. The network Device includes an electronic Device capable of automatically performing numerical calculation and information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded Device, and the like. The network device includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud of a plurality of servers; here, the Cloud is composed of a large number of computers or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual supercomputer consisting of a collection of loosely coupled computers. Including, but not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless Ad Hoc 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 touch terminal, or the network device and the touch terminal through a network.
Of course, those skilled in the art will appreciate that the foregoing is by way of example only, and that other existing or future devices, which may be suitable for use in the present application, are also encompassed within the scope of the present application and are hereby incorporated by reference.
In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
Fig. 1 shows a flowchart of a method for information-flow-based native rendering according to an embodiment of the present application, the method including step S11, step S12, and step S13. In step S11, in response to a load trigger operation for a target link address in a target application, a user equipment acquires a configuration file corresponding to the target link address, and acquires at least one information flow corresponding to the target link address according to the configuration file, where 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 of 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 native control description information included in the one or more template information, wherein the all 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 on the at least one native control, and renders all native controls according to the one or more template information on a current page generated based on the load trigger operation.
In step S11, in response to a load trigger operation for a target link address in a target application, a user equipment 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, where 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 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 loading trigger operation may be the user inputting a target link address in the target application, or clicking the target link address in the target application by the user, or clicking the target link address in another application to jump to the target application, where no limitation is imposed on the loading trigger operation. In some embodiments, the configuration file may be a file of any format, and preferably, the configuration file may be a file of json format. In some embodiments, the configuration file may be obtained from a server corresponding to the target link address, or the configuration file may also be obtained from a server to which the target should correspond, or the configuration file may also be obtained locally from the user equipment, or the target link address may include a storage address (e.g., a third party server address) of the configuration file, and the configuration file may 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 contains one or more displayed regions, the one or more displayed regions comprising a plurality of types, 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, the display area of the third type is rendered on the current page at first only in response to an access triggering operation (for example, a clicking operation and the like) executed on the native control in the first type of display area, and the display area of the third type is skipped from the current page to a new second page and rendered on the second page in response to an access triggering operation (for example, a clicking operation and the like) executed on the native control in the first type of display area or the second type of display area. In some embodiments, the configuration file includes one or more template information, and each display area may correspond to one template information or a plurality of template information. In some embodiments, each display region may correspond to different template information, respectively, or multiple display regions may correspond to the same template information. In some embodiments, the template information may be layout style information of a corresponding display area, the layout style information includes one or more native control description information, the native control description information is used to describe information, such as a type and an attribute of a native control that needs to be rendered on the corresponding display area, and according to the template information, the one or more native controls corresponding to the template information may be rendered on the corresponding display area. In some embodiments, the native control may be a preset view of the user equipment system (e.g., Button, TextView, cycleview, etc.), a preset view group of the user equipment system (e.g., one or more views or view groups are included in the view group, such as linear layout, relatedlayout, etc.), and a custom view or custom view group. In some embodiments, at least one of the one or more pieces of template information needs to obtain a corresponding information flow, at this time, for each piece of template information in the at least one piece of template information, at least one piece of native control description information in the one or more pieces of native control description information included in the template information needs to obtain an information flow to be bound to a native control corresponding to the at least one piece of native control description information, and how to obtain an obtaining manner (an information flow parsing rule) of the one or more information flows that need to be bound to the native control corresponding to the at least one piece of native control description information is defined in the configuration file for each piece of native control description information in the at least one piece of native control description information. In some embodiments, the configuration file includes one or more interface addresses (e.g., ajax interface addresses), multiple pieces of native control description information may correspond to the same interface address, or may correspond to different interface addresses, interface data information (e.g., json format data) corresponding to a piece of native control description information is obtained by requesting (e.g., ajax request) an interface address corresponding to the piece of native control description information, and then information flow parsing rule information in the configuration file includes which interface address in the configuration file each piece of native control description information corresponds to and one or more pieces of field path information (e.g., paths of one or more keys in the json format data) is obtained by parsing the interface data information corresponding to the piece of native control description information (e.g., value corresponding to one or more keys in json format data), and using the one or more information flows as the information flows needing to be bound to the native control corresponding to the native control description information. In some embodiments, according to the HTML page information corresponding to the target link address, Document information corresponding to the native control description information may be obtained, where the Document is a root node of the HTML page information, all tags in the HTML page information may be accessed through the Document, then rule information is parsed through an information stream in a configuration file, the rule information includes one or more tag path 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 stream corresponding to the one or more tags is used as an information stream that needs to be bound to the native control corresponding to the native control description information.
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 the all native controls include at least one native control corresponding to the at least one native control description information. It should be noted that there is no strict sequence between the information flow acquisition and the native control creation, and the information flow may be acquired first and then the native control may be created, or the native control may be created first and then the information flow may be acquired. In some embodiments, creating the native control includes, but is not limited to, creating a native control object (e.g., calling a constructor of Button to new a TextView object), initializing the native control object according to the native control description information (e.g., calling an init method of TextView, or calling a related method of TextView (e.g., setTextSize method) or directly setting related properties of TextView according to property information of TextView in the native control description information), and the like.
In step S13, the user device binds the at least one information flow on the at least one native control, and renders all native controls according to the one or more template information on a current page generated based on the load trigger operation. In some embodiments, for each of at least one native control requiring binding information flow, one or more information flows corresponding to the native control are obtained through a configuration file, and the one or more information flows are bound to the native control, where the binding may be to call a relevant method corresponding to the native control object (for example, to call a setTextSize method of TextView) to transfer the one or more information flows into the native control object, or may also directly assign relevant properties in the native control object to the one or more information flows. In some embodiments, according to one or more pieces of template information, rendering one or more native controls corresponding to one or more pieces of native control description information included in each piece of template information on a current page generated based on the loading trigger operation, wherein the rendering mode is based on native rendering of an operating system of the user equipment, and not based on rendering of a browser kernel. It should be noted that, in the embodiments of the present application, an android system is taken as an example, and those skilled in the art should understand that the solution of the present application can also be applied to other systems, such as an IOS system.
The method and the device can acquire one or more template information according to the configuration file corresponding to the target link address, further acquire one or more native controls from each template information, acquire one or more information streams corresponding to at least one of the one or more native controls according to the configuration file, then create the one or more native controls, bind the one or more information streams on 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 streams in the H5 page through the native controls, displaying the H5 page in a native form, solving the performance problem and the security problem of the H5, and enabling a developer to have experience close to native application on the premise of not learning a native language, the learning and development cost of developers is reduced; further, the development cost of the developer on the UI can also be reduced, so that the developer can concentrate on the information stream itself that is desired to be presented.
In some embodiments, the obtaining the configuration file corresponding to the target link address includes: and acquiring a configuration file corresponding to the target link address from a server corresponding to the target link address.
In some embodiments, the target link address comprises a profile address; the obtaining of the configuration file corresponding to the target link address includes: and acquiring a configuration file corresponding to the target link address according to the configuration file address. In some embodiments, the target link address may include a storage address of the profile, where the storage address may be a storage path of the profile locally on the user equipment, or may be an address of a third-party server storing the profile, for example, the end of the target link address includes a storage address of an "@ profile".
In some embodiments, the obtaining the configuration file corresponding to the target link address includes: and acquiring the configuration file corresponding to the target link address from the server corresponding to the target application.
In some embodiments, the 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 a server corresponding to the target application, so that the server queries a configuration file corresponding to the host information; and receiving a configuration file corresponding to the host information returned by the server, and taking the configuration file corresponding to the host information as a configuration file corresponding to the target link address. In some embodiments, the HOST information is HOST information of a target link address, a server corresponding to the target application maintains a mapping relationship between the HOST information and a configuration file, the user equipment 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 the configuration file to the user equipment as the configuration file corresponding to the target link address. In some embodiments, the file name of the configuration file is HOST information of a link address corresponding to the configuration file, and the user equipment sends the HOST information corresponding to the target link address to a server corresponding to the target application, matches the HOST information with the file names of all the configuration files, obtains the configuration file matched with the HOST information, returns the configuration file to the user equipment, and uses the configuration file as the configuration file corresponding to the target link address.
In some embodiments, the configuration file comprises at least one second link address; wherein, the obtaining at least one information flow corresponding to the target link address according to the configuration file includes: the method includes the steps of obtaining at least one template information corresponding to at least one second link address from the configuration file, obtaining one or more pieces of 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 piece of native control description information in the one or more pieces of native control description information according to the configuration file, wherein each second link address corresponds to one or more pieces of template information, and each piece of template information in the one or more pieces of template information comprises one or more pieces of native control description information. In some embodiments, the current page contains one or more display regions, the one or more displayed regions comprising a plurality of types, wherein a first type of display region is rendered directly on the current page, a second type of display region is not initially rendered on the current page, the rendering on the current page is required in response to an access-triggering operation performed on native controls in the first type of display region, a third type of display region is not initially rendered on the current page, and the jumping from the current page to a new second page and the rendering on the second page is required in response to an access-triggering operation performed on native controls in the first type or the second type of display region. In some embodiments, one or more display areas correspond to a second link address, for example, the current page includes 2 display areas, a movie channel display area and a movie 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. In some embodiments, each second link address may correspond to one template information, or may correspond to a plurality of 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 pieces of template information corresponding to the second link address are obtained from the configuration file, the template information may be layout style information of one or more display regions corresponding to the second link address, and one or more pieces of native control description information corresponding to the second link address are obtained from the layout style information, the native control description information is used to describe information, such as a type and an attribute of a native control that needs to be rendered on the corresponding display region, and the one or more native controls corresponding to the template information may be rendered on the corresponding display region according to the template information. In some embodiments, for each second link address, according to a configuration file, one or more information streams that need to be bound to at least one native control corresponding to at least one native control description information in 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, the one or more information streams are bound to the corresponding at least one native control, and then the one or more controls are rendered on the current page natively according to one or more template information corresponding to the second link address.
In some embodiments, the configuration file further comprises at least one rule information; the 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 native control description information in the one or more native control description information according to the configuration file includes, for each second link address in the at least one second link address: acquiring rule information corresponding to the second link address from the configuration file, acquiring one or more template information corresponding to the second link address from the rule information, and acquiring one or more native control description information corresponding to the second link address from the one or more template information; and acquiring one or more information flows corresponding to at least one piece of native control description information in the one or more pieces of native control description information according to the rule information. In some embodiments, the configuration file further includes at least one rule information, each second link address corresponds to one rule information, and the rule information includes one or more template information corresponding to the second link address, and how to obtain an obtaining manner of one or more information streams that need to be bound to at least one native control corresponding to at least one native control description information in one or more native control description information in the one or more template information. For example, the current page includes 2 display areas, a movie channel display area and a movie 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/", the second link address corresponding to the movie channel display area is "https:// m.douban.com/tv/", the second link address "https:// m.douban.com/movie/" corresponding rule information is "movie _ rule", the second link address "https:// m.douban.com/tv" corresponding rule information is "tv _ rule", the "movie _ rule" includes template information (e.g., template identification information (e.g., template ID, "template": 1), and the link information of a target server or a target server can be obtained from a local server or a target server according to the template identification information, and the template of the target server is obtained from the target server or the target server The method includes the steps of obtaining a corresponding information flow obtaining mode, wherein the "tv _ rule" includes template information (for example, "template": 2), obtaining specific template information from a server corresponding to a local user equipment and a target application or a server corresponding to a target link address according to template identification information) and the corresponding information flow obtaining mode, and obtaining one or more information flows which need to be bound to at least one native control corresponding to at least one of one or more native control description information corresponding to a second link address "https:// m.douban.com/movie/" and "https:// m.douban.com/tv/" according to the respective corresponding information flow obtaining modes.
In some embodiments, the configuration file further comprises a mapping relationship between at least one link-related information and the at least one rule information; wherein the obtaining of the rule information corresponding to the second link address from the configuration file includes: and matching the second link address with the at least one piece of link related information to obtain link related information matched with the second link address, and taking the rule information corresponding to the link related information as the rule information corresponding to the second link address according to the mapping relation. In some embodiments, the link related information may be the second link address itself or 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, where different link related information corresponds to different rule information, or several different link related information correspond to the same rule information, and a certain second link address is matched with at least one link related information in the configuration file to obtain link related information matched with the second link address, and the rule information mapped by the link related information is 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" }), the second link address is "https:// m.douban.com/movie/," and the rule information corresponding to the second link address "https:// m.douban.com/movie/" can be determined as "movie _ rule" according to the mapping relationship.
In some embodiments, the obtaining, according to the rule information, one or more information flows corresponding to at least one of the one or more native control description 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, obtaining information flow parsing rule information corresponding to the native control description information from the rule information, and parsing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow parsing rule information. In some embodiments, the document object information is a carrier of an information flow, the rule information includes information flow parsing rule information corresponding to one or more native controls description information in one or more template information corresponding to the rule information, and the information flow 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 flows that need to be bound to the native controls corresponding to the native control description information. In some embodiments, one piece of rule information may correspond to one piece of document object information, and all pieces of native control description information corresponding to each piece of rule information share the document object information corresponding to the piece of rule information, or one piece of rule information may correspond to a plurality of pieces of document object information, and the plurality of pieces of native control description information corresponding to each piece of rule information respectively correspond to different pieces of document object information. In some embodiments, the document object information may be interface data information, in this case, the rule information includes one or more interface addresses, multiple pieces of 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, the interface data information corresponding to the native control description information is obtained by requesting the interface address corresponding to a certain native control, then the information flow parsing rule information corresponding to the native control description information in the rule information includes which interface address and one or more pieces of field path information in the rule information corresponding to the native control description information, and the one or more information flows corresponding to the one or more pieces of field path information are parsed from the interface data information corresponding to the native control description information, and taking the one or more information flows as the information flow corresponding to the native control description information. In some embodiments, the Document object information may be Document information, Document information corresponding to the native control description information may be obtained according to HTML page information of a target link address or HTML page information of a second link address corresponding to the rule information, then the rule information is parsed through an information stream in the rule information, the information stream parsing rule information includes obtaining 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, parsing and obtaining one or more tags corresponding to the one or more tag path information from the Document corresponding to the native control description information, and taking an information stream corresponding to the one or more tags as an information stream corresponding to the native control description information.
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; the obtaining of the document object information corresponding to the native control description information includes: acquiring interface address information corresponding to the native control description information; according to the interface address information, requesting to obtain interface data information corresponding to the native control description information; analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises: and for each piece of field path information in the one or more pieces of field path information, analyzing the interface data information corresponding to the native control description information to obtain an information stream corresponding to the field path information. In some embodiments, the document object information is interface data information (e.g., json data obtained according to ajax interface request), the rule information includes one or more interface addresses (e.g., ajax interface addresses), multiple pieces of 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, the interface data information corresponding to a certain piece of native control description information is obtained by requesting (e.g., ajax request) the interface address corresponding to the certain piece of native control description information, then the rule information is parsed by the information flow corresponding to the piece of native control description information in the rule information, 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 pieces of field path information (e.g., paths of one or more keys in json format data), analyzing and obtaining one or more information flows (for example, values corresponding to one or more keys in json format data) corresponding to the one or more field path information from the interface data information corresponding to the native control description information, and taking the one or more information flows as the information flow corresponding to the native control description information. For example, the template information corresponding to the rule information includes a native control textview a, interface address information in the rule information corresponding to the native control textview a is "https:// m.douban.com/rexxar/api/v 2/movie/comment," interface data information in json format corresponding to the native control textview a is obtained by initiating ajax request for the interface address information, "information flow parsing rule information (" title ": selector": title > value ") corresponding to the native textview a in the rule information is parsed to obtain an information flow corresponding to field path information" title > value "from the interface data information in json format corresponding to the native textview a, and the information flow is transferred to the native textview a by calling a settie method of the native textview a.
In some embodiments, the document object information isDocument information, the information flow parsing rule information including one or more label path information; 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 a first link address, wherein the first link address is the target link address or the second link address; analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises: and for each piece of label path information in the one or more pieces of label path information, analyzing HTML information corresponding to the native control description information to obtain an information stream corresponding to the label path information. In some embodiments, the Document object information is Document information, Document information corresponding to the native control description information may be obtained according to HTML page information of a target link address or HTML page information of a second link address corresponding to the rule information, the Document is a root node of the HTML page information, all tags in the HTML page information may be accessed through the Document, then rule information is parsed through an information stream corresponding to the native control description information in the rule information, the information stream parsing rule information includes obtaining corresponding Document information according to the target link address or the second link address corresponding to the rule information, and one or more tag path information, the tag path information may be path information of tags in a DOM tree, or may be an id attribute, a className attribute or other attributes corresponding to the tags, one or more tags corresponding to the one or more tag path information are obtained from the Document corresponding to the native control description information, and taking the information flow corresponding to the one or more labels as the information flow corresponding to the native control description information. For example, the template information corresponding to the rule information includes a native control textview b, and the rule information corresponding to the native control textview b corresponds to the target link address "https:// m.douban.com/movie/", according to destination Link Address"https://m.douban.com/movie/Corresponding HTML page information, and obtaining the Document message corresponding to the native control TextViewBAnd then analyzing the rule information (title { "className:" myTitle "}) through the information flow corresponding to the native control TextViewB in the rule information to obtain the information flow corresponding to the label with the className being" myTitle "from the Document corresponding to the native control, and transmitting the information flow into the native control TextViewB by calling the setTitle method of the native control TextViewB.
In some embodiments, the configuration file further comprises one or more third link addresses and at least one second rule information; wherein the method further comprises: the user equipment responds to an access triggering operation aiming at a target third link address in the one or more third link addresses in the current page, acquires second rule information corresponding to the target third link address from the configuration file, acquires one or more second template information corresponding to the target third link address from the second rule information, and acquires one or more second native control description information corresponding to the target third link address from the one or more second template information; acquiring 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 according to the second rule 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; binding the one or more information flows on the at least one second native control, and rendering 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 further includes one or more third link addresses and at least one second rule information, each third link address corresponds to one second rule information, and the second rule information corresponding to each third link address includes second template information corresponding to the third link address and how to obtain the obtaining manner of one or more information streams in at least one second native control 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 the one or more third link addresses, for example, a target third link address is included in a target first information stream bound by a target first native control that has been rendered on a current page, and an access trigger operation (e.g., a click operation) performed by a user for 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 the one or more second template information corresponding to the target third link address begin not to be 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 of 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 the at least one second native control corresponding to the at least one second native control description information, and the one or more second native controls are not rendered on the current page until the one or more second native controls are rendered on the current page according to the one or more second template information, the current page is updated for presentation on the updated current page.
In some embodiments, the configuration file further comprises one or more fourth link addresses and at least one third rule information; wherein the method further comprises: the user equipment responds to an access triggering operation aiming at a target fourth link address in the one or more fourth link addresses in the current page, and jumps to a second page corresponding to the target fourth link address from the current page; acquiring third rule information corresponding to the target fourth link address from the configuration file, acquiring one or more third template information corresponding to the target fourth link address from the third rule information, and acquiring one or more third primitive control description information corresponding to the target fourth link address from the one or more third template information; acquiring 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 according to the third rule 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; binding the one or more information flows on the at least one third native control, and rendering 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 further includes one or more fourth link addresses and at least one third rule information, each fourth link address corresponds to one third rule information, and the third rule information corresponding to each fourth link address includes third template information corresponding to the fourth link address and how to obtain an obtaining manner of 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 a target fourth link address in the one or more fourth link addresses, for example, a target fourth link address is included in a target first information stream or a target second information stream bound by a target first native control or a target second native control that has been rendered on a current page, and an access trigger operation (e.g., a click operation) performed by a user for 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 begin not to be rendered on the current page, jump from the current page to a second page corresponding to the target fourth link address in response to an access trigger operation for the target fourth link address in the current page, then obtain one or more information flows 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, bind the one or more information flows to the at least one third native control corresponding to the at least one third native control description information, and according to the one or more third template information, rendering the one or more third native controls on the second page for presentation on the second page.
In some embodiments, the obtaining, from the rule information, one or more template information corresponding to the second link address includes: and 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. In some embodiments, the template identification information may be a template name or a template ID, for example, the template identification information may be a ("template": 1). In some embodiments, the specific template information may be obtained from a server local to the user equipment, corresponding to the target application, or corresponding to the target link address according to the template identification information.
In some embodiments, the obtaining, from the rule information, one or more template identification information corresponding to the second link address and obtaining one or more template information corresponding to the one or more template identification information includes: acquiring 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 acquiring one or more initial template information corresponding to the one or more template identification information; and 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, based on the template identification information, the standard initial template information may be obtained from a server local to the user equipment, corresponding to the target application, or corresponding to the target link address. In some embodiments, the template style extension information is used to customize the style of the extended standard initial template, for example, the style of the background, inner margin, outer margin, etc. of the standard initial template may be extended. In some embodiments, 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 standard initial template 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 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"}), so as to extend the background, inner margin and outer margin of the standard initial template whose id is 2, thereby obtaining the final template information.
Fig. 2 shows a block diagram of a user device based on native rendering of information streams, according to an embodiment of the present application, the device comprising a one-module 11, a two-module 12 and a three-module 13. A one-to-one module 11, 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 flow corresponding to the target link address according to the configuration file, where the configuration file includes one or more pieces of template information, each piece of template information in the one or more pieces of template information includes one or more pieces of native control description information, and at least one piece of native control description information in all pieces of native control description information included in the one or more pieces of template information corresponds to the at least one information flow; a secondary module 12, configured to create all native controls corresponding to all native control description information included in the one or more template information, where all native controls include at least one native control corresponding to the at least one native control description information; a third module 13, configured to bind the at least one information flow to the at least one native control, and render all the native controls on a current page generated based on the load trigger operation according to the one or more template information.
A module 11, configured to, in some embodiments, a load trigger operation may be a user inputting a target link address in a target application, or a user clicking the target link address in the target application, or a user clicking the target link address in another application to jump to the target application, where no limitation is imposed on the load trigger operation. In some embodiments, the configuration file may be a file of any format, and preferably, the configuration file may be a file of json format. In some embodiments, the configuration file may be obtained from a server corresponding to the target link address, or the configuration file may also be obtained from a server to which the target should correspond, or the configuration file may also be obtained locally from the user equipment, or the target link address may include a storage address (e.g., a third party server address) of the configuration file, and the configuration file may 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 contains one or more displayed regions, the one or more displayed regions comprising a plurality of types, 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, the display area of the third type is rendered on the current page at first only in response to an access triggering operation (for example, a clicking operation and the like) executed on the native control in the first type of display area, and the display area of the third type is skipped from the current page to a new second page and rendered on the second page in response to an access triggering operation (for example, a clicking operation and the like) executed on the native control in the first type of display area or the second type of display area. In some embodiments, the configuration file includes one or more template information, and each display area may correspond to one template information or a plurality of template information. In some embodiments, each display region may correspond to different template information, respectively, or multiple display regions may correspond to the same template information. In some embodiments, the template information may be layout style information of a corresponding display area, the layout style information includes one or more native control description information, the native control description information is used to describe information, such as a type and an attribute of a native control that needs to be rendered on the corresponding display area, and according to the template information, the one or more native controls corresponding to the template information may be rendered on the corresponding display area. In some embodiments, the native control may be a preset view of the user equipment system (e.g., Button, TextView, cycleview, etc.), a preset view group of the user equipment system (e.g., one or more views or view groups are included in the view group, such as linear layout, relatedlayout, etc.), and a custom view or custom view group. In some embodiments, at least one of the one or more pieces of template information needs to obtain a corresponding information flow, at this time, for each piece of template information in the at least one piece of template information, at least one piece of native control description information in the one or more pieces of native control description information included in the template information needs to obtain an information flow to be bound to a native control corresponding to the at least one piece of native control description information, and how to obtain an obtaining manner (an information flow parsing rule) of the one or more information flows that need to be bound to the native control corresponding to the at least one piece of native control description information is defined in the configuration file for each piece of native control description information in the at least one piece of native control description information. In some embodiments, the configuration file includes one or more interface addresses (e.g., ajax interface addresses), multiple pieces of native control description information may correspond to the same interface address, or may correspond to different interface addresses, interface data information (e.g., json format data) corresponding to a piece of native control description information is obtained by requesting (e.g., ajax request) an interface address corresponding to the piece of native control description information, and then information flow parsing rule information in the configuration file includes which interface address in the configuration file each piece of native control description information corresponds to and one or more pieces of field path information (e.g., paths of one or more keys in the json format data) is obtained by parsing the interface data information corresponding to the piece of native control description information (e.g., value corresponding to one or more keys in json format data), and using the one or more information flows as the information flows needing to be bound to the native control corresponding to the native control description information. In some embodiments, according to the HTML page information corresponding to the target link address, Document information corresponding to the native control description information may be obtained, where the Document is a root node of the HTML page information, all tags in the HTML page information may be accessed through the Document, then rule information is parsed through an information stream in a configuration file, the rule information includes one or more tag path 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 stream corresponding to the one or more tags is used as an information stream that needs to be bound to the native control corresponding to the native control description information.
A secondary module 12, configured to create all native controls corresponding to all native control description information included in the one or more template information, where all native controls include at least one native control corresponding to the at least one native control description information. It should be noted that there is no strict sequence between the information flow acquisition and the native control creation, and the information flow may be acquired first and then the native control may be created, or the native control may be created first and then the information flow may be acquired. In some embodiments, creating the native control includes, but is not limited to, creating a native control object (e.g., calling a constructor of Button to new a TextView object), initializing the native control object according to the native control description information (e.g., calling an init method of TextView, or calling a related method of TextView (e.g., setTextSize method) or directly setting related properties of TextView according to property information of TextView in the native control description information), and the like.
A third module 13, configured to bind the at least one information flow to the at least one native control, and render all the native controls on a current page generated based on the load trigger operation according to the one or more template information. In some embodiments, for each of at least one native control requiring binding information flow, one or more information flows corresponding to the native control are obtained through a configuration file, and the one or more information flows are bound to the native control, where the binding may be to call a relevant method corresponding to the native control object (for example, to call a setTextSize method of TextView) to transfer the one or more information flows into the native control object, or may also directly assign relevant properties in the native control object to the one or more information flows. In some embodiments, according to one or more pieces of template information, rendering one or more native controls corresponding to one or more pieces of native control description information included in each piece of template information on a current page generated based on the loading trigger operation, wherein the rendering mode is based on native rendering of an operating system of the user equipment, and not based on rendering of a browser kernel. It should be noted that, in the embodiments of the present application, an android system is taken as an example, and those skilled in the art should understand that the solution of the present application can also be applied to other systems, such as an IOS system.
The method and the device can acquire one or more template information according to the configuration file corresponding to the target link address, further acquire one or more native controls from each template information, acquire one or more information streams corresponding to at least one of the one or more native controls according to the configuration file, then create the one or more native controls, bind the one or more information streams on 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 streams in the H5 page through the native controls, displaying the H5 page in a native form, solving the performance problem and the security problem of the H5, and enabling a developer to have experience close to native application on the premise of not learning a native language, the learning and development cost of developers is reduced; further, the development cost of the developer on the UI can also be reduced, so that the developer can concentrate on the information stream itself that is desired to be presented.
In some embodiments, the obtaining the configuration file corresponding to the target link address includes: and acquiring a configuration file corresponding to the target link address from a server corresponding to the target link address. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the target link address comprises a profile address; the obtaining of the configuration file corresponding to the target link address includes: and acquiring a configuration file corresponding to the target link address according to the configuration file address. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the obtaining the configuration file corresponding to the target link address includes: and acquiring the configuration file corresponding to the target link address from the server corresponding to the target application. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the 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 a server corresponding to the target application, so that the server queries a configuration file corresponding to the host information; and receiving a configuration file corresponding to the host information returned by the server, and taking the configuration file corresponding to the host information as a configuration file corresponding to the target link address. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the configuration file comprises at least one second link address; wherein, the obtaining at least one information flow corresponding to the target link address according to the configuration file includes: the method includes the steps of obtaining at least one template information corresponding to at least one second link address from the configuration file, obtaining one or more pieces of 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 piece of native control description information in the one or more pieces of native control description information according to the configuration file, wherein each second link address corresponds to one or more pieces of template information, and each piece of template information in the one or more pieces of template information comprises one or more pieces of native control description information. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the configuration file further comprises at least one rule information; the 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 native control description information in the one or more native control description information according to the configuration file includes, for each second link address in the at least one second link address: acquiring rule information corresponding to the second link address from the configuration file, acquiring one or more template information corresponding to the second link address from the rule information, and acquiring one or more native control description information corresponding to the second link address from the one or more template information; and acquiring one or more information flows corresponding to at least one piece of native control description information in the one or more pieces of native control description information according to the rule information. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the configuration file further comprises a mapping relationship between at least one link-related information and the at least one rule information; wherein the obtaining of the rule information corresponding to the second link address from the configuration file includes: and matching the second link address with the at least one piece of link related information to obtain link related information matched with the second link address, and taking the rule information corresponding to the link related information as the rule information corresponding to the second link address according to the mapping relation. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the obtaining, according to the rule information, one or more information flows corresponding to at least one of the one or more native control description 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, obtaining information flow parsing rule information corresponding to the native control description information from the rule information, and parsing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow parsing rule information. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
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; the obtaining of the document object information corresponding to the native control description information includes: acquiring interface address information corresponding to the native control description information; according to the interface address information, requesting to obtain interface data information corresponding to the native control description information; analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises: and for each piece of field path information in the one or more pieces of field path information, analyzing the interface data information corresponding to the native control description information to obtain an information stream corresponding to the field path information. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the Document object information is Document information, and the information flow parsing rule information includes one or more tag path information; 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 a first link address, wherein the first link address is the target link address or the second link address; analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises: and for each piece of label path information in the one or more pieces of label path information, analyzing HTML information corresponding to the native control description information to obtain an information stream corresponding to the label path information. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the configuration file further comprises one or more third link addresses and at least one second rule information; wherein the device is further configured to: responding to an access trigger operation aiming at a target third link address in the one or more third link addresses in the current page, acquiring second rule information corresponding to the target third link address from the configuration file, acquiring one or more second template information corresponding to the target third link address from the second rule information, and acquiring one or more second native control description information corresponding to the target third link address from the one or more second template information; acquiring 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 according to the second rule 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; binding the one or more information flows on the at least one second native control, and rendering 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 the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the configuration file further comprises one or more fourth link addresses and at least one third rule information; wherein the device is further configured to: responding to an access triggering operation aiming at a target fourth link address in the one or more fourth link addresses in the current page, and jumping to a second page corresponding to the target fourth link address from the current page; acquiring third rule information corresponding to the target fourth link address from the configuration file, acquiring one or more third template information corresponding to the target fourth link address from the third rule information, and acquiring one or more third primitive control description information corresponding to the target fourth link address from the one or more third template information; acquiring 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 according to the third rule 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; binding the one or more information flows on the at least one third native control, and rendering 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 the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the obtaining, from the rule information, one or more template information corresponding to the second link address includes: and 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. Here, the related operations are the same as or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
In some embodiments, the obtaining, from the rule information, one or more template identification information corresponding to the second link address and obtaining one or more template information corresponding to the one or more template identification information includes: acquiring 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 acquiring one or more initial template information corresponding to the one or more template identification information; and 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 or similar to those of the embodiment shown in fig. 1, and therefore are not described again, and are included herein by reference.
FIG. 3 illustrates an exemplary system that can be used to implement the various embodiments described in this application.
In some embodiments, as shown in FIG. 3, the system 300 can be implemented as any of the devices in the various embodiments described. In some embodiments, system 300 may include one or more computer-readable media (e.g., system memory or NVM/storage 320) having instructions and one or more processors (e.g., processor(s) 305) coupled with the one or more computer-readable media and configured to execute the instructions to implement modules to perform the actions described herein.
For one embodiment, system control module 310 may include any suitable interface controllers 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.
The system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315. Memory controller module 330 may be a hardware module, a software module, and/or a firmware module.
System memory 315 may be used, for example, to load and store data and/or instructions for system 300. For one embodiment, system memory 315 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, the system memory 315 may include a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
For one embodiment, system control module 310 may include one or more input/output (I/O) controllers to provide an interface to NVM/storage 320 and communication interface(s) 325.
For example, NVM/storage 320 may be used to store data and/or instructions. NVM/storage 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 Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives).
NVM/storage 320 may include storage resources that are physically part of the device on which system 300 is installed or may be accessed by the device and not necessarily part of the device. For example, NVM/storage 320 may be accessible over a network via communication interface(s) 325.
Communication interface(s) 325 may provide an interface for system 300 to communicate over one or more networks and/or with any other suitable device. System 300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and/or protocols.
For one embodiment, at least one of the processor(s) 305 may be packaged together with logic for one or more controller(s) (e.g., memory controller module 330) of the system control module 310. For one embodiment, at least one of the processor(s) 305 may be packaged together with logic for one or more controller(s) 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 logic for one or more controller(s) 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 logic for one or more controller(s) of the system control module 310 to form a system on a chip (SoC).
In various embodiments, system 300 may be, but is not limited to being: a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a holding computing device, a tablet, a netbook, etc.). In various embodiments, system 300 may have more or fewer components and/or different architectures. For example, in some embodiments, 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 speakers.
The present application also provides a computer readable storage medium having stored thereon computer code which, when executed, performs a method as in any one of the preceding.
The present application also provides a computer program product, which when executed by a computer device, performs the method of any of the preceding claims.
The present application further provides a computer device, comprising:
one or more processors;
a memory for storing one or more computer programs;
the one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the method of any preceding claim.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Those skilled in the art will appreciate that the form in which the computer program instructions reside on a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, and the like, and that the manner in which the 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. Computer-readable media herein can be any available computer-readable storage media or communication media that can be accessed by a computer.
Communication media includes media by which communication signals, including, for example, computer readable instructions, data structures, program modules, or other data, are transmitted from one system to another. Communication media may include conductive transmission media such as cables and wires (e.g., fiber optics, coaxial, etc.) and wireless (non-conductive transmission) media capable of propagating energy waves such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data may be embodied in a modulated data signal, for example, in a wireless medium such as a carrier wave or similar mechanism such as is embodied as part of spread spectrum techniques. The term "modulated data signal" means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. The modulation may be analog, digital or hybrid modulation techniques.
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 disk, tape, CD, DVD); or other now known media or later developed that can store computer-readable information/data for use by a computer system.
An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (17)

1. A method for native rendering based on information flow, applied to a user device, wherein the method comprises:
responding to a loading trigger operation aiming at a target link address in a target application, acquiring a configuration file corresponding to the target link address, and acquiring at least one information flow corresponding to the target link address according to the configuration file, wherein the configuration file comprises one or more template information, each template information in the one or more template information comprises one or more native control description information, and at least one native control description information in all the native control description information included in the one or more template information corresponds to the at least one information flow;
creating all native controls corresponding to all native control description information included in the one or more template information, wherein the all native controls include at least one native control corresponding to the at least one native control description information;
and binding the at least one information flow on the at least one native control, and rendering all native controls on a current page generated based on the loading trigger operation according to the one or more template information.
2. The method of claim 1, wherein the obtaining the configuration file corresponding to the target link address comprises:
and acquiring a configuration file corresponding to the target link address from a server corresponding to the target link address.
3. The method of claim 1, wherein the target link address comprises a configuration file address;
the obtaining of the configuration file corresponding to the target link address includes:
and acquiring a configuration file corresponding to the target link address according to the configuration file address.
4. The method of claim 1, wherein the obtaining the configuration file corresponding to the target link address comprises:
and acquiring the configuration file corresponding to the target link address from the server corresponding to the target application.
5. The method of claim 4, wherein the obtaining the configuration file corresponding to the target link address from the server corresponding to the target application comprises:
sending the host information of the target link address to a server corresponding to the target application, so that the server queries a configuration file corresponding to the host information;
and receiving a configuration file corresponding to the host information returned by the server, and taking the configuration file corresponding to the host information as a configuration file corresponding to the target link address.
6. The method of any of claims 1 to 5, wherein the configuration file comprises at least one second link address;
wherein, the obtaining at least one information flow corresponding to the target link address according to the configuration file includes:
the method includes the steps of obtaining at least one template information corresponding to at least one second link address from the configuration file, obtaining one or more pieces of 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 piece of native control description information in the one or more pieces of native control description information according to the configuration file, wherein each second link address corresponds to one or more pieces of template information, and each piece of template information in the one or more pieces of template information comprises one or more pieces of native control description information.
7. The method of claim 6, wherein the configuration file further comprises at least one rule information;
the 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 native control description information in the one or more native control description information according to the configuration file includes, for each second link address in the at least one second link address:
acquiring rule information corresponding to the second link address from the configuration file, acquiring one or more template information corresponding to the second link address from the rule information, and acquiring one or more native control description information corresponding to the second link address from the one or more template information;
and acquiring one or more information flows corresponding to at least one piece of native control description information in the one or more pieces of native control description information according to the rule information.
8. The method of claim 7, wherein the configuration file further comprises a mapping relationship between at least one link-related information and the at least one rule information;
wherein the obtaining of 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 matched with the second link address;
and according to the mapping relation, taking the rule information corresponding to the link related information as the rule information corresponding to the second link address.
9. The method according to claim 7 or 8, wherein the obtaining, according to the rule information, one or more information flows corresponding to at least one of the one or more native control description 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, obtaining information flow parsing rule information corresponding to the native control description information from the rule information, and parsing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow parsing rule information.
10. The method of claim 9, wherein the document object information is interface data information, the information flow parsing rule information including one or more field path information;
the obtaining of the document object information corresponding to the native control description information includes:
acquiring interface address information corresponding to the native control description information;
according to the interface address information, requesting to obtain interface data information corresponding to the native control description information;
analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises:
and for each piece of field path information in the one or more pieces of field path information, analyzing the interface data information corresponding to the native control description information to obtain an information stream corresponding to the field path information.
11. The method of claim 9, wherein the Document object information is Document information, and the information flow parsing rule information includes one or more tag path information;
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 a first link address, wherein the first link address is the target link address or the second link address;
analyzing the document object information to obtain one or more information flows corresponding to the native control description information according to the information flow analysis rule information, wherein the analyzing comprises:
and for each piece of label path information in the one or more pieces of label path information, analyzing HTML information corresponding to the native control description information to obtain an information stream corresponding to the label path information.
12. The method of claim 7, wherein the configuration file further comprises one or more third link addresses and at least one second rule information;
wherein the method further comprises:
responding to an access triggering operation aiming at a target third link address in the one or more third link addresses in the current page, acquiring second rule information corresponding to the target third link address from the configuration file, acquiring one or more second template information corresponding to the target third link address from the second rule information, and acquiring one or more second native control description information corresponding to the target third link address from the one or more second template information;
acquiring 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 according to the second rule 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;
binding the one or more information flows on the at least one second native control, and rendering the one or more second native controls on the current page according to the one or more second template information.
13. The method of claim 7, wherein the configuration file further comprises one or more fourth link addresses and at least one third rule information;
wherein the method further comprises:
responding to an access triggering operation aiming at a target fourth link address in the one or more fourth link addresses in the current page, and jumping to a second page corresponding to the target fourth link address from the current page;
acquiring third rule information corresponding to the target fourth link address from the configuration file, acquiring one or more third template information corresponding to the target fourth link address from the third rule information, and acquiring one or more third primitive control description information corresponding to the target fourth link address from the one or more third template information;
acquiring 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 according to the third rule 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;
binding the one or more information flows on the at least one third native control, and rendering the one or more third native controls on the second page according to the one or more third template information.
14. The method according to any one of claims 7 to 14, wherein the obtaining one or more template information corresponding to the second link address from the rule information includes:
and 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.
15. The method of claim 14, wherein the 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 comprises:
acquiring 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 acquiring one or more initial template information corresponding to the one or more template identification information;
and 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.
16. An apparatus for native rendering based on information flow, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1 to 15.
17. A computer-readable medium storing instructions that, when executed, cause a system to perform the operations of any of the methods of claims 1-15.
CN202010980206.0A 2020-09-17 2020-09-17 Native rendering method and device based on information flow Pending CN112241499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010980206.0A CN112241499A (en) 2020-09-17 2020-09-17 Native rendering method and device based on information flow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010980206.0A CN112241499A (en) 2020-09-17 2020-09-17 Native rendering method and device based on information flow

Publications (1)

Publication Number Publication Date
CN112241499A true CN112241499A (en) 2021-01-19

Family

ID=74171542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010980206.0A Pending CN112241499A (en) 2020-09-17 2020-09-17 Native rendering method and device based on information flow

Country Status (1)

Country Link
CN (1) CN112241499A (en)

Similar Documents

Publication Publication Date Title
CN108958780B (en) Method and equipment for presenting update information of hosted program
CN109408696B (en) Method and equipment for searching hosted program
JP2019520624A (en) Page component dynamic layout
CN110765395B (en) Method and equipment for providing novel information
CN109359237B (en) Method and equipment for searching hosted program
CN110333918B (en) Method and equipment for managing boarder programs
CN110321189B (en) Method and equipment for presenting hosted program in hosted program
CN110519250B (en) Method and equipment for providing information flow
CN110290557B (en) Method and equipment for loading page tags in application
CN109710832B (en) Method and equipment for searching hosted program
CN111506232B (en) Method and equipment for controlling menu display in reading application
CN111427650A (en) Method and equipment for providing presence information
CN111125562A (en) Method and equipment for switching display label pages
CN110430253B (en) Method and equipment for providing novel update notification information
CN109254781B (en) Method and equipment for installing application on user equipment
CN110020370B (en) Method and device for realizing animation in client application and framework of animation script
CN110765258B (en) Method and equipment for providing electronic books
CN112256991B (en) Method and equipment for native rendering of information flow fusing multiple link addresses
CN115309657A (en) Method, device, medium and program product for providing test case
CN111666195A (en) Method and apparatus for providing video information or image information
CN110941437A (en) Method and equipment for installing application
CN111767498A (en) Method and device for realizing file information sharing
CN112241499A (en) Native rendering method and device based on information flow
CN112256992A (en) Native rendering method and device for information stream fusing multi-link addresses
CN111125565A (en) Method and equipment for inputting information in application

Legal Events

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