Data processing, application starting method and device, computer equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-06-24
- Publication Date
- 2026-08-07
AI Technical Summary
然而,H5页面在加载时的速度比较低下,导致H5应用程序运行性能降低
[0071]基于内置应用原生起始页结构数据进行页面渲染,得到内置应用原生起始页面并在目标应用中展示内置应用的起始页面。
Smart Images

Figure CN115525305B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing, application launching method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of internet technology, H5 (HyperText Markup Language 5) applications have emerged. H5 applications refer to applications developed using H5. Currently, H5 applications have advantages such as being usable without downloading and low development costs. Current H5 applications typically display application content through H5 pages. However, H5 pages load relatively slowly, leading to reduced performance of H5 applications. Summary of the Invention
[0003] Therefore, it is necessary to provide a data processing and application startup method, device, computer equipment, and storage medium that can improve the loading speed of H5 pages and thus enhance the performance of H5 applications, in order to address the aforementioned technical problems.
[0004] A data processing method, the method comprising:
[0005] Receive page generation instructions, which carry page identifiers;
[0006] Retrieve the corresponding H5 page information based on the page identifier, and obtain the current device information;
[0007] Parse the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data;
[0008] Identify H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Then, convert the H5 page component information, H5 page layout information, and H5 page style rules into their original data format according to preset native data format conversion rules to obtain the original page structure data.
[0009] The page is rendered based on the original page structure data to obtain and display the original page.
[0010] In one embodiment, before receiving the page generation instruction, which carries a page identifier, the method further includes:
[0011] When an H5 page information download event is detected, an H5 page information download request is sent to the server, and the H5 page information download request carries a page identifier;
[0012] Obtain the H5 page information returned by the server. The H5 page information is found by the server based on the page identifier. Save the H5 page information according to the memory storage path corresponding to the page identifier.
[0013] In one embodiment, after rendering the page based on the native page structure data to obtain and display the native page, the method further includes:
[0014] Send an H5 page information silent update request to the server, wherein the H5 page information silent update request carries the page identifier;
[0015] Obtain the updated version information returned by the server, wherein the updated version information is found by the server using the page identifier;
[0016] Obtain the local version information of the H5 page information corresponding to the page identifier, compare the updated version information with the local version information, and when the updated version information is inconsistent with the local version information, send an H5 page update information download request to the server, the H5 page update information download request carrying the updated version information;
[0017] Obtain the H5 page update information returned by the server. The H5 page update information is found by the server based on the update version information. Save the H5 page update information and delete the H5 page information corresponding to the local version information.
[0018] In one embodiment, after obtaining the corresponding H5 page information based on the page identifier and obtaining the current device information, the method further includes:
[0019] Start the first thread, the second thread, and the main thread;
[0020] The step of parsing the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data includes:
[0021] The first thread is used to parse the H5 page information in the runtime environment corresponding to the current device information to obtain the H5 page structure data.
[0022] The process involves identifying the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are then converted to their original data format according to a preset native data format conversion rule to obtain native page structure data, including:
[0023] The second thread is used to identify the H5 page structure data to obtain H5 page component information, H5 page layout information and H5 page style rules. The H5 page component information, H5 page layout information and H5 page style rules are converted into data format according to the preset native data format conversion rules to obtain native page structure data.
[0024] The process of rendering the page based on the native page structure data to obtain and display the native page includes:
[0025] The main thread is used to render the page based on the native page structure data, resulting in the native page, which is then displayed.
[0026] In one embodiment, after rendering the page based on the native page structure data to obtain and display the native page, the process includes:
[0027] When an anomaly is detected in the data communication channel, a long-connection message channel reconnection request is sent to the server, and the long-connection message channel reconnection request carries the terminal identifier.
[0028] The server re-establishes a long-connection message channel based on the long-connection message channel reconnection request and the terminal corresponding to the terminal identifier.
[0029] A data processing apparatus, the apparatus comprising:
[0030] The instruction receiving module is used to receive page generation instructions, which carry page identifiers.
[0031] The information acquisition module is used to obtain the corresponding H5 page information based on the page identifier and to obtain the current device information;
[0032] The parsing module is used to parse H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data;
[0033] The conversion module is used to identify H5 page structure data, obtain H5 page component information, H5 page layout information and H5 page style rules, and convert the H5 page component information, H5 page layout information and H5 page style rules into data format according to preset native data format conversion rules to obtain native page structure data.
[0034] The rendering module is used to render the page based on the native page structure data, obtain the native page, and display it.
[0035] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0036] Receive page generation instructions, which carry page identifiers;
[0037] Retrieve the corresponding H5 page information based on the page identifier, and obtain the current device information;
[0038] Parse the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data;
[0039] Identify H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Then, convert the H5 page component information, H5 page layout information, and H5 page style rules into their original data format according to preset native data format conversion rules to obtain the original page structure data.
[0040] The page is rendered based on the original page structure data to obtain and display the original page.
[0041] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0042] Receive page generation instructions, which carry page identifiers;
[0043] Retrieve the corresponding H5 page information based on the page identifier, and obtain the current device information;
[0044] Parse the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data;
[0045] Identify H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Then, convert the H5 page component information, H5 page layout information, and H5 page style rules into their original data format according to preset native data format conversion rules to obtain the original page structure data.
[0046] The page is rendered based on the original page structure data to obtain and display the original page.
[0047] The aforementioned data processing method, apparatus, computer equipment, and storage medium obtain corresponding H5 page information and current device information when the page is generated. They then parse the H5 page information within the operating environment corresponding to the current device information to obtain H5 page structure data. Next, they identify the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Finally, they convert the H5 page component information, H5 page layout information, and H5 page style rules according to preset native data format conversion rules to obtain native page structure data. This native page structure data is then used for page rendering to obtain and display the native page. In other words, by converting H5 page information into native page structure data for page rendering, a native page is obtained, thereby improving page loading speed and ultimately enhancing the performance of H5 applications.
[0048] A data processing method, the method comprising:
[0049] When a built-in application launch command is received in the target application, the built-in application launch command carries a built-in application identifier, and the corresponding built-in application start page identifier is obtained based on the built-in application identifier.
[0050] Obtain the corresponding H5 start page information of the built-in application based on the start page identifier of the built-in application, and obtain the current device information;
[0051] Parse the H5 start page information of the built-in application in the operating environment corresponding to the current device information to obtain the H5 start page structure data of the built-in application.
[0052] Identify the H5 start page structure data of the built-in application, obtain the H5 start page component information, H5 start page layout information and H5 start page style rules, and convert the H5 start page component information, H5 start page layout information and H5 start page style rules according to the preset native data format conversion rules to obtain the native start page structure data of the built-in application.
[0053] The page is rendered based on the native start page structure data of the built-in application, resulting in the native start page of the built-in application, and then displayed in the target application.
[0054] An application launch device, the device comprising:
[0055] The startup instruction receiving module is used to receive the built-in application startup instruction in the target application. The built-in application startup instruction carries the built-in application identifier, and the corresponding built-in application start page identifier is obtained based on the built-in application identifier.
[0056] The starting information acquisition module is used to obtain the corresponding H5 starting page information of the built-in application based on the starting page identifier of the built-in application, and to obtain the current device information;
[0057] The start information parsing module is used to parse the start page information of the built-in application H5 in the operating environment corresponding to the current device information, and obtain the structure data of the start page of the built-in application H5.
[0058] The start information conversion module is used to identify the structure data of the built-in application H5 start page, obtain the component information, layout information and style rules of the built-in application H5 start page, and convert the component information, layout information and style rules of the built-in application H5 start page according to the preset native data format conversion rules to obtain the native start page structure data of the built-in application.
[0059] The start page display module is used to render the page based on the native start page structure data of the built-in application, obtain the native start page of the built-in application, and display the start page of the built-in application in the target application.
[0060] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0061] When a built-in application launch command is received in the target application, the built-in application launch command carries a built-in application identifier, and the corresponding built-in application start page identifier is obtained based on the built-in application identifier.
[0062] Obtain the corresponding H5 start page information of the built-in application based on the start page identifier of the built-in application, and obtain the current device information;
[0063] Parse the H5 start page information of the built-in application in the operating environment corresponding to the current device information to obtain the H5 start page structure data of the built-in application.
[0064] Identify the H5 start page structure data of the built-in application, obtain the H5 start page component information, H5 start page layout information and H5 start page style rules, and convert the H5 start page component information, H5 start page layout information and H5 start page style rules according to the preset native data format conversion rules to obtain the native start page structure data of the built-in application.
[0065] The page is rendered based on the native start page structure data of the built-in application, resulting in the native start page of the built-in application, and then displayed in the target application.
[0066] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0067] When a built-in application launch command is received in the target application, the built-in application launch command carries a built-in application identifier, and the corresponding built-in application start page identifier is obtained based on the built-in application identifier.
[0068] Obtain the corresponding H5 start page information of the built-in application based on the start page identifier of the built-in application, and obtain the current device information;
[0069] Parse the H5 start page information of the built-in application in the operating environment corresponding to the current device information to obtain the H5 start page structure data of the built-in application.
[0070] Identify the H5 start page structure data of the built-in application, obtain the H5 start page component information, H5 start page layout information and H5 start page style rules, and convert the H5 start page component information, H5 start page layout information and H5 start page style rules according to the preset native data format conversion rules to obtain the native start page structure data of the built-in application.
[0071] The page is rendered based on the native start page structure data of the built-in application, resulting in the native start page of the built-in application, and then displayed in the target application.
[0072] The aforementioned application launch method, apparatus, computer device, and storage medium, upon receiving a built-in application launch command in the target application, obtain the corresponding built-in application H5 start page information based on the built-in application start page identifier, acquire current device information, parse the built-in application H5 start page information in the operating environment corresponding to the current device information to obtain built-in application H5 start page structure data, then identify the built-in application H5 start page structure data to obtain built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules, convert the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules according to preset native data format conversion rules to obtain built-in application native start page structure data, perform page rendering based on the built-in application native start page structure data, obtain the built-in application native start page, and display the built-in application's start page in the target application. In other words, when the built-in application starts, it converts the H5 start page information corresponding to the built-in application start page into native start page structure data, then performs page rendering to obtain and display the built-in application native start page, thereby improving the loading speed of the built-in application native start page, increasing the startup speed of the built-in application, and thus improving the running performance of the built-in application. Attached Figure Description
[0073] Figure 1 This is a diagram illustrating the application environment of a data processing method in one embodiment.
[0074] Figure 2This is a flowchart illustrating a data processing method in one embodiment;
[0075] Figure 3 This is a schematic diagram of the process for obtaining page information in a specific embodiment;
[0076] Figure 4 This is a schematic diagram of the process of loading basic resource information in one embodiment;
[0077] Figure 5 This is a schematic diagram of the process of loading basic resource information in a specific embodiment;
[0078] Figure 6 This is a schematic diagram of the process for loading business resource information in one embodiment;
[0079] Figure 7 This is a schematic diagram of the process of loading business resource information in a specific embodiment;
[0080] Figure 8 This is a schematic diagram of the silent update process in one embodiment;
[0081] Figure 9 This is a schematic diagram of the silent update process in a specific embodiment;
[0082] Figure 10a This is a flowchart illustrating the use of thread processing in one embodiment;
[0083] Figure 10b This is a flowchart illustrating the use of thread processing in a specific embodiment;
[0084] Figure 10c This is a schematic diagram of the mapping of interface elements in one embodiment;
[0085] Figure 10d This is a schematic diagram of the conversion logic in a specific embodiment;
[0086] Figure 11 This is a schematic diagram of the page switching process in one embodiment;
[0087] Figure 12 This is a flowchart illustrating the application of the startup method in one embodiment;
[0088] Figure 13 This is a schematic diagram of the conversion framework in a specific embodiment;
[0089] Figure 14 This is a schematic diagram of the conversion logic in a specific embodiment;
[0090] Figure 15 This is a schematic diagram of public data status management in a specific embodiment;
[0091] Figure 16 This is a schematic diagram illustrating data state synchronization and updating in a specific embodiment;
[0092] Figure 17 This is a schematic diagram of the framework communication mechanism in a specific embodiment;
[0093] Figure 18 This is a schematic diagram of a social sharing application page in a specific embodiment;
[0094] Figure 19 This is a schematic diagram of the interactive functions of a page in a specific embodiment;
[0095] Figure 20 This is a schematic diagram of the exit interface of the blackboard application in a specific embodiment;
[0096] Figure 21 This is a schematic diagram of the application startup process in a specific embodiment;
[0097] Figure 22 This is a schematic diagram of the application scenario in a specific embodiment;
[0098] Figure 23 This is a structural block diagram of a data processing device in a specific embodiment;
[0099] Figure 24 This is a structural block diagram of the application of the starting device in a specific embodiment;
[0100] Figure 25 This is an internal structural diagram of a computer device in one embodiment;
[0101] Figure 26 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0102] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0103] The data processing method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 receives a page generation instruction, which carries a page identifier; it obtains the corresponding H5 page information based on the page identifier and obtains the current device information; it parses the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data; it identifies the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules; it converts the H5 page component information, H5 page layout information, and H5 page style rules according to preset native data format conversion rules to obtain native page structure data; it renders the page based on the native page structure data to obtain and display the native page. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0104] In one embodiment, such as Figure 2 As shown, a data processing method is provided, which can be applied to... Figure 1 Taking a terminal as an example, it can be understood that this method can also be applied to terminals, and can also be applied to systems that include terminals and servers, and is implemented through the interaction between the terminal and the server. In this embodiment, the following steps are included:
[0105] Step 202: Receive the page generation instruction, which carries the page identifier.
[0106] The page identifier uniquely identifies the page and can be a page address, page name, page number, etc. This page can be a page within an H5 application. It possesses cross-platform capability, meaning it can be generated and displayed on various operating system platforms. Operating system platforms refer to the terminals running operating systems, which include desktop operating systems and mobile operating systems, as well as HarmonyOS. Desktop operating systems include Windows (Microsoft's operating system), Linux (an open-source operating system), etc. Mobile operating systems include Android and iOS (Apple's operating system, etc.). This page can be developed using a framework that converts H5 pages into native rendering at runtime.
[0107] Specifically, the terminal receives the page generation instruction, which can occur when a user clicks a page entry point, and the terminal responds to the click by receiving the instruction. The page entry point refers to the point of entry into the page, which can be displayed to the user in a clickable form such as a button or link. When the page is the start page of an H5 application, the page entry point can also be the H5 application's entry point. The page generation instruction carries a page identifier.
[0108] Step 204: Obtain the corresponding H5 page information based on the page identifier, and obtain the current device information.
[0109] H5 page information refers to the information required to generate an H5 page, including page resource information and page data. Page resource information refers to the resources needed to generate the page, which may include basic resources, image resources, component resources, JS resources, CSS resources, etc. Page data refers to the data within the page. Current device information refers to the operating system information of the current terminal device, which may include the operating system name, version, etc.
[0110] Specifically, the terminal can retrieve the corresponding H5 page information from its local memory based on the page identifier. This H5 page information may be pre-loaded into the terminal. Alternatively, the terminal can send a page information retrieval request to the server, carrying the page identifier, and then retrieve the H5 page information returned by the server. The terminal then obtains its current device information, specifically its own operating system information.
[0111] In a specific embodiment, H5 page information can be the information obtained after packaging the page using Vue (Vue is a progressive framework for building user interfaces. Unlike other large frameworks, Vue is designed to be applied layer by layer from the bottom up. Vue's core library only focuses on the view layer, making it easy to learn and integrate with third-party libraries or existing projects), including compressed packages of basic page resources, page data, and page business resources, etc.
[0112] Step 206: Parse the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data.
[0113] In this context, H5 page structure data refers to the virtual DOM tree corresponding to the H5 page. DOM stands for Document Object Model, a standard interface specification defined by the W3C, and a standard API for processing HTML and XML files. The DOM provides an access model for the entire document, treating it as a tree structure where each node represents an HTML tag or a text item within a tag. The DOM tree structure precisely describes the interrelationships between tags in an HTML document.
[0114] Specifically, the terminal determines the current operating environment based on the current device information. Different operating systems have different operating environments. Then, the terminal parses the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data.
[0115] In one specific implementation, if the current device information refers to the iOS operating system, the H5 page information can be parsed using the JSCore runtime environment (JavaScriptCore is an important component of WebKit, primarily responsible for parsing and providing an execution environment for JavaScript). If the current device information refers to the Android operating system, the H5 page information can be parsed using the V8 runtime environment (Chrome's JavaScript engine). This yields the H5 page structure data. In other words, in Vue, the function template is used to obtain a virtual DOM tree through rendering functions.
[0116] Step 208: Identify H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Convert the H5 page component information, H5 page layout information, and H5 page style rules into their original data format according to preset native data format conversion rules to obtain native page structure data.
[0117] H5 page generation information refers to the information needed to generate an H5 page, including H5 page component information, H5 page layout information, H5 page style rules information, etc. Preset native data format conversion rules refer to pre-set rules for converting data formats; specifically, data format conversion means converting the H5 page's data format to the native page's data format. The native page's data format refers to the format corresponding to the data used to generate the native page. A native page refers to a page within a native application. Native page structure data refers to the data used when generating the native page.
[0118] Specifically, the terminal identifies the H5 page structure data, obtaining H5 page component information, H5 page layout information, H5 page style rule information, etc., corresponding to the H5 page. Then, it converts this information according to preset native data format conversion rules to obtain component information, page layout information, and style rule information in native data format, thus obtaining the native page structure data. In one specific embodiment, the virtual DOM parsed by Vue is converted according to preset native data format conversion rules to obtain a Flutter widget structure tree. Flutter is an open-source user interface (UI) toolkit, and widgets are used to describe the configuration data of a UI element. By performing the conversion during page generation, the page gains cross-platform capability and the ability to retain dynamic updates. This avoids the problem of converting H5 page information during development and then using the converted page information during page generation, which would compromise dynamic updates and cross-platform compatibility.
[0119] Step 210: Render the page based on the native page structure data to obtain and display the native page.
[0120] Specifically, the native page is rendered by using native page structure data, that is, the UI layout and style are restored according to the native page structure data. When the rendering is complete, the terminal displays the original page.
[0121] In the above data processing method, the corresponding H5 page information and the current device information are obtained when the page is generated. The H5 page information is parsed in the running environment corresponding to the current device information to obtain H5 page structure data. Then, the H5 page structure data is identified to obtain H5 page component information, H5 page layout information, and H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are converted into data formats according to preset native data format conversion rules to obtain native page structure data. The native page structure data is used for page rendering to obtain and display the native page. That is, by converting H5 page information into native page structure data for page rendering, the native page is obtained, thereby improving the page loading speed and thus improving the running performance of H5 applications.
[0122] In one embodiment, step 202, namely receiving a page generation instruction, which carries a page identifier, includes the following steps:
[0123] The target application receives a page generation instruction, which carries a target page identifier. The target page identifier is used to uniquely identify the page in the H5 application, which is a built-in application within the target application.
[0124] The target application refers to an application that has an H5 application built in. This target application can be a native application, which is an application that can run directly on the current operating system. An H5 application is a web application that needs to be run through a browser.
[0125] Specifically, when a user wants to access a page in an H5 application within the target application, they do so by clicking a page button or link in the H5 application within the target application. This causes the terminal to receive a page generation instruction within the target application. This instruction carries a target page identifier associated with the page button or link. The terminal obtains the corresponding H5 page information of the H5 application based on the target page identifier, and also obtains the current device information. Within the runtime environment corresponding to the current device information, the terminal parses the H5 page information of the H5 application to obtain H5 page structure data. It then identifies the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. These data are then converted according to preset native data format conversion rules to obtain native page structure data. Finally, the page is rendered based on the native page structure data to obtain and display the native page. This improves the loading speed of pages within the built-in H5 application within the target application, thereby enhancing the user experience.
[0126] In one specific embodiment, the target application can be a WeChat application, and the H5 application can be an H5 application within the workbench function. When a user uses the workbench function of the target application, they can use various H5 applications. When a user clicks the name button of an H5 application, the terminal receives an instruction to enter the homepage of the H5 application. This instruction carries the page address associated with the name button of the H5 application. Then, based on the page address, the H5 page information and current device information are obtained. The H5 page information is parsed in the runtime environment corresponding to the current device 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 H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are converted into their original data format according to preset native data format conversion rules to obtain native page structure data. Based on the native page structure data, the page is rendered to obtain the native page and displayed. In one specific embodiment, the target application can also be a WeChat application, and the H5 application can be a mini-program application within the WeChat application. This mini-program application is an application developed using a framework that converts H5 pages into native rendering at runtime.
[0127] In one embodiment, H5 page information includes H5 page basic resource information, H5 page business resource information, and H5 page data;
[0128] Step 204 involves obtaining the corresponding H5 page information based on the page identifier, including the following steps:
[0129] Based on the page identifier, retrieve the corresponding H5 page basic resource information, H5 page business resource information, and H5 page data from memory, and load the H5 page basic resource information, H5 page business resource information, and H5 page data.
[0130] H5 page basic resource information refers to the initial basic environment configuration information corresponding to the H5 page, which can be stored in the terminal in the form of a compressed package. H5 page business resource information refers to the resource information of the business developed using a framework that converts the H5 page into native rendering at runtime, which can include CSS resources, JS resources, image resources, and other resources, etc., and can also be stored in the terminal in the form of a compressed package. H5 page data refers to the information stored in the H5 page on the terminal, such as cookies (data stored on the user's local terminal).
[0131] Specifically, the terminal stores basic H5 page resource information, H5 page business resource information, and H5 page data. This basic H5 page resource information, H5 page business resource information, and H5 page data can be downloaded from the server in advance and can be dynamically updated in real time. When the terminal needs to generate a page, it retrieves the corresponding basic H5 page resource information, H5 page business resource information, and H5 page data from memory based on the page identifier, and loads these resources. This involves decompressing the compressed packages corresponding to the basic H5 page resource information and H5 page business resource information to obtain the basic H5 page resource information and H5 page business resource information for subsequent use.
[0132] In a specific embodiment, such as Figure 3 The diagram illustrates the process of obtaining H5 page information for an H5 application. When the terminal receives an instruction to open the H5 application, it loads basic resource information and business resource information to obtain the H5 application's homepage data. This data is then used to generate the homepage, thus opening the H5 application and displaying the homepage. In this embodiment, the H5 application is developed using a framework that converts H5 pages into native rendering at runtime. This framework achieves a near-native experience for H5 applications, providing near-native opening speeds, faster data loading speeds, near-native transition animations, better integration with native features, and more stable and reliable network channels. This satisfies the needs of flexible and frequently updated business requirements while also providing a better user experience and performance for the H5 application.
[0133] In one embodiment, such as Figure 4 As shown, the system retrieves the corresponding H5 page basic resource information from memory based on the page identifier and loads the H5 page basic resource information, including:
[0134] Step 402: Obtain the corresponding basic resource storage path based on the page identifier. If the basic resource information of the H5 page is not found according to the basic resource storage path, send an H5 page basic resource information download request to the server. The H5 page basic resource information download request carries the page identifier.
[0135] Among them, the basic resource storage path refers to the storage path of basic resource information on the local terminal.
[0136] Specifically, the terminal can locate the corresponding basic resource storage path based on the pre-set association between the page identifier and the basic resource storage path. If the H5 page basic resource information is not found according to the basic resource storage path, it means that the terminal does not store the H5 page basic resource information corresponding to that page identifier. In this case, the terminal needs to download it from the server, that is, it can send an H5 page basic resource information download request to the server, and the H5 page basic resource information download request carries the page identifier.
[0137] Step 404: Obtain the basic resource information of the H5 page returned by the server and save it according to the basic resource storage path.
[0138] Specifically, when the server receives a request from the terminal to download basic H5 page resource information, it locates the corresponding latest version of the basic H5 page resource information based on the page identifier and returns the found latest version of the basic H5 page resource information to the server. The terminal receives the basic H5 page resource information returned by the server and saves the basic H5 page resource information according to the basic resource storage path.
[0139] Step 406: Locate the basic resource information of the H5 page from the basic resource storage path, compare the version information corresponding to the basic resource information of the H5 page with the version information corresponding to the preset basic resource information of the H5 page, and load the basic resource information of the H5 page when the version information corresponding to the basic resource information of the H5 page is greater than the version information corresponding to the preset basic resource information of the H5 page.
[0140] The preset H5 page basic resource information refers to the pre-downloaded, fallback version of the H5 page basic resource information stored in the terminal. Version information is used to identify the version corresponding to the H5 page basic resource information, and may include version number, version name, etc.
[0141] Specifically, since the terminal may fail to save the basic resource information of the H5 page, it searches for the basic resource information again from the basic resource storage path. If the basic resource information is found, it indicates successful saving. At this point, the version information corresponding to this basic resource information is compared with the version information corresponding to the preset basic resource information. If the version information is greater than the preset version information, it means the basic resource information is the latest version, and the terminal loads it. If the version information is less than the preset version information, it means the preset basic resource information is the latest version, and the terminal loads it.
[0142] In a specific embodiment, such as Figure 5 The diagram illustrates the process of loading basic resource information for an H5 page. Specifically: The terminal searches for the basic resource information for the H5 page corresponding to the page identifier in the database (DB). If not found, the terminal constructs a storage address for the basic resource information and retrieves it from the server, storing it in that address. Since storing the basic resource information may fail, the terminal needs to verify successful storage. The terminal then searches for the corresponding basic resource information again based on the storage path. If not found, it downloads and saves the basic resource information from the server. Again, due to the possibility of download failure, the terminal searches for the corresponding basic resource information based on the storage path. When found, the terminal compares the version information of the current basic resource information with the fallback version information corresponding to a preset basic resource information. If the version information is the latest version, the current basic resource information is loaded; if the fallback version information is the latest version, the preset basic resource information is loaded. If the page cannot be found, the basic resource information of the H5 page corresponding to the fallback version will be used for loading. This prevents page loading failure and improves user experience.
[0143] In one embodiment, such as Figure 6 As shown, the corresponding H5 page business resource information is retrieved from memory based on the page identifier, and then loaded, including:
[0144] Step 602: Obtain the corresponding business resource storage path based on the page identifier. If the H5 page business resource information is not found according to the business resource storage path, send an H5 page business resource information download request to the server. The H5 page business resource information download request carries the page identifier.
[0145] Among them, the business resource storage path refers to the storage path of H5 page business resource information on the local terminal.
[0146] Specifically, the terminal can find the business resource storage path and basic resource information corresponding to the page identifier from the page configuration file. The page configuration file can be downloaded and saved from the server in advance. The terminal can also find the corresponding basic resource storage path based on the pre-set association between the page identifier and the business resource storage path. When the H5 page business resource information is not found according to the business resource storage path, it means that the terminal does not store the H5 page business resource information corresponding to the page identifier. In this case, the terminal needs to download it from the server, that is, it can send an H5 page business resource information download request to the server, and the H5 page business resource information download request carries the page identifier.
[0147] Step 604: Obtain the H5 page business resource information returned by the server and save it according to the business resource storage path.
[0148] Specifically, when the server receives a request from the terminal to download H5 page service resource information, it locates the corresponding latest version of the H5 page service resource information based on the page identifier and returns the found latest version of the H5 page service resource information to the server. The terminal receives the H5 page service resource information returned by the server and saves the H5 page service resource information according to the service resource storage path.
[0149] Step 606: Locate the H5 page business resource information from the business resource storage path, compare the target version information corresponding to the H5 page business resource information with the preset version information corresponding to the preset H5 page business resource information, and load the H5 page business resource information when the target version information corresponding to the H5 page business resource information is greater than the preset version information corresponding to the preset H5 page business resource information.
[0150] The target version information refers to the version information of the H5 page business resources downloaded from the server. The preset version information refers to the version information corresponding to the preset H5 page business resources. The preset H5 page business resources refer to the H5 page business resources that have been downloaded from the server and saved in the terminal in advance.
[0151] Specifically, since the terminal may fail to save H5 page service resource information, it needs to re-verify whether the H5 page service resource information is stored. That is, the terminal searches for the H5 page service resource information again from the service resource storage path. When the H5 page service resource information is found, it indicates successful saving. At this point, 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. If the target version information is greater than the preset version information, it means the H5 page service resource information is the latest version, and the terminal loads it. If the target version information is less than the preset version information, it means the preset H5 page service resource information is the latest version, and the terminal loads it. In other words, by comparing the target version information with the preset version information, the latest version of the H5 page service resource information is loaded, ensuring the generated page is the latest version and improving the user experience.
[0152] In a specific embodiment, such as Figure 7The diagram illustrates the process of loading H5 page business resource information. Specifically: The terminal searches for H5 page business resource information in the database. If no H5 page business resource information is found, a storage address corresponding to the H5 page business resource information is established. This address can be either a memory storage address or a cache storage address. When the H5 page business resource information is found, it checks whether the initial page configuration information exists. If so, the initial page configuration information is stored, and the main configuration data is used to retrieve the H5 page business resource information. In other words, the terminal checks whether the address (URL: Uniform Resource Locator) corresponding to the H5 page business resource information is the latest address. If it is not the latest address, the H5 page business resource information is downloaded from the latest address on the server and stored. Then, it checks again whether the address corresponding to the H5 page business resource information is consistent with the latest address. If they are consistent, it checks whether the H5 page business resource information exists in the storage path corresponding to the H5 page business resource information. Due to the possibility of storage failure, if the H5 page business resource information is not found in the storage path corresponding to the H5 page business resource information, the H5 page business resource information is downloaded from the server and saved. Next, it checks if the H5 page business resource information exists in the storage path corresponding to the H5 page business resource information. When the existence of H5 page business resource information is detected, it compares the version size of this H5 page business resource information with the built-in H5 page business resource information, and selects the H5 page business resource information with the larger version for loading, thereby generating the latest version of the page and improving the user experience.
[0153] In one embodiment, before step 202, i.e. before receiving the page generation instruction, which carries a page identifier, the following step is also included:
[0154] When an H5 page information download event is detected, an H5 page information download request is sent to the server, carrying a page identifier. The server then retrieves the H5 page information returned by the server, which is located by the page identifier. The H5 page information is saved according to the memory storage path corresponding to the page identifier.
[0155] The H5 page information download event refers to the event of pre-downloading H5 page information, which includes at least the event of the H5 page switching from the background to the foreground on the terminal, and the event of the terminal entering the associated page corresponding to the H5 page. The user can access the H5 page from the associated page, which can be the preceding page of the H5 page, or a page with a corresponding access link to the H5 page, etc. The memory storage path refers to the storage path of the H5 page information in the terminal's local memory.
[0156] Specifically, when the terminal detects that an H5 page information download event has been triggered, it sends an H5 page information download request to the server, which carries a page identifier; it then obtains the H5 page information returned by the server, which is found by the server based on the page identifier, saves the H5 page information according to the memory storage path corresponding to the page identifier, and can then delete historical H5 page information.
[0157] It can keep the information on H5 pages dynamically updated, thereby improving the user experience by maintaining the page's dynamic update capability.
[0158] In one embodiment, such as Figure 8 As shown, after step 210, that is, after rendering the page based on the native page structure data to obtain and display the native page, the process also includes:
[0159] Step 802: Send a silent update request for H5 page information to the server. The silent update request for H5 page information carries the page identifier.
[0160] Silent updates refer to information updates performed without the user's awareness.
[0161] Specifically, after displaying the native page, the terminal can silently update the H5 page information. That is, the terminal can send a silent update request for H5 page information to the server, and the silent update request for H5 page information carries the page identifier.
[0162] Step 804: Obtain the updated version information returned by the server. The updated version information is found by the server using the page identifier.
[0163] Among them, the updated version information refers to the version information corresponding to the H5 page information on the server, which is the latest version information.
[0164] Specifically, when the server receives a silent update request for H5 page information from the terminal, it finds the latest version of the corresponding H5 page information based on the page identifier and returns this latest version information to the terminal as the update version information to be updated. The terminal then obtains the update version information returned by the server.
[0165] Step 806: Obtain the local version information of the H5 page information corresponding to the page identifier, compare the updated version information with the local version information, and when the updated version information is inconsistent with the local version information, send an H5 page update information download request to the server. The H5 page update information download request carries the updated version information.
[0166] Among them, local version information refers to the version information corresponding to the H5 page information stored in the terminal memory.
[0167] Specifically, the terminal obtains the local version information of the H5 page information corresponding to the page identifier, compares the updated version information with the local version information, and if the updated version information is inconsistent with the local version information, it means that the H5 page information has been updated and needs to be updated in the terminal. At this time, the terminal uses the updated version information to send an H5 page update information download request to the server.
[0168] Among them, local version information refers to the version information corresponding to the H5 page information stored in the terminal memory.
[0169] Step 808: Obtain the H5 page update information returned by the server. The H5 page update information is found by the server based on the update version information. Save the H5 page update information and delete the H5 page information corresponding to the local version information.
[0170] H5 page update information refers to the updated H5 page information.
[0171] Specifically, when the server receives the H5 page update information download request sent by the terminal, it uses the update version information to find the corresponding H5 page update information, returns the H5 page update information to the terminal, the terminal obtains the H5 page update information, saves the H5 page update information, and deletes the H5 page information corresponding to the local version information.
[0172] In the above embodiments, the H5 page update information is downloaded to the terminal for storage through silent updates, and the H5 page information corresponding to the local version information is deleted. This enables the H5 page information on the terminal to be updated in a timely manner, thereby generating the latest version of the page and facilitating user use.
[0173] In a specific embodiment, such as Figure 9 The diagram illustrates the silent update process. The terminal can update the basic resource information of the H5 page. Specifically: During a silent update, the terminal retrieves the latest version information corresponding to the basic resource information of the H5 page from the server. This latest version information is compared with the local version information stored on the terminal. If the latest version information matches the local version information, it means the basic resource information of the H5 page stored on the terminal is the latest version, and no update is needed. If the latest version information does not match the local version information, it means the basic resource information of the H5 page has been updated. In this case, the terminal downloads the latest version information of the H5 page basic resource information from the server. Upon successful download, the latest version information of the H5 page basic resource information is saved to the terminal, and the historical H5 page basic resource information in the terminal is deleted. This historical H5 page basic resource information refers to H5 page basic resource information that has not been used on the front end and H5 page basic resource information that is not currently saved.
[0174] The terminal can also update H5 page service resource information. Specifically: During silent updates, the terminal retrieves the latest version information corresponding to the H5 page service resource information from the server and compares it with the local version information stored on the terminal. If the latest version information matches the local version information, it means that the H5 page service resource information stored on the terminal is the latest version, and no update is needed. If the latest version information does not match the local version information, it means that the H5 page service resource information has been updated. In this case, the terminal downloads the latest version information of the H5 page service resource information from the server. Upon successful download, the latest version information of the H5 page service resource information is saved to the terminal, and the historical H5 page service resource information in the terminal is deleted. This historical H5 page service resource information refers to H5 page service resource information that has not been used on the front end and H5 page service resource information that is not currently saved.
[0175] In one embodiment, such as Figure 10a As shown, after step 210, that is, after obtaining the corresponding H5 page information based on the page identifier and obtaining the current device information, the method further includes:
[0176] Step 1002: Start the first thread, the second thread, and the main thread.
[0177] The first thread is used for parsing. The second thread is used for data format conversion, and the main thread is used for page rendering and generation.
[0178] Specifically, the terminal starts the first thread, the second thread, and the main thread simultaneously.
[0179] Step 206 involves parsing the H5 page information within the operating environment corresponding to the current device information to obtain the H5 page structure data, including:
[0180] Step 1004: Use the first thread to parse the H5 page information in the runtime environment corresponding to the current device information to obtain the H5 page structure data.
[0181] Specifically, the terminal can first call the first thread to parse the H5 page information. When the parsing is complete, the H5 page structure data is obtained, and then the first thread sends the execution result to the second thread.
[0182] Step 208: Identify the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Convert the H5 page component information, H5 page layout information, and H5 page style rules according to preset native data format conversion rules to obtain native page structure data, including:
[0183] Step 1006: Use the second thread to identify H5 page structure data, obtain H5 page component information, H5 page layout information and H5 page style rules, and convert the H5 page component information, H5 page layout information and H5 page style rules into data format according to the preset native data format conversion rules to obtain native page structure data.
[0184] Specifically, when the second thread in the terminal obtains the H5 page structure data, it identifies the H5 page component information, H5 page layout information, and H5 page style rules. Then, it converts the H5 page component information, H5 page layout information, and H5 page style rules according to preset native data format conversion rules to obtain native page structure data. The second thread then sends the native page structure data to the main thread.
[0185] Step 210: Render the page based on the native page structure data to obtain and display the native page, including:
[0186] Step 1008: Use the main thread to render the page based on the native page structure data to obtain and display the native page.
[0187] Specifically, the terminal uses the native page structure data to render the page in the main thread to obtain the native page, and then the terminal displays the execution result of the main thread.
[0188] In a specific embodiment, such as Figure 10b The diagram illustrates thread processing. Under the current device's operating system (V8 or JSCore) executable environment, a JS thread parses the H5 page information (i.e., the compressed JS resource package). Then, a shadow thread uses the Lvcpp module to convert the parsed results according to preset native data format conversion rules, obtaining the native page structure data. Finally, the main thread uses the UI module and native modules to generate the native page. JSI (JavaScript Interface) is used to establish a mapping between JavaScript and Native. The encapsulated wxajs module is responsible for coordinating the data communication capabilities of each module. In a specific embodiment, as shown... Figure 10c The diagram illustrates the mapping of UI elements. The Vue.js file (H5 page information) is parsed by a JS thread, then converted according to preset native data format conversion rules to obtain the native page structure data. This involves WxaJS dynamically recognizing the JS structure and updating accordingly. The lvcpp module then uses the dart2cpp communication module to notify the Flutter widget structure tree of the structure tree for rendering, thus obtaining the native page. In a specific embodiment, as shown... Figure 10d The diagram shows the conversion logic. The terminal sends the virtual DOM tree obtained by parsing the JS resource compressed package, i.e., the H5 page information, to the Lvcpp module for conversion. The Lvcpp module identifies the component information, parses the CSS, and identifies the style rules and page layout, etc. Then it obtains the measurement value of the floating node, and converts it into a Flutter widgets tree to obtain the native page structure data.
[0189] In the above embodiments, the first thread parses the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data. The second thread identifies the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are converted into data formats according to preset native data format conversion rules to obtain native page structure data. The main thread then renders the page based on the native page structure data to obtain the native page and displays it, thereby improving the efficiency of page generation.
[0190] In one embodiment, step 206, which involves parsing the H5 page information in the operating environment corresponding to the current device information to obtain the H5 page structure data, includes the following steps:
[0191] In the operating environment corresponding to the current device information, perform abstract syntactic analysis on the H5 page information to obtain the abstract syntactic structure data of the H5 page; based on the abstract syntactic structure data of the H5 page, construct a virtual document object model tree to obtain the structure data of the H5 page.
[0192] Among them, the abstract syntax structure data of H5 page refers to the structure data of the abstract syntax tree corresponding to H5 page. The abstract syntax tree is a tree-like representation of the abstract syntax structure of the AST (abstract syntax tree) source code. Each node in the tree represents a structure in the source code.
[0193] Specifically, the terminal performs abstract syntactic analysis on the H5 page information within the operating environment corresponding to the current device information, obtaining a permutation of short strings. Then, it performs syntactic analysis on the permutation of short strings to obtain the abstract syntactic structure data of the H5 page. Finally, it uses the abstract syntactic structure data of the H5 page to construct a virtual document object model tree, obtaining the H5 page structure data; that is, it uses the AST of the H5 page to generate the Vdom (Virtual Document Object Model) tree.
[0194] In one embodiment, step 208 involves identifying H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules, and then converting the H5 page component information, H5 page layout information, and H5 page style rules into their original data format according to a preset native data format conversion rule to obtain the original page structure data.
[0195] Here, H5 page component information refers to the information about the components used to generate the page. H5 page layout information refers to the page layout information used to generate the page. H5 page style rules refer to the page style rules used to generate the page.
[0196] Specifically, the terminal identifies the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. It can also identify communication interfaces and node attributes from the H5 page structure data. Then, the H5 page component information, H5 page layout information, and H5 page style rules are converted to their original data format according to preset native data format conversion rules. The communication interfaces and node attributes can also be converted to their original data format to obtain the native initial page structure data. In other words, the H5 page generated using a framework that converts the H5 page runtime into native rendering converts all original document (document) native methods, DOM (Document Object Model) operations, and all access permissions of the JSAPI (JavaScript API) that originally depended on the webpage view to their original data format.
[0197] In the above embodiments, by identifying H5 page structure data, H5 page component information, H5 page layout information, and H5 page style rules are obtained. Then, the data is converted according to preset native data format conversion rules to obtain native page structure data, which makes the obtained native page structure data more accurate.
[0198] In one embodiment, after step 210, that is, after rendering the page based on the native page structure data to obtain and display the native page, the following step is also included:
[0199] The system detects and triggers a page information preloading event, responds to the event to obtain the addresses of each preloaded page, downloads the corresponding page information from the server based on the preloaded page address, and stores the page information in the cache.
[0200] Here, "page switching" refers to the page displayed after switching from the original page. "Page switching information" refers to the page information corresponding to the switched page. The "page switching information preload event" refers to the event that loads the page information corresponding to the switched page.
[0201] Specifically, the terminal detects a pre-loading event for page switching information. This can be triggered automatically when the native page finishes displaying, or triggered after the terminal receives a user action through the displayed native page. User actions can include clicks, presses, etc. Alternatively, the pre-loading event can be triggered when a pre-set trigger condition is met. This pre-set trigger condition could be that the user remains on the native page for a certain period, such as 2 minutes, after which the pre-loading event is automatically triggered.
[0202] In one embodiment, such as Figure 11 As shown, 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 process also includes:
[0203] Step 1102: Receive the page switching instruction through the native page, and obtain the target page address based on the page switching instruction.
[0204] The target page address refers to the address of the page to which you want to switch.
[0205] Specifically, the terminal receives a page switching instruction when it receives a user's page switching operation. This user page switching operation can be a swipe operation, such as a swipe down, swipe up, swipe left, or swipe right. The terminal then obtains the target page address based on the page switching instruction. The association between swipe operations and page addresses can be pre-set; for example, a swipe operation can be associated with a target page address. In one embodiment, different swipe operations can be associated with different page addresses. For example, a swipe down, swipe up, swipe left, or swipe right can each be associated with a corresponding page address. The specific direction of the swipe operation then determines the corresponding page address. In another embodiment, the user page switching operation can be other operations, such as a press or click.
[0206] Step 1104: Based on the target switching page address, retrieve the corresponding target switching page information from the cache, parse the target switching page information in the runtime environment corresponding to the current device information, and obtain the switching H5 page structure data.
[0207] Among them, "target switching page information" refers to the page information of the target switching page. The target switching page is the page corresponding to the address of the target switching page. "Switching H5 page structure data" refers to the H5 page structure data corresponding to the target switching page.
[0208] Specifically, the terminal pre-caches the page information of the switching page. At this time, the terminal directly looks up the corresponding target switching page information from the cache according to the target switching page address, and then parses the target switching page information in the running environment corresponding to the current device information to obtain the switching H5 page structure data.
[0209] Step 1106: Identify the H5 page structure data to obtain the H5 page component information, H5 page layout information, and H5 page style rules. Then, convert the H5 page component information, H5 page layout information, and H5 page style rules according to the preset native data format conversion rules to obtain the native page structure data.
[0210] Specifically, "Switch H5 page component information" refers to the component information corresponding to the H5 page to be switched; "Switch H5 page layout information" refers to the page layout information corresponding to the H5 page to be switched; "Switch H5 page style rules" refers to the page style rules corresponding to the H5 page to be switched; and "Switch native page structure data" refers to the native page structure data corresponding to the target page to be switched.
[0211] Specifically, the terminal also converts the H5 page component information, H5 page layout information, and H5 page style rules corresponding to the target switching page into native page structure data according to preset native data format conversion rules.
[0212] Step 1108: Render the page based on the switching native page structure data to obtain the switching native page and display it through a switching animation.
[0213] Among them, transition animation refers to the animation effect when switching between pages.
[0214] Specifically, the terminal uses the switching native page structure data to render the page and obtain the switching native page, and then switches through the switching animation to make the terminal display the target switching page.
[0215] In the above embodiments, the terminal receives a page switching instruction through the native page, obtains the target switching page address according to the page switching instruction, searches for the corresponding target switching page information in the cache based on the target switching page address, obtains the switching native page structure data based on the target switching page information, and uses the switching native page structure data to display the target switching page, thereby improving the switching efficiency of the target switching page, enabling the H5 webpage to achieve the effect of native network switching, and improving the user experience.
[0216] In one embodiment, after step 210, that is, after rendering the page based on the native page structure data to obtain and display the native page, the following steps are included:
[0217] When an anomaly is detected in the data communication channel, a long-connection message channel reconnection request is sent to the server. The long-connection message channel reconnection request carries the terminal identifier. The server re-establishes the long-connection message channel based on the long-connection message channel reconnection request and the terminal corresponding to the terminal identifier.
[0218] An anomaly in the data communication channel refers to an error in the long-term connection message channel established between the terminal and the server. For example, when network fluctuations occur, the data communication channel may become abnormal. The terminal identifier is used to uniquely identify the terminal.
[0219] Specifically, after displaying the native page, the terminal can establish a persistent connection message channel with the server for data communication. When the terminal detects an anomaly in the data communication channel, it can send a persistent connection message channel reconnection request to the server, carrying the terminal identifier. The server then re-establishes the persistent connection message channel with the terminal corresponding to the terminal identifier based on the persistent connection message channel reconnection request. In other words, when the terminal's data communication channel becomes abnormal, the terminal can reconnect, ensuring the stability of the network channel.
[0220] In one embodiment, such as Figure 12 As shown, an application launch method is provided, which is applied to... Figure 1 Taking a terminal as an example, it can be understood that this method can also be applied to terminals, and can also be applied to systems that include terminals and servers, and is implemented through the interaction between the terminal and the server. In this embodiment, the following steps are included:
[0221] Step 1202: Receive the built-in application launch instruction in the target application. The built-in application launch instruction carries the built-in application identifier. Obtain the corresponding built-in application start page identifier based on the built-in application identifier.
[0222] In this context, "target application" refers to a native application that includes an H5 application. "Built-in application" refers to an H5 application embedded within the target application. Multiple built-in applications can be embedded within the target application. The built-in application identifier uniquely identifies the built-in application and can be its name, address, or ID, etc. The built-in application start page identifier uniquely identifies the starting webpage within the built-in application; the starting webpage is the homepage of the built-in application and can be a webpage address. Built-in applications are applications developed using frameworks that convert H5 pages into native rendering at runtime.
[0223] Specifically, when a user uses the target application, they can use the built-in application. That is, the user can operate within the display page of the built-in application in the target application. When the user selects the built-in application to use, the terminal receives the built-in application launch command within the target application, obtains the corresponding built-in application start page identifier based on the built-in application identifier, and can download and save the configuration information of the built-in application from the server when the target application launches. This configuration information contains the mapping relationship between the built-in application identifier and the built-in application start page identifier. Alternatively, the terminal can download and save the configuration information of the built-in application from the server when the user enters the display page of the built-in application within the target application.
[0224] Step 1204: Obtain the corresponding built-in application H5 start page information based on the built-in application start page identifier, and obtain the current device information.
[0225] Among them, the H5 start page information of the built-in application refers to the H5 page information corresponding to the start page of the built-in application.
[0226] Specifically, the configuration information of the built-in applications obtained by the terminal also includes the H5 start page information of the built-in applications. The terminal can directly find the H5 start page information of the built-in application corresponding to the built-in application start page identifier from the saved configuration information. Then, the terminal detects the operating system information corresponding to the current device.
[0227] Step 1206: Parse the H5 start page information of the built-in application in the operating environment corresponding to the current device information to obtain the H5 start page structure data of the built-in application.
[0228] Among them, the H5 start page structure data of the built-in application refers to the H5 page structure data corresponding to the start page of the built-in application.
[0229] Specifically, different current device information corresponds to different operating environments. The built-in application H5 start page information is parsed in the operating environment corresponding to the current backup information of the terminal to obtain the built-in application H5 start page structure data.
[0230] Step 1208: Identify the built-in application H5 start page structure data to obtain the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules. Convert the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules according to the preset native data format conversion rules to obtain the built-in application native start page structure data.
[0231] The embedded application H5 start page generation information refers to the H5 page generation information corresponding to the start page of the embedded application, including the H5 start page component information, H5 start page layout information, and H5 start page style rules. The embedded application native start page structure data refers to the native page structure data corresponding to the start page of the embedded application.
[0232] Specifically, the terminal runs the H5 page runtime into a native rendering framework to identify the built-in application H5 start page structure data, obtain the built-in application H5 start page component information, H5 start page layout information and H5 start page style rules, and then convert the built-in application H5 start page component information, H5 start page layout information and H5 start page style rules according to the preset native data format conversion rules to obtain the built-in application native start page structure data.
[0233] Step 1210: Render the page based on the native start page structure data of the built-in application to obtain the native start page of the built-in application and display the start page of the built-in application in the target application.
[0234] Specifically, the terminal generates the page by rendering and drawing the native start page structure data of the built-in application using the data, and then displays the start page of the built-in application in the target application. In one specific embodiment, the page in the built-in application can be obtained using any of the above data processing methods. The page in the built-in application can be the homepage or a page other than the homepage.
[0235] The proposed application launch method involves receiving a built-in application launch command from the target application, retrieving the corresponding built-in application H5 start page information based on the built-in application start page identifier, and obtaining current device information. Within the operating environment corresponding to the current device information, the built-in application H5 start page information is parsed to obtain the built-in application H5 start page structure data. This structure data is then identified to obtain the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules. These components, layout, and style rules are then converted according to preset native data format conversion rules to obtain the built-in application native start page structure data. Based on this native start page structure data, page rendering is performed to obtain the built-in application native start page, which is then displayed in the target application. In other words, when the built-in application launches, the H5 start page information corresponding to the built-in application start page is converted into native start page structure data, and then the page is rendered to obtain and display the built-in application native start page. This improves the loading speed of the built-in application native start page, thereby increasing the launch speed of the built-in application and ultimately improving its overall performance.
[0236] In a specific embodiment, such as Figure 13 The diagram illustrates the overall process of a built-in application using a framework to convert an H5 page into native rendering at runtime. Specifically, the H5 page information generated using the Vue framework is parsed within the JSCore (JavaScriptcore) and V8 executable JS environments to obtain the AST and VDom structures. These are then identified to define the communication interfaces, conventions, components, and properties used in the framework conversion, and converted into Flutter Widget rendering components. These Flutter Widget components are then used for page rendering, resulting in the native page of the built-in application for display. Furthermore, the built-in application can implement native storage, native network communication, native permission control, and native development interfaces through native modules. This allows the built-in application to achieve a native application experience, avoiding the performance issues associated with H5 applications. In a specific embodiment, such as... Figure 14 The diagram illustrates the conversion logic of the built-in application. When the built-in application, developed using a framework that converts H5 pages to native rendering, uses Vue Runtime (which only includes the runtime version, not the compiler) to parse H5 page information, it converts all original native methods of components dependent on the webpage view, DOM operations, and JS interfaces. Flutter handles the rendering, while C++ coordinates the communication between JS and Native. In a specific embodiment, as shown... Figure 15 The diagram illustrates the Store (public data state management) provided during the development of a built-in application. Through the Store, the built-in application, i.e., a lightweight application (LitrApp), can manage and maintain data across different pages, as well as update its state. It also provides data state sharing and management capabilities between Native and H5 pages. In a specific embodiment, such as... Figure 16 The diagram illustrates data state synchronization and updates for public data state management. It establishes a common bridge between Flutter and H5, converting H5 page runtime to native rendering, to connect the Store with the view layer Flutter components and the H5 business side for data state synchronization and updates. Built-in application 1 can synchronize and update its data state with its Store via an interface, or with the Store of built-in application 2 if access permissions are granted. In a specific embodiment, as shown... Figure 17The diagram illustrates the communication mechanism between the framework that converts H5 pages to native rendering and the JSAPI. The JSI framework provides non-intrusive script library management and comprehensive support for front-end development debugging, documentation parsing, template compilation, and packaging / export. This framework is responsible for JS script management and parsing, as well as communication with wxajs (a C++ module), JNI (Java Native Interface, which ensures code portability across different platforms), and OC (the iOS development language). wxajs provides the framework's underlying capabilities, including XLog (logging system), WCDB (storage module), WSS (WebSocket long-connection communication module), and Cronet (short-connection network communication module). The communication between JNI and OC primarily facilitates communication and connectivity between Android and iOS modules.
[0237] In one embodiment, prior to step 1202, i.e. before receiving the built-in application launch instruction in the target application, the method further includes:
[0238] Upon detecting a built-in application resource information update event, the system responds by sending a built-in application resource information update retrieval request to the server, which carries the built-in application identifier. The system retrieves the built-in application resource information update returned by the server, saves the updated information, and deletes the historical resource information of the built-in application corresponding to the built-in application identifier.
[0239] Among them, the built-in application resource information update event refers to the event that updates the basic resource information and business resources corresponding to the built-in application.
[0240] Specifically, the terminal can trigger a built-in application resource information update event when the target application enters the built-in application display page. In response to this event, the terminal sends a built-in application resource information update retrieval request to the server, carrying a built-in application identifier. If the target application has multiple built-in application identifiers, updates can be performed simultaneously; that is, the built-in application resource information update retrieval request can carry multiple different built-in application identifiers. The server uses each built-in application identifier to find the corresponding built-in application update resource information based on the request. The terminal retrieves the server-returned built-in application update resource information, saves it, and deletes the historical resource information of the built-in application corresponding to the built-in application identifier. In one embodiment, the terminal can also obtain the resource information version information returned by the server based on the built-in application identifier, compare it with the local source information version information, and if the version information is inconsistent, retrieve the returned built-in application update resource information from the server, save it, and delete the historical resource information of the built-in application corresponding to the built-in application identifier. If the resource information version information is consistent with the local source information version information, no processing is performed.
[0241] In the above embodiments, by detecting the triggering of a built-in application resource information update event, obtaining the built-in application update resource information, saving the built-in application update resource information, and deleting the built-in application historical resource information corresponding to the built-in application identifier, the resource information can be updated in real time, keeping the running application up-to-date and improving the user experience.
[0242] In one embodiment, the built-in application includes a social sharing application; after step 1210, after rendering the page based on the native start page structure data of the built-in application to obtain the native start page of the built-in application and displaying the start page of the built-in application in the target application, the process includes:
[0243] Receive a reply command to a social sharing message on the start page, and display the native reply interaction window based on the reply command. Obtain the reply message through the native reply interaction window and display the reply message on the start page.
[0244] Social sharing applications refer to applications used for social interaction and information sharing. For example, forum applications provide posting functions for information sharing and interaction, and blackboard applications use posting functions for information sharing and interaction. Social sharing messages refer to information shared by other users displayed on the start page. Native reply interaction windows refer to native pop-ups used for replying to messages.
[0245] Specifically, users can communicate within social sharing applications. The terminal receives reply instructions for social sharing messages on the start page and displays a native reply interaction window based on these instructions. Users can input their reply messages through the native reply interaction window. When input is complete, the terminal retrieves the reply message through the native reply interaction window and displays it on the start page.
[0246] In a specific embodiment, such as Figure 18 The image shown is a screenshot of a social sharing application, specifically a blackboard application. Users can create blackboards to share information with all users on that blackboard. Figure 18 Page A is the page for displaying social sharing messages. Figure 18 Page B is the display page for the native reply interaction window. Users can click the input frame on page A, and the terminal receives the reply instruction, displaying page B accordingly. The terminal obtains the reply message entered by the user via the keyboard through page B and displays the reply message on the initial page. In a specific embodiment, the social sharing application can interact with the target application. For example, when a user right-clicks a social sharing message on the initial page, interactive functions for interacting with the target application can be displayed. When the target application is an instant messaging application, such as... Figure 19 The image shows a schematic diagram of the interactive functions on the social sharing application. Users can select interactive functions to engage with the application. These interactive functions include selecting emoticons, copying, replying, and forwarding. Users can also access files, emoticons, documents, and other data saved in the target application within the social sharing application and use them there. In one embodiment, such as... Figure 20 The image shows a diagram of the exit interface for the WeChat Work application. The diagram illustrates the description of the WeChat Work application, its members, and other interactive functions. Users can exit the WeChat Work application by clicking the "Exit WeChat Work" button.
[0247] In one embodiment, such as Figure 21 As shown, an application launch method is provided, which specifically includes the following steps:
[0248] Step 2102: In the target application, a built-in application resource information update event is detected. In response to the built-in application resource information update event, a built-in application update resource information acquisition request is sent to the server. The built-in application update resource information acquisition request carries the built-in application identifier.
[0249] Step 2104: Obtain the built-in application update resource information returned by the server, save the built-in application update resource information and delete the built-in application historical resource information corresponding to the built-in application identifier.
[0250] Step 2106: Receive the built-in application launch instruction in the target application. The built-in application launch instruction carries the built-in application identifier. Obtain the corresponding built-in application start page identifier based on the built-in application identifier.
[0251] Step 2108: Based on the application start page identifier, retrieve the corresponding H5 page basic resource information, H5 page business resource information, and H5 page data from memory, load the H5 page basic resource information, H5 page business resource information, and H5 page data, and obtain the current device information.
[0252] Step 2110: Start the first thread, the second thread, and the main thread. Use the first thread to parse the basic resource information and business resource information of the H5 page in the running environment corresponding to the current device information to obtain the structure data of the built-in application H5 start page.
[0253] Step 2112: Identify the built-in application H5 start page structure data to obtain the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules. Convert the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules according to the preset native data format conversion rules to obtain the built-in application native start page structure data.
[0254] Step 2114: Render the page based on the native start page structure data of the built-in application and the H5 page data to obtain the native start page of the built-in application and display the start page of the built-in application in the target application.
[0255] Step 2116: Send a silent update request for H5 page information to the server. This request carries a page identifier. Retrieve the updated version information returned by the server; this updated version information is retrieved by the server using the page identifier.
[0256] Step 2118: Obtain the local version information of the H5 page information corresponding to the application start page identifier, compare the updated version information with the local version information, and when the updated version information is inconsistent with the local version information, send an H5 page update information download request to the server. The H5 page update information download request carries the updated version information.
[0257] Step 2120: Obtain the H5 page update information returned by the server. The H5 page update information is found by the server based on the update version information. Save the H5 page update information and delete the H5 page information corresponding to the local version information.
[0258] This application also provides an application scenario in which the above-described application startup method is applied. Specifically,
[0259] This application launch method is used in built-in applications within WeChat Work, such as... Figure 22 The diagram shown illustrates the specific framework of the application scenario. Specifically:
[0260] The scaffolding is used to initialize the basic environment configuration, compile, package, and publish the built-in application project to the resource management system. The Enterprise WeChat application backend, i.e., the Enterprise WeChat server, establishes a link with the resource publishing system through the general backend access (AE) module of the resource management system. The resource publishing system maintains a shared database of built-in application resource packages, and can obtain resource package update information and update the saved resource packages through an interface. The Enterprise WeChat application backend can obtain the latest version of the business resource package and basic resource package from the resource publishing system through the built-in application identifier. The Enterprise WeChat application backend obtains the configured business entry identifier of the built-in application and then distributes the configuration information of the built-in application. This configuration information may include the business entry identifier, resource package download address, built-in application homepage path, etc. The distribution of the built-in application's resource package can also be controlled through canary releases. The Enterprise WeChat application frontend can download the built-in application resource information through the configuration information distributed by the server and can also obtain the latest resource package information of the built-in application from the resource publishing system. Then, when a user wants to launch the built-in application, the resource package of the built-in application, which is pre-fetched and stored by the front end of the WeChat application, is obtained. This built-in application can be a Vue project application. The resource package is then decompressed to obtain the corresponding specified page information, such as H5 start page information, i.e., Vue.js. Next, the current device information is obtained; the built-in application H5 start page information is parsed in the runtime environment corresponding to the current device information to obtain the built-in application H5 start page structure data; the built-in application H5 start page structure data is identified to obtain the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules. The built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules are converted according to preset native data format conversion rules to obtain the built-in application native start page structure data, i.e., Vue is converted into Flutter Widget components for FlutterView rendering to obtain and display the start page. In a specific embodiment, the application launch method can also be applied to built-in applications within the WeChat application. That is, the WeChat application is also connected to the resource publishing system, and the WeChat application can obtain the resource package of the built-in application and then use the built-in application's resource package to generate pages. The WeChat application backend can control the updates of built-in application resource packages through canary releases. It can also initialize the basic environment configuration, compile, package, and publish the built-in application projects within the WeChat application to the resource management system via a scaffolding tool. Additionally, the WeChat application backend can perform hot updates for built-in applications.
[0261] It should be understood that, although Figure 2-12 as well as Figure 20The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-12 as well as Figure 20 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0262] In one embodiment, such as Figure 23 As shown, a data processing device 2300 is provided. This device can be a software module, a hardware module, or a combination of both, integrated into a computer device. Specifically, the device includes: an instruction receiving module 2302, an information acquisition module 2304, a parsing module 2306, a conversion module 2308, and a rendering module 2310, wherein:
[0263] Instruction receiving module 2302 is used to receive page generation instructions, which carry page identifiers.
[0264] The information acquisition module 2304 is used to acquire the corresponding H5 page information based on the page identifier and to acquire the current device information;
[0265] Parsing module 2306 is used to parse H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data;
[0266] The conversion module 2308 is used to identify H5 page structure data, obtain H5 page component information, H5 page layout information and H5 page style rules, and convert the H5 page component information, H5 page layout information and H5 page style rules into data format according to preset native data format conversion rules to obtain native page structure data.
[0267] The rendering module 2310 is used to render the page based on the native page structure data, obtain the native page, and display it.
[0268] In one embodiment, the instruction receiving module 2302 is further configured to receive a page generation instruction in the target application, wherein the page generation instruction carries a target page identifier, which is used to uniquely identify a page in the H5 application, and the H5 application is an application built into the target application.
[0269] In one embodiment, the H5 page information includes H5 page basic resource information, H5 page business resource information, and H5 page data; the information acquisition module 2304 is also used to search for the corresponding H5 page basic resource information, H5 page business resource information, and H5 page data in memory according to the page identifier, and load the H5 page basic resource information, H5 page business resource information, and H5 page data.
[0270] In one embodiment, the information acquisition module 2304 is further configured to acquire the corresponding basic resource storage path based on the page identifier; when the basic resource information of the H5 page is not found according to the basic resource storage path, a download request for the basic resource information of the H5 page is sent to the server, the download request carrying the page identifier; acquire the basic resource information of the H5 page returned by the server and save it according to the basic resource storage path; find the basic resource information of the H5 page from the basic resource storage path, compare the version information corresponding to the basic resource information of the H5 page with the version information corresponding to the preset basic resource information of the H5 page, and when the version information corresponding to the basic resource information of the H5 page is greater than the version information corresponding to the preset basic resource information of the H5 page, load the basic resource information of the H5 page.
[0271] In one embodiment, the information acquisition module 2304 is further configured to acquire the corresponding business resource storage path based on the page identifier; when no H5 page business resource information is found according to the business resource storage path, an H5 page business resource information download request is sent to the server, the H5 page business resource information download request carrying the page identifier; acquire the H5 page business resource information returned by the server and save it according to the business resource storage path; find the H5 page business resource information from the business resource storage path, compare the target version information corresponding to the H5 page business resource information with the preset version information corresponding to the preset H5 page business resource information; when the target version information corresponding to the H5 page business resource information is greater than the preset version information corresponding to the preset H5 page business resource information, load the H5 page business resource information.
[0272] In one embodiment, the data processing apparatus 2300 further includes:
[0273] The pre-download module is used to send an H5 page information download request to the server when an H5 page information download event is detected. The H5 page information download request carries a page identifier. The module also retrieves the H5 page information returned by the server. The H5 page information is found by the server based on the page identifier and is saved according to the memory storage path corresponding to the page identifier.
[0274] In one embodiment, the data processing apparatus 2300 further includes:
[0275] The silent update module is used to send a silent update request for H5 page information to the server, which carries a page identifier; obtain the updated version information returned by the server, which is found by the server using the page identifier; obtain the local version information of the H5 page information corresponding to the page identifier, compare the updated version information with the local version information, and if the updated version information is inconsistent with the local version information, send an H5 page update information download request to the server, which carries the updated version information; obtain the H5 page update information returned by the server, which is found by the server based on the updated version information, save the H5 page update information, and delete the H5 page information corresponding to the local version information.
[0276] In one embodiment, the data processing apparatus 2300 further includes:
[0277] The thread startup module is used to start the first thread, the second thread, and the main thread;
[0278] The parsing module 2206 is also used to use the first thread to parse the H5 page information in the runtime environment corresponding to the current device information to obtain the H5 page structure data;
[0279] The conversion module 2208 is also used to use the second thread to identify H5 page structure data, obtain H5 page component information, H5 page layout information and H5 page style rules, and convert the H5 page component information, H5 page layout information and H5 page style rules into data format according to the preset native data format conversion rules to obtain native page structure data;
[0280] Rendering module 2210 is also used to render the page using the main thread based on the native page structure data, obtain the native page, and display it.
[0281] In one embodiment, the parsing module 2306 is further configured to perform abstract syntax analysis on the H5 page information in the operating environment corresponding to the current device information to obtain the abstract syntax structure data of the H5 page; and to construct a virtual document object model tree based on the abstract syntax structure data of the H5 page to obtain the structure data of the H5 page.
[0282] In one embodiment, the data processing apparatus 2300 further includes:
[0283] The switching information loading module is used to detect and trigger the switching page information preloading event, respond to the switching page information preloading event to obtain the address of each preloaded switching page, download the corresponding switching page information from the server based on the preloaded switching page address, and store the switching page information in the cache.
[0284] In one embodiment, the data processing apparatus 2300 further includes:
[0285] The switching module receives page switching instructions from the native page, obtains the target switching page address based on the instructions, searches for the corresponding target switching page information in the cache based on the target switching page address, parses the target switching page information in the runtime environment corresponding to the current device information, and obtains the switching H5 page structure data; identifies the switching H5 page structure data to obtain switching H5 page component information, switching H5 page layout information, and switching H5 page style rules, converts the switching H5 page component information, switching H5 page layout information, and switching H5 page style rules according to preset native data format conversion rules, and obtains the switching native page structure data; and renders the page based on the switching native page structure data to obtain the switching native page and displays it through a switching animation.
[0286] In one embodiment, the data processing apparatus 2300 includes:
[0287] The reconnection module is used to send a long-connection message channel reconnection request to the server when an abnormality is detected in the data communication channel. The long-connection message channel reconnection request carries the terminal identifier; the server re-establishes the long-connection message channel based on the long-connection message channel reconnection request and the terminal corresponding to the terminal identifier.
[0288] In one embodiment, such as Figure 24 As shown, an application launch device 2400 is provided. This device can be a software module, a hardware module, or a combination of both, integrated into a computer device. Specifically, the device includes: a launch command receiving module 2402, a start information acquisition module 2404, a start information parsing module 2406, a start information conversion module 2408, and a start page display module 2410, wherein:
[0289] The startup instruction receiving module 2402 is used to receive a built-in application startup instruction in the target application. The built-in application startup 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.
[0290] The starting information acquisition module 2404 is used to obtain the corresponding built-in application H5 starting page information based on the built-in application starting page identifier, and to obtain the current device information;
[0291] The start information parsing module 2406 is used to parse the start page information of the built-in application H5 in the operating environment corresponding to the current device information, and obtain the structure data of the start page of the built-in application H5.
[0292] The start information conversion module 2408 is used to identify the structure data of the built-in application H5 start page, obtain the component information, layout information and style rules of the built-in application H5 start page, and convert the component information, layout information and style rules of the built-in application H5 start page according to the preset native data format conversion rules to obtain the native start page structure data of the built-in application.
[0293] The start page display module 2410 is used to render the page based on the native start page structure data of the built-in application, obtain the native start page of the built-in application, and display the start page of the built-in application in the target application.
[0294] In one embodiment, the application initiation device 2400 further includes:
[0295] The resource update module is used to detect and respond to built-in application resource information update events, send a built-in application resource information update retrieval request to the server, and carry the built-in application identifier in the built-in application resource information retrieval request; retrieve the built-in application resource information update returned by the server, save the built-in application resource information update and delete the built-in application historical resource information corresponding to the built-in application identifier.
[0296] In one embodiment, the built-in application includes a social sharing application;
[0297] The application startup device 2400 also includes:
[0298] The interaction module is used to receive reply instructions to social sharing messages on the start page, display the native reply interaction window according to the reply instructions, obtain reply messages through the native reply interaction window, and display reply messages on the start page.
[0299] Specific limitations regarding the data processing device and application launch device can be found in the limitations regarding the data processing method and application launch method above, and will not be repeated here. Each module in the aforementioned data processing device and application launch device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0300] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 25As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores page resource information. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a data processing method or an application startup method.
[0301] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 26 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data processing method or an application launch method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0302] Those skilled in the art will understand that Figure 25 Alternatively, the structure shown in Figure 26 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0303] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0304] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0305] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0306] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0307] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0308] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A data processing method, characterized in that, The method includes: Receive a page generation instruction, wherein the page generation instruction carries a page identifier; Obtain the corresponding H5 page information based on the page identifier, and obtain the current device information; Parsing 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 the 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. The H5 page structure data is identified to obtain H5 page component information, H5 page layout information, and H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are then converted into their original data format according to a preset native data format conversion rule to obtain native page structure data. The H5 page component information refers to the information of the components used to generate the page, the H5 page layout information refers to the information of the page layout used to generate the page, and the H5 page style rules refer to the page style rules used to generate the page. The page is rendered based on the original page structure data to obtain and display the original page.
2. The method according to claim 1, characterized in that, The received page generation instruction, wherein the page generation instruction carries a page identifier, including: The target application receives a page generation instruction, which 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 into the target application.
3. The method according to claim 1, characterized in that, The H5 page information includes basic H5 page resource information, H5 page business resource information, and H5 page data; Obtain the corresponding H5 page information based on the page identifier, including: Based on the page identifier, retrieve the corresponding H5 page basic resource information, H5 page business resource information, and H5 page data from memory, and load the H5 page basic resource information, H5 page business resource information, and H5 page data.
4. The method according to claim 3, characterized in that, The step of retrieving the corresponding H5 page basic resource information from memory based on the page identifier and loading the H5 page basic resource information includes: Based on the page identifier, the corresponding basic resource storage path is obtained. When the basic resource information of the H5 page is not found according to the basic resource storage path, an H5 page basic resource information download request is sent to the server. The H5 page basic resource information download request carries the page identifier. Obtain the basic resource information of the H5 page returned by the server and save it according to the basic resource storage path; The basic resource information of the H5 page is retrieved from the basic resource storage path. The version information corresponding to the basic resource information of the H5 page is compared with the version information corresponding to the preset basic resource information of the H5 page. When the version information corresponding to the basic resource information of the H5 page is greater than the version information corresponding to the preset basic resource information of the H5 page, the basic resource information of the H5 page is loaded.
5. The method according to claim 3, characterized in that, The step of retrieving the corresponding H5 page business resource information from memory based on the page identifier and loading the H5 page business resource information includes: Based on the page identifier, the corresponding business resource storage path is obtained. When the H5 page business resource information is not found according to the business resource storage path, an H5 page business resource information download request is sent to the server. The H5 page business resource information download request carries the page identifier. Obtain the H5 page business resource information returned by the server and save it according to the business resource storage path; The H5 page business resource information is retrieved from the business resource storage path. The target version information corresponding to the H5 page business resource information is compared with the preset version information corresponding to the preset H5 page business resource information. When the target version information corresponding to the H5 page business resource information is greater than the preset version information corresponding to the preset H5 page business resource information, the H5 page business resource information is loaded.
6. The method according to claim 1, characterized in that, Before receiving the page generation instruction, which carries a page identifier, the method further includes: When an H5 page information download event is detected, an H5 page information download request is sent to the server, and the H5 page information download request carries a page identifier; Obtain the H5 page information returned by the server. The H5 page information is found by the server based on the page identifier. Save the H5 page information according to the memory storage path corresponding to the page identifier.
7. The method according to claim 1, characterized in that, After rendering the page based on the native page structure data to obtain and display the native page, the process further includes: Send an H5 page information silent update request to the server, wherein the H5 page information silent update request carries the page identifier; Obtain the updated version information returned by the server, wherein the updated version information is found by the server using the page identifier; Obtain the local version information of the H5 page information corresponding to the page identifier, compare the updated version information with the local version information, and when the updated version information is inconsistent with the local version information, send an H5 page update information download request to the server, the H5 page update information download request carrying the updated version information; Obtain the H5 page update information returned by the server. The H5 page update information is found by the server based on the update version information. Save the H5 page update information and delete the H5 page information corresponding to the local version information.
8. The method according to claim 1, characterized in that, After obtaining the corresponding H5 page information based on the page identifier and obtaining the current device information, the method further includes: Start the first thread, the second thread, and the main thread; The step of parsing the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data includes: The first thread is used to parse the H5 page information in the runtime environment corresponding to the current device information to obtain the H5 page structure data. The process involves identifying the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. The H5 page component information, H5 page layout information, and H5 page style rules are then converted to their original data format according to a preset native data format conversion rule to obtain native page structure data, including: The second thread is used to identify the H5 page structure data to obtain H5 page component information, H5 page layout information and H5 page style rules. The H5 page component information, H5 page layout information and H5 page style rules are converted into data format according to the preset native data format conversion rules to obtain native page structure data. The process of rendering the page based on the native page structure data to obtain and display the native page includes: The main thread is used to render the page based on the native page structure data, resulting in the native page, which is then displayed.
9. The method according to claim 1, characterized in that, After rendering the page based on the native page structure data to obtain and display the native page, the process further includes: Detect and trigger a page switching information preloading event, and respond to the page switching information preloading event to obtain the addresses of each preloaded page switching page; Based on the preloaded switching page address, the corresponding switching page information is downloaded from the server and stored in the cache.
10. The method according to claim 9, characterized in that, After downloading the corresponding switching page information from the server based on the preloaded switching page address and storing the switching page information in the cache, the method further includes: The page switching instruction is received through the native page, and the target page address is obtained according to the page switching instruction; Based on the target switching page address, the corresponding target switching page information is retrieved from the cache, and the target switching page information is parsed in the operating environment corresponding to the current device information to obtain the switching H5 page structure data. Identify the H5 page structure data to obtain H5 page component information, H5 page layout information, and H5 page style rules. Convert the H5 page component information, H5 page layout information, and H5 page style rules according to a preset native data format conversion rule to obtain native page structure data. Based on the aforementioned native page structure data, the page is rendered to obtain the native page being switched and displayed through a switching animation.
11. The method according to claim 1, characterized in that, After rendering the page based on the native page structure data to obtain and display the native page, the process includes: When an anomaly is detected in the data communication channel, a long-connection message channel reconnection request is sent to the server, and the long-connection message channel reconnection request carries the terminal identifier. The server re-establishes a long-connection message channel based on the long-connection message channel reconnection request and the terminal corresponding to the terminal identifier.
12. An application launch method, characterized in that, The method includes: When a built-in application launch instruction is received in the target application, the built-in application launch 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; Obtain the corresponding built-in application H5 start page information based on the built-in application start page identifier, and obtain the current device information; Parsing the built-in application H5 start page information in the operating environment corresponding to the current device information to obtain the built-in application H5 start page structure data includes performing abstract syntax analysis on the built-in application H5 start page information in the operating environment corresponding to the current device information to obtain the built-in application H5 start page abstract syntax structure data, and constructing a virtual document object model tree based on the built-in application H5 start page abstract syntax structure data to obtain the built-in application H5 start page structure data. The built-in application H5 start page structure data is identified to obtain the built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules. The built-in application H5 start page component information, H5 start page layout information, and H5 start page style rules are then converted according to preset native data format conversion rules to obtain the built-in application native start page structure data. The H5 start page component information refers to the information of the components used to generate the page, the H5 start page layout information refers to the information of the page layout used to generate the page, and the H5 start page style rules refer to the page style rules used to generate the page. The page is rendered based on the native start page structure data of the built-in application to obtain the native start page of the built-in application, and then the start page of the built-in application is displayed in the target application.
13. The method according to claim 12, characterized in that, Before receiving the built-in application launch instruction in the target application, the method further includes: Upon detecting a built-in application resource information update event, the system responds to the built-in application resource information update event by sending a built-in application update resource information retrieval request to the server, the built-in application update resource information retrieval request carrying the built-in application identifier. Obtain the built-in application update resource information returned by the server, save the built-in application update resource information and delete the built-in application historical resource information corresponding to the built-in application identifier.
14. The method according to claim 12, characterized in that, The built-in applications include social sharing applications; After rendering the page based on the native start page structure data of the built-in application to obtain the native start page of the built-in application and displaying the start page of the built-in application in the target application, the process includes: Receive a reply instruction to the social sharing message on the starting page, and display the native reply interaction window according to the reply instruction; The reply message is obtained through the native reply interaction window and displayed on the start page.
15. A data processing apparatus, characterized in that, The device includes: The instruction receiving module is used to receive page generation instructions, wherein the page generation instructions carry a page identifier; The information acquisition module is used to acquire the corresponding H5 page information based on the page identifier and to acquire the current device information; The parsing module is used to parse the H5 page information in the operating environment corresponding to the current device information to obtain H5 page structure data, including: performing abstract syntax analysis on the H5 page information in the 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; The conversion module is used to identify the H5 page structure data, obtain H5 page component information, H5 page layout information, and H5 page style rules, and convert the H5 page component information, H5 page layout information, and H5 page style rules according to a preset native data format conversion rule to obtain native page structure data. The H5 page component information refers to the information of the components used to generate the page, the H5 page layout information refers to the information of the page layout used to generate the page, and the H5 page style rules refer to the page style rules used to generate the page. The rendering module is used to render the page based on the original page structure data, obtain the original page, and display it.
16. The apparatus according to claim 15, characterized in that, The instruction receiving module is also used to receive a page generation instruction in the target application. The page generation instruction carries a target page identifier, which is used to uniquely identify a page in the H5 application. The H5 application is an application built into the target application.
17. The apparatus according to claim 15, characterized in that, The H5 page information includes basic H5 page resource information, H5 page business resource information, and H5 page data; The information acquisition module is also used to search for the corresponding H5 page basic resource information, H5 page business resource information and H5 page data in memory according to the page identifier, and load the H5 page basic resource information, the H5 page business resource information and the H5 page data.
18. The apparatus according to claim 17, characterized in that, The information acquisition module is also used to obtain the corresponding basic resource storage path based on the page identifier. When the basic resource information of the H5 page is not found according to the basic resource storage path, an H5 page basic resource information download request is sent to the server. The H5 page basic resource information download request carries the page identifier. The H5 page basic resource information returned by the server is obtained and saved according to the basic resource storage path. The basic resource information of the H5 page is retrieved from the basic resource storage path. The version information corresponding to the basic resource information of the H5 page is compared with the version information corresponding to the preset basic resource information of the H5 page. When the version information corresponding to the basic resource information of the H5 page is greater than the version information corresponding to the preset basic resource information of the H5 page, the basic resource information of the H5 page is loaded.
19. The apparatus according to claim 17, characterized in that, The information acquisition module is also used to obtain the corresponding business resource storage path based on the page identifier. When the H5 page business resource information is not found according to the business resource storage path, an H5 page business resource information download request is sent to the server. The H5 page business resource information download request carries the page identifier. The H5 page business resource information returned by the server is obtained and saved according to the business resource storage path. The H5 page business resource information is retrieved from the business resource storage path. The target version information corresponding to the H5 page business resource information is compared with the preset version information corresponding to the preset H5 page business resource information. When the target version information corresponding to the H5 page business resource information is greater than the preset version information corresponding to the preset H5 page business resource information, the H5 page business resource information is loaded.
20. The apparatus according to claim 15, characterized in that, The device further includes: The pre-download module is used to send an H5 page information download request to the server when an H5 page information download event is detected, the H5 page information download request carrying a page identifier; obtain the H5 page information returned by the server, the H5 page information being found by the server based on the page identifier, and save the H5 page information according to the memory storage path corresponding to the page identifier.
21. The apparatus according to claim 15, characterized in that, The device further includes: A silent update module is used to send a silent update request for H5 page information to the server, the H5 page information silent update request carrying the page identifier; obtain the update version information returned by the server, the update version information being found by the server using the page identifier; obtain the local version information of the H5 page information corresponding to the page identifier, compare the update version information with the local version information, and when the update version information and the local version information are inconsistent, send an H5 page update information download request to the server, the H5 page update information download request carrying the update version information; obtain the H5 page update information returned by the server, the H5 page update information being found by the server based on the update version information, save the H5 page update information, and delete the H5 page information corresponding to the local version information.
22. The apparatus according to claim 15, characterized in that, The device further includes: The thread startup module is used to start the first thread, the second thread, and the main thread; The parsing module is also used to use the first thread to parse the H5 page information in the running environment corresponding to the current device information to obtain H5 page structure data. The conversion module is also used to use the second thread to identify the H5 page structure data, obtain H5 page component information, H5 page layout information and H5 page style rules, and convert the H5 page component information, H5 page layout information and H5 page style rules into data format according to the preset native data format conversion rules to obtain native page structure data; The rendering module is also used to use the main thread to render the page based on the native page structure data, obtain the native page, and display it.
23. The apparatus according to claim 15, characterized in that, The device further includes: The switching information loading module is used to detect and trigger a switching page information preloading event, respond to the switching page information preloading event to obtain the addresses of each preloaded switching page, download the corresponding switching page information from the server based on the preloaded switching page addresses, and store the switching page information in the cache.
24. The apparatus according to claim 15, characterized in that, The device further includes: The switching module is used to receive a page switching instruction through the native page, obtain the target switching page address according to the page switching instruction; search for the corresponding target switching page information in the cache based on the target switching page address, parse the target switching page information in the runtime environment corresponding to the current device information, and obtain the switching H5 page structure data; identify the switching H5 page structure data to obtain switching H5 page component information, switching H5 page layout information, and switching H5 page style rules, convert the switching H5 page component information, switching H5 page layout information, and switching H5 page style rules according to a preset native data format conversion rule to obtain switching native page structure data; and perform page rendering based on the switching native page structure data to obtain the switching native page and display it through a switching animation.
25. The apparatus according to claim 15, characterized in that, The device includes: The reconnection module is used to send a long-connection message channel reconnection request to the server when an abnormality is detected in the data communication channel. The long-connection message channel reconnection request carries a terminal identifier. The server re-establishes the long-connection message channel based on the long-connection message channel reconnection request and the terminal corresponding to the terminal identifier.
26. An application activation device, characterized in that, The device includes: The startup instruction receiving module is used to receive a built-in application startup instruction in the target application. The built-in application startup 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 to acquire the corresponding built-in application H5 starting page information based on the built-in application starting page identifier, and to acquire the current device information; The starting information parsing module is used to parse the built-in application H5 starting page information in the running environment corresponding to the current device information to obtain the built-in application H5 starting page structure data. This includes performing abstract syntax analysis on the built-in application H5 starting page information in the running environment corresponding to the current device information to obtain the built-in application H5 starting page abstract syntax structure data, and constructing a virtual document object model tree based on the built-in application H5 starting page abstract syntax structure data to obtain the built-in application H5 starting page structure data. The starting information conversion module is used to identify the structure data of the built-in application H5 starting page, obtain the component information, layout information, and style rules of the built-in application H5 starting page, and convert the component information, layout information, and style rules of the built-in application H5 starting page according to a preset native data format conversion rule to obtain the native starting page structure data of the built-in application. The H5 starting page component information refers to the information of the components used to generate the page, the H5 starting page layout information refers to the page layout information used to generate the page, and the H5 starting page style rules refer to the page style rules used to generate the page. The start page display module is used to render the page based on the native start page structure data of the built-in application, obtain the native start page of the built-in application, and display the start page of the built-in application in the target application.
27. The apparatus according to claim 26, characterized in that, The device further includes: The resource update module is used to detect and trigger a built-in application resource information update event, respond to the built-in application resource information update event, send a built-in application update resource information acquisition request to the server, the built-in application update resource information acquisition request carrying a built-in application identifier; acquire the built-in application update resource information returned by the server, save the built-in application update resource information, and delete the built-in application historical resource information corresponding to the built-in application identifier.
28. The apparatus according to claim 26, characterized in that, The built-in applications include social sharing applications; The device includes: The interaction module is used to receive reply instructions to social sharing messages on the start page, display a native reply interaction window according to the reply instructions, obtain reply messages through the native reply interaction window, and display the reply messages on the start page.
29. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 14.
30. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Page display method and apparatus, storage medium and electronic device
CN108280125A
Page display method and device, equipment and storage medium
CN110427586A
Mobile terminal H5 page generation method and device, electronic equipment and storage medium
CN112905179A