Page rendering method, and method and device for generating data packet to be analyzed

By obtaining and converting native information in the data packet to be parsed, generating native runtime objects, and directly rendering the mini program page, the problem of low rendering efficiency during the mini program loading process is solved, and the overall loading and response efficiency is improved.

CN118963871APending Publication Date: 2024-11-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310543842.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

During the loading process, the mini program needs to be rendered through web page views and bridges, resulting in low rendering efficiency and performance losses in the system.

Method used

By detecting the page loading instructions, the data packet to be parsed is obtained, including native view mapping information, native event mapping information and native configuration mapping information, view conversion, code conversion and configuration conversion, generate native runtime objects, and render them directly to avoid web pages View and bridge rendering.

Benefits of technology

Improves the rendering efficiency and loading efficiency of applets, and reduces the performance losses caused by web views and bridge communications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963871A_ABST
    Figure CN118963871A_ABST
Patent Text Reader

Abstract

The invention relates to a page rendering method, a to-be-analyzed data packet generation method and a to-be-analyzed data packet generation device, and relates to the technical field of computers. The method comprises the steps of obtaining a to-be-analyzed data packet which corresponds to a target applet and comprises native view mapping information, native event mapping information and native configuration mapping information, performing view conversion processing on the native view mapping information to obtain native view information, performing code conversion processing on the native event mapping information to obtain native event code information, and transmitting the native event code information to the target applet. And performing configuration conversion processing on the native configuration mapping information to obtain native global configuration information, generating a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information, and rendering a target applet page based on the native runtime object. By utilizing the embodiment of the invention, the page rendering efficiency of the applet can be improved, and the overall loading efficiency and response efficiency of the applet can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a page rendering method, a method for generating a data packet to be parsed, and a device. Background Art

[0002] Mini Program is an application that can run inside a software platform. It does not require users to download and install it, and can be used directly on the relevant platform. At present, the loading process of Mini Program is as follows: the Mini Program developer uploads the Mini Program package H5 (HyperTextMarkupLanguage5, Hypertext Markup Language 5) resource file to the Mini Program server; the Mini Program user client triggers the opening of the Mini Program, triggers the download of the Mini Program, and downloads the H5 resource file to the local computer; the Mini Program client container loads the H5 resource file of the Mini Program through the web view; the Mini Program H5 resource file communicates with the Mini Program client container through the bridge, and requests the native side to render the native view; the native side receives the page construction parameters from the bridge, and uses the native components to build the Mini Program page. However, the Mini Program package exists in the form of an H5 resource file. When loading the Mini Program, the client needs to first download the H5 resource file from the background service, and use the bridge and web view to load the H5 resource file to render the Mini Program, which has low rendering efficiency. Summary of the invention

[0003] In view of the above-mentioned technical problems, the present disclosure proposes a page rendering method, a method and a device for generating a data packet to be parsed.

[0004] According to one aspect of an embodiment of the present disclosure, a page rendering method is provided, including:

[0005] When a page loading instruction of a target applet is detected, a data packet to be parsed corresponding to the target applet is obtained; the data packet to be parsed includes native view mapping information, native event mapping information, and native configuration mapping information;

[0006] Performing view conversion processing on the native view mapping information to obtain native view information corresponding to the target applet;

[0007] Performing code conversion processing on the native event mapping information to obtain native event code information corresponding to the target applet;

[0008] Performing configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet;

[0009] Generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information;

[0010] Based on the native runtime object, render the target mini-program page corresponding to the page loading instruction.

[0011] According to another aspect of an embodiment of the present disclosure, a method for generating a data packet to be parsed is provided, comprising:

[0012] Acquire a mini-program data packet corresponding to a target mini-program; the mini-program data packet includes preset view information corresponding to the target mini-program, preset event code information corresponding to the target mini-program, and preset global configuration information corresponding to the target mini-program;

[0013] Performing view parsing processing on the preset view information to obtain native view mapping information corresponding to the target applet;

[0014] Performing logic analysis on the preset event code information to obtain native event mapping information corresponding to the target applet;

[0015] Performing configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet;

[0016] Based on the native view mapping information, the native event mapping information and the native configuration mapping information, a data packet to be parsed corresponding to the target applet is generated.

[0017] According to another aspect of an embodiment of the present disclosure, a page rendering device is provided, including:

[0018] A first data packet acquisition module is used to acquire a data packet to be parsed corresponding to the target applet when a page loading instruction of the target applet is detected; the data packet to be parsed includes native view mapping information, native event mapping information and native configuration mapping information;

[0019] A view conversion processing module, used to perform view conversion processing on the native view mapping information to obtain native view information corresponding to the target applet;

[0020] A code conversion processing module, used to perform code conversion processing on the native event mapping information to obtain native event code information corresponding to the target applet;

[0021] A first configuration conversion module, configured to perform configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet;

[0022] An object generation module, used to generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information;

[0023] The page rendering module is used to render the target mini-program page corresponding to the page loading instruction based on the native runtime object.

[0024] According to another aspect of an embodiment of the present disclosure, there is provided a device for generating a data packet to be parsed, comprising:

[0025] A second data packet acquisition module is used to acquire a mini-program data packet corresponding to a target mini-program; the mini-program data packet includes preset view information corresponding to the target mini-program, preset event code information corresponding to the target mini-program, and preset global configuration information corresponding to the target mini-program;

[0026] A view parsing processing module, used to perform view parsing processing on the preset view information to obtain native view mapping information corresponding to the target applet;

[0027] A logic analysis processing module, used to perform logic analysis on the preset event code information to obtain native event mapping information corresponding to the target applet;

[0028] A second configuration conversion module is used to perform configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet;

[0029] A data packet generation module is used to generate a to-be-parsed data packet corresponding to the target applet based on the native view mapping information, the native event mapping information and the native configuration mapping information.

[0030] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the above-mentioned page rendering method or the above-mentioned method for generating a data packet to be parsed.

[0031] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned page rendering method or the above-mentioned method for generating a data packet to be parsed.

[0032] According to another aspect of an embodiment of the present disclosure, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute the above-mentioned page rendering method or the above-mentioned method for generating a data packet to be parsed.

[0033] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0034] By obtaining the data packet to be parsed including native view mapping information, native event mapping information and native configuration mapping information corresponding to the target applet when the page loading instruction of the target applet is detected, the target applet data packet can be quickly obtained, and then the native view mapping information is processed for view conversion to obtain the native view information corresponding to the target applet, the native event mapping information is processed for code conversion to obtain the native event code information corresponding to the target applet, the native configuration mapping information is processed for configuration conversion to obtain the native global configuration information corresponding to the target applet, so as to realize data conversion in the data packet to be parsed of the target applet. Then, based on the native The view information, native event code information and native global configuration information are used to generate the native runtime object corresponding to the target mini-program, which can realize the construction of the native object of the target mini-program, so that the rendering module can directly render based on the native runtime object of the target mini-program, thereby improving the rendering efficiency. Then, combined with the native runtime object, the target mini-program page corresponding to the rendering page loading instruction can be directly rendered through the native runtime object, without the need for rendering through web view and bridge, thereby improving the rendering efficiency of the mini-program page, thereby reducing the performance loss in the system due to the rendering of the web view and bridge communication, and improving the overall loading efficiency and response efficiency of the mini-program.

[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0037] Figure 1 is a schematic diagram of an application system according to an exemplary embodiment;

[0038] Figure 2 is a flow chart of a page rendering method according to an exemplary embodiment;

[0039] Figure 3 is a flow chart of a method for generating a data packet to be parsed according to an exemplary embodiment;

[0040] Figure 4 It is a structural block diagram of a page rendering device and a device for generating a data packet to be parsed according to an exemplary embodiment;

[0041] Figure 5 is a schematic diagram of an interaction process in a method for generating a data packet to be parsed according to an exemplary embodiment;

[0042] Figure 6 is a schematic diagram of an interaction process in a page rendering method according to an exemplary embodiment;

[0043] Figure 7 is a block diagram of a page rendering device according to an exemplary embodiment;

[0044] Figure 8 is a block diagram of a device for generating a data packet to be parsed according to an exemplary embodiment;

[0045] Fig. 9 is a block diagram of an electronic device for rendering a target applet page or generating a data packet to be parsed according to an exemplary embodiment;

[0046] Fig.10 It is a block diagram of another electronic device for rendering a target applet page or generating a data packet to be parsed according to an exemplary embodiment. DETAILED DESCRIPTION

[0047] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0048] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0049] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0050] See also Figure 1 , Figure 1 is a schematic diagram of an application system according to an exemplary embodiment. The application system can be used in the page rendering method or the method for generating a data packet to be parsed of the present application. Figure 1 As shown, the application system may at least include a server 01 and a terminal 02 .

[0051] In the embodiment of the present application, the server 01 can be used to generate a data packet to be parsed of the target applet. Specifically, the server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0052] In the embodiment of the present application, the terminal 02 can be used to render the target applet page. The terminal 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, vehicle terminals, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc., and may also include software running in physical devices, such as applications. The operating system running on the terminal 02 in the embodiment of the present application may include but is not limited to Android, IOS, Linux, Windows, etc.

[0053] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual application, other application environments may also be included. For example, the process of generating the data packet to be parsed of the target applet may also be implemented on the terminal 02.

[0054] In the embodiments of this specification, the terminal 02 and the server 01 may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.

[0055] It should be noted that the following figure shows a possible sequence of steps, which is not actually limited to strictly follow this sequence. Some steps can be executed in parallel without relying on each other.

[0056] Specifically, Figure 2 FIG. 1 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 2 As shown, the page rendering method can be used in electronic devices such as terminals, and can specifically include the following steps:

[0057] S201: When a page loading instruction of a target applet is detected, a to-be-parsed data packet corresponding to the target applet is obtained.

[0058] In a specific embodiment, the target applet may refer to the applet currently triggered to be opened in the target client. The target applet may include an e-commerce applet, a reservation applet, or a consulting applet, etc. The target client may refer to the client that currently needs to load the target applet.

[0059] In a specific embodiment, the page loading instruction may be used to request the client to load the target applet and render the target applet page. The page loading instruction may include applet identification information of the target applet.

[0060] In a specific embodiment, the data packet to be parsed may be a data packet used by the client to load the target applet and render the target applet page. The data packet to be parsed may include native view mapping information, native event mapping information, and native configuration mapping information. Specifically, the data packet to be parsed may be a JSON (JavaScript Object Notation, JS object notation) file. Among them, the native view mapping information can be used to concisely describe the native view information of the target applet. The native event mapping information can be used to concisely describe the native event code information of the target applet. The native configuration mapping information can be used to concisely describe the native global configuration information of the target applet. Specifically, the native view mapping information may be obtained by performing view parsing processing on the preset view information of the target applet. The native event mapping information may be obtained by performing logical parsing processing on the preset event code information of the target applet. The native configuration mapping information may be obtained by performing configuration conversion processing on the preset global configuration information of the target applet.

[0061] In a specific embodiment, the user account can trigger the start instruction of the target applet through the target client. After detecting the start instruction of the target applet, the target client can generate a page loading instruction of the target applet; when detecting the page loading instruction of the target applet, send a data packet acquisition instruction carrying the applet identification information of the target applet to the server, so that the server returns the data packet to be parsed of the above-mentioned target applet. Specifically, when the server receives the above-mentioned data packet acquisition instruction, it can obtain the data packet to be parsed of the target applet from the respective data packets of multiple different applet based on the applet identification information of the target applet in the above-mentioned data packet acquisition instruction; and then return the data packet to be parsed of the above-mentioned target applet to the target client. Correspondingly, the target client can receive the data packet to be parsed of the target applet returned by the server. It can be understood that after the applet developer uploads the applet resource file of the target applet, the server can parse the applet resource file of the target applet to obtain the data packet to be parsed of the target applet; accordingly, before the applet is triggered to be opened, the server can pre-store the respective data packets of multiple different applet, so that after the target applet is triggered to be opened, the corresponding data packet to be parsed of the target applet can be obtained from the server.

[0062] In the above embodiment, when a page loading instruction of a target applet is detected, a data packet to be parsed including native view mapping information, native event mapping information and native configuration mapping information is obtained, so that the target applet data packet can be quickly obtained.

[0063] S203: Perform view conversion processing on the native view mapping information to obtain native view information corresponding to the target applet.

[0064] In a specific embodiment, the native view mapping information can be used to concisely describe the native view information of the target applet. The native view mapping information may include view page mapping information and view component mapping information. Among them, the view page mapping information can be used to concisely describe the native view page information of the target applet. The view page mapping information may include page attribute tree information corresponding to each of the multiple view pages in the target applet. The view component mapping information can be used to concisely describe the native view component information of the target applet. The view component mapping information may include at least one mapped view component tree information corresponding to each of the multiple view pages in the target applet. Any mapped view component tree information may be obtained by converting the view component tree information through a preset view mapping relationship.

[0065] In a specific embodiment, the native view information may include native view page information and native view component information. The native view information may be used to construct a native view object in a native runtime object.

[0066] In a specific embodiment, the above step S203 may include:

[0067] Based on the preset view mapping relationship, the view page mapping information is converted to obtain the native view page information;

[0068] Based on the preset view mapping relationship, the view component mapping information is converted and processed to obtain the native view component information.

[0069] In a specific embodiment, the preset view mapping relationship may include a mapping relationship between native view mapping information and native view information. It is understandable that during the loading process of the mini program, the native view mapping information is one of the data that needs to be converted, and the preset view mapping relationship may be a medium for converting the native view mapping information into the native view information.

[0070] In a specific embodiment, based on the preset view mapping relationship, each page attribute mapping information in the page attribute tree information corresponding to each view page can be replaced with the page attribute type information corresponding to the above each page attribute mapping information in the preset view mapping relationship, and accordingly, the native view page information can be obtained.

[0071] In a specific embodiment, based on the preset view mapping relationship, the component type mapping information corresponding to each view component in each mapped view component tree information can be replaced with the view component type information corresponding to each view component above, and the component attribute mapping information corresponding to each view component in each mapped view component tree information can be replaced with the view component attribute information corresponding to each view component above, and accordingly, the native view component information can be obtained.

[0072] S205: Perform code conversion processing on the native event mapping information to obtain native event code information corresponding to the target applet.

[0073] In a specific embodiment, the native event mapping information can be used to concisely describe the native event code information of the target applet. The native event mapping information may include the preset code mapping information of at least one event to be triggered corresponding to each of the multiple view components in the target applet. Among them, the preset code mapping information corresponding to any event to be triggered can be used to describe the first event code information corresponding to any of the above-mentioned events to be triggered. Specifically, the preset code mapping information corresponding to any event to be triggered can be the intermediate code corresponding to the first event code information of any event to be triggered.

[0074] In a specific embodiment, the native event code information can be used to construct the event logic code object in the native runtime object. The native event code information may include the first event code information of at least one to-be-triggered event corresponding to each of the multiple view components in the target mini-program. Among them, any to-be-triggered event corresponding to any view component may refer to an event that can be triggered by operating any of the above view components. The to-be-triggered event may include a view component sliding event or a view component click event, etc. The view component may refer to the basic component in the mini-program page. The first event code information of any to-be-triggered event in at least one to-be-triggered event corresponding to any view component may represent the native code that needs to be executed when any of the above view components is triggered by any of the above to-be-triggered events. The above mini-program resource file may be an H5 resource file uploaded by the mini-program developer.

[0075] In a specific embodiment, the above step S205 may include:

[0076] Based on the preset logical mapping relationship, the preset code mapping information of each event to be triggered in the native event mapping information is converted to obtain the first event code information of each event to be triggered.

[0077] In a specific embodiment, the preset code mapping information corresponding to any event to be triggered may include the event abstract syntax tree information corresponding to any of the above-mentioned events to be triggered.

[0078] In a specific embodiment, the preset logical mapping relationship may include a mapping relationship between native event mapping information and native event code information.

[0079] In a specific embodiment, based on a preset logical mapping relationship, the event abstract syntax tree information corresponding to any event to be triggered among multiple events to be triggered corresponding to any view component is subjected to logic code restoration processing to obtain the first event code information corresponding to any of the above events to be triggered.

[0080] S207: Perform configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet.

[0081] In a specific embodiment, the native configuration mapping information can be used to concisely describe the native global configuration information of the target applet. The native configuration mapping information may include application code mapping information, application configuration mapping information, and page routing mapping information. Among them, the application code mapping information can be used to concisely describe the native application code information of the target applet. The application configuration mapping information can be used to concisely describe the native application configuration information of the target applet. The page routing mapping information can be used to concisely describe the native page routing information of the target applet.

[0082] In a specific embodiment, the native global configuration information can be used to construct a native global configuration object in a native runtime object. The native global configuration information can include native application code information, native application configuration information, and native page routing information.

[0083] In a specific embodiment, the above step S207 may include:

[0084] Based on the preset logical mapping relationship, the application code mapping information is converted to obtain the native application code information;

[0085] Based on the preset configuration mapping relationship, the application configuration mapping information is converted to obtain the native application configuration information;

[0086] Based on the preset configuration mapping relationship, the page routing mapping information is converted and processed to obtain the native page routing information.

[0087] In a specific embodiment, the preset logical mapping relationship may include a mapping relationship between application code mapping information and native application code information.

[0088] In a specific embodiment, the application code mapping information may include application abstract syntax tree information.

[0089] In a specific embodiment, the native application code information may represent the global logic code of the target applet.

[0090] In a specific embodiment, based on a preset logical mapping relationship, the application abstract syntax tree information is subjected to logic code restoration processing to obtain the above-mentioned native application code information.

[0091] In a specific embodiment, the native application configuration information may refer to the global application configuration information of the target applet. The native application configuration information may include navigation bar attribute information and network timeout information, etc.

[0092] In a specific embodiment, the preset configuration mapping relationship may include a mapping relationship between application configuration mapping information and native application configuration information, and a mapping relationship between page routing mapping information and native page routing information.

[0093] In a specific embodiment, based on a preset configuration mapping relationship, any application attribute mapping information in the application configuration mapping information can be replaced with application attribute information corresponding to any of the above application attribute mapping information, and accordingly, native application configuration information can be obtained.

[0094] In a specific embodiment, the native page routing information may refer to the native page routing information of the target applet. Specifically, based on the preset configuration mapping relationship, the mapping information in the page routing mapping information may be replaced with the corresponding routing information in the preset configuration mapping relationship to obtain the above-mentioned native page routing information.

[0095] In the above embodiment, by performing view conversion processing on the native view mapping information to obtain the native view information corresponding to the target applet, performing code conversion processing on the native event mapping information to obtain the native event code information corresponding to the target applet, and performing configuration conversion processing on the native configuration mapping information to obtain the native global configuration information corresponding to the target applet, data conversion in the data packet to be parsed of the target applet can be achieved.

[0096] S209: Generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information.

[0097] In a specific embodiment, the native runtime object corresponding to the target applet can be used to provide the rendering module in the target client so that the target applet page can be directly rendered. The native runtime object may include a native view object and a native global configuration object.

[0098] In a specific embodiment, the above step S209 may include:

[0099] Generate a native view object corresponding to the target applet based on the native event code information and the native view information;

[0100] Based on the native global configuration information, generate the native global configuration object corresponding to the target applet;

[0101] Generate native runtime objects based on native view objects and native global configuration objects.

[0102] In a specific embodiment, the native view object can be used in the target client to render the page view of the target applet by the rendering module. The native view object may include a native view component object and a native view page object. Among them, the native view component object may include a native component attribute object and a native event code object. The native component attribute object may represent the attributes of multiple view components corresponding to multiple view pages in the target applet. The native event code object may represent the event code that needs to be executed when at least one to-be-triggered event corresponding to each view component in any view page in the target applet is triggered.

[0103] In a specific embodiment, a native component attribute object can be generated based on the native view component information in the native view information; then, a native view page object can be generated based on the native view page information in the native view information; then, a native event code object can be generated based on the native event code information; then, based on the correspondence between any to-be-triggered event corresponding to any view component and any event code information, each event code information in the native event code object can be bound to a to-be-triggered event corresponding to any view component in the native view component object; accordingly, a native view component object can be obtained. Furthermore, a native view object can be generated based on the native view component object and the native view page object.

[0104] In a specific embodiment, the native global configuration object can be used to be called by the native view object during the loading and running of the target applet. Specifically, the native global configuration object can be constructed based on the application code mapping information, application configuration mapping information and page routing mapping information in the native global configuration information.

[0105] In a specific embodiment, a native runtime object corresponding to the target applet may be constructed based on the above-mentioned native view object and native global configuration object.

[0106] In the above embodiment, based on the native event code information and the native view information, the native view object corresponding to the target applet is generated, based on the native global configuration information, the native global configuration object corresponding to the target applet is generated, and based on the native view object and the native global configuration object, the native runtime object is generated. This can realize the construction of the native object of the target applet, so that the rendering module can directly render based on the native runtime object of the target applet, thereby improving the rendering efficiency.

[0107] S211: Based on the native runtime object, render the target mini program page corresponding to the page loading instruction.

[0108] In a specific embodiment, the target mini-program page may refer to a page that the target mini-program requests to load and display.

[0109] In a specific embodiment, a rendering module may be pre-set in the target client. On this basis, after the native runtime object is constructed, the entry page of the target mini program may be displayed first, and then the native runtime object may be directly run through the rendering module in the target client to render the target mini program page corresponding to the page loading instruction.

[0110] In the above embodiment, by acquiring the data packet to be parsed including native view mapping information, native event mapping information and native configuration mapping information corresponding to the target applet when the page loading instruction of the target applet is detected, the target applet data packet can be quickly acquired, and then the native view mapping information is subjected to view conversion processing to obtain the native view information corresponding to the target applet, the native event mapping information is subjected to code conversion processing to obtain the native event code information corresponding to the target applet, the native configuration mapping information is subjected to configuration conversion processing to obtain the native global configuration information corresponding to the target applet, and the data conversion in the data packet to be parsed of the target applet can be realized. Then, Based on the native view information, native event code information and native global configuration information, the native runtime object corresponding to the target mini program is generated, which can realize the construction of the native object of the target mini program, so that the rendering module can directly render based on the native runtime object of the target mini program, thereby improving the rendering efficiency. Then, combined with the native runtime object, the target mini program page corresponding to the rendering page loading instruction can be directly rendered through the native runtime object, without the need to achieve rendering through the web view and bridge, thereby improving the mini program page rendering efficiency, thereby reducing the performance loss in the system due to the rendering of the web view and bridge communication, and improving the overall loading efficiency and response efficiency of the mini program.

[0111] Specifically, Figure 3 FIG. 1 is a flow chart showing a method for generating a data packet to be parsed according to an exemplary embodiment. Figure 3 As shown, the method for generating a data packet to be parsed can be used in electronic devices such as servers, and can specifically include the following steps:

[0112] S301: Obtain the mini program data packet corresponding to the target mini program.

[0113] In a specific embodiment, the mini program data packet corresponding to the target mini program may refer to a resource file data packet uploaded to the platform by the mini program developer corresponding to the target mini program. The mini program data packet may include an H5 resource file. The mini program data packet may include preset view information corresponding to the target mini program, preset event code information corresponding to the target mini program, and preset global configuration information corresponding to the target mini program.

[0114] In a specific embodiment, after the mini program developer completes the development of the target mini program and obtains the mini program data package, the mini program data package can be uploaded to the mini program platform. Accordingly, after detecting that the mini program data package of the target mini program has been uploaded, the mini program data package of the target mini program can be obtained from the above mini program platform. Specifically, after obtaining the mini program data package, the preset view information, preset event code information and preset global configuration information in the mini program data package can be obtained by decompressing the mini program data package.

[0115] S303: Perform view parsing on the preset view information to obtain native view mapping information corresponding to the target applet.

[0116] In a specific embodiment, the preset view information may include view page information of each of the multiple view pages corresponding to the target applet and at least one view component information corresponding to each of the multiple view pages. It is understandable that the expression form of the preset view information may be H5, and correspondingly, the expression form of the native view information may be native code.

[0117] In a specific embodiment, the native view mapping information may include page attribute tree information corresponding to each of the multiple view pages and at least one mapping view component tree information corresponding to each of the multiple view pages.

[0118] In a specific embodiment, the above step S303 may include:

[0119] Based on the view page information of each view page, generate page attribute tree information corresponding to each view page;

[0120] Based on at least one view component information corresponding to each view page, generate at least one view component tree information corresponding to each view page;

[0121] Based on the preset view mapping relationship, the view component type information corresponding to each view component in each view component tree information is replaced with the component type mapping information corresponding to each view component, and the view component attribute information corresponding to each view component in each view component tree information is replaced with the component attribute mapping information corresponding to each view component, so as to obtain at least one mapped view component tree information corresponding to each view page.

[0122] In a specific embodiment, the page attribute tree information corresponding to any view page can be constructed with multiple page attribute information corresponding to any view page as nodes and the hierarchical relationship between the multiple page attribute information corresponding to any view page as edges between nodes.

[0123] In a specific embodiment, the directory of the unzipped applet package can be first read from the applet data package of the target applet, and the view page identifiers of the multiple view pages corresponding to the target applet can be obtained from the applet configuration file in the applet data package. Then, based on the view page identifiers of the multiple view pages, the view page path information of the multiple view pages can be obtained. Then, based on the view page path information, the page files of the multiple view pages corresponding to the target applet can be obtained. Then, based on the page files of any of the view pages, the page attribute information corresponding to any view page can be constructed with the multiple page attribute information corresponding to any view page as nodes and the hierarchical relationship between the multiple page attribute information corresponding to any view page as edges between nodes.

[0124] In a specific embodiment, any view component tree information corresponding to any view page can be constructed with multiple view components in any view page as nodes and the hierarchical relationship between the multiple view components in any view page as the edges between the nodes.

[0125] In a specific embodiment, based on the view component information corresponding to any view page in the page file of any view page, with multiple view components in any view page as nodes and the hierarchical relationship between the multiple view components in any view page as the edges between the nodes, any view component tree information in any view page can be constructed.

[0126] In a specific embodiment, the preset view mapping relationship may include a mapping relationship between view component type information in the preset view information and component type mapping information in the native view mapping information, as well as a mapping relationship between view component attribute information in the preset view information and component attribute mapping information in the native view mapping information.

[0127] In a specific embodiment, based on the mapping relationship between the view component type information in the preset view information in the preset view mapping relationship and the component type mapping information in the native view mapping information, the view component type information corresponding to any view component in any view component tree information can be replaced with the component type mapping information corresponding to any view component; then, based on the mapping relationship between the view component attribute information in the preset view information in the preset view mapping relationship and the component attribute mapping information in the native view mapping information, the view component attribute information corresponding to any view component in any view component tree information can be replaced with the component attribute mapping information corresponding to any view component; accordingly, at least one mapped view component tree information corresponding to any view page can be obtained.

[0128] In the above embodiment, based on the view page information of each view page, page attribute tree information corresponding to each view page is generated; based on at least one view component information corresponding to each view page, at least one view component tree information corresponding to each view page is generated; based on the preset view mapping relationship, the view component type information corresponding to each view component in each view component tree information is replaced with the component type mapping information corresponding to each view component; and the view component attribute information corresponding to each view component in each view component tree information is replaced with the component attribute mapping information corresponding to each view component, so as to obtain at least one mapped view component tree information corresponding to each view page. This can realize view parsing of the view information of the target applet, reduce the package size of the subsequently generated target applet to be parsed data packet, so that the client can quickly download the target applet to be parsed data packet when triggering the opening of the applet, thereby improving the loading efficiency of the target applet.

[0129] S305: Perform logical analysis on the preset event code information to obtain native event mapping information corresponding to the target applet.

[0130] In a specific embodiment, the preset event code information may include the second event code information of at least one to-be-triggered event corresponding to each of the multiple view components in the target applet. It is understandable that the expression form of the preset event code information may be H5, and correspondingly, the expression form of the native event code information may be native code.

[0131] In a specific embodiment, the native event mapping information may include preset code mapping information of at least one event to be triggered.

[0132] In a specific embodiment, the above step S305 may include:

[0133] Based on the preset logical mapping relationship, the second event code information of each to-be-triggered event in the preset event code information is logically extracted to obtain the preset code mapping information of each to-be-triggered event.

[0134] In a specific embodiment, the preset logical mapping relationship may include a mapping relationship between a plurality of different second event code information of the events to be triggered and different preset code mapping information of the events to be triggered.

[0135] In a specific embodiment, the preset code mapping information of each event to be triggered may include event abstract syntax tree information corresponding to each event to be triggered.

[0136] In a specific embodiment, the event code word segmentation sequence corresponding to each of the multiple events to be triggered corresponding to any view component in the preset event code information can be obtained by performing lexical analysis on the second event code information corresponding to each event to be triggered; then, the event code word segmentation sequence corresponding to each of the events to be triggered can be analyzed grammatically and semantically to obtain the event abstract syntax tree information corresponding to each of the events to be triggered; accordingly, the event abstract syntax tree information corresponding to each of the events to be triggered can be used as the preset code mapping information of each of the events to be triggered.

[0137] In the above embodiment, through the preset logical mapping relationship, the second event code information of each event to be triggered in the preset event code information is logically extracted and processed to obtain the preset code mapping information of each event to be triggered, which can realize the logical analysis of the preset event code information of the target applet, and can reduce the package size of the data packet to be parsed of the subsequently generated target applet, so that the client can quickly download the data packet to be parsed of the target applet when triggering the opening of the applet, thereby improving the loading efficiency of the target applet.

[0138] S307: Perform configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet.

[0139] In a specific embodiment, the preset global configuration information may include preset application configuration information, preset page path information and preset application code information. It is understandable that the preset global configuration information may be expressed in H5, and correspondingly, the native global configuration information may be expressed in native code.

[0140] In a specific embodiment, the native configuration mapping information may include application configuration mapping information, page routing mapping information, and application code mapping information.

[0141] In a specific embodiment, the above step S307 may include:

[0142] Based on the preset configuration mapping relationship, the preset application configuration information is converted to obtain application configuration mapping information;

[0143] Generate page routing mapping information based on preset page path information;

[0144] The preset application code information is logically extracted and processed to obtain application code mapping information.

[0145] In a specific embodiment, the preset configuration mapping relationship may include a mapping relationship between preset application configuration information and application configuration mapping information, and a mapping relationship between page routing mapping information and native page routing information.

[0146] In a specific embodiment, based on the preset configuration mapping relationship, any application attribute information in the preset application configuration information can be replaced with the application attribute mapping information corresponding to the preset configuration mapping relationship, and accordingly, the application configuration mapping information can be obtained.

[0147] In a specific embodiment, the native page routing information corresponding to the target mini program can be constructed based on the preset page path information corresponding to the target mini program; then, based on the mapping relationship between the page routing mapping information in the preset configuration mapping relationship and the native page routing information, the routing information in the above-mentioned native page routing information can be replaced with the corresponding mapping information in the preset configuration mapping relationship, and the above-mentioned page routing mapping information can be obtained.

[0148] In a specific embodiment, the application code mapping information may include application abstract syntax tree information.

[0149] In a specific embodiment, the above-mentioned application code word segmentation sequence can be obtained by performing lexical analysis on the preset application code information; and then the above-mentioned application code word segmentation sequence can be subjected to grammatical semantic analysis to obtain the application abstract syntax tree information corresponding to the above-mentioned preset application code information; accordingly, the above-mentioned application abstract syntax tree information can be used as the above-mentioned application code mapping information.

[0150] In the above embodiment, the preset application configuration information is converted and processed through the preset configuration mapping relationship to obtain application configuration mapping information, page routing mapping information is generated based on the preset page path information, and the preset application code information is logically extracted and processed to obtain application code mapping information. This can implement the configuration conversion of the preset global configuration information of the target applet, and can reduce the package size of the data packets to be parsed of the subsequently generated target applet, so that the client can quickly download the data packets to be parsed of the target applet when triggering the opening of the applet, thereby improving the loading efficiency of the target applet.

[0151] S309: Generate a to-be-parsed data packet corresponding to the target applet based on the native view mapping information, the native event mapping information, and the native configuration mapping information.

[0152] In a specific embodiment, the native view mapping information corresponding to the target applet, the native event mapping information corresponding to the target applet and the native configuration mapping information corresponding to the target applet can be packaged to obtain the data packet to be parsed corresponding to the target applet.

[0153] In the above embodiment, a mini-program data packet including preset view information, preset event code information and preset global configuration information is obtained, and view parsing processing is performed on the preset view information to obtain native view mapping information corresponding to the target mini-program, and logic parsing processing is performed on the preset event code information to obtain native event mapping information corresponding to the target mini-program, and configuration conversion processing is performed on the preset global configuration information to obtain native configuration mapping information corresponding to the target mini-program. This can reduce the package size of the target mini-program's to-be-parsed data packet generated subsequently, so that the client can quickly download the target mini-program's to-be-parsed data packet when triggering the mini-program to be opened, thereby improving the loading efficiency of the target mini-program. Combined with the native view mapping information, native event mapping information and native configuration mapping information, a to-be-parsed data packet corresponding to the target mini-program is generated, which can realize the parsing of the target mini-program's mini-program data packet, so that in the subsequent target mini-program triggering process, the target mini-program's to-be-parsed data packet obtained in advance can be parsed and converted to obtain a native runtime object, so that the target client can directly render through the native runtime object, thereby improving the rendering efficiency of the mini-program.

[0154] Figure 4 1 is a structural block diagram of a page rendering device and a device for generating a data packet to be parsed according to an exemplary embodiment. Figure 4 As shown, the server may include a data packet parsing module and a mapping relationship maintenance module; the target client may include a mapping parsing module, a rendering module and a mini-program loading module. Among them, the above-mentioned data packet parsing module can be used to parse and process the mini-program data packet uploaded by the mini-program developer. The above-mentioned mapping relationship maintenance module can be used to maintain the preset mapping relationship of the current version; specifically, the above-mentioned preset mapping relationship may include a preset view mapping relationship, a preset logical mapping relationship and a preset configuration mapping relationship. The above-mentioned mapping parsing module can be used to parse and convert the data packet to be parsed of the target mini-program. The rendering module can be used to render the mini-program page based on the native runtime object parsed by the mapping parsing module. The mini-program loading module can be used to pull the mini-program information of the target mini-program and the data packet to be parsed of the target mini-program from the interface provided by the server.

[0155] Figure 5 FIG. 1 is a schematic diagram of an interaction process in a method for generating a data packet to be parsed according to an exemplary embodiment. Figure 5As shown, the mini program developer can upload the mini program data packet of the target mini program to the mini program platform after the target mini program is developed; the data packet parsing module can obtain the preset view mapping relationship, the preset logical mapping relationship and the preset configuration mapping relationship from the mapping relationship maintenance module, and based on the above-mentioned preset view mapping relationship, perform view parsing processing on the preset view information in the mini program data packet of the target mini program to obtain the native view mapping information of the target mini program, and then based on the preset logical mapping relationship, perform logical parsing processing on the preset event code information in the mini program data packet to obtain the native event mapping information of the target mini program, and then, based on the preset configuration mapping relationship, perform configuration conversion processing on the preset global configuration information to obtain the native configuration mapping information corresponding to the target mini program, and then, package the above-mentioned native view mapping information, the above-mentioned native event mapping information and the above-mentioned native configuration mapping information to obtain the data packet to be parsed corresponding to the target mini program.

[0156] Figure 6 FIG. 1 is a schematic diagram of an interaction process in a page rendering method according to an exemplary embodiment. Figure 6 As shown, the user account can trigger the start instruction of the target applet through the target client. After detecting the start instruction of the target applet, the target client can generate a page loading instruction for the target applet; when the page loading instruction of the target applet is detected, the applet loading module can obtain the data packet to be parsed of the target applet from the server; after receiving the data packet to be parsed returned by the server, the applet loading module can request the mapping parsing module to parse the above-mentioned data packet to be parsed; the mapping parsing module can perform view conversion processing on the native view mapping information in the data packet to be parsed to obtain the native view information of the target applet, and then perform code conversion processing on the native event mapping information in the data packet to be parsed to obtain the native event code information of the target applet, and then perform configuration conversion processing on the native configuration mapping information in the data packet to be parsed to obtain the native global configuration information of the target applet, and then, based on the above-mentioned native view information, native event code information and native global configuration information, generate the native runtime object corresponding to the target applet, and send the above-mentioned native runtime object to the rendering module; the rendering module can render the target applet page corresponding to the above-mentioned page loading instruction based on the native runtime object corresponding to the above-mentioned target applet.

[0157] Figure 7 FIG. 1 is a block diagram of a page rendering device according to an exemplary embodiment. Figure 7 As shown, the device may include:

[0158] The first data packet acquisition module 710 may be used to acquire a data packet to be parsed corresponding to the target applet when a page loading instruction of the target applet is detected; the data packet to be parsed includes native view mapping information, native event mapping information, and native configuration mapping information;

[0159] The view conversion processing module 720 can be used to perform view conversion processing on the native view mapping information to obtain the native view information corresponding to the target applet;

[0160] The code conversion processing module 730 can be used to perform code conversion processing on the native event mapping information to obtain the native event code information corresponding to the target applet;

[0161] The first configuration conversion module 740 may be used to perform configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet;

[0162] The object generation module 750 may be used to generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information;

[0163] The page rendering module 760 can be used to render the target mini-program page corresponding to the page loading instruction based on the native runtime object.

[0164] In a specific embodiment, the object generation module 750 may include:

[0165] A native view object generation module can be used to generate a native view object corresponding to a target applet based on native event code information and native view information;

[0166] The native global configuration object generation module can be used to generate the native global configuration object corresponding to the target applet based on the native global configuration information;

[0167] The native runtime object generation module can be used to generate native runtime objects based on native view objects and native global configuration objects.

[0168] In a specific embodiment, the view conversion processing module 720 may include:

[0169] A first conversion processing module may be used to convert the view page mapping information based on a preset view mapping relationship to obtain native view page information;

[0170] The second conversion processing module can be used to convert the view component mapping information based on the preset view mapping relationship to obtain the native view component information.

[0171] In a specific embodiment, the code conversion processing module 730 may include:

[0172] The third conversion processing module can be used to convert the preset code mapping information of each to-be-triggered event in the native event mapping information based on a preset logical mapping relationship to obtain the first event code information of each to-be-triggered event.

[0173] In a specific embodiment, the first configuration conversion module 740 may include:

[0174] The fourth conversion processing module may be used to convert the application code mapping information based on a preset logical mapping relationship to obtain native application code information;

[0175] A fifth conversion processing module may be used to convert the application configuration mapping information based on a preset configuration mapping relationship to obtain native application configuration information;

[0176] The sixth conversion processing module can be used to convert the page routing mapping information based on the preset configuration mapping relationship to obtain the native page routing information.

[0177] Figure 8 FIG. 1 is a block diagram of a device for generating a data packet to be parsed according to an exemplary embodiment. Figure 8 As shown, the device may include:

[0178] The second data packet acquisition module 810 is used to acquire a mini-program data packet corresponding to the target mini-program; the mini-program data packet includes preset view information corresponding to the target mini-program, preset event code information corresponding to the target mini-program, and preset global configuration information corresponding to the target mini-program;

[0179] The view parsing processing module 820 is used to perform view parsing processing on the preset view information to obtain the native view mapping information corresponding to the target applet;

[0180] The logic analysis processing module 830 is used to perform logic analysis on the preset event code information to obtain the native event mapping information corresponding to the target applet;

[0181] The second configuration conversion module 840 is used to perform configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet;

[0182] The data packet generation module 850 is used to generate a data packet to be parsed corresponding to the target applet based on the native view mapping information, the native event mapping information and the native configuration mapping information.

[0183] In a specific embodiment, the view parsing processing module 820 may include:

[0184] The page attribute tree generation module can be used to generate page attribute tree information corresponding to each view page based on the view page information of each view page, wherein the page attribute tree information corresponding to any view page is constructed with multiple page attribute information corresponding to any view page as nodes and the hierarchical relationship between multiple page attribute information corresponding to any view page as edges between nodes;

[0185] A view component tree generation module can be used to generate at least one view component tree information corresponding to each view page based on at least one view component information corresponding to each view page. Any view component tree information corresponding to any view page is constructed with multiple view components in any view page as nodes and the hierarchical relationship between multiple view components in any view page as edges between nodes.

[0186] The information replacement module can be used to replace the view component type information corresponding to each view component in each view component tree information with the component type mapping information corresponding to each view component based on the preset view mapping relationship, and to replace the view component attribute information corresponding to each view component in each view component tree information with the component attribute mapping information corresponding to each view component, so as to obtain at least one mapped view component tree information corresponding to each view page.

[0187] In a specific embodiment, the above logic analysis processing module 830 may include:

[0188] The first logic extraction processing module can be used to perform logic extraction processing on the second event code information of each to-be-triggered event in the preset event code information based on a preset logic mapping relationship to obtain the preset code mapping information of each to-be-triggered event.

[0189] In a specific embodiment, the second configuration conversion module 840 may include:

[0190] A seventh conversion processing module may be used to convert the preset application configuration information based on the preset configuration mapping relationship to obtain application configuration mapping information;

[0191] A routing mapping information generation module can be used to generate page routing mapping information based on preset page path information;

[0192] The second logic extraction processing module can be used to perform logic extraction processing on the preset application code information to obtain application code mapping information.

[0193] Regarding the device in the above embodiment, the specific manner in which each module and unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0194] Fig. 9 is a block diagram of an electronic device for rendering a target applet page or generating a data packet to be parsed according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a page rendering method or a method for generating a data packet to be parsed is implemented.

[0195] Fig.10 is a block diagram of another electronic device for rendering a target applet page or generating a data packet to be parsed according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a page rendering method or a method for generating a data packet to be parsed is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0196] Those skilled in the art will understand that Fig. 9 or Fig.10 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0197] In an exemplary embodiment, an electronic device is also provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a page rendering method or a method for generating a data packet to be parsed as in an embodiment of the present disclosure.

[0198] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the page rendering method or the method for generating a data packet to be parsed in the embodiment of the present disclosure.

[0199] In an exemplary embodiment, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the page rendering method or the method for generating a data packet to be parsed in the embodiments of the present disclosure.

[0200] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0201] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0202] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0203] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A page rendering method, It is characterized in that Applied to a target client, the method comprises: When a page loading instruction of a target applet is detected, a data packet to be parsed corresponding to the target applet is obtained; the data packet to be parsed includes native view mapping information, native event mapping information, and native configuration mapping information; Performing view conversion processing on the native view mapping information to obtain native view information corresponding to the target applet; Performing code conversion processing on the native event mapping information to obtain native event code information corresponding to the target applet; Performing configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet; Generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information; Based on the native runtime object, render the target mini-program page corresponding to the page loading instruction.

2. The method according to claim 1, It is characterized in that The generating a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information includes: Based on the native event code information and the native view information, generate a native view object corresponding to the target applet; Based on the native global configuration information, generate a native global configuration object corresponding to the target applet; The native runtime object is generated based on the native view object and the native global configuration object.

3. The method according to claim 1, It is characterized in that The native view mapping information includes view page mapping information and view component mapping information, and the native view information includes native view page information and native view component information; The performing view conversion processing on the native view mapping information to obtain the native view information corresponding to the target applet includes: Based on a preset view mapping relationship, converting the view page mapping information to obtain the native view page information; Based on the preset view mapping relationship, the view component mapping information is converted to obtain the native view component information.

4. The method according to claim 1, It is characterized in that The native event mapping information includes preset code mapping information of at least one event to be triggered corresponding to each of the multiple view components in the target applet, and the native event code information includes first event code information of each of the at least one event to be triggered; The performing code conversion processing on the native event mapping information to obtain the native event code information corresponding to the target applet includes: Based on the preset logical mapping relationship, the preset code mapping information of each to-be-triggered event in the native event mapping information is converted to obtain the first event code information of each to-be-triggered event.

5. The method according to claim 1, It is characterized in that The native configuration mapping information includes application code mapping information, application configuration mapping information and page routing mapping information, and the native global configuration information includes native application code information, native application configuration information and native page routing information; The performing configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet includes: Based on a preset logical mapping relationship, converting the application code mapping information to obtain the native application code information; Based on a preset configuration mapping relationship, convert the application configuration mapping information to obtain the native application configuration information; Based on the preset configuration mapping relationship, the page routing mapping information is converted to obtain the native page routing information.

6. A method for generating a data packet to be parsed, It is characterized in that The method comprises: Acquire a mini-program data packet corresponding to a target mini-program; the mini-program data packet includes preset view information corresponding to the target mini-program, preset event code information corresponding to the target mini-program, and preset global configuration information corresponding to the target mini-program; Performing view parsing processing on the preset view information to obtain native view mapping information corresponding to the target applet; Performing logic analysis on the preset event code information to obtain native event mapping information corresponding to the target applet; Performing configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet; Based on the native view mapping information, the native event mapping information and the native configuration mapping information, a data packet to be parsed corresponding to the target applet is generated.

7. The method according to claim 6, It is characterized in that The preset view information includes view page information of each of the multiple view pages corresponding to the target applet and at least one view component information corresponding to each of the multiple view pages, and the native view mapping information includes page attribute tree information corresponding to each of the multiple view pages and at least one mapping view component tree information corresponding to each of the multiple view pages; The performing view parsing processing on the preset view information to obtain native view mapping information corresponding to the target applet includes: Based on the view page information of each view page, the page attribute tree information corresponding to each view page is generated, wherein the page attribute tree information corresponding to any view page is constructed by taking the multiple page attribute information corresponding to any view page as nodes and taking the hierarchical relationship between the multiple page attribute information corresponding to any view page as edges between the nodes; Based on at least one view component information corresponding to each view page, at least one view component tree information corresponding to each view page is generated, wherein any view component tree information corresponding to any view page is constructed with multiple view components in any view page as nodes and hierarchical relationships between multiple view components in any view page as edges between nodes; Based on the preset view mapping relationship, the view component type information corresponding to each view component in each view component tree information is replaced with the component type mapping information corresponding to each view component, and the view component attribute information corresponding to each view component in each view component tree information is replaced with the component attribute mapping information corresponding to each view component, so as to obtain at least one mapped view component tree information corresponding to each view page.

8. The method according to claim 6, It is characterized in that The preset event code information includes second event code information of at least one event to be triggered corresponding to each of the multiple view components in the target applet, and the native event mapping information includes preset code mapping information of at least one event to be triggered; The performing logical analysis on the preset event code information to obtain native event mapping information corresponding to the target applet includes: Based on the preset logical mapping relationship, the second event code information of each to-be-triggered event in the preset event code information is logically extracted to obtain the preset code mapping information of each to-be-triggered event.

9. The method according to claim 6, It is characterized in that The preset global configuration information includes preset application configuration information, preset page path information and preset application code information, and the native configuration mapping information includes application configuration mapping information, page routing mapping information and application code mapping information; The performing configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet includes: Based on the preset configuration mapping relationship, convert the preset application configuration information to obtain the application configuration mapping information; Based on the preset page path information, generating the page routing mapping information; The preset application code information is logically extracted to obtain the application code mapping information.

10. A page rendering device, It is characterized in that The device comprises: A first data packet acquisition module is used to acquire a data packet to be parsed corresponding to the target applet when a page loading instruction of the target applet is detected; the data packet to be parsed includes native view mapping information, native event mapping information and native configuration mapping information; A view conversion processing module, used to perform view conversion processing on the native view mapping information to obtain native view information corresponding to the target applet; A code conversion processing module, used to perform code conversion processing on the native event mapping information to obtain native event code information corresponding to the target applet; A first configuration conversion module, configured to perform configuration conversion processing on the native configuration mapping information to obtain native global configuration information corresponding to the target applet; An object generation module, used to generate a native runtime object corresponding to the target applet based on the native view information, the native event code information and the native global configuration information; The page rendering module is used to render the target mini-program page corresponding to the page loading instruction based on the native runtime object.

11. A device for generating a data packet to be parsed, It is characterized in that The device comprises: A second data packet acquisition module is used to acquire a mini-program data packet corresponding to a target mini-program; the mini-program data packet includes preset view information corresponding to the target mini-program, preset event code information corresponding to the target mini-program, and preset global configuration information corresponding to the target mini-program; A view parsing processing module, used to perform view parsing processing on the preset view information to obtain native view mapping information corresponding to the target applet; A logic analysis processing module, used to perform logic analysis on the preset event code information to obtain native event mapping information corresponding to the target applet; A second configuration conversion module is used to perform configuration conversion processing on the preset global configuration information to obtain native configuration mapping information corresponding to the target applet; A data packet generation module is used to generate a to-be-parsed data packet corresponding to the target applet based on the native view mapping information, the native event mapping information and the native configuration mapping information.

12. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the page rendering method described in any one of claims 1 to 5 or the method for generating a data packet to be parsed described in any one of claims 6 to 9.

13. A non-volatile computer readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the page rendering method described in any one of claims 1 to 5 or the method for generating a data packet to be parsed described in any one of claims 6 to 9 is implemented.