CN115525305A - Data processing method, application starting method, device, computer equipment and storage medium - Google Patents

Data processing method, application starting method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN115525305A
CN115525305A CN202110707730.5A CN202110707730A CN115525305A CN 115525305 A CN115525305 A CN 115525305A CN 202110707730 A CN202110707730 A CN 202110707730A CN 115525305 A CN115525305 A CN 115525305A
Authority
CN
China
Prior art keywords
page
information
application
built
native
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
CN202110707730.5A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110707730.5A priority Critical patent/CN115525305A/en
Publication of CN115525305A publication Critical patent/CN115525305A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

The application relates to a data processing method, a data processing device, computer equipment and a storage medium. The method comprises the following steps: receiving a page generation instruction, wherein the page generation instruction carries a page identifier; acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information; analyzing H5 page information in an operating environment corresponding to the current equipment information to obtain H5 page structure data; identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data, and performing page rendering based on the native page structure data to obtain a native page and displaying the native page. By adopting the method, the loading speed of the page can be improved, and the running performance of the H5 application program is further improved.

Description

Data processing method, application starting method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for data processing and application starting, a computer device, and a storage medium.
Background
With the development of internet technology, H5 (HyperText Markup Language 5, 5 th generation) applications have appeared, and the H5 applications refer to applications developed using H5. Currently, H5 applications have the advantages of being available without downloading, low development cost, and the like, and the current H5 applications usually show application contents through an H5 page. However, the speed of the H5 page is low when it is loaded, resulting in reduced H5 application execution performance.
Disclosure of Invention
Accordingly, it is desirable to provide a data processing method, an application starting method, an apparatus, a computer device and a storage medium, which can improve the loading speed of the H5 page and further improve the performance of the H5 application program.
A method of data processing, the method comprising:
receiving a page generation instruction, wherein the page generation instruction carries a page identifier;
acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information;
analyzing H5 page information in an operating environment corresponding to the current equipment information to obtain H5 page structure data;
identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data;
and rendering the page based on the native page structure data to obtain and display the native page.
In an embodiment, before the receiving a page generating instruction, where the page generating instruction carries a page identifier, the method further includes:
when an event for triggering H5 page information downloading is detected, sending an H5 page information downloading request to a server, wherein the H5 page information downloading request carries a page identifier;
and obtaining H5 page information returned by the server, wherein the H5 page information is searched by the server according to the page identifier, and the H5 page information is stored according to a memory storage path corresponding to the page identifier.
In an embodiment, after the page rendering based on the native page structure data, obtaining and displaying a native page, the method further includes:
sending a H5 page information silent updating request to a server, wherein the H5 page information silent updating request carries the page identifier;
acquiring updated version information returned by the server, wherein the updated version information is searched by the server by using the page identifier;
obtaining local version information of H5 page information corresponding to the page identifier, comparing the updated version information with the local version information, and sending an H5 page update information downloading request to the server when the updated version information is inconsistent with the local version information, wherein the updated version information is carried by the H5 page update information downloading request;
and acquiring H5 page updating information returned by the server, wherein the H5 page updating information is searched by the server according to the updating version information, the H5 page updating information is stored, and the H5 page information corresponding to the local version information is deleted.
In an embodiment, after the obtaining the corresponding H5 page information according to the page identifier and obtaining the current device information, the method further includes:
starting a first thread, a second thread and a main thread;
analyzing the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data, including:
analyzing the H5 page information in the running environment corresponding to the current equipment information by using the first thread to obtain H5 page structure data;
the identifying the H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data, includes:
identifying the H5 page structure data by using the second thread to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data;
the rendering a page based on the native page structure data to obtain and display a native page comprises the following steps:
and rendering the page by using the main thread based on the native page structure data to obtain and display a native page.
In one embodiment, after the page rendering based on the native page structure data, obtaining and displaying a native page, the method includes:
when detecting that the data communication channel is abnormal, sending a long link message channel reconnection request to a server, wherein the long link message channel reconnection request carries a terminal identifier;
and the server reestablishes the long link message channel according to the long link message channel reconnection request and the terminal corresponding to the terminal identification.
A data processing apparatus, the apparatus comprising:
the instruction receiving module is used for receiving a page generation instruction, and the page generation instruction carries a page identifier;
the information acquisition module is used for acquiring corresponding H5 page information according to the page identifier and acquiring current equipment information;
the analysis module is used for analyzing the H5 page information in the running environment corresponding to the current equipment information to obtain H5 page structure data;
the conversion module is used for identifying H5 page structure data to obtain H5 page component information, H5 page layout information and H5 page style rules, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rules according to a preset native data format conversion rule to obtain native page structure data;
and the rendering module is used for rendering the page based on the native page structure data to obtain and display the native page.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a page generation instruction, wherein the page generation instruction carries a page identifier;
acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information;
analyzing H5 page information in an operating environment corresponding to the current equipment information to obtain H5 page structure data;
identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data;
and rendering the page based on the native page structure data to obtain and display the native page.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a page generation instruction, wherein the page generation instruction carries a page identifier;
acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information;
analyzing H5 page information in an operating environment corresponding to the current equipment information to obtain H5 page structure data;
identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data;
and rendering the page based on the native page structure data to obtain and display the native page.
According to the data processing method, the data processing device, the computer equipment and the storage medium, corresponding H5 page information is obtained when a page is generated, current equipment information is obtained, the H5 page information is analyzed in an operating environment corresponding to the current equipment information to obtain H5 page structure data, the H5 page structure data is identified to obtain H5 page component information, H5 page layout information and an H5 page style rule, the H5 page component information, the H5 page layout information and the H5 page style rule are subjected to data format conversion according to a preset native data format conversion rule to obtain native page structure data, page rendering is carried out by using the native page structure data to obtain a native page and display, namely, the H5 page information is converted into the native page structure data to carry out page rendering to obtain the native page, so that the loading speed of the page can be improved, and the operating performance of an H5 application program can be further improved.
A method of data processing, the method comprising:
receiving a built-in application starting instruction in a target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier;
acquiring corresponding built-in application H5 start page information according to the built-in application start page identifier, and acquiring current equipment information;
analyzing the starting page information of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the starting page structure data of the built-in application H5;
identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and H5 starting page style rules, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rules according to a preset native data format conversion rule to obtain built-in application native starting page structure data;
and rendering the page based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
An application launching device, the device comprising:
the starting instruction receiving module is used for receiving a built-in application starting instruction in the target application, wherein the built-in application starting instruction carries a built-in application identifier, and the corresponding built-in application starting page identifier is obtained based on the built-in application identifier;
the starting information acquisition module is used for acquiring corresponding starting page information of the built-in application H5 according to the built-in application starting page identifier and acquiring current equipment information;
the starting information analysis module is used for analyzing the starting page information of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the starting page structure data of the built-in application H5;
the starting information conversion module is used for identifying the starting page structure data of the built-in application H5, obtaining the starting page component information of the built-in application H5, the starting page layout information of the H5 and the starting page style rule of the H5, and converting the starting page component information of the built-in application H5, the starting page layout information of the H5 and the starting page style rule of the H5 according to the preset native data format conversion rule to obtain the native starting page structure data of the built-in application;
and the starting page display module is used for rendering the page based on the native starting page structure data of the built-in application to obtain a native starting page of the built-in application and displaying the starting page of the built-in application in the target application.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a built-in application starting instruction in a target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier;
acquiring corresponding built-in application H5 start page information according to the built-in application start page identifier, and acquiring current equipment information;
analyzing the starting page information of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the starting page structure data of the built-in application H5;
identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and an H5 starting page style rule, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule according to a preset native data format conversion rule to obtain built-in application native starting page structure data;
and rendering the page based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a built-in application starting instruction in a target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier;
acquiring corresponding built-in application H5 start page information according to the built-in application start page identifier, and acquiring current equipment information;
analyzing the information of the starting page of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the structural data of the starting page of the built-in application H5;
identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and H5 starting page style rules, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rules according to a preset native data format conversion rule to obtain built-in application native starting page structure data;
and rendering the page based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
The application starting method, the device, the computer equipment and the storage medium acquire the corresponding built-in application H5 starting page information according to the built-in application starting page identifier by receiving a built-in application starting instruction in a target application, acquire the current equipment information, analyze the built-in application H5 starting page information in the operating environment corresponding to the current equipment information to acquire the built-in application H5 starting page structure data, then identify the built-in application H5 starting page structure data to acquire the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule, convert the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule according to the preset native data format conversion rule to acquire the built-in application native starting page structure data, and perform page rendering based on the built-in application native starting page structure data to acquire the built-in application native starting page and display the built-in application starting page in the target application. The method comprises the steps of converting h5 start page information corresponding to a start page of the built-in application into native start page structure data when the built-in application is started, and then rendering the page to obtain and display a native start page of the built-in application, so that the loading speed of the native start page of the built-in application is increased, the starting speed of the built-in application is increased, and the running performance of the built-in application is improved.
Drawings
FIG. 1 is a diagram of an application environment of a data processing method in one embodiment;
FIG. 2 is a flow diagram that illustrates a data processing method in one embodiment;
FIG. 3 is a flowchart illustrating a process of obtaining page information in an embodiment;
FIG. 4 is a flow diagram illustrating loading of base resource information, according to an embodiment;
FIG. 5 is a flowchart illustrating loading of base resource information in an exemplary embodiment;
FIG. 6 is a flow diagram illustrating loading of business resource information in one embodiment;
fig. 7 is a schematic flow chart of loading service resource information in an embodiment;
FIG. 8 is a flow diagram of a silent update in one embodiment;
FIG. 9 is a flow diagram of a silent update in an exemplary embodiment;
FIG. 10a is a flow diagram that illustrates the use of thread processing in one embodiment;
FIG. 10b is a flowchart illustrating the use of thread processing in one embodiment;
FIG. 10c is a diagram illustrating a mapping of interface elements in one embodiment;
FIG. 10d is a schematic diagram of the conversion logic in one embodiment;
FIG. 11 is a diagram illustrating a page switch process in one embodiment;
FIG. 12 is a flowchart illustrating a method for application launching in one embodiment;
FIG. 13 is a schematic view of a conversion frame in an exemplary embodiment;
FIG. 14 is a schematic diagram of the conversion logic in one embodiment;
FIG. 15 is a diagram of common data state management in an exemplary embodiment;
FIG. 16 is a diagram illustrating data state synchronization and update in one embodiment;
FIG. 17 is a diagram of a framework communication mechanism in one embodiment;
FIG. 18 is a schematic diagram of a page of the social sharing application in one embodiment;
FIG. 19 is a schematic diagram of a page of interaction functionality in an embodiment;
FIG. 20 is a diagram of a small blackboard application exit interface in one embodiment;
FIG. 21 is a flowchart illustrating application startup in one embodiment;
FIG. 22 is a block diagram of an application scenario in one embodiment;
FIG. 23 is a block diagram of a data processing apparatus in an exemplary embodiment;
FIG. 24 is a block diagram of an exemplary embodiment of an application launching mechanism;
FIG. 25 is a diagram showing an internal structure of a computer device in one embodiment;
fig. 26 is an internal structural view of a computer device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 receives a page generation instruction, wherein the page generation instruction carries a page identifier; acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information; analyzing H5 page information in an operating environment corresponding to the current equipment information to obtain H5 page structure data; identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data; and rendering the page based on the native page structure data to obtain and display the native page. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by multiple servers.
In an embodiment, as shown in fig. 2, a data processing method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and it is understood that the method may also be applied to the terminal, and may also be applied to a system including the terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method comprises the following steps:
step 202, receiving a page generation instruction, where the page generation instruction carries a page identifier.
The page identifier is used to uniquely represent a page, and may be a page address, a page name, a page number, and the like. The page may be a page in an H5 application. The page has cross-platform capability, namely, page generation and presentation can be carried out on different operating system platforms. The operating system platform refers to a terminal carrying an operating system, the operating system includes two types of operating systems, namely a desktop operating system and a mobile operating system, and a harmony os (operating system), and the desktop operating system includes windows (microsoft operating system), linux (open source operating system), and the like. The mobile-side operating system includes the android operating system and the iOS (apple operating system, etc. this page may be a page developed using a framework that converts H5 page runtime to native rendering.
Specifically, the terminal receives the page generation instruction, where the page generation instruction is received by the terminal in response to the click time by clicking the page entry by the user. The page entry refers to an entry into a page, and can be displayed to a user in other clickable forms such as a button and a link. When the page is an H5 application start page, the page entry may also be an H5 application entry. The page generation instruction carries a page identifier.
And 204, acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information.
The H5 page information refers to information required for generating an H5 page, and includes page resource information, page data, and the like. The page resource information refers to resources required by page generation, and may include basic resources, picture resources, component resources, JS resources, CSS resources, and the like. Page data refers to data in a page. The current device information refers to operating system information of the current terminal device, and may include an operating system name, a version, and the like.
Specifically, the terminal may obtain corresponding H5 page information from the local memory according to the page identifier, where the H5 page information may be a terminal preloaded in the terminal. Or sending a page information acquisition request to the server, wherein the page information acquisition request carries a page identifier, and the terminal acquires the H5 page information returned by the server. And then the terminal acquires the current equipment information, namely the terminal detects the own operating system information.
In a specific embodiment, the H5 page information can be information obtained by using Vue (Vue is a progressive framework for constructing a user interface, unlike other large frameworks, vue is designed to be applied layer by layer from bottom to top, vue's core library only focuses on view layers, is not only easy to use, but also is convenient for page development and page packaging after being integrated with a third-party library or an existing project), and comprises a page basic resource compression package, page data and page business resource compression package and the like.
And step 206, analyzing the H5 page information in the operating environment corresponding to the current equipment information to obtain H5 page structure data.
The H5 page structure data refers to a virtual Dom tree corresponding to the H5 page. Dom is a Document Object Model (Dom) that is a standard interface specification made by W3C and is a standard API for processing HTML and XML files. The DOM provides an access model to the entire document as a tree structure, with each node of the tree representing an HTML tag or text item within a tag. The DOM tree structure accurately describes the interrelationship between tags in an HTML document.
Specifically, the terminal determines a current operating environment according to the current device information, that is, different operating environments exist in different operating systems, and then the terminal analyzes the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data.
In a specific embodiment, when the current device information refers to the iOS operating system, the H5 page information may be resolved in a JSCore (JavaScriptCore is an important component of webkit, and mainly resolves JS and provides an execution environment) execution environment. When the current device information refers to an android operating system, the H5 page information may be parsed by using a V8 (JavaScript engine of browser) running environment. And obtaining H5 page structure data. That is, the function template is passed through the rendering function to get a virtual DOM tree in Vue.
And 208, identifying the H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data.
The H5 page generation information refers to information required for generating an H5 page, and includes H5 page component information, H5 page layout information, H5 page style rule information, and the like. The preset native data format conversion rule is a preset rule for converting the data format, wherein the data format conversion is to convert the data format of the H5 page into the data format of the native page. The data format of the native page refers to a format corresponding to data for generating the native page. Native pages refer to pages in a native application. Native page structure data refers to data used in generating a native page.
Specifically, the terminal identifies H5 page structure data to obtain H5 page component information, H5 page layout information, H5 page style rule information and the like corresponding to the H5 page, and then converts the H5 page component information, the H5 page layout information, the H5 page style rule information and the like according to a preset native data format conversion rule to obtain component information, page layout information and style rule information of a native data format, so as to obtain native page structure data. In a specific embodiment, a virtual DOM obtained by parsing Vue is converted according to a preset native data format conversion rule to obtain a flutter widget structure tree, where flutter is an open-source construction User Interface (UI) toolkit, and widget is used to describe configuration data of a UI element. By converting when the page is generated, the page has the cross-platform capability, so that the dynamic updating capability can be stored, and the problem that the dynamic updating capability and the cross-platform capability cannot be maintained due to the fact that the H5 page information is converted when the page is developed and the converted page information is used for generating when the page is generated is avoided.
And step 210, performing page rendering based on the native page structure data to obtain and display a native page.
Specifically, the native page is obtained by rendering the page by using the native page structure data, that is, UI layout and style reduction are performed according to the native page structure data, and when rendering is completed, the terminal displays the original page.
According to the data processing method, corresponding H5 page information is obtained when a page is generated, current equipment information is obtained, the H5 page information is analyzed in an operating environment corresponding to the current equipment information, H5 page structure data is obtained, then the H5 page structure data is identified, H5 page component information, H5 page layout information and H5 page style rules are obtained, data format conversion is carried out on the H5 page component information, the H5 page layout information and the H5 page style rules according to a preset native data format conversion rule, native page structure data is obtained, page rendering is carried out by using the native page structure data, a native page is obtained and displayed, namely, the native page is obtained by converting the H5 page information into the native page structure data, so that the loading speed of the page can be increased, and the operating performance of an H5 application program is improved.
In one embodiment, step 202, receiving a page generation instruction, where the page generation instruction carries a page identifier, includes the steps of:
receiving a page generation instruction in a target application, wherein the page generation instruction carries a target page identifier, the target page identifier is used for uniquely identifying a page in an H5 application, and the H5 application is an application built in the target application.
The target application is an application program with a built-in H5 application, and the target application may be a native application, and the native application is an application program capable of directly running on a current operating system. The H5 application is a web application that needs to be run through a browser.
Specifically, when the user is about to enter a page in the H5 application in the target application, by clicking a page button or a link or the like of the H5 application in the target application. Enabling the terminal to receive a page generation instruction in the target application, wherein the page generation instruction carries a target page identifier associated with a page button or a link, and the terminal acquires H5 page information of the corresponding H5 application according to the target page identifier and acquires current equipment information; analyzing H5 page information of the H5 application in an operating environment corresponding to the current equipment information to obtain H5 page structure data; identifying H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data; and rendering the page based on the native page structure data to obtain and display the native page, so that the loading speed of the page in the built-in H5 application in the target application can be increased, and the user experience can be improved.
In a particular embodiment, the target application may be an enterprise WeChat application and the H5 application may be an H5 application in a workbench function. When the user uses the workbench function in the target application, various H5 applications can be used. When a user clicks a name button of an H5 application, a terminal receives an instruction for entering a first page in the H5 application, the instruction carries a page address associated with the name button of the H5 application, then H5 page information and current equipment information are obtained according to the page address, the H5 page information is analyzed in an operating environment corresponding to the current equipment information to obtain H5 page structure data, the H5 page structure data is identified to obtain H5 page component information, H5 page layout information and an H5 page style rule, and data format conversion is carried out on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data; and rendering the page based on the native page structure data to obtain and display the native page. In a particular embodiment, the target application may also be a WeChat application, and the H5 application may be an applet application in the WeChat application. The applet application is an application developed using a framework that converts H5 page runtimes into native renderings.
In one embodiment, the H5 page information includes H5 page basic resource information, H5 page service resource information, and H5 page data;
step 204, acquiring corresponding H5 page information according to the page identifier, including the steps of:
and searching corresponding H5 page basic resource information, H5 page service resource information and H5 page data from the memory according to the page identifier, and loading the H5 page basic resource information, the H5 page service resource information and the H5 page data.
The H5 page basic resource information refers to initialized basic environment configuration information corresponding to the H5 page, and may be stored in the terminal in the form of a compressed packet. The H5 page service resource information refers to resource information of a service developed using a framework for converting the H5 page runtime into the native rendering, and may include CSS resources, JS resources, picture resources, and other resources, and the like, which may be stored in the terminal in the form of compressed packets. The H5 page data refers to information stored in the H5 page in the terminal, such as Cookies (data stored on the local terminal of the user).
Specifically, the terminal stores H5 page basic resource information, H5 page service resource information, and H5 page data, and the H5 page basic resource information, the H5 page service resource information, and the H5 page data can be downloaded from the server in advance, and can be dynamically updated in real time. When a terminal needs to generate a page, corresponding H5 page basic resource information, H5 page service resource information and H5 page data are searched from a memory according to a page identifier, and the H5 page basic resource information, the H5 page service resource information and the H5 page data are loaded, that is, a compression packet corresponding to the H5 page basic resource information and the H5 page service resource information is decompressed to obtain the H5 page basic resource information and the H5 page service resource information, so that the subsequent use is facilitated.
In a specific embodiment, as shown in fig. 3, a flowchart for acquiring H5 page information of an H5 application is shown. When the terminal receives an instruction for opening the H5 application, the basic resource information is loaded, the service resource information is loaded, H5 application home page data is obtained, then home page generation is carried out by using the H5 application home page data, and therefore the H5 application display home page is opened. In this embodiment, the H5 application is developed by using a framework that converts H5 page runtime into Native rendering, the framework is a framework that enables the H5 application to achieve Native experience, and the framework can provide an opening speed close to Native experience, a faster data loading speed, a transition animation close to Native experience, a better capability of fusing Native, and a more stable and reliable network channel, so that the H5 application has better user experience and performance while satisfying flexible, variable and frequent updates of services.
In an embodiment, as shown in fig. 4, searching the corresponding H5 page basic resource information from the memory according to the page identifier, and loading the H5 page basic resource information includes:
step 402, acquiring a corresponding basic resource storage path based on the page identifier, and sending an H5 page basic resource information downloading request to the server when the H5 page basic resource information is not found according to the basic resource storage path, wherein the H5 page basic resource information downloading request carries the page identifier.
The basic resource storage path refers to a storage path of the basic resource information in the local terminal.
Specifically, the terminal may search the corresponding basic resource storage path according to a preset association relationship between the page identifier and the basic resource storage path. When the H5 page basic resource information is not found according to the basic resource storage path, it is indicated that the H5 page basic resource information corresponding to the page identifier is not stored in the terminal at this time, the terminal needs to download from the server, that is, a downloading request of the H5 page basic resource information can be sent to the server, and the downloading request of the H5 page basic resource information carries the page identifier.
And step 404, acquiring basic resource information of the H5 page returned by the server and storing the basic resource information according to a basic resource storage path.
Specifically, when receiving an H5 page basic resource information downloading request sent by the terminal, the server searches for the corresponding H5 page basic resource information of the latest version according to the page identifier, and returns the searched H5 page basic resource information of the latest version to the server. And the terminal receives the H5 page basic resource information returned by the server and stores the H5 page basic resource information according to the basic resource storage path.
Step 406, finding the H5 page basic resource information from the basic resource storage path, comparing the version information corresponding to the H5 page basic resource information with the version information corresponding to the preset H5 page basic resource information, and loading the H5 page basic resource information when the version information corresponding to the H5 page basic resource information is greater than the version information corresponding to the preset H5 page basic resource information.
The preset H5 page basic resource information refers to H5 page basic resource information of a bottom-packed version which is downloaded in advance and stored in the terminal. The version information is used for representing the version corresponding to the H5 page basic resource information, and may include a version number, a version name, and the like.
Specifically, because the terminal has a situation that the H5 page basic resource information is unsuccessfully stored, the terminal searches for the H5 page basic resource information from the basic resource storage path again, when the H5 page basic resource information is found, it is indicated that the storage is successful, at this time, the version information corresponding to the H5 page basic resource information is compared with the version information corresponding to the preset H5 page basic resource information, and when the version information corresponding to the H5 page basic resource information is greater than the version information corresponding to the preset H5 page basic resource information, that is, it is indicated that the H5 page basic resource information is the latest version of the H5 page basic resource information, at this time, the terminal loads the H5 page basic resource information. When the version information corresponding to the H5 page basic resource information is smaller than the version information corresponding to the preset H5 page basic resource information, it is indicated that the preset H5 page basic resource information is the latest version of the H5 page basic resource information, and at this time, the terminal loads the preset H5 page basic resource information.
In a specific embodiment, as shown in fig. 5, a schematic flow chart of loading H5 page basic resource information is shown, specifically: the terminal searches H5 page basic resource information corresponding to the page identification from a Database (DB), when the H5 page basic resource information is not searched, the terminal constructs a storage address for storing the H5 page basic resource information, and then acquires the H5 page basic resource information from the server and stores the H5 page basic resource information into the storage address. Due to the fact that the basic resource information of the H5 page possibly fails to be stored, at the moment, the terminal needs to verify whether the storage is successful or not. And the terminal searches the corresponding H5 page basic resource information again according to the storage path, and when the corresponding H5 page basic resource information is not searched, the H5 page basic resource information is downloaded from the server and stored. And the terminal searches the corresponding H5 page basic resource information according to the storage path again because the downloading failure condition may exist. When the version information corresponding to the H5 page basic resource information is found out, the version information corresponding to the H5 page basic resource information is compared with the pocket bottom version information corresponding to the preset H5 page basic resource information, when the version information corresponding to the H5 page basic resource information is the latest version, the H5 page basic resource information is loaded, and when the pocket bottom version information corresponding to the preset H5 page basic resource information is the latest version, the preset H5 page basic resource information is loaded. When the basic resource information of the H5 page corresponding to the pocket bottom version is not found, the basic resource information of the H5 page corresponding to the pocket bottom version is directly used for loading, namely the basic resource information of the H5 page corresponding to the pocket bottom version is used for loading, page loading failure can be prevented, and user experience is improved.
In an embodiment, as shown in fig. 6, searching for corresponding H5 page service resource information from a memory according to a page identifier, and loading the H5 page service resource information includes:
step 602, obtaining a corresponding service resource storage path based on the page identifier, and sending an H5 page service resource information downloading request to the server when the H5 page service resource information is not found according to the service resource storage path, where the H5 page service resource information downloading request carries the page identifier.
The service resource storage path refers to a storage path of the H5 page service resource information in the local terminal.
Specifically, the terminal may search the service resource storage path and the basic resource information corresponding to the page identifier from the page configuration file. The page configuration file may be previously downloaded from the server and saved. The terminal can also search the corresponding basic resource storage path according to the preset association relationship between the page identifier and the service resource storage path. When the H5 page service resource information is not found according to the service resource storage path, which indicates that the H5 page service resource information corresponding to the page identifier is not stored in the terminal at this time, the terminal needs to download from the server, that is, a H5 page service resource information downloading request can be sent to the server, where the H5 page service resource information downloading request carries the page identifier.
And step 604, acquiring the H5 page service resource information returned by the server and storing the information according to the service resource storage path.
Specifically, when receiving an H5 page service resource information download request sent by a terminal, the server searches for the corresponding H5 page service resource information of the latest version according to the page identifier, and returns the found H5 page service resource information of the latest version to the server. And the terminal receives the H5 page service resource information returned by the server and stores the H5 page service resource information according to the service resource storage path.
Step 606, finding the H5 page service resource information from the service resource storage path, comparing the target version information corresponding to the H5 page service resource information with the preset version information corresponding to the preset H5 page service resource information, and loading the H5 page service resource information when the target version information corresponding to the H5 page service resource information is greater than the preset version information corresponding to the preset H5 page service resource information.
The target version information refers to the version information of the H5 page service resource information downloaded from the server. The preset version information refers to version information corresponding to preset H5 page service resource information. The preset H5 page service resource information refers to H5 page service resource information which is downloaded from a server to a terminal in advance and is stored in the terminal.
Specifically, because the terminal has a situation that the H5 page service resource information is not stored successfully, the terminal needs to verify whether the H5 page service resource information is stored again, that is, the terminal searches the H5 page service resource information from the service resource storage path again, when the H5 page service resource information is found, the storage is successful, at this time, the target version information corresponding to the H5 page service resource information is compared with the preset version information corresponding to the preset H5 page service resource information, when the target version information corresponding to the H5 page service resource information is greater than the preset version information corresponding to the preset H5 page service resource information, it is stated that the H5 page service resource information is the H5 page service resource information of the latest version, at this time, the terminal loads the H5 page service resource information. When the target version information corresponding to the H5 page service resource information is smaller than the preset version information corresponding to the preset H5 page service resource information, it is indicated that the preset H5 page service resource information is the latest version of the H5 page service resource information, and at this time, the terminal loads the preset H5 page service resource information. The target version information is compared with the H5 page service resource information of the preset version information, so that the H5 page service resource information of the latest version is loaded, the generated page is the page of the latest version, and the user experience is improved.
In a specific embodiment, as shown in fig. 7, a schematic flow chart of loading H5 page service resource information is shown, specifically: the terminal searches H5 page service resource information from the database, and when the H5 page service resource information is not searched, a storage address corresponding to the H5 page service resource information is established, wherein the storage address can be a memory storage address or a cache storage address. And when the H5 page service resource information is searched, detecting whether page initial configuration information exists, and when the page initial configuration information is stored, acquiring the H5 page service resource information by using the main configuration data. That is, the terminal detects whether the address (URL: uniform Resource Locator) corresponding to the H5 page service Resource information is the latest address, and if not, downloads and stores the H5 page service Resource information from the latest address of the server. And then detecting whether the address corresponding to the H5 page service resource information is consistent with the latest address again, and if so, detecting whether the H5 page service resource information exists in the storage path corresponding to the H5 page service resource information, and if the H5 page service resource information is not found in the storage path corresponding to the H5 page service resource information due to the possible storage failure, downloading the H5 page service resource information from the server and storing the H5 page service resource information. And then detecting whether the H5 page service resource information exists in a storage path corresponding to the H5 page service resource information. When the existence of the H5 page service resource information is detected, the version size of the H5 page service resource information is compared with the version size of the built-in H5 page service resource information, and the H5 page service resource information with the large version is selected to be loaded, so that the page with the latest version can be generated, and the user experience is improved.
In an embodiment, before step 202, that is, before receiving a page generating instruction, the page generating instruction carries a page identifier, the method further includes the steps of:
when an event for triggering the downloading of the H5 page information is detected, sending an H5 page information downloading request to a server, wherein the H5 page information downloading request carries a page identifier; and acquiring H5 page information returned by the server, wherein the H5 page information is searched by the server according to the page identifier, and the H5 page information is stored according to a memory storage path corresponding to the page identifier.
The H5 page information downloading event refers to an event for downloading H5 page information in advance, and at least includes an event that an H5 page is switched from a background to a foreground of the terminal to run, an event that the terminal enters a related page corresponding to the H5 page, and the like, wherein a user can enter the H5 page from the related page, and the related page may be a front page of the H5 page, or a page with an access link corresponding to the H5 page, and the like. The memory storage path refers to a storage path of the H5 page information in the local memory of the terminal.
Specifically, when detecting an event for triggering downloading of H5 page information, the terminal sends an H5 page information downloading request to the server, wherein the H5 page information downloading request carries a page identifier; and acquiring H5 page information returned by the server, wherein the H5 page information is searched by the server according to the page identifier, the H5 page information is stored according to a memory storage path corresponding to the page identifier, and then the historical H5 page information can be deleted.
The H5 page information can be kept dynamically updated, so that the page can be kept dynamically updating, and the user experience is improved.
In an embodiment, as shown in fig. 8, after step 210, that is, after performing page rendering based on the native page structure data to obtain a native page and displaying, the method further includes:
step 802, sending a H5 page information silent update request to a server, where the H5 page information silent update request carries a page identifier.
The silent updating refers to updating information under the condition that a user does not perceive.
Specifically, the terminal can update the H5 page information in a silent manner after displaying the native page, that is, the terminal can send an H5 page information silent update request to the server, where the H5 page information silent update request carries the page identifier.
And step 804, obtaining the updated version information returned by the server, wherein the updated version information is searched by the server by using the page identifier.
The updated version information refers to version information corresponding to H5 page information in the server, and the version information is up-to-date.
Specifically, when receiving a H5 page information silent update request sent by the terminal, the server finds the latest version information corresponding to the H5 page information according to the page identifier, and returns the latest version information to the terminal as the update version information to be updated by the terminal. And the terminal acquires the updated version information returned by the server.
Step 806, obtaining local version information of the H5 page information corresponding to the page identifier, comparing the updated version information with the local version information, and sending an H5 page update information downloading request to the server when the updated version information is inconsistent with the local version information, where the H5 page update information downloading request carries the updated version information.
The local version information refers to version information corresponding to the H5 page information stored in the terminal memory.
Specifically, the terminal acquires local version information of the H5 page information corresponding to the page identifier, compares the updated version information with the local version information, and when the updated version information is inconsistent with the local version information, indicates that the H5 page information is updated and needs to update the H5 page information stored in the terminal. At this time, the terminal transmits an H5 page update information download request to the server using the update version information.
The local version information refers to version information corresponding to the H5 page information stored in the terminal memory.
And 808, acquiring the H5 page update information returned by the server, wherein the H5 page update information is searched by the server according to the update version information, storing the H5 page update information, and deleting the H5 page information corresponding to the local version information.
The H5 page update information refers to updated H5 page information.
Specifically, the server receives an H5 page update information download request sent by the terminal, searches for corresponding H5 page update information using the update version information, returns the H5 page update information to the terminal, and the terminal acquires the H5 page update information, stores the H5 page update information, and deletes the H5 page information corresponding to the local version information.
In the embodiment, the H5 page update information is downloaded to the terminal for storage through silent update, and the H5 page information corresponding to the local version information is deleted, so that the H5 page information in the terminal can be updated in time, a page with the latest version can be generated, and the use of a user is facilitated.
In a specific embodiment, as shown in fig. 9, a flow diagram of silent update is shown, where a terminal may update basic resource information of an H5 page, specifically: when the terminal is updated in a silent mode, the latest version information corresponding to the H5 page basic resource information is obtained from the server, the latest version information is compared with the local version information corresponding to the H5 page basic resource information stored in the terminal, and when the latest version information is consistent with the local version information, the H5 page basic resource information stored in the terminal is indicated to be the latest version, and updating is not needed. When the latest version information is inconsistent with the local version information, the updating of the H5 page basic resource information is indicated, at the moment, the H5 page basic resource information of the latest version information is downloaded from the server, and when the downloading is successful, the H5 page basic resource information of the latest version information is stored in the terminal, and the historical H5 page basic resource information in the terminal is deleted. The historical H5 page basic resource information refers to H5 page basic resource information that is not used at the front end and H5 page basic resource information that is not currently stored.
The terminal can also update the service resource information of the H5 page. Specifically, the method comprises the following steps: when the terminal is updated in a silent mode, the latest version information corresponding to the H5 page service resource information is obtained from the server, the latest version information is compared with the local version information corresponding to the H5 page service resource information stored in the terminal, and when the latest version information is consistent with the local version information, the H5 page service resource information stored in the terminal is indicated to be the latest version, and at the moment, updating is not needed. When the latest version information is inconsistent with the local version information, the H5 page service resource information is updated, at the moment, the H5 page service resource information of the latest version information is downloaded from the server, and when the downloading is successful, the H5 page service resource information of the latest version information is stored in the terminal, and the historical H5 page service resource information in the terminal is deleted. The historical H5 page service resource information refers to H5 page service resource information that is not used at the front end and H5 page service resource information that is not currently stored.
In one embodiment, as shown in fig. 10a, after step 210, that is, after acquiring the corresponding H5 page information according to the page identifier and acquiring the current device information, the method further includes:
step 1002 starts a first thread, a second thread, and a main thread.
The first thread is a thread for performing parsing. The second thread is a thread for data format conversion, and the main thread is a thread for page rendering generation
Specifically, the terminal simultaneously starts a first thread, a second thread and a main thread.
Step 206, analyzing the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data, including:
and 1004, analyzing the H5 page information in the running environment corresponding to the current equipment information by using the first thread to obtain H5 page structure data.
Specifically, the terminal may call a first thread first, perform H5 page information parsing using the first thread, obtain H5 page structure data when the parsing is completed, and then send an execution result to a second thread by the first thread.
Step 208, recognizing the H5 page structure data to obtain H5 page component information, H5 page layout information and H5 page style rules, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rules according to a preset native data format conversion rule to obtain native page structure data, including:
step 1006, recognizing the H5 page structure data by using a second thread to obtain H5 page component information, H5 page layout information, and H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information, and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data.
Specifically, when acquiring the H5 page structure data, a second thread in the terminal performs identification to obtain H5 page component information, H5 page layout information, and an H5 page style rule, and then converts the H5 page component information, the H5 page layout information, and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data. The second thread then sends the native page structure data to the main thread.
Step 210, performing page rendering based on the native page structure data to obtain and display a native page, including:
and step 1008, rendering the page by using the main thread based on the native page structure data to obtain and display the native page.
Specifically, the terminal performs page rendering on the main thread by using the native page structure data to obtain a native page, and then the terminal displays the execution result of the main thread.
In a specific embodiment, as shown in fig. 10b, a schematic diagram of thread processing is shown, wherein H5 page information, that is, JS resource compressed packets, are parsed by a JS thread in the executable environment V8 or JSCore of the current device operating system, that is, platform. And then, converting the analyzed result by using an Lvcpp module through a shadow thread according to a preset native data format conversion rule to obtain native page structure data, and then generating a native page by using an interface module and a native module through a main thread. The JSI means that JavaScript Interface is used for establishing mapping between JavaScript and Native. Wxajs enclosed by + + is responsible for coordinating the data communication capabilities of the modules. In a specific embodiment, as shown in fig. 10c, the UI interface element is a mapping diagram, where the vue.js file, that is, the H5 page information, is parsed by a JS thread, and then is converted according to a preset native data format conversion rule, so as to obtain native page structure data, that is, the JS structure is dynamically identified by WxaJS, and response updating is performed. And then the lvcpp module informs the flutter widget structure tree of the result of the structure tree to render through a communication module of dart2cpp, so as to obtain a native page. In a specific embodiment, as shown in fig. 10d, the method is a schematic diagram of a conversion logic, where a terminal sends a virtual Dom tree obtained by analyzing a JS resource compression packet, that is, H5 page information, to an Lvcpp module for conversion, the Lvcpp module identifies to obtain component information, analyzes through Css, identifies to obtain a style rule, a page layout, and the like, then obtains a metric value of a floating node, and then converts the metric value into a Flutter widget tree, so as to obtain native page structure data.
In the embodiment, the H5 page information is analyzed in the operating environment corresponding to the current device information through the first thread to obtain H5 page structure data, the H5 page structure data is identified through the second thread to obtain H5 page component information, H5 page layout information and an H5 page style rule, data format conversion is performed on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data, page rendering is performed on the basis of the native page structure data through the main thread to obtain a native page and display the native page to generate the page, and therefore page generation efficiency can be improved.
In an embodiment, in step 206, parsing the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data includes the steps of:
performing abstract syntax analysis on the H5 page information in the running environment corresponding to the current equipment information to obtain H5 page abstract syntax structure data; and constructing a virtual document object model tree based on the H5 page abstract syntax structure data to obtain H5 page structure data.
The abstract syntax structure data of the H5 page refers to the structure data of an abstract syntax tree corresponding to the H5 page, the abstract syntax tree refers to a tree representation form of an abstract syntax structure of an AST (abstract syntax tree) source code, and each node on the tree represents one structure in the source code.
Specifically, the terminal performs abstract syntax analysis on the H5 page information in the running environment corresponding to the current device information to obtain arrangement of the short character strings, and then performs syntax analysis on the arrangement of the short character strings to obtain abstract syntax structure data of the H5 page. And then, using the H5 page abstract syntax structure data to construct a Virtual Document Object Model tree, so as to obtain H5 page structure data, namely, using AST of the H5 page to generate a Vcom (Virtual Document Object Model) tree.
In an embodiment, in step 208, the H5 page structure data is identified to obtain H5 page component information, H5 page layout information, and H5 page style rule, and the H5 page component information, the H5 page layout information, and the H5 page style rule are subjected to data format conversion according to a preset native data format conversion rule to obtain native page structure data.
Here, the H5 page component information refers to information of a component used for generating a page. The H5 page layout information refers to information of a page layout used to generate a page. The H5 page style rule refers to a page style rule used for generating a page.
Specifically, the terminal identifies the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules, and may also identify the H5 page structure data to obtain a communication interface and node attributes. And then carrying out data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule, and also carrying out data format conversion on a communication interface and node attributes to obtain native initial page structure data. Namely, the H5 page generated by the framework for converting the H5 page runtime into the native rendering carries out data format conversion on all Document (Document) native methods, dom (Document Object Model) operations and all access rights of JAPI (JavaScript interface) of the original dependent webpage view.
In the embodiment, the H5 page component information, the H5 page layout information and the H5 page style rule are obtained by identifying the H5 page structure data, and then the conversion is performed according to the preset native data format conversion rule to obtain the native page structure data, so that the obtained native page structure data can be more accurate.
In one embodiment, after step 210, i.e. after performing page rendering based on the native page structure data to obtain and display the native page, the method further comprises the steps of:
detecting a switching page information preloading event, and responding to the switching page information preloading event to obtain each preloading switching page address; and downloading corresponding switching page information from the server based on the preloaded switching page address, and storing the switching page information into a cache.
The switching page refers to a page obtained by switching the displayed native page. The switching page information refers to page information corresponding to a switching page. The switching page information preloading event refers to an event for loading page information corresponding to a switching page,
specifically, the terminal detects a pre-loading event for triggering switching of the page information, where the pre-loading event for triggering switching of the page information may be automatically triggered when the presentation of the native page is completed. Or the terminal receives user operation through the displayed native page and then triggers the page information switching preloading event. The user operation may be a click operation, a press operation, or the like. Or triggering a pre-loading event of the page information switching when a preset triggering condition is reached, where the preset triggering condition may be that the user stops on the native page for a certain time, for example, the pre-loading event of the page information switching is automatically triggered after 2 minutes.
In one embodiment, as shown in fig. 11, after downloading the corresponding switching page information from the server based on the switching page address and storing the switching page information in the cache, the method further includes:
step 1102, receiving a page switching instruction through a native page, and acquiring a target switching page address according to the page switching instruction.
The target switching page address refers to an address of a page to be switched.
Specifically, the terminal may receive the page switching instruction when acquiring a user page switching operation, where the user page switching operation may be a sliding operation, for example, a downward sliding operation, an upward sliding operation, a leftward sliding operation, a rightward sliding operation, and the like. And then, the terminal acquires a target switching page address according to the page switching instruction, wherein the association relationship between the sliding operation and the switching page address can be preset, for example, the sliding operation can associate the target switching page address. In one embodiment, different swipe operations may also be associated with different switch page addresses. For example, the downward sliding operation, the upward sliding operation, the leftward sliding operation, and the rightward sliding operation may be associated with the corresponding page switching addresses, respectively. And then acquiring a corresponding page switching address according to the specific direction of the sliding operation. In one embodiment, the user page switching operation may be other operations, such as a press operation, a click operation, and the like.
And 1104, searching corresponding target switching page information from the cache based on the target switching page address, and analyzing the target switching page information in the operating environment corresponding to the current equipment information to obtain switching H5 page structure data.
The target switching page information refers to page information of a target switching page. The target switching page refers to a page corresponding to the target switching page address. The switching H5 page structure data refers to H5 page structure data corresponding to the target switching page.
Specifically, the terminal caches page information of the switching page in advance, at this time, the terminal directly searches for corresponding target switching page information from the cache according to a target switching page address, and then analyzes the target switching page information in an operating environment corresponding to current equipment information to obtain switching H5 page structure data.
Step 1106, identifying the switching H5 page structure data to obtain switching H5 page component information, switching H5 page layout information and switching H5 page style rules, and converting the switching H5 page component information, the switching H5 page layout information and the switching H5 page style rules according to a preset native data format conversion rule to obtain switching native page structure data.
The switching H5 page component information refers to component information corresponding to an H5 page needing to be switched, the switching H5 page layout information refers to page layout information corresponding to the H5 page needing to be switched, and the switching H5 page style rule refers to a page style rule corresponding to the H5 page needing to be switched. The switching native page structure data refers to native page structure data corresponding to the target switching page.
Specifically, the H5 page component information, the H5 page layout information, and the H5 page style rule corresponding to the target switching page, which are the same as the terminal, are converted into native page structure data according to the preset native data format conversion rule.
And 1108, rendering the page based on the switching native page structure data to obtain a switching native page and displaying the switching native page through the switching animation.
The switching animation refers to an animation effect when switching is performed between pages.
Specifically, the terminal performs page rendering by using the switching native page structure data to obtain a switching native page and performs switching by switching animation to enable the terminal to display a target switching page.
In the embodiment, the terminal receives the page switching instruction through the native page, acquires the target switching page address according to the page switching instruction, searches for corresponding target switching page information from the cache based on the target switching page address, then obtains the switching native page structure data according to the target switching page information, and displays the target switching page by using the switching native page structure data, so that the switching efficiency of the target switching page is improved, the H5 webpage achieves the effect of native network switching, and the user experience is improved.
In one embodiment, after step 210, i.e. after rendering the page based on the native page structure data, obtaining and displaying the native page, the method includes:
when the data communication channel is detected to be abnormal, a long-link message channel reconnection request is sent to a server, and the long-link message channel reconnection request carries a terminal identifier; and the server reestablishes the long link message channel according to the long link message channel reconnection request and the terminal corresponding to the terminal identification.
The abnormal data communication channel refers to an abnormal long link message channel established between the terminal and the server, for example, when the network fluctuates, the abnormal data communication channel occurs. The terminal identification is used to uniquely identify the terminal,
specifically, after the terminal displays the native page, a long link message channel can be established between the terminal and the server for data communication. When the terminal detects that the data communication channel is abnormal, a long-link message channel reconnection request can be sent to the server, and the long-link message channel reconnection request carries the terminal identification. And the server reestablishes the long link message channel according to the long link message channel reconnection request and the terminal corresponding to the terminal identification. Namely, when the data communication channel of the terminal is abnormal, the terminal can be reconnected, and the stability of the network channel is ensured.
In an embodiment, as shown in fig. 12, an application starting method is provided, which is described by taking the application of the method to the terminal in fig. 1 as an example, it is understood that the method may also be applied to the terminal, and may also be applied to a system including the terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method comprises the following steps:
step 1202, receiving a built-in application starting instruction in a target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier.
The target application is a native application in which an H5 application is built. The built-in application refers to an H5 application built in a target application. Multiple built-in applications may be built into the target application. The built-in application identifier is used for uniquely identifying the built-in application, and may be a name, an address, a number and the like of the built-in application. The home page identifier of the built-in application is used for uniquely identifying a home page in the built-in application, and the home page in the built-in application, i.e. a home page in the built-in application, may be a web page address. Built-in applications are applications developed using a framework that converts H5 page runtime to native rendering.
Specifically, when the user uses the target application, the built-in application may be used. Namely, the user can operate in the display page of the built-in application in the target application. When a user selects a built-in application to be used, a terminal receives a built-in application starting instruction in a target application, and acquires a corresponding built-in application start page identifier based on the built-in application identifier, wherein the terminal can download and store configuration information of the built-in application from a server when the target application is started, and the configuration information is configured with a corresponding relation between the built-in application identifier and the built-in application start page identifier. The terminal can also download the configuration information of the built-in application from the server and store the configuration information when the user enters the display page of the built-in application in the target application.
And 1204, acquiring corresponding built-in application H5 start page information according to the built-in application start page identifier, and acquiring current equipment information.
The start page information of the built-in application H5 is H5 page information corresponding to a start page in the built-in application.
Specifically, the configuration information of the built-in application acquired by the terminal also includes start page information of the built-in application H5. The terminal can directly search the start page information of the built-in application H5 corresponding to the start page identifier of the built-in application from the stored configuration information. And then the terminal detects the operating system information corresponding to the current equipment.
And 1206, analyzing the start page information of the built-in application H5 in the running environment corresponding to the current device information to obtain the start page structure data of the built-in application H5.
The starting page structure data of the built-in application H5 refers to H5 page structure data corresponding to a starting page in the built-in application.
Specifically, different current device information corresponds to different operating environments, and the built-in application H5 start page information is analyzed in the operating environment corresponding to the current device information of the terminal to obtain the built-in application H5 start page structure data.
And 1208, identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and an H5 starting page style rule, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule according to a preset native data format conversion rule to obtain built-in application native starting page structure data.
The generation information of the start page of the built-in application H5 refers to generation information of an H5 page corresponding to the start page in the built-in application, and comprises H5 start page component information, H5 start page layout information and H5 start page style rules corresponding to the built-in application. The native start page structure data of the built-in application refers to the native page structure data corresponding to the start page in the built-in application.
Specifically, the terminal converts the H5 page running into a native rendered frame to identify the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and an H5 starting page style rule, and then converts the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule according to a preset native data format conversion rule to obtain the built-in application native starting page structure data.
And 1210, performing page rendering based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
Specifically, the terminal generates a page, namely, renders and draws the page by using the native start page structure data of the built-in application to obtain the native start page of the built-in application, and displays the start page of the built-in application in the target application. In a specific embodiment, the page in the built-in application may be obtained by using any embodiment of the data processing method, and the page in the built-in application may be a top page or a page other than the top page.
The marketing application starting method includes the steps that a built-in application starting instruction is received in a target application, corresponding built-in application H5 starting page information is obtained according to a built-in application starting page identification, current equipment information is obtained, the built-in application H5 starting page information is analyzed in an operating environment corresponding to the current equipment information, built-in application H5 starting page structure data is obtained, then the built-in application H5 starting page structure data is identified, built-in application H5 starting page component information, H5 starting page layout information and H5 starting page style rules are obtained, the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rules are converted according to preset native data format conversion rules, built-in application native starting page structure data is obtained, page rendering is carried out based on the built-in application native starting page structure data, a built-in application native starting page is obtained, and the built-in application starting page is displayed in the target application. The method comprises the steps of converting h5 start page information corresponding to a start page of the built-in application into native start page structure data when the built-in application is started, and then rendering the page to obtain and display a native start page of the built-in application, so that the loading speed of the native start page of the built-in application is increased, the starting speed of the built-in application is increased, and the running performance of the built-in application is improved.
In a specific embodiment, as shown in fig. 13, for the built-in application, the general schematic diagram of the framework for converting the H5 page runtime into the native rendering is used at runtime, wherein the H5 page information generated by using the Vue framework is parsed in JSCore (javascript) and V8 executable JS environments to obtain AST and VDom structures, and then the AST and VDom structures are recognized to obtain a communication interface, a convention specification, a component, an attribute, and the like defined and converted with the framework, and are converted into a Flutter Widget rendering component, and then the Flutter Widget rendering component is used to render the page, so that the native page of the built-in application is obtained and displayed. And the built-in application can realize native storage, native network communication, native authority control and native development interface through the native module. Therefore, the built-in application achieves the experience of the native application, and the problem of poor running performance of the H5 application is avoided. In a specific embodiment, as shown in fig. 14, a logic diagram for converting built-in applications is shown, where when a built-in application developed by a framework for converting a H5 page Runtime into a Native rendering parses H5 page information using Vue Runtime (only including a Runtime version, without a compiler), all component Native methods, dom operations, and JS interfaces that originally depend on a web page attempt are converted into Flutter to handle rendering, and C + + is responsible for coordinating communication conversion between JS and Native. In a specific embodiment, as shown in fig. 15, a schematic diagram of Store (public data state management) provided for a built-in application at the time of development is provided, through which data between different pages can be managed and maintained by the built-in application, that is, a lightweight application (littrepp) at the time of development, and state update and the like can be realized, and through which data state sharing and management capability between Native (Native) and H5 can also be provided. In a specific embodiment, as shown in FIG. 16, a schematic diagram of data state synchronization and update for common data state management is shown. The framework for converting the H5 page operation into the native rendering establishes a common bridge between the flute and the H5, and is used for connecting the storage and the view layer flute assembly in series and the synchronization and updating capacity of the H5 service side data state. The built-in application 1 can perform data state synchronization and update with the Store of the built-in application 1 through an interface, and also can perform data state synchronization and update with the Store of the built-in application 2 under the condition of acquiring the access right. In a specific embodiment, as shown in fig. 17, a communication mechanism diagram of a framework for converting H5 page runtime into native rendering in JSAPI, wherein the JSI framework is used for providing non-intrusive scripting management and comprehensive front-end development debugging, document parsing, stencil compiling, packaging export environment support, etc. The framework is responsible for script management and analysis work of JS, and is responsible for communication with wxajs (C + + module), JNI (JNI is an abbreviation of Java Native Interface, and codes can be guaranteed to be conveniently transplanted on different platforms by writing programs through a Java local Interface) and OC (iOS development language) modules. wxajs is responsible for providing the underlying capabilities of the framework, including XLog (logging system), WCDB (storage module), WSS (WebSocket long link communication module), cronet (short link network communication module), while the communication of JNI and OC mainly provides the communication and link between Android and iOS modules.
In one embodiment, before step 1202, that is, before the built-in application start instruction is received in the target application, the method further includes:
the method comprises the steps of detecting a triggering built-in application resource information updating event, responding to the built-in application resource information updating event, and sending a built-in application updating resource information acquisition request to a server, wherein the built-in application updating resource information acquisition request carries a built-in application identifier; and acquiring the built-in application updating resource information returned by the server, storing the built-in application updating resource information and deleting the built-in application historical resource information corresponding to the built-in application identifier.
The built-in application resource information updating event refers to an event for updating basic resource information and service resources corresponding to the built-in application.
Specifically, the terminal may trigger a built-in application resource information update event when the target application enters the built-in application presentation page, respond to the built-in application resource information update event, and send a built-in application update resource information acquisition request to the server, where the built-in application update resource information acquisition request carries the built-in application identifier. When the target application has a plurality of built-in application identifiers, the target application can be updated simultaneously, namely, a built-in application update resource information acquisition request can carry a plurality of different built-in application identifiers, the server searches corresponding built-in application update resource information by using each built-in application identifier according to the built-in application update resource information acquisition request, the terminal acquires built-in application update resource information returned by the server, and stores the built-in application update resource information and deletes the built-in application history resource information corresponding to the built-in application identifiers. In one embodiment, the terminal may also obtain resource information version information returned by the server according to the built-in application identifier, compare the resource information version information with local source information version information, obtain the returned built-in application update resource information from the server when the resource information version information is inconsistent with the local source information version information, and store and delete the built-in application update resource information corresponding to the built-in application identifier. And when the resource information version information is consistent with the local source information version information, no processing is carried out.
In the embodiment, when a trigger built-in application resource information updating event is detected, built-in application updating resource information is acquired, and the built-in application updating resource information is stored and the built-in application historical resource information corresponding to the built-in application identifier is deleted, so that the resource information can be updated in real time, the running application can be kept up to date, and the user experience is improved.
In one embodiment, the built-in application comprises a social sharing application; after step 1210, after performing page rendering based on the native start page structure data of the built-in application, obtaining a native start page of the built-in application and displaying the start page of the built-in application in the target application, the method includes:
and receiving a reply instruction of the social sharing message in the initial page, and displaying a native reply interactive window according to the reply instruction. And acquiring the reply message through the native reply interactive window, and displaying the reply message in the initial page.
The social sharing application refers to an application for performing social contact and information sharing, for example, a forum application provides a posting function for information sharing and interaction, and for example, a small blackboard application performs information sharing and interaction through the posting function. The social sharing message refers to information shared by other users shown in the initial page. The native reply interactive window refers to a native popup window for replying information.
Specifically, the user can communicate in the social sharing application, the terminal receives a reply instruction to the social sharing message in the start page through the start page, and the native reply interactive window is displayed according to the reply instruction. And the user can input the reply message through the original reply interactive window, and when the input is finished, the terminal acquires the reply message through the original reply interactive window and displays the reply message in the initial page.
In a specific embodiment, as shown in fig. 18, the page diagram of the social sharing application is a small blackboard application in which a user can share information to all users of the small blackboard by creating the small blackboard. In fig. 18, a is a display page of the social sharing message, and B is a display page of the native reply interaction window, the user may click the input frame in the page a, and the terminal receives the reply instruction and displays the page B according to the reply instruction. And the terminal acquires the reply message input by the user through the input keyboard through the page B and displays the reply message in the initial page. In a particular embodiment, the social sharing application may interact with the target application. For example, when the user right-clicks the social sharing message in the start page, an interaction function interacting with the target application may be displayed, and when the target application is an instant messaging application, as shown in fig. 19, the target application is a page diagram of the interaction function, and the user may select the interaction function in the social sharing application for interaction. The interactive functions include selecting an expression, copying, replying, forwarding and the like. The user can also obtain files, expressions, documents, files and the like saved in the target application by the user in the social sharing application and use the files in the social sharing application. In one embodiment, as shown in FIG. 20, a schematic of an exit interface for a small blackboard application. The description of the small blackboard, members of the small blackboard and other interaction functions are shown in a schematic diagram of a quitting interface of the small blackboard application, and when a user wants to quit the small blackboard application, the user can quit the small blackboard application by clicking the quitting small blackboard to return to the enterprise WeChat application.
In an embodiment, as shown in fig. 21, an application starting method is provided, which specifically includes the following steps:
step 2102, detecting a trigger built-in application resource information updating event in the target application, responding to the built-in application resource information updating event, and sending a built-in application updating resource information acquisition request to the server, wherein the built-in application updating resource information acquisition request carries a built-in application identifier.
And step 2104, obtaining the built-in application update resource information returned by the server, storing the built-in application update resource information, and deleting the built-in application history resource information corresponding to the built-in application identifier.
Step 2106, receiving a built-in application starting instruction in the target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier.
Step 2108, searching the corresponding H5 page basic resource information, H5 page service resource information and H5 page data from the memory according to the application start page identifier, loading the H5 page basic resource information, the H5 page service resource information and the H5 page data, and acquiring the current device information.
Step 2110, starting a first thread, a second thread and a main thread, and analyzing H5 page basic resource information and H5 page service resource information in a running environment corresponding to the current device information by using the first thread to obtain the H5 initial page structure data of the built-in application.
Step 2112, identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and an H5 starting page style rule, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rule according to a preset native data format conversion rule to obtain built-in application native starting page structure data.
And step 2114, performing page rendering based on the native start page structure data of the built-in application and the H5 page data to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
Step 2116, sending the H5 page information silent update request to the server, where the H5 page information silent update request carries the page identifier. And obtaining the updated version information returned by the server, wherein the updated version information is searched by the server by using the page identifier.
Step 2118, obtaining the local version information of the H5 page information corresponding to the application start page identifier, comparing the updated version information with the local version information, and sending an H5 page update information downloading request to the server when the updated version information is inconsistent with the local version information, wherein the H5 page update information downloading request carries the updated version information.
And step 2120, acquiring the H5 page update information returned by the server, wherein the H5 page update information is searched by the server according to the update version information, storing the H5 page update information, and deleting the H5 page information corresponding to the local version information.
The application also provides an application scenario, and the application starting method is applied to the application scenario. In particular, the amount of the solvent to be used,
the application starting method is applied to built-in application in enterprise WeChat, as shown in FIG. 22, and is a specific framework schematic diagram of an application scenario, specifically:
and initializing basic environment configuration of the built-in application project through a scaffold, compiling, packaging and publishing to a resource management system. The enterprise wechat application background, namely the enterprise wechat server, establishes a link with the resource issuing system through a general background Access (AE) module accessed into the resource management system. A built-in application resource package sharing database is established in the resource issuing system, and the resource package updating information can be acquired through an interface and the stored resource packages are updated. The enterprise WeChat application background can obtain the business resource package and the basic resource package of the current latest version of the resource release system through the built-in application identification. The method comprises the steps of obtaining a configured service entrance identifier of the built-in application in an enterprise WeChat application background, and then issuing configuration information of the built-in application, wherein the configuration information can comprise the service entrance identifier of the built-in application, a resource package download address, a built-in application home page path and the like. And then the issuing of the resource packet of the built-in application can be controlled through the gray scale. The enterprise WeChat application front end can download the resource information of the built-in application through the configuration information issued by the server, and can also obtain the latest resource package information of the built-in application from the resource issuing system. Then, when a user wants to start the built-in application, a resource package of the built-in application pre-pulled and stored at the front end of the enterprise wechat application is obtained, the built-in application can be an application of a Vue project, and then the resource package is decompressed to obtain corresponding specified page information, for example, the specified page information can be H5 start page information, namely Vue. Then obtaining current equipment information; analyzing the information of the starting page of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the structural data of the starting page of the built-in application H5; identifying the built-in application H5 initial page structure data to obtain built-in application H5 initial page component information, H5 initial page layout information and H5 initial page style rules, converting the built-in application H5 initial page component information, the H5 initial page layout information and the H5 initial page style rules according to a preset native data format conversion rule to obtain built-in application native initial page structure data, namely converting vue into a flutter Widget component to perform flutter View rendering, and obtaining and displaying an initial page. In a specific embodiment, the application launching method may also be applied to a built-in application in a WeChat application. The WeChat application is accessed into the resource publishing system, and the WeChat application can acquire the resource package of the built-in application and then use the resource package of the built-in application to generate the page. The WeChat application background can control the updating of the built-in application resource package through the gray level. And basic environment configuration of a built-in application project in the WeChat application can be initialized through a scaffold, compiled, packaged and released to a resource management system. Meanwhile, the WeChat application background can also perform hot update on the built-in application.
It should be understood that although the various steps in the flowcharts of fig. 2-12 and 20 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-12 and 20 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 23, there is provided a data processing apparatus 2300 which can be a part of a computer device by adopting a software module or a hardware module, or a combination of the two, the apparatus specifically comprising: an instruction receiving module 2302, an information obtaining module 2304, a parsing module 2306, a conversion module 2308 and a rendering module 2310, wherein:
the instruction receiving module 2302 is used for receiving a page generation instruction, and the page generation instruction carries a page identifier;
the information acquisition module 2304 is configured to acquire corresponding H5 page information according to the page identifier, and acquire current device information;
an analyzing module 2306, configured to analyze the H5 page information in an operating environment corresponding to the current device information, to obtain H5 page structure data;
a conversion module 2308, configured to identify H5 page structure data, obtain H5 page component information, H5 page layout information, and H5 page style rules, and perform data format conversion on the H5 page component information, the H5 page layout information, and the H5 page style rules according to a preset native data format conversion rule, to obtain native page structure data;
the rendering module 2310 is configured to perform page rendering based on the native page structure data, obtain a native page, and display the native page.
In an embodiment, the instruction receiving module 2302 is further configured to receive a page generation instruction in a target application, where the page generation instruction carries a target page identifier, the target page identifier is used to uniquely identify a page in an H5 application, and the H5 application is an application built in the target application.
In one embodiment, the H5 page information includes H5 page basic resource information, H5 page service resource information, and H5 page data; the information obtaining module 2304 is further configured to search for corresponding H5 page basic resource information, H5 page service resource information, and H5 page data from the memory according to the page identifier, and load the H5 page basic resource information, the H5 page service resource information, and the H5 page data.
In one embodiment, the information obtaining module 2304 is further configured to obtain a corresponding basic resource storage path based on the page identifier, and when the H5 page basic resource information is not found according to the basic resource storage path, send an H5 page basic resource information downloading request to the server, where the H5 page basic resource information downloading request carries the page identifier; acquiring basic resource information of the H5 page returned by the server and storing the basic resource information according to a basic resource storage path; and searching the H5 page basic resource information from the basic resource storage path, comparing the version information corresponding to the H5 page basic resource information with the version information corresponding to the preset H5 page basic resource information, and loading the H5 page basic resource information when the version information corresponding to the H5 page basic resource information is greater than the version information corresponding to the preset H5 page basic resource information.
In one embodiment, the information obtaining module 2304 is further configured to obtain a corresponding service resource storage path based on the page identifier, and when the H5 page service resource information is not found according to the service resource storage path, send an H5 page service resource information downloading request to the server, where the H5 page service resource information downloading request carries the page identifier; acquiring H5 page service resource information returned by the server and storing the information according to a service resource storage path; searching H5 page service resource information from the service resource storage path, comparing target version information corresponding to the H5 page service resource information with preset version information corresponding to preset H5 page service resource information, and loading the H5 page service resource information when the target version information corresponding to the H5 page service resource information is larger than the preset version information corresponding to the preset H5 page service resource information.
In one embodiment, the data processing apparatus 2300, further comprising:
the pre-downloading module is used for sending an H5 page information downloading request to the server when detecting an event triggering the downloading of the H5 page information, wherein the H5 page information downloading request carries a page identifier; and acquiring H5 page information returned by the server, wherein the H5 page information is searched by the server according to the page identifier, and the H5 page information is stored according to a memory storage path corresponding to the page identifier.
In one embodiment, the data processing apparatus 2300, further comprising:
the silent updating module is used for sending an H5 page information silent updating request to the server, wherein the H5 page information silent updating request carries a page identifier; acquiring updated version information returned by the server, wherein the updated version information is searched by the server by using the page identifier; the method comprises the steps of obtaining local version information of H5 page information corresponding to a page identifier, comparing updated version information with the local version information, and sending an H5 page update information downloading request to a server when the updated version information is inconsistent with the local version information, wherein the H5 page update information downloading request carries the updated version information; and acquiring H5 page updating information returned by the server, wherein the H5 page updating information is searched by the server according to the updating version information, storing the H5 page updating information, and deleting the H5 page information corresponding to the local version information.
In one embodiment, the data processing apparatus 2300, further comprising:
the thread starting module is used for starting a first thread, a second thread and a main thread;
the parsing module 2206 is further configured to parse the H5 page information in the operating environment corresponding to the current device information by using the first thread to obtain H5 page structure data;
the conversion module 2208 is further configured to identify the H5 page structure data by using a second thread, obtain H5 page component information, H5 page layout information, and an H5 page style rule, and perform data format conversion on the H5 page component information, the H5 page layout information, and the H5 page style rule according to a preset native data format conversion rule, to obtain native page structure data;
the rendering module 2210 is further configured to perform page rendering based on the native page structure data by using the main thread, obtain and display the native page.
In an embodiment, the parsing module 2306 is further configured to perform abstract syntax analysis on the H5 page information in an operating environment corresponding to the current device information, so as to obtain H5 page abstract syntax structure data; and constructing a virtual document object model tree based on the H5 page abstract syntax structure data to obtain H5 page structure data.
In one embodiment, the data processing apparatus 2300, further comprising:
the switching information loading module is used for detecting a switching page information preloading event and responding to the switching page information preloading event to acquire each preloading switching page address; and downloading corresponding switching page information from the server based on the preloaded switching page address, and storing the switching page information into a cache.
In one embodiment, the data processing apparatus 2300, further comprising:
the switching module is used for receiving a page switching instruction through a native page and acquiring a target switching page address according to the page switching instruction; searching corresponding target switching page information from a cache based on the target switching page address, and analyzing the target switching page information in an operating environment corresponding to the current equipment information to obtain switching H5 page structure data; identifying switching H5 page structure data to obtain switching H5 page component information, switching H5 page layout information and switching H5 page style rules, and converting the switching H5 page component information, the switching H5 page layout information and the switching H5 page style rules according to a preset native data format conversion rule to obtain switching native page structure data; and rendering the page based on the switching native page structure data to obtain a switching native page and displaying the switching native page through switching animation.
In one embodiment, data processing apparatus 2300, comprising:
the reconnection module is used for sending a long link message channel reconnection request to the server when detecting that the data communication channel is abnormal, wherein the long link message channel reconnection request carries a terminal identifier; and the server reestablishes the long link message channel according to the long link message channel reconnection request and the terminal corresponding to the terminal identification.
In one embodiment, as shown in fig. 24, there is provided an application starting apparatus 2400, which may adopt a software module or a hardware module, or a combination of the two modules, as a part of a computer device, and specifically includes: a starting instruction receiving module 2402, an initial information obtaining module 2404, an initial information analyzing module 2406, an initial information converting module 2408 and an initial page displaying module 2410, wherein:
a start instruction receiving module 2402, configured to receive a built-in application start instruction in a target application, where the built-in application start instruction carries a built-in application identifier, and obtains a corresponding built-in application start page identifier based on the built-in application identifier;
a start information obtaining module 2404, configured to obtain start page information of a corresponding internal application H5 according to the start page identifier of the internal application, and obtain current device information;
the starting information analysis module 2406 is configured to analyze the starting page information of the internal application H5 in the running environment corresponding to the current device information to obtain starting page structure data of the internal application H5;
the start information conversion module 2408 is configured to identify the start page structure data of the internal application H5, obtain internal application H5 start page component information, H5 start page layout information, and an H5 start page style rule, and convert the internal application H5 start page component information, the H5 start page layout information, and the H5 start page style rule according to a preset native data format conversion rule to obtain the native start page structure data of the internal application;
the start page display module 2410 is configured to perform page rendering based on the native start page structure data of the built-in application, obtain a native start page of the built-in application, and display the start page of the built-in application in the target application.
In one embodiment, the application launching device 2400 further includes:
the resource updating module is used for detecting a built-in application resource information updating event which is triggered, responding to the built-in application resource information updating event, and sending a built-in application updating resource information acquisition request to the server, wherein the built-in application updating resource information acquisition request carries a built-in application identifier; and acquiring the built-in application updating resource information returned by the server, storing the built-in application updating resource information and deleting the built-in application historical resource information corresponding to the built-in application identifier.
In one embodiment, the built-in application comprises a social sharing application;
the application starting apparatus 2400 further includes:
the interaction module is used for receiving a reply instruction of the social sharing message in the initial page and displaying a native reply interaction window according to the reply instruction; and acquiring the reply message through the native reply interactive window, and displaying the reply message in the initial page.
For specific limitations of the data processing device and the application starting device, reference may be made to the above limitations of the data processing method and the application starting method, which are not described herein again. The respective modules in the data processing apparatus and the application starting apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 25. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing page resource information data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data processing method or an application launching method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 26. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a data processing method or an application launching method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 25 or 26 are only block diagrams of some of the configurations relevant to the present application, and do not constitute a limitation on the computer apparatus to which the present application is applied, and a particular computer apparatus may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of the computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps of the above-described method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A method of data processing, the method comprising:
receiving a page generation instruction, wherein the page generation instruction carries a page identifier;
acquiring corresponding H5 page information according to the page identifier, and acquiring current equipment information;
analyzing the H5 page information in the operating environment corresponding to the current equipment information to obtain H5 page structure data;
identifying the H5 page structure data to obtain H5 page component information, H5 page layout information and an H5 page style rule, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rule according to a preset native data format conversion rule to obtain native page structure data;
and rendering the page based on the native page structure data to obtain and display a native page.
2. The method according to claim 1, wherein the receiving a page generation instruction, the page generation instruction carrying a page identifier, comprises:
receiving a page generation instruction in a target application, wherein the page generation instruction carries a target page identifier, the target page identifier is used for uniquely identifying a page in an H5 application, and the H5 application is an application built in the target application.
3. The method of claim 1, wherein the H5 page information comprises H5 page base resource information, H5 page service resource information, and H5 page data;
acquiring corresponding H5 page information according to the page identifier, wherein the acquiring comprises the following steps:
and searching corresponding H5 page basic resource information, H5 page service resource information and H5 page data from a memory according to the page identifier, and loading the H5 page basic resource information, the H5 page service resource information and the H5 page data.
4. The method according to claim 3, wherein the searching for the corresponding H5 page basic resource information from the memory according to the page identifier and loading the H5 page basic resource information comprises:
acquiring a corresponding basic resource storage path based on the page identifier, and sending an H5 page basic resource information downloading request to a server when the H5 page basic resource information is not found according to the basic resource storage path, wherein the page identifier is carried in the H5 page basic resource information downloading request;
acquiring basic resource information of the H5 page returned by the server and storing the basic resource information according to the basic resource storage path;
and searching the H5 page basic resource information from the basic resource storage path, comparing the version information corresponding to the H5 page basic resource information with the version information corresponding to the preset H5 page basic resource information, and loading the H5 page basic resource information when the version information corresponding to the H5 page basic resource information is greater than the version information corresponding to the preset H5 page basic resource information.
5. The method according to claim 3, wherein the searching for the corresponding H5 page service resource information from the memory according to the page identifier and loading the H5 page service resource information comprises:
acquiring a corresponding service resource storage path based on the page identifier, and sending an H5 page service resource information downloading request to a server when the H5 page service resource information is not found according to the service resource storage path, wherein the H5 page service resource information downloading request carries the page identifier;
acquiring H5 page service resource information returned by the server and storing the information according to the service resource storage path;
searching the H5 page service resource information from the service resource storage path, comparing target version information corresponding to the H5 page service resource information with preset version information corresponding to preset H5 page service resource information, and loading the H5 page service resource information when the target version information corresponding to the H5 page service resource information is greater than the preset version information corresponding to the preset H5 page service resource information.
6. The method according to claim 1, wherein the analyzing the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data includes:
performing abstract syntax analysis on the H5 page information in an operating environment corresponding to the current device information to obtain H5 page abstract syntax structure data;
and constructing a virtual document object model tree based on the H5 page abstract syntax structure data to obtain H5 page structure data.
7. The method of claim 1, wherein after the rendering a page based on the native page structure data, obtaining a native page and displaying, further comprising:
detecting a switching page information preloading event, and responding to the switching page information preloading event to obtain each preloading switching page address;
and downloading corresponding switching page information from a server based on the pre-loading switching page address, and storing the switching page information into a cache.
8. The method according to claim 7, further comprising, after downloading corresponding switching page information from a server based on the switching page address and storing the switching page information in a cache:
receiving a page switching instruction through the native page, and acquiring a target switching page address according to the page switching instruction;
searching corresponding target switching page information from a cache based on the target switching page address, and analyzing the target switching page information in an operating environment corresponding to the current equipment information to obtain switching H5 page structure data;
identifying the switching H5 page structure data to obtain switching H5 page component information, switching H5 page layout information and switching H5 page style rules, and converting the switching H5 page component information, the switching H5 page layout information and the switching H5 page style rules according to a preset native data format conversion rule to obtain switching native page structure data;
and rendering the page based on the switching native page structure data to obtain a switching native page and displaying the switching native page through switching animation.
9. An application launching method, characterized in that the method comprises:
receiving a built-in application starting instruction in a target application, wherein the built-in application starting instruction carries a built-in application identifier, and acquiring a corresponding built-in application start page identifier based on the built-in application identifier;
acquiring corresponding built-in application H5 start page information according to the built-in application start page identification, and acquiring current equipment information;
analyzing the initial page information of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the initial page structure data of the built-in application H5;
identifying the built-in application H5 starting page structure data to obtain built-in application H5 starting page component information, H5 starting page layout information and H5 starting page style rules, and converting the built-in application H5 starting page component information, the H5 starting page layout information and the H5 starting page style rules according to a preset native data format conversion rule to obtain built-in application native starting page structure data;
and performing page rendering based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application.
10. The method according to claim 9, before receiving the built-in application start instruction in the target application, further comprising:
the method comprises the steps that a trigger built-in application resource information updating event is detected, a built-in application updating resource information acquisition request is sent to a server in response to the built-in application resource information updating event, and the built-in application updating resource information acquisition request carries a built-in application identifier;
and acquiring built-in application updating resource information returned by the server, storing the built-in application updating resource information and deleting the built-in application historical resource information corresponding to the built-in application identifier.
11. The method of claim 9, wherein the built-in application comprises a social sharing application;
after the page rendering is performed based on the native start page structure data of the built-in application to obtain a native start page of the built-in application and display the start page of the built-in application in the target application, the method includes:
receiving a reply instruction of the social sharing message in the starting page, and displaying a native reply interactive window according to the reply instruction;
and acquiring a reply message through the native reply interactive window, and displaying the reply message in the initial page.
12. A data processing apparatus, characterized in that the apparatus comprises:
the instruction receiving module is used for receiving a page generation instruction, and the page generation instruction carries a page identifier;
the information acquisition module is used for acquiring corresponding H5 page information according to the page identifier and acquiring current equipment information;
the analysis module is used for analyzing the H5 page information in the operating environment corresponding to the current equipment information to obtain H5 page structure data;
the conversion module is used for identifying the H5 page structure data to obtain H5 page component information, H5 page layout information and H5 page style rules, and performing data format conversion on the H5 page component information, the H5 page layout information and the H5 page style rules according to a preset native data format conversion rule to obtain native page structure data;
and the rendering module is used for rendering the page based on the native page structure data to obtain and display the native page.
13. An application launching device, characterized in that the device comprises:
the starting instruction receiving module is used for receiving a built-in application starting instruction in the target application, wherein the built-in application starting instruction carries a built-in application identifier, and the corresponding built-in application start page identifier is obtained based on the built-in application identifier;
the starting information acquisition module is used for acquiring corresponding starting page information of the built-in application H5 according to the built-in application starting page identifier and acquiring current equipment information;
the initial information analysis module is used for analyzing the initial page information of the built-in application H5 in the running environment corresponding to the current equipment information to obtain the initial page structure data of the built-in application H5;
the starting information conversion module is used for identifying the H5 starting page structure data of the built-in application, obtaining H5 starting page component information, H5 starting page layout information and H5 starting page style rules of the built-in application, and converting the H5 starting page component information, the H5 starting page layout information and the H5 starting page style rules of the built-in application according to a preset native data format conversion rule to obtain native starting page structure data of the built-in application;
and the starting page display module is used for rendering a page based on the native starting page structure data of the built-in application to obtain a native starting page of the built-in application and displaying the starting page of the built-in application in the target application.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 11 when executing the computer program.
15. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 11.
CN202110707730.5A 2021-06-24 2021-06-24 Data processing method, application starting method, device, computer equipment and storage medium Pending CN115525305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110707730.5A CN115525305A (en) 2021-06-24 2021-06-24 Data processing method, application starting method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110707730.5A CN115525305A (en) 2021-06-24 2021-06-24 Data processing method, application starting method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115525305A true CN115525305A (en) 2022-12-27

Family

ID=84693974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110707730.5A Pending CN115525305A (en) 2021-06-24 2021-06-24 Data processing method, application starting method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115525305A (en)

Similar Documents

Publication Publication Date Title
US11461111B2 (en) Method for running applets, and electronic device
KR102436987B1 (en) Method and terminal device for extracting web page content
Taivalsaari et al. Web browser as an application platform
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
US20230036980A1 (en) Micro-frontend system, sub-application loading method, electronic device, computer program product, and computer-readable storage medium
US9436482B2 (en) Input content to application via web browser
US9292253B2 (en) Methods and apparatus for voiced-enabling a web application
US9400633B2 (en) Methods and apparatus for voiced-enabling a web application
US9781262B2 (en) Methods and apparatus for voice-enabling a web application
CN110659057B (en) Application program hot updating method and device, storage medium and computer equipment
US10157612B2 (en) Methods and apparatus for voice-enabling a web application
CN109240697B (en) Call processing method and device and storage medium
US20230229406A1 (en) Page rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product
CN111324833A (en) Page display method, device, electronic design and computer readable medium
CN111680253A (en) Page application data packet generation method and device, computer equipment and storage medium
CN112596714A (en) Webpage development method, device, terminal, server and storage medium
US9292252B2 (en) Methods and apparatus for voiced-enabling a web application
CN112114890A (en) Method, device and equipment for processing small program and storage medium
US10789751B2 (en) Method and apparatus for implementing animation in client application and animation script framework
CN113495730A (en) Resource package generation and analysis method and device
CN112764746A (en) Data processing method and device, electronic equipment and storage medium
CN113315829B (en) Client offline H5 page loading method and device, computer equipment and medium
CN115525305A (en) Data processing method, application starting method, device, computer equipment and storage medium
CN114254232A (en) Cloud product page generation method and device, computer equipment and storage medium
CN113342450A (en) Page processing method and device, electronic equipment and computer readable medium

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40079485

Country of ref document: HK