Page rendering method and apparatus, and device and medium
By pre-injecting the mini-program page content data on the server and using the rendering thread to load style files in parallel, the problem of slow mini-program page rendering speed was solved, achieving fast rendering and high-quality display.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2026-03-19
AI Technical Summary
The slow page rendering speed when the mini program starts up results in a long period of blank screen, which affects the user experience.
By simulating the launch of the mini-program on the server, extracting page content data and pre-injecting it into the page style file of the rendering thread, the rendering thread loads the style file in parallel for initial rendering, and performs incremental rendering when the logic thread is ready to improve speed.
It reduces page rendering time, improves user experience, and enhances page display quality.
Smart Images

Figure CN2025120383_19032026_PF_FP_ABST
Abstract
Description
Page rendering method, device, apparatus and medium
[0001] Cross-reference to Related Applications
[0002] This application claims priority to Chinese Patent Application No. 202411274954.1, filed on September 11, 2024, the disclosure of which is incorporated herein in its entirety as part of the present application. TECHNICAL FIELD
[0003] Embodiments of the present disclosure relate to a page rendering method, device, apparatus and medium. BACKGROUND
[0004] With the rapid development of small programs, more and more host applications (APPs) integrate many small programs to provide different services to users through these small programs, so as to meet the diversified needs of users. However, at present, when a user opens a small program, the page rendering speed is often slow, resulting in a long white screen state. Therefore, how to improve the page rendering speed of the small program has become a problem to be solved at present. SUMMARY
[0005] Embodiments of the present disclosure provide a page rendering method, device, apparatus and medium.
[0006] In a first aspect, embodiments of the present disclosure provide a page rendering method, comprising:
[0007] loading a page style file of a target small program page in response to a start instruction for the target small program;
[0008] rendering the target small program page according to page style data in the page style file and pre-injected page content data.
[0009] In a second aspect, embodiments of the present disclosure provide a page rendering device, comprising:
[0010] a file loading module configured to load a page style file of a target small program page in response to a start instruction for the target small program;
[0011] a page rendering module configured to render the target small program page according to page style data in the page style file and pre-injected page content data.
[0012] In a third aspect, embodiments of the present disclosure provide an electronic device, comprising:
[0013] The processor and the memory, the memory stores a computer program, the processor is configured to call and run the computer program stored in the memory, to execute the page rendering method as described in the foregoing first aspect embodiment and each implementation.
[0014] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium configured to store a computer program, the computer program causing a computer to execute the page rendering method as described in the foregoing first aspect embodiment and each implementation.
[0015] In a fifth aspect, the embodiments of the present disclosure provide a computer program product containing program instructions, when the program instructions are run on an electronic device, causing the electronic device to execute the page rendering method as described in the foregoing first aspect embodiment and each implementation. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those of ordinary skill in the art without any creative effort based on these drawings.
[0017] FIG. 1 is an architecture diagram of an exemplary applet framework provided by the embodiments of the present disclosure;
[0018] FIG. 2 is a flowchart of a page rendering method provided by the embodiments of the present disclosure;
[0019] FIG. 3 is a flowchart of another page rendering method provided by the embodiments of the present disclosure;
[0020] FIG. 4 is a flowchart of still another page rendering method provided by the embodiments of the present disclosure;
[0021] FIG. 5 is an exemplary block diagram of a specific page rendering provided by the embodiments of the present disclosure;
[0022] FIG. 6 is a schematic block diagram of a page rendering apparatus provided by the embodiments of the present disclosure; and
[0023] FIG. 7 is a schematic block diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some embodiments of the present disclosure, rather than all the embodiments. According to the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without any creative effort fall within the scope of the present disclosure.
[0025] It should be noted that the terms "first", "second", and the like in the description and claims of the present disclosure and the above drawings are intended to distinguish similar objects and are not necessarily intended to describe a particular sequential or chronological order. It should be understood that the data thus used can be interchanged, where appropriate, so that the embodiments of the present disclosure described herein can be carried out in other than the order shown or described herein. Furthermore, the terms "comprise" and "have", and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or server including a list of steps or units is not necessarily limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such processes, methods, products, or devices.
[0026] In the embodiments of the present disclosure, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration, and anything so designated in the embodiments of the present disclosure should not be necessarily construed as preferable or advantageous over other embodiments or aspects. Rather, the use of "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0027] In the description of the embodiments of the present disclosure, "a plurality of" means two or more, that is, at least two, unless otherwise specified. "At least one" means one or more. "Any" means any one or any combination thereof.
[0028] FIG. 1 is an architecture diagram of an exemplary applet framework provided by the embodiments of the present disclosure. As shown in FIG. 1, the framework of the applet is a dual-thread architecture, which includes a logical thread and a rendering thread. For example, the logical thread is used to execute the logical code written by the applet developer, and dispatch page content data to the rendering thread, so that the rendering thread performs page rendering operation. The rendering thread is used to render and display the applet page obtained by rendering according to the page content data dispatched by the logical thread.
[0029] In the related art, when the applet is started by the user, the logical thread and the rendering thread shown in FIG. 1 are simultaneously run. However, because the underlying library on the side of the logical thread and the logical code are relatively complex, and the implementation logic of the rendering thread is relatively simple, the rendering thread is relatively idle when the applet is started compared with the logical thread, that is, the logical thread is relatively busy, so that the logical thread sends the page content data to the rendering thread relatively late, resulting in slow page rendering speed of the applet, long time display of white screen page to the user, that is, long time in white screen state, affecting the user experience.
[0030] To solve the problem that the page rendering speed is slow and the page is in a white screen state for a long time when a user opens an applet, the present disclosure provides a page rendering method, device, equipment and medium.
[0031] The technical solutions provided by the embodiments of the present disclosure will be described in detail below through some embodiments. The embodiments described below can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments.
[0032] FIG. 2 is a flowchart of a page rendering method according to an embodiment of the present disclosure. The page rendering method according to the embodiment of the present disclosure can be executed by a page rendering device, which can be composed of hardware and / or software and can be integrated into an electronic device. In the embodiment of the present disclosure, the electronic device can be, but is not limited to, a smartphone, a tablet computer, a vehicle terminal, a notebook computer, a desktop computer, a wearable device, and the like. For example, the wearable device can include smart glasses, a smart watch, a smart bracelet, a head-mounted device, and the like. It should be understood that the electronic device in the embodiment of the present disclosure can also be referred to as a terminal device or a user equipment, which is not limited herein.
[0033] As shown in FIG. 2, the page rendering method can include the following steps:
[0034] S101, in response to a start instruction for a target applet, loading a page style file of a target applet page.
[0035] S102, rendering the target applet page according to page style data in the page style file and pre-injected page content data.
[0036] It should be understood that the start instruction for the target applet is specifically an open instruction for the target applet by a user.
[0037] For example, the target applet can be any applet integrated in a host application, which is not limited herein.
[0038] In the embodiment of the present disclosure, the pre-injected page content data can be understood as pre-injected page data required for rendering the target applet page, such as text content, graphic content, and tables in the applet page. Moreover, the pre-injected page content data can include page basic rendering data and page supplementary rendering data. For example, the page basic rendering data can be represented as initData.
[0039] The page basis rendering data is necessary data required when the page of the applet is started and the page is rendered for the first time, and is used to provide basic content or state for the display of the page. The page supplementary rendering data is page data used to update the first rendering result after the first rendering based on the page basis rendering data, so that the updated applet page can display more rich information content. For example, the page supplementary rendering data can be obtained from the server side in advance or dynamically obtained from the server through asynchronous request or other manners, which is not limited herein.
[0040] For example, the page basis rendering data can include text, pictures, and basic configurations, etc. For example, the basic configurations can include component color, component style, background color, etc. The page supplementary rendering data can include user input data, page logic processing result, and other data. For example, the page logic processing result can include calculated result value and filtered list, etc.
[0041] That is, the page basis rendering data in the pre-injected page content data in the embodiment of the present disclosure is used to provide basic rendering content for the applet page, so that the user can see some basic content or layout when the page is loaded. The page supplementary rendering data is used to update and enrich the content of the applet page rendered based on the page basis rendering data, so as to obtain the final applet page.
[0042] Considering that the applet can run on the server, before step S101 is performed, the page content data of the target applet can be extracted from the logic code file of the target applet page by simulating starting the target applet on the server, and the page content data of the target applet is injected into the page style file corresponding to the rendering thread of the target applet by the server during the starting process of the target applet. Then, the rendering thread of the target applet can obtain the page content data from the page style file corresponding to itself during the running process, and perform page rendering according to the page content data, without waiting for the page content data sent by the logic thread, so as to improve the page rendering speed.
[0043] For example, the page style file of the target applet can be understood as a code file corresponding to the rendering thread, and the code file is specifically a page style file.
[0044] For example, the page style file can include page layout and page font data, etc.
[0045] In the embodiments of the present disclosure, the server can be a cloud server or a physical server. The cloud server has the advantages of high availability, elastic expansion, easy management, security, and flexibility compared with the physical server. Therefore, the server can be a cloud server in the embodiments of the present disclosure.
[0046] In some embodiments, when any target applet integrated in the host application is started by the user, that is, when the starting instruction of the user for the target applet is received, the electronic device provided in the embodiments of the present disclosure can synchronously run the logic thread and the rendering thread when starting the target applet, so as to load the logic code file corresponding to the logic thread through the logic thread, and load the page style file (page style code file) corresponding to the rendering thread through the rendering thread.
[0047] Since the page content data used for rendering the page is pre-injected in the page style file corresponding to the rendering thread, the rendering thread can obtain the page content data from the page style file corresponding to the rendering thread, and then perform the page rendering operation according to the page content data and the page style data. In this way, when the user opens any applet, the rendering thread of the applet can directly perform the page rendering operation according to the pre-injected page content data in the page style file corresponding to the rendering thread and the page style file, without waiting for the page content data sent by the logic thread, thereby improving the page rendering speed, effectively solving the problem that the page is in a white screen state for a long time due to the long waiting of the applet rendering thread for the page content data sent by the logic thread, and causing poor user experience.
[0048] The technical solutions disclosed in at least one embodiment of the present disclosure can reduce the page rendering time, improve the page rendering speed, and improve the user experience by responding to the starting instruction of the target applet, loading the page style file of the target applet page, and then rendering the target applet page according to the page style data and the pre-injected page content data in the page style file.
[0049] The page rendering method provided in the embodiments of the present disclosure will be further explained and described below in combination with FIG. 3. As shown in FIG. 3, the page rendering method can include the following steps:
[0050] S201, in response to a starting instruction of a target applet, loading a page style file of a page of the target applet and a logic code file of the page of the target applet.
[0051] In some embodiments, when the instruction of the user to open the target applet is received, the electronic device provided in the embodiments of the present disclosure can run the logic thread and the rendering thread of the target applet in parallel. Then, the logic code file of the page of the target applet is loaded through the logic thread, and the page style file of the target applet is loaded through the rendering thread.
[0052] S202, render the target mini-program page according to the page style data in the page style file and the pre-injected page content data.
[0053] Considering that the rendering thread is relatively simple in implementing logic when running the logical thread and the rendering thread in parallel, the rendering thread can be loaded into the page style file in advance compared with the logical thread. Further, the rendering thread can directly render the target mini-program page based on the page style data in the page style file loaded by itself and the pre-injected page content data.
[0054] S203, extract the original page content data of the target mini-program page from the logic code file.
[0055] S204, re-render the target mini-program page according to the original page content data of the target mini-program page.
[0056] After the rendering thread renders the target mini-program page, if the logical thread loads the logic code file, the original page content data used for rendering the target mini-program page is extracted from the logic code file by the logical thread at this time. Then, the original page content data extracted is sent to the rendering thread by the logical thread.
[0057] Further, when receiving the original page content data sent by the logical thread, the rendering thread can re-render the target mini-program page according to the received original page content data to obtain the final target mini-program page.
[0058] In some embodiments, the rendering thread re-renders the target mini-program page according to the received original page content data, for example, by comparing the original page content data with the pre-injected page content data to determine the incremental difference data between the original page content data and the pre-injected page content data. Further, the target mini-program page is re-rendered according to the incremental difference data to obtain the final target mini-program page.
[0059] In some embodiments, the rendering thread re-renders the target mini-program page rendered according to the incremental difference data can include one of the following cases:
[0060] In the first case, the incremental difference data is added to the pre-injected page content data to obtain updated pre-injected page content data. Further, the target mini-program page is re-rendered according to the updated pre-injected page content data and the page style data.
[0061] In the second case, the target mini-program page is incrementally rendered according to the incremental difference data to achieve the purpose of re-rendering the target mini-program page.
[0062] The technical solution disclosed by the embodiments of the present disclosure can reduce the page rendering time, improve the page rendering speed, and improve the user experience by responding to the starting instruction for the target mini-program, loading the page style file of the target mini-program page, and then rendering the target mini-program page according to the page style data in the page style file and the pre-injected page content data. In addition, after the rendering thread renders the target mini-program page based on the pre-injected page content data, the target mini-program page is re-rendered according to the original page content data sent by the logic thread, so that the final mini-program page displayed to the user corresponds to the page content data when the mini-program is actually running, thereby improving the page display quality on the basis of improving the page rendering speed.
[0063] In some embodiments, considering that the pre-injected page content data can include first type resource data and second type resource data, the first type resource data can be, for example, page basic rendering data, that is, initData, and the second type resource data can be, for example, page supplementary rendering data. Then, when the pre-injected page content data is the first type resource data, the page rendering method disclosed by the embodiments of the present disclosure is specifically described as follows:
[0064] As shown in FIG. 4, the page rendering method can include the following steps:
[0065] S301, in response to a starting instruction for a target mini-program, loading a page style file of the target mini-program page and a logic code file of the target mini-program page.
[0066] For example, when receiving an instruction of a user opening a target mini-program, the embodiments of the present disclosure can start the target mini-program and synchronously run the logic thread and the rendering thread corresponding to the target mini-program. Then, the logic thread loads the logic code file of the target mini-program page, and the rendering thread loads the page style file of the target mini-program.
[0067] S302, according to the page style data in the page style file and the first type resource data, performing first drawing on the target mini-program page to obtain a first drawing result of the target mini-program page.
[0068] In some embodiments, when the rendering thread first loads the page style file, the rendering thread can obtain the page style data for rendering the page and the first type of resource data (page basic rendering data) pre-injected from the page style file, and then perform first rendering on the target mini-program page according to the page style data and the pre-injected page basic rendering data to obtain a first rendering result of the target mini-program page. For example, first rendering (FP) can be understood as the time point when the rendering thread first draws pixels to the screen, that is, the time when the page first visually changes on the screen. Moreover, first rendering focuses on the time when any pixel starts to be drawn, without requiring the content to be actually readable or meaningful.
[0069] After the rendering thread performs first rendering on the target mini-program page, if the logic thread loads the logic code file and extracts the original page basic rendering data for rendering the page from the logic code file. At this time, the logic thread can send the extracted original page basic rendering data to the rendering thread. Then, after the rendering thread receives the original page basic rendering data sent by the logic thread, it can compare whether there is difference data between the original page basic rendering data and the pre-injected page basic rendering data. If it is determined that there is difference data, the first rendering result is updated according to the difference data, and if it is determined that there is no difference data, no processing is performed.
[0070] S303, updating and rendering the first rendering result of the target mini-program page according to the second type of resource data of the target mini-program page to obtain a final target mini-program page.
[0071] In order to display a page with actual meaning to the user, after the first rendering or first rendering update of the target mini-program page is performed by the rendering thread, the disclosure embodiment can send a page supplementary rendering data acquisition request to the logic thread, so that the logic thread loads the second type of resource data (page supplementary rendering data), and sends the loaded page supplementary rendering data to the rendering thread in the form of an update rendering event. For example, the page supplementary rendering data is carried in the update rendering event. Then, the rendering thread updates and renders the first rendering result of the target mini-program page according to the page supplementary rendering data corresponding to the update rendering event sent by the logic thread to obtain a final target mini-program page, that is, a target mini-program page with actual meaning.
[0072] In some embodiments, the logic thread of the embodiments of the present disclosure loads the page supplement rendering data and sends the loaded page supplement rendering data to the rendering thread. Specifically, the logic thread obtains the page supplement rendering data of the target mini-program page from the server through the page loading function page.onLoad, and generates an update rendering event according to the page supplement rendering data, and then sends the update rendering event to the rendering thread, so that the rendering thread updates the first drawing result of the target mini-program page according to the received update rendering event to obtain the final target mini-program page. For example, the update rendering event carries the page supplement rendering data of the target mini-program page.
[0073] The technical solution disclosed by the embodiments of the present disclosure can reduce the page rendering time, improve the page rendering speed, and improve the user experience by responding to the start instruction of the target mini-program, loading the page style file of the target mini-program page, and then rendering the target mini-program page according to the page style data in the page style file and the pre-injected page content data.
[0074] In order to more clearly illustrate the embodiments of the present disclosure, a specific example is used to illustrate the mini-program page rendering. As shown in FIG. 5, when the electronic device of the embodiments of the present disclosure receives the opening instruction of any target mini-program from the user, the logic thread and the rendering thread are simultaneously run to load the logic code file of the target mini-program through the logic thread and load the page style file of the target mini-program through the rendering thread.
[0075] For example, App.js in the logic thread is the entry file of the target mini-program, which includes the logic code of the target mini-program; App.onLaunch is an initialization function, which can be used to perform some initialization operations, such as setting global variables, etc.; App.onShow is a display function; Page.js is the entry file of each page, which can be used to specify the initial data, lifecycle callback, and event handling function of the page, etc.; Page.initData is the original page basic rendering data of the page, for example, the original page basic rendering data is the necessary data required for the first display of the page; Page.onLoad is a page loading function, which can be used to obtain page supplement rendering data from the server, etc.; Page.onShow is a page display function, which can be used to perform some operations required when the page is displayed, such as executing page transition effects, etc.; Page.onReady is a page initial rendering completion function; setData is a page update function, which can be used to update page data and views.
[0076] Because the rendering thread is relatively simple compared to the logic thread to implement logic, the rendering thread first loads the page style file of the target applet, and then the logic thread loads the logic code file of the target applet. Then, the rendering thread can perform first rendering on the target applet page according to the page style data in the loaded page style file and the pre-injected page basic rendering data, to obtain a first rendering result of the target applet page. After that, the rendering thread can send a page supplementary rendering data obtaining request to the logic thread, for example, send the first rendering result to the page first rendering end function Page.onReady in the logic thread, so that the logic thread loads the page supplementary rendering data of the target applet page from the server through the page loading function Page.onLoad, and generates an update rendering event according to the page supplementary rendering data, and then sends the update rendering event to the rendering thread. When the rendering thread receives the update rendering event sent by the logic thread, the rendering thread can perform update rendering on the first rendering result according to the page supplementary rendering data carried in the update rendering event, to obtain a first meaningful rendering result, that is, the final target applet page. In this disclosure, the first meaningful rendering result can be the first content rendering result in FIG. 5.
[0077] Next, a page rendering device proposed in an embodiment of the present disclosure is described with reference to FIG. 6. As shown in FIG. 6, the page rendering device 400 includes a file loading module 410 and a page rendering module 420.
[0078] The file loading module 410 is configured to load a page style file of a target applet page in response to a start instruction for the target applet.
[0079] The page rendering module 420 is configured to render the target applet page according to page style data in the page style file and pre-injected page content data.
[0080] In an implementation manner of the embodiment of the present disclosure, the page rendering device 400 further includes a data extraction module and a re-rendering module; wherein the file loading module 410 is further configured to load a logic code file of the target applet page; the data extraction module is configured to extract original page content data of the target applet page from the logic code file; and the re-rendering module is configured to re-render the target applet page according to the original page content data of the target applet page.
[0081] In an optional implementation manner of the embodiment of the present disclosure, the re-rendering module is specifically configured to determine incremental difference data between the original page content data and the pre-injected page content data; and re-render the target applet page according to the incremental difference data.
[0082] In an optional implementation of the embodiment of the present disclosure, the re-rendering module is further configured to add the incremental difference data into the pre-injected page content data, and re-render the target miniprogram page according to the updated pre-injected page content data and the page style data; or, incrementally render the target miniprogram page according to the incremental difference data.
[0083] In an optional implementation of the embodiment of the present disclosure, when the pre-injected page content data is the first type of resource data, the page rendering apparatus 400 further comprises: a first drawing module configured to perform first drawing on the target miniprogram page according to the page style data in the page style file and the first type of resource data, to obtain a first drawing result of the target miniprogram page; and a re-rendering module further configured to update render the first drawing result of the target miniprogram page according to the second type of resource data of the target miniprogram page, to obtain a final target miniprogram page.
[0084] In an optional implementation of the embodiment of the present disclosure, the re-rendering module is further configured to obtain the second type of resource data of the target miniprogram page from a server; generate an update rendering event according to the second type of resource data; and update render the first drawing result of the target miniprogram page according to the update rendering event, to obtain a final target miniprogram page.
[0085] In an optional implementation of the embodiment of the present disclosure, the page rendering apparatus 400 further comprises: a pre-injection module; wherein the pre-injection module is configured to simulate starting the target miniprogram on a server; extract, by the server, page content data of the target miniprogram from a logic code file of the target miniprogram page during the starting process of the target miniprogram; and inject, by the server, the page content data of the target miniprogram into a page style file of the target miniprogram.
[0086] It should be understood that the apparatus embodiments and the foregoing method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, no longer described here. Specifically, the apparatus 400 shown in FIG. 6 can perform the corresponding method embodiments of FIG. 2, and the foregoing and other operations and / or functions of each module in the apparatus 400 are respectively for realizing the corresponding processes in each method in FIG. 2, and for the sake of brevity, no longer described here.
[0087] The apparatus 400 of the embodiments of the present disclosure is described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, the steps of the first aspect method embodiments in the embodiments of the present disclosure can be completed by the integrated logic circuit of hardware in the processor and / or instructions of software. The steps of the first aspect method disclosed in the embodiments of the present disclosure can be directly embodied as hardware code processing for execution, or can be executed by a combination of hardware and software modules in the code processing. Alternatively, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above-mentioned first aspect method embodiments in combination with the hardware thereof.
[0088] FIG. 7 is a schematic block diagram of an electronic device provided by the embodiments of the present disclosure. As shown in FIG. 7, the electronic device 500 can include a memory 510 and a processor 520, the memory 510 being configured to store a computer program and transmit the program code to the processor 520. In other words, the processor 520 can invoke and run the computer program from the memory 510 to implement the page rendering method of the first aspect in the embodiments of the present disclosure.
[0089] For example, the processor 520 can be configured to execute the above-mentioned page rendering method according to the instructions in the computer program.
[0090] In some embodiments, the above-mentioned page rendering method comprises:
[0091] In response to a start instruction for the target mini-program, loading a page style file of the target mini-program page;
[0092] According to the page style data in the page style file and the pre-injected page content data, rendering the target mini-program page.
[0093] In some embodiments, the above-mentioned page rendering method further comprises:
[0094] Loading a logic code file of the target mini-program page;
[0095] From the logic code file, extracting original page content data of the target mini-program page;
[0096] According to the original page content data of the target mini-program page, re-rendering the target mini-program page.
[0097] In some embodiments, the re-rendering the target miniprogram page according to the original page content data of the target miniprogram page comprises:
[0098] determining incremental difference data between the original page content data and the pre-injected page content data;
[0099] re-rendering the target miniprogram page according to the incremental difference data.
[0100] In some embodiments, the re-rendering the target miniprogram page according to the incremental difference data comprises:
[0101] adding the incremental difference data to the pre-injected page content data, and re-rendering the target miniprogram page according to the updated pre-injected page content data and the page style data;
[0102] or, incrementally rendering the target miniprogram page according to the incremental difference data.
[0103] In some embodiments, when the pre-injected page content data is first-type resource data, the page rendering method further comprises:
[0104] first rendering the target miniprogram page according to page style data in the page style file and the first-type resource data to obtain a first rendering result of the target miniprogram page;
[0105] updating and rendering the first rendering result of the target miniprogram page according to second-type resource data of the target miniprogram page to obtain a final target miniprogram page.
[0106] In some embodiments, the updating and rendering the first rendering result of the target miniprogram page according to second-type resource data of the target miniprogram page to obtain a final target miniprogram page comprises:
[0107] obtaining the second-type resource data of the target miniprogram page from a server;
[0108] generating an update and rendering event according to the second-type resource data;
[0109] updating and rendering the first rendering result of the target miniprogram page according to the update and rendering event to obtain a final target miniprogram page.
[0110] In some embodiments, the page rendering method further comprises:
[0111] simulating starting the target miniprogram on a server;
[0112] In the target applet starting process, the server extracts page content data of the target applet from a logic code file of the target applet page;
[0113] The server injects the page content data of the target applet into a page style file of the target applet.
[0114] In some embodiments of the present disclosure, the processor 520 can include but is not limited to:
[0115] A general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and the like.
[0116] In some embodiments of the present disclosure, the memory 510 includes but is not limited to:
[0117] A volatile memory and / or a non-volatile memory. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and direct Rambus RAM (DR RAM).
[0118] In some embodiments of the present disclosure, the computer program can be divided into one or more modules stored in the memory 510 and executed by the processor 520 to complete the page rendering method provided by the present disclosure. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.
[0119] As shown in FIG. 7, the electronic device 500 can further include:
[0120] The transceiver 530 can be connected to the processor 520 or the memory 510.
[0121] For example, the processor 520 can control the transceiver 530 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 530 can include a transmitter and a receiver. The transceiver 530 can further include an antenna, and the number of antennas can be one or more.
[0122] It should be understood that various components in the electronic device are connected through a bus system, wherein the bus system includes a data bus, a power supply bus, a control bus and a state signal bus in addition to the data bus.
[0123] The embodiments of the present disclosure further provide a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to execute the page rendering method of the first aspect described above.
[0124] In some embodiments, the page rendering method described above comprises:
[0125] In response to a start instruction for the target mini-program, loading a page style file of the target mini-program page;
[0126] According to the page style data in the page style file and the pre-injected page content data, rendering the target mini-program page.
[0127] In some embodiments, the page rendering method further comprises:
[0128] Loading a logic code file of the target mini-program page;
[0129] From the logic code file, extracting original page content data of the target mini-program page;
[0130] According to the original page content data of the target mini-program page, re-rendering the target mini-program page.
[0131] In some embodiments, the re-rendering the target miniprogram page according to the original page content data of the target miniprogram page comprises:
[0132] determining the incremental difference data between the original page content data and the pre-injected page content data;
[0133] re-rendering the target miniprogram page according to the incremental difference data.
[0134] In some embodiments, the re-rendering the target miniprogram page according to the incremental difference data comprises:
[0135] adding the incremental difference data to the pre-injected page content data, and re-rendering the target miniprogram page according to the updated pre-injected page content data and the page style data;
[0136] or, incrementally rendering the target miniprogram page according to the incremental difference data.
[0137] In some embodiments, when the pre-injected page content data is first-type resource data, the page rendering method further comprises:
[0138] first rendering the target miniprogram page according to the page style data in the page style file and the first-type resource data to obtain a first rendering result of the target miniprogram page;
[0139] updating and rendering the first rendering result of the target miniprogram page according to the second-type resource data of the target miniprogram page to obtain a final target miniprogram page.
[0140] In some embodiments, the updating and rendering the first rendering result of the target miniprogram page according to the second-type resource data of the target miniprogram page to obtain a final target miniprogram page comprises:
[0141] obtaining the second-type resource data of the target miniprogram page from a server;
[0142] generating an update and rendering event according to the second-type resource data;
[0143] updating and rendering the first rendering result of the target miniprogram page according to the update and rendering event to obtain a final target miniprogram page.
[0144] In some embodiments, the page rendering method further comprises:
[0145] simulating starting the target miniprogram on a server;
[0146] In the target applet starting process, the server extracts page content data of the target applet from a logic code file of the target applet page;
[0147] The server injects the page content data of the target applet into a page style file of the target applet.
[0148] The embodiments of the present disclosure further provide a computer program product containing program instructions, which, when running on an electronic device, cause the electronic device to execute the page rendering method in the first aspect.
[0149] In some embodiments, the page rendering method comprises:
[0150] In response to a starting instruction for a target applet, loading a page style file of a target applet page;
[0151] According to page style data in the page style file and pre-injected page content data, rendering the target applet page.
[0152] In some embodiments, the page rendering method further comprises:
[0153] Loading a logic code file of the target applet page;
[0154] From the logic code file, extracting original page content data of the target applet page;
[0155] According to the original page content data of the target applet page, re-rendering the target applet page.
[0156] In some embodiments, the re-rendering the target applet page according to the original page content data of the target applet page comprises:
[0157] Determining incremental difference data between the original page content data and the pre-injected page content data;
[0158] According to the incremental difference data, re-rendering the target applet page.
[0159] In some embodiments, the re-rendering the target applet page according to the incremental difference data comprises:
[0160] Adding the incremental difference data to the pre-injected page content data, and re-rendering the target applet page according to the updated pre-injected page content data and the page style data;
[0161] Or, according to the incremental difference data, the target applet page is incrementally rendered.
[0162] In some embodiments, when the pre-injected page content data is first type resource data, the page rendering method further comprises:
[0163] According to the page style data in the page style file and the first type resource data, the target applet page is first drawn to obtain a first drawing result of the target applet page;
[0164] According to the second type resource data of the target applet page, the first drawing result of the target applet page is updated and rendered to obtain a final target applet page.
[0165] In some embodiments, the updating and rendering of the first drawing result of the target applet page according to the second type resource data of the target applet page to obtain a final target applet page comprises:
[0166] The second type resource data of the target applet page is obtained from the server;
[0167] According to the second type resource data, an update rendering event is generated;
[0168] According to the update rendering event, the first drawing result of the target applet page is updated and rendered to obtain a final target applet page.
[0169] In some embodiments, the page rendering method further comprises:
[0170] The target applet is simulated to start on the server;
[0171] During the starting process of the target applet, the page content data of the target applet is extracted from the logic code file of the target applet page through the server;
[0172] The page content data of the target applet is injected into the page style file of the target applet through the server.
[0173] When implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media can be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired computer program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, or a twisted pair, as examples, then the coaxial cable, fiber optic cable, or twisted pair are included in the definition of medium. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), and Blu-Ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0174] In one embodiment, the techniques described herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the techniques can be realized in whole or in part in a computer-readable medium during execution of software by a computer-based system, a processing device based system, or other system(s). Computer-readable media can include computer storage media and communication media. Storage media can be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, semiconductor memory, such as erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), or flash memory, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, functional modules can comprise components of an integrated circuit, programmable logic device, a field programmable gate array (FPGA), or other logic device implemented in a hardware device. In one embodiment, a functional module can comprise a computer program product that can be traded as a product. In another embodiment, a functional module can comprise a computer program product that can be downloaded or transferred via a network, such as the Internet, Intranet, Extranet, or a local area network.
[0175] In several embodiments provided in the present disclosure, it should be understood that the disclosed system, device, and method can be implemented in other manners. For example, the described device embodiments are merely illustrative. For example, the division of the modules is merely logical function division. There can be another division manner for the actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interface, device, or module, and can be in electrical, mechanical, or other forms.
[0176] The modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed to multiple network elements. Part or all of the modules can be selected to achieve the purpose of the embodiments of the present disclosure according to actual needs. For example, the functional modules in various embodiments of the present disclosure can be integrated in one processing module, or each module can be physically present separately, or two or more modules can be integrated in one module.
[0177] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that contains the function of the module or unit.
[0178] The above is merely specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A page rendering method, comprising: loading a page style file of a target applet page in response to a start instruction for the target applet; rendering the target applet page according to page style data in the page style file and pre-injected page content data. 2.The method of claim 1, further comprising: loading a logic code file of the target applet page; extracting original page content data of the target applet page from the logic code file; re-rendering the target applet page according to the original page content data of the target applet page.
3. The method of claim 2, wherein, The re-rendering the target applet page according to the original page content data of the target applet page comprises: determining incremental difference data between the original page content data and the pre-injected page content data; re-rendering the target applet page according to the incremental difference data.
4. The method of claim 3, wherein, The re-rendering the target applet page according to the incremental difference data comprises: adding the incremental difference data to the pre-injected page content data, and re-rendering the target applet page according to the updated pre-injected page content data and the page style data; or incrementally rendering the target applet page according to the incremental difference data. When the pre-injected page content data is first type resource data, the method further comprises:
5. The method according to any one of claims 1 to 4, wherein, first rendering the target applet page according to the page style data in the page style file and the first type resource data to obtain a first rendering result of the target applet page; updating and rendering the first rendering result of the target applet page according to second type resource data of the target applet page to obtain a final target applet page. The updating and rendering the first rendering result of the target applet page according to the second type resource data of the target applet page to obtain a final target applet page comprises:
6. The method of claim 5, wherein, obtaining the second type resource data of the target applet page from a server; generating an update and rendering event according to the second type resource data; updating and rendering the first rendering result of the target applet page according to the update and rendering event to obtain a final target applet page. 7.The method of any one of claims 1-6, further comprising: simulating starting the target applet on a server; extracting page content data of the target applet from a logic code file of the target applet page through the server during the starting of the target applet; injecting the page content data of the target applet into a page style file of the target applet through the server. 8.A page rendering apparatus, comprising: a file loading module configured to load a page style file of a target applet page in response to a start instruction for the target applet; a page rendering module configured to render the target applet page according to page style data in the page style file and pre-injected page content data. 9. An electronic device, comprising: A processor and a memory, the memory storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein, The computer program causes a computer to execute the method according to any one of claims 1 to 7.
11. A computer program product comprising program instructions, wherein, The program instructions, when run on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Applet page rendering method and device, electronic equipment and storage medium
CN112540806A
Applet page rendering method and device, electronic equipment and readable storage medium
CN112559086A
Page program generation method and device, computer equipment and storage medium
CN114168875A
Data processing method, computer device, and storage medium
US20230367616A1