Page rendering method, page display method, device, system, equipment and medium
By loading and running rendering executors and functions for target page types on the server side, the problem of long page rendering time in the prior art is solved, and more efficient page rendering is achieved.
Patent Information
- Application Number
- CN202411910721.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, the page rendering time is long, resulting in low rendering efficiency.
By loading the executor and corresponding functions for rendering the target page type on the server side, running these functions to render the target page data and sending the rendered data to the terminal for display.
Reduces the rendering pressure of the terminal, uses the server's ability to accelerate page rendering, shortens rendering time, and thus improves the rendering efficiency of the page.
Smart Images

Figure CN119903254A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a page rendering method, a page display method, an apparatus, a system, a device and a medium. Background Art
[0002] With the development of computer technology, web pages are increasingly widely used. When accessing a page, the rendering time of the page is an important indicator for measuring page performance. When a user accesses a page through a terminal, the terminal obtains the page data corresponding to the page and renders the page based on the page data. However, the current page rendering method requires a long rendering time, resulting in low page rendering efficiency. Summary of the invention
[0003] The present disclosure provides a page rendering method, a page display method, an apparatus, a system, a device and a medium, which can improve the rendering efficiency of a page. The technical solution of the present disclosure is as follows:
[0004] According to one aspect of an embodiment of the present disclosure, a page rendering method is provided, the method comprising:
[0005] Receiving a page access request sent by a terminal, wherein the page access request is used to access a target page;
[0006] Based on the page type of the target page, loading an executor for rendering a page of the page type and a function corresponding to the executor, wherein the function is used to render a page of the page type;
[0007] By means of the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page;
[0008] The rendering data of the target page is sent to the terminal.
[0009] In some embodiments, the page access request carries a page identifier of the target page; and before the executor runs the function to render the page data of the target page and obtains the rendered data of the target page, the method further includes:
[0010] Storing the page identifier in a parameter set of the executor;
[0011] The step of running the function through the executor to render the page data of the target page to obtain the rendering data of the target page includes:
[0012] The function is run through the executor, the page identifier is read from the parameter set, page data corresponding to the page identifier is obtained based on the page identifier, the page data of the target page is rendered, and the rendering data of the target page is obtained.
[0013] In some embodiments, the executor for rendering the page of the page type includes a first executor and a second executor; the executor runs the function to render the page data of the target page to obtain the rendering data of the target page, including:
[0014] By means of the first executor, a function corresponding to the first executor is run to obtain page data of the target page, and the page data is stored in a common parameter set corresponding to the first executor and the second executor;
[0015] The function corresponding to the second executor is run through the second executor, the page data is read from the common parameter set, the page data is rendered, and the rendering data of the target page is obtained.
[0016] In some embodiments, the executor for rendering the page of the page type includes a third executor and a fourth executor; the executing, by the executor, running the function to render the page data of the target page to obtain the rendering data of the target page includes:
[0017] Running the first function corresponding to the third executor through the third executor, and calling the fourth executor;
[0018] By means of the fourth executor, a function corresponding to the fourth executor is run to obtain page data of the target page, and the page data is stored in a common parameter set corresponding to the third executor and the fourth executor;
[0019] The second function corresponding to the third executor is run through the third executor, the page data is read from the common parameter set, the page data is rendered, and the rendering data of the target page is obtained.
[0020] In some embodiments, the executor for rendering the page of the page type includes a fifth executor and a sixth executor; the executor runs the function to render the page data of the target page to obtain the rendering data of the target page, including:
[0021] By means of the fifth executor, a function corresponding to the fifth executor is run to create a virtual environment, wherein the virtual environment is used to simulate an environment in which the terminal renders a page;
[0022] The function corresponding to the sixth executor is run through the sixth executor, and the page data of the target page is rendered in the virtual environment to obtain the rendering data of the target page.
[0023] In some embodiments, the function corresponding to the executor includes a third function and a fourth function; and the step of running the function through the executor to render the page data of the target page to obtain the rendering data of the target page includes:
[0024] By means of the executor, the third function is executed to obtain page data of the target page;
[0025] The fourth function is run through the executor to render the page data to obtain rendering data of the target page.
[0026] In some embodiments, after the executor executes the third function corresponding to the executor to obtain the page data of the target page, the method further includes:
[0027] During the process of the executor running the third function, storing the page data in a parameter set of the executor;
[0028] The step of running the fourth function corresponding to the executor through the executor to render the page data and obtain the rendering data of the target page includes:
[0029] The fourth function is run through the executor, the page data is read from the parameter set, the page data is rendered, and the rendering data of the target page is obtained.
[0030] In some embodiments, based on the page type of the target page, loading an executor for rendering a page of the page type and a function corresponding to the executor includes:
[0031] Based on the page type of the target page, query the function set corresponding to the page type from the first correspondence, the function set includes an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence includes multiple page types and a function set corresponding to each page type; or, based on the page type of the target page, query the executor corresponding to the page type and the function corresponding to the page type and the executor from the second correspondence, the second correspondence includes multiple executors, the page type corresponding to each executor, and the function run when each executor renders a page of the corresponding page type;
[0032] Load an executor for rendering a page of the page type and a function corresponding to the executor.
[0033] In some embodiments, before loading an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page, the method further includes:
[0034] In response to the page access request, creating a page rendering service;
[0035] The step of loading an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page includes:
[0036] By means of the page rendering service, based on the page type of the target page, the executor and the function are loaded into the page rendering service;
[0037] Before the executor runs the function to render the page data of the target page and obtains the rendered data of the target page, the method further includes:
[0038] The executor is run through the page rendering service.
[0039] In some embodiments, before running the executor through the page rendering service, the method further includes:
[0040] Generate a public parameter set corresponding to the executor through the page rendering service, wherein the public parameter set includes parameters corresponding to the page to be rendered;
[0041] After the executor runs the function and renders the page data of the target page to obtain the rendering data of the target page, the method further includes:
[0042] By means of the executor, the parameters corresponding to the page to be rendered in the common parameter set are updated to rendering data of the target page;
[0043] The sending the rendering data of the target page to the terminal includes:
[0044] The page data is read from the public parameter set through the page rendering service, and the rendering data of the target page is sent to the terminal.
[0045] According to another aspect of an embodiment of the present disclosure, a page display method is provided, the method comprising:
[0046] In response to the access operation to the target page, sending a page access request for the target page to the server;
[0047] Receiving rendering data of the target page returned by the server in response to the page access request, the rendering data being obtained by an executor running a function to render page data of the target page, the executor being used to render a page of a page type, the function being used to render a page of the page type, and the page type being the page type of the target page;
[0048] Based on the rendering data, the target page is displayed.
[0049] According to another aspect of an embodiment of the present disclosure, a page rendering system is provided, the page rendering system comprising a terminal and a server;
[0050] The terminal is used to send a page access request for the target page to the server in response to an access operation to the target page;
[0051] The server is used to receive the page access request; based on the page type of the target page, load an executor for rendering a page of the page type and a function corresponding to the executor, wherein the function is used to render a page of the page type; run the function through the executor to render the page data of the target page to obtain the rendering data of the target page; and send the rendering data of the target page to the terminal;
[0052] The terminal is further configured to receive rendering data of the target page sent by the server; and display the target page based on the rendering data.
[0053] According to another aspect of an embodiment of the present disclosure, a page rendering device is provided, the device comprising:
[0054] A receiving unit, configured to execute a page access request sent by a receiving terminal, wherein the page access request is used to access a target page;
[0055] a loading unit configured to execute, based on the page type of the target page, an executor for rendering a page of the page type and a function corresponding to the executor, wherein the function is used to render a page of the page type;
[0056] an operating unit, configured to execute the function through the executor, render the page data of the target page, and obtain the rendering data of the target page;
[0057] The sending unit is configured to send the rendering data of the target page to the terminal.
[0058] In some embodiments, the page access request carries a page identifier of the target page; the loading unit is further configured to execute storing the page identifier into a parameter set of the executor;
[0059] The running unit is configured to execute the function through the executor, read the page identifier from the parameter set, obtain the page data corresponding to the page identifier based on the page identifier, render the page data of the target page, and obtain the rendering data of the target page.
[0060] In some embodiments, the executor for rendering a page of the page type includes a first executor and a second executor; the running unit is configured to execute through the first executor, run the function corresponding to the first executor, obtain the page data of the target page, and store the page data in a common parameter set corresponding to the first executor and the second executor; through the second executor, run the function corresponding to the second executor, read the page data from the common parameter set, render the page data, and obtain the rendering data of the target page.
[0061] In some embodiments, the executor for rendering a page of the page type includes a third executor and a fourth executor; the running unit is configured to execute through the third executor, run a first function corresponding to the third executor, and call the fourth executor; through the fourth executor, run a function corresponding to the fourth executor, obtain page data of the target page, and store the page data in a common parameter set corresponding to the third executor and the fourth executor; through the third executor, run a second function corresponding to the third executor, read the page data from the common parameter set, render the page data, and obtain the rendering data of the target page.
[0062] In some embodiments, the executor for rendering the page of the page type includes a fifth executor and a sixth executor; the running unit is configured to execute through the fifth executor, run the function corresponding to the fifth executor, create a virtual environment, and the virtual environment is used to simulate the environment of the terminal rendering page; through the sixth executor, run the function corresponding to the sixth executor, render the page data of the target page in the virtual environment, and obtain the rendering data of the target page.
[0063] In some embodiments, the functions corresponding to the executor include a third function and a fourth function; the running unit is configured to execute the third function through the executor to obtain the page data of the target page; and to execute the fourth function through the executor to render the page data to obtain the rendering data of the target page.
[0064] In some embodiments, the loading unit is further configured to store the page data in a parameter set of the executor during the process of the executor running the third function;
[0065] The running unit is configured to execute the fourth function through the executor, read the page data from the parameter set, render the page data, and obtain the rendering data of the target page.
[0066] In some embodiments, the loading unit is configured to execute based on the page type of the target page, query the function set corresponding to the page type from a first correspondence relationship, the function set includes an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence relationship includes multiple page types and a function set corresponding to each page type; or, based on the page type of the target page, query the executor corresponding to the page type and the function corresponding to the page type and the executor from a second correspondence relationship, the second correspondence relationship includes multiple executors, the page type corresponding to each executor, and the function run when each executor renders a page of the corresponding page type; load the executor for rendering the page of the page type and the function corresponding to the executor.
[0067] In some embodiments, the apparatus further comprises:
[0068] A creating unit, configured to execute, in response to the page access request, creating a page rendering service;
[0069] The loading unit is configured to execute, through the page rendering service, based on the page type of the target page, loading the executor and the function into the page rendering service;
[0070] The running unit is further configured to execute the executor through the page rendering service.
[0071] In some embodiments, the apparatus further comprises:
[0072] A generating unit, configured to execute the page rendering service to generate a common parameter set corresponding to the executor, wherein the common parameter set includes parameters corresponding to the page to be rendered;
[0073] The loading unit is further configured to execute, through the executor, updating the parameters corresponding to the to-be-rendered page in the common parameter set to rendering data of the target page;
[0074] The sending unit is configured to execute the page rendering service, read the page data from the public parameter set, and send the rendering data of the target page to the terminal.
[0075] According to another aspect of an embodiment of the present disclosure, a page display device is provided, wherein the device comprises:
[0076] A sending unit, configured to execute, in response to an access operation to a target page, sending a page access request for the target page to a server;
[0077] a receiving unit, configured to receive rendering data of the target page returned by the server in response to the page access request, wherein the rendering data is obtained by an executor running a function to render page data of the target page, wherein the executor is used to render a page of a page type, and the function is used to render a page of the page type, and the page type is the page type of the target page;
[0078] The display unit is configured to display the target page based on the rendering data.
[0079] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:
[0080] one or more processors;
[0081] A memory for storing program codes executable by the processor;
[0082] The processor is configured to execute the program code to implement the above-mentioned page rendering method or page display method.
[0083] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When a program code in the computer-readable storage medium is executed by a processor of an electronic device, the electronic device can perform the above-mentioned page rendering method or page display method.
[0084] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which implements the above-mentioned page rendering method or page display method when executed by a processor.
[0085] In the solution provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor of the page for rendering the page type and the function corresponding to the executor, so that the corresponding function can be run through the executor. In the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, there is no need for the terminal to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's capabilities, which can shorten the time required for rendering the page, thereby improving the page rendering efficiency.
[0086] 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
[0087] 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.
[0088] Figure 1 The diagram is a schematic structural diagram of a page rendering system according to an exemplary embodiment.
[0089] Figure 2 The present invention is a flow chart of a page rendering method according to an exemplary embodiment.
[0090] Figure 3 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0091] Figure 4 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0092] Figure 5 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0093] Figure 6 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0094] Figure 7 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0095] Figure 8 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0096] Fig. 9 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0097] Fig.10 The figure is a flow chart of a page display method according to an exemplary embodiment.
[0098] Fig.11 The figure is a schematic diagram showing a life cycle function corresponding to the operation of an executor according to an exemplary embodiment.
[0099] Fig.12 The figure is a flowchart of another page rendering method according to an exemplary embodiment.
[0100] Fig.13 The diagram is a schematic diagram showing mutual calling of multiple executors according to an exemplary embodiment.
[0101] Fig.14 The diagram is a schematic diagram of multiple actuators in a business scenario according to an exemplary embodiment.
[0102] Fig.15 The present invention is a block diagram of a page rendering device according to an exemplary embodiment.
[0103] Fig.16 The figure is a block diagram of another page rendering device according to an exemplary embodiment.
[0104] Fig.17 The figure is a block diagram of a page display device according to an exemplary embodiment.
[0105] Fig.18 It is a block diagram of a terminal according to an exemplary embodiment.
[0106] Fig.19 It is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0107] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0108] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0109] The user information involved in this disclosure may be information authorized by the user or fully authorized by all parties. It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the page data, functions, executors and rendering data involved in this disclosure are all obtained with full authorization.
[0110] Figure 1 FIG. 1 is a schematic diagram showing a structure of a page rendering system according to an exemplary embodiment. Figure 1 The page rendering system includes: a terminal 101 and a server 102, and the terminal 101 is connected to the server 102 via a wireless network or a wired network.
[0111] The terminal 101 is used to access a page, and can send a page access request to the server 102 for the accessed page. The server 102 is used to provide services for the page, and can render rendering data of the accessed page for the terminal 101 in response to the page access request sent by the terminal 101, so that the terminal 101 can display the accessed page based on the rendering data.
[0112] The terminal 101 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, etc. The server 102 may be at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center.
[0113] In some embodiments, an application is installed and running on the terminal 101, and the server 102 is used to provide services for the application.
[0114] The terminal 101 is used to access a page provided by the application through the application, and can send a page access request to the server 102 through the application. The server 102 is used to render rendering data of the accessed page for the terminal 101 in response to the page access request sent by the terminal 101, and send the rendering data of the accessed page to the terminal 101 through the application, so that the terminal 101 displays the accessed page based on the rendering data through the application.
[0115] It should be noted that the number of the above servers 102 may be more or less, and the embodiment of the present disclosure does not limit this. Of course, the server 102 may also include other functional servers to provide more comprehensive and diversified services.
[0116] Figure 2 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 2 As shown, the method is executed by the server, and the method includes the following steps:
[0117] In step S201, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0118] In the disclosed embodiment, the server is used to provide page rendering services. When the terminal accesses any page, it sends a page access request to the server so that the server provides page rendering services to the terminal and returns rendering data of the accessed page to the terminal so that the terminal can display the accessed page based on the rendering data. In this way, the pressure on the terminal to render the page can be reduced, and the server's capabilities can be utilized to accelerate the rendering of the page, thereby ensuring the efficiency of the terminal accessing the page.
[0119] The target page is any page, for example, the target page is an item viewing page, a resource transfer page, etc. In the disclosed embodiment, the server is used to provide services for the target page and can render the page data of the target page. For example, the server is used to provide services for an application installed on the terminal, and the target page is a page in the application. When the terminal accesses the target page through the application, it sends a page access request to the server so that the server renders the target page for the terminal.
[0120] In step S202, based on the page type of the target page, an executor for rendering a page of the page type and a function corresponding to the executor are loaded, and the function is used to render a page of the page type.
[0121] In the embodiments of the present disclosure, the page types of different pages may be different. Considering that the rendering methods of pages of different page types may be different, during the development process, the corresponding rendering logic is configured according to the page type. After receiving the page access request, the server loads the corresponding rendering logic based on the page type of the target page to be accessed by the page access request, that is, loads the executor for rendering the page type and the function corresponding to the executor, so as to subsequently run the executor, so that the executor can run the corresponding function, and then the rendering of the target page can be realized.
[0122] In the disclosed embodiments, page types are divided according to the page compilation method, or according to the page function. For example, page types are divided according to the page compilation method, and there are two compilation methods: one is to compile code for the page, and the page rendering can be realized by running the compiled code; the other is to compose the page by adding page components to the page template. For these two compilation methods, two page types are divided, and different rendering logics are configured for different page types.
[0123] For another example, page types are divided according to page functions, including item viewing function, resource transfer function, login function, etc. In the process of rendering pages for implementing different functions, considering that the page data required to be obtained may be different, multiple page types are divided according to the functions of multiple pages, and different rendering logics are configured for different page types.
[0124] Among them, the executor is a standardized independent logic unit used to run the corresponding function. In the embodiment of the present disclosure, the executor is equivalent to a tool composed of code and used to run the corresponding function. The function corresponding to the executor refers to the function that the executor needs to run when rendering a page of the same page type as the target page, that is, the executor runs the corresponding function to realize the rendering of the page data of the page type corresponding to the executor. The function corresponding to the executor is also called the life cycle function of the executor.
[0125] In the embodiments of the present disclosure, for any page type, the executor used to render the page of the page type and the function corresponding to the executor are equivalent to the rendering logic of the page type. The rendering logic of different page types is different. In the rendering logic of different page types, the executors in the rendering logic of different page types may be different, or the executors in the rendering logic of different page types are the same but the functions corresponding to the executors are different.
[0126] In step S203, the function is run by the executor to render the page data of the target page to obtain the rendering data of the target page.
[0127] In the embodiment of the present disclosure, an executor for rendering a page of the page type is used to run a function corresponding to the executor. During the process of running the corresponding function, the page data of the target page can be rendered, and then the rendering data of the target page can be obtained, thereby realizing the rendering of the target page.
[0128] In the embodiment of the present disclosure, the page data of the target page indicates the content contained in the target page. At this time, the page data is discrete data and does not need to form a page for display; while the rendering data of the target page can indicate the content and layout of the target page, and is data that integrates the content contained in the target page. The page can be displayed subsequently based on the rendering data.
[0129] For example, the page data of the target page includes text, pictures, etc. in the target page. The rendering data of the target page not only includes the text, pictures, etc. in the target page, but also indicates the position of the text and the position of the picture in the target page.
[0130] For example, the target page is an item details page, and the page data of the target page includes the name, price, description, image, URL (Uniform Resource Locator), inventory quantity and other information of the product. The rendering data of the target page is HTML (Hyper Text Markup Language) data, which not only includes the name, price, description, image URL, inventory quantity and other information of the product, but also indicates the location of the name, price, description, image URL, inventory quantity and other information of the product in the target page.
[0131] In step S204, the rendering data of the target page is sent to the terminal.
[0132] In an embodiment of the present disclosure, the server responds to a page access request sent by a terminal, renders rendering data of the target page accessed for the terminal, and then sends the rendering data of the target page to the terminal to complete the response to the page access request, so that subsequent terminals can display the target page based on the rendering data of the target page.
[0133] In the solution provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor of the page for rendering the page type and the function corresponding to the executor, so that the corresponding function can be run through the executor. In the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, there is no need for the terminal to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's capabilities, which can shorten the time required for rendering the page, thereby improving the page rendering efficiency.
[0134] In the above Figure 2 On the basis of the illustrated embodiment, the embodiment of the present disclosure realizes data transmission through a parameter set of an actuator, and the specific process is detailed in the following embodiment.
[0135] Figure 3 is a flowchart of another page rendering method according to an exemplary embodiment. Figure 3 As shown, the method is executed by the server, and the method includes the following steps:
[0136] In step S301, a page access request sent by a terminal is received, the page access request is used to access a target page, and the page access request carries a page identifier of the target page.
[0137] The page access request is used to access the page indicated by the page identifier carried by the page access request. If the page identifier carried by the page access request is the target page, the page access request is used to access the target page. The page identifier can be represented in any form, for example, the page identifier is represented in the form of a string. The page access request is used to access the page indicated by the page identifier carried by the page access request.
[0138] In some embodiments, if the terminal is installed with an application provided by a server, the process of the server receiving a page access request includes: the terminal sends a page access request to the server through the application in response to an access operation to a target page in the application; and the server receives the page access request sent by the terminal.
[0139] The application is any application, for example, the application is a video application, an instant messaging application, a shopping application, etc. The target page is any page in the application, for example, the target page is the home page, the item viewing page, or the login page, etc. in the application.
[0140] In step S302, based on the page type of the target page, an executor for rendering a page of the page type and a function corresponding to the executor are loaded, and the function is used to render a page of the page type.
[0141] In some embodiments, the function corresponding to the executor is the life cycle function of the executor, and the life cycle function of the executor includes a Before (preparation phase) function, a Run (running phase) function, and an After (cleaning phase) function.
[0142] In the disclosed embodiment, when the executor runs the Before function, it can perform some preparatory work so that the subsequent executor can run the Run function. For example, when the executor runs the Before function, it establishes a database connection, sets query parameters, checks the cache, etc. After the executor runs the Before function, it can run the Run function to perform actual data acquisition and processing work. In the disclosed embodiment, when the executor runs the Run function, it can render the page data of the page. After the data acquisition and processing are completed, that is, after the executor runs the Run function, it can run the After function to perform some cleanup and subsequent processing work, such as closing resources, caching data, recording logs, etc.
[0143] In the disclosed embodiment, for any executor, there are one or more Before functions corresponding to the executor, there is only one Run function corresponding to the executor, and there are one or more After functions corresponding to the executor.
[0144] In some embodiments, step S302 includes: based on the page type of the target page, querying the function set corresponding to the page type from the first correspondence relationship, the function set including an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence relationship including multiple page types and a function set corresponding to each page type; loading the executor for rendering a page of the page type and a function corresponding to the executor.
[0145] In an embodiment of the present disclosure, a first correspondence is provided in the server, and the first correspondence includes a plurality of page types and a function set corresponding to each page type, and the function set corresponding to each page type is equivalent to the rendering logic corresponding to each page type. The server responds to a page access request, and based on the page type of the target page accessed by the page access request, queries from the first correspondence to query the function set corresponding to the page type of the target page. When the function set corresponding to the page type is queried, the executor in the function set is the executor for rendering the page of the page type, and the function of the executor in the function set is the function that needs to be run when the executor renders the page of the page type. Therefore, the executor in the function set and the function corresponding to the executor are loaded so that the page data of the target page can be rendered later.
[0146] In the embodiment of the present disclosure, a first correspondence is configured in the server so that the server can render pages of multiple page types, and for a page access request of any page type, the corresponding rendering logic can be quickly loaded by querying the first correspondence, thereby ensuring that the page access request can be responded to in a timely manner, so that the events consumed by page rendering can be reduced subsequently, thereby improving the page rendering efficiency.
[0147] Among them, the function set corresponding to each page type is equivalent to the rendering logic corresponding to the page type, and can also be called the cloud function corresponding to the page type.
[0148] In some embodiments, the same executor exists in the function sets corresponding to different page types, but the functions corresponding to the executors are different.
[0149] In the disclosed embodiment, for any page type, the rendering logic of the page type can be implemented by only at least one executor among the multiple executors. Therefore, the same executor may be used for different page types, but the same executor but the corresponding functions of the executor exist in the function sets corresponding to the different page types, so that the same executor can implement the rendering logic of different page types by executing different functions. In this way, the reuse of executors can be achieved, and different executors do not need to be developed for multiple page types, thereby ensuring development efficiency.
[0150] For example, for multiple page types in an application, only three executors need to be configured in the server. For any page type, at least one of the three executors can be used and the corresponding functions can be configured for the executor to complete the rendering logic configuration of the page type. According to the above method, for each page type, an executor can be selected from the three executors and the corresponding functions can be configured for it, so as to configure the rendering logic for multiple page types.
[0151] In some embodiments, step S302 includes: based on the page type of the target page, querying the executor corresponding to the page type and the function corresponding to the page type and the executor from the second correspondence relationship, the second correspondence relationship including multiple executors, the page type corresponding to each executor, and the function run when each executor renders a page of the corresponding page type; loading the executor for rendering the page of the page type and the function corresponding to the executor.
[0152] In the embodiment of the present disclosure, a second correspondence is set in the server, and the second correspondence includes multiple executors, the page type corresponding to each executor, and the function that runs when each executor renders a page of the corresponding page type. In the second correspondence, the executor corresponding to any page type and the function that runs when the executor corresponding to the page type renders a page of the page type are equivalent to the rendering logic of the page type. In response to the page access request, the server queries from the second correspondence based on the page type of the target page accessed by the page access request to query the executor corresponding to the page type and the function that runs when the executor corresponding to the page type renders a page of the page type, and loads the queried executor and the function corresponding to the executor so that the page data of the target page can be rendered later.
[0153] In the disclosed embodiment, a first correspondence is configured in the server so that the server can render pages of multiple page types, and for a page access request of any page type, the corresponding rendering logic can be quickly loaded by querying the first correspondence, ensuring that the subsequent response to the page access request can be timely, so that the subsequent events consumed by page rendering can be reduced, thereby improving page rendering efficiency. In addition, in the first correspondence, there is a situation where the same executor is applicable to different page types. For the same executor used for different page types, it is only necessary to set different functions for the executor, without having to develop different executors for multiple page types, so that the same executor can be reused for different page types to ensure development efficiency.
[0154] In step S303, the page identifier is stored in the parameter set of the executor.
[0155] In the disclosed embodiment, the executor has a parameter set, and the executor can access the data stored in the parameter set. Therefore, when the server receives a page access request for a target page, it not only loads the executor and the function corresponding to the executor for rendering the target page, but also adds the page identifier of the target page to the parameter set of the executor, so that when the executor subsequently runs the corresponding function, it can call the page identifier in the parameter set, thereby achieving the rendering of the target page.
[0156] The parameter set can also be called the Context of the executor, which is used to store data that can be called by the executor. For example, the parameter set stores attribute parameters, functions that can be called by the executor, and the like.
[0157] In some embodiments, the parameter set of the executor includes a public sub-set and a private sub-set, and the server stores the page identifier in the public sub-set of the executor.
[0158] Among them, the public sub-collection is used to store the public data of different executors, that is, the data contained in the public sub-collections in the parameter sets of different executors are synchronized to ensure that the data in the public sub-collections of different executors are the same. The private sub-collection is used to store the data that the executor itself can access. For example, the private sub-collection is used to store the data generated by the executor in the process of running the corresponding function. Any executor can only access its own private sub-collection, and cannot access the private sub-collections of other executors.
[0159] In some embodiments, the parameter set of the executor is a public parameter set corresponding to different executors, and the server stores the page identifier in the public parameter set of the executor.
[0160] In the disclosed embodiment, the executor has a common parameter set corresponding to it, and the common parameter set is used to store common data of different executors, that is, the common parameter set can be accessed by different executors. By storing the page identifier in the common parameter set, the subsequent executor can access the common parameter set to read the page identifier therefrom.
[0161] In step S304, the function is run through the executor, the page identifier is read from the parameter set, the page data corresponding to the page identifier is obtained based on the page identifier, the page data of the target page is rendered, and the rendering data of the target page is obtained.
[0162] In the embodiment of the present disclosure, in the process of running the corresponding function through the executor, the page identifier of the page to be rendered can be read from the parameter set of the executor, and then the corresponding page data can be obtained according to the read page identifier, and then the obtained page data can be rendered to obtain the rendering data of the target page.
[0163] In some embodiments, the process of acquiring corresponding page data based on the page identifier includes: the executor reads the page data corresponding to the page identifier from the database based on the page identifier during the process of running the corresponding function.
[0164] The database stores various page identifiers and page data corresponding to each page identifier, and different page identifiers indicate different pages. When the executor runs the corresponding function, it can access the database based on the page data read from the parameter set, and then obtain the page data corresponding to the page identifier from the database.
[0165] It should be noted that the embodiment of the present disclosure is explained by taking the example of storing the page identifier carried by the page access request in the parameter set of the executor. In another embodiment, there is no need to execute the above steps S303-S304, but other methods are adopted to run the function through the executor to render the page data of the target page and obtain the rendering data of the target page.
[0166] In step S305, the rendering data of the target page is sent to the terminal.
[0167] In some embodiments, the server sends rendering data of the target page and a page identifier of the target page to the terminal.
[0168] In the disclosed embodiment, in response to a page access request, the server not only returns rendering data to the terminal, but also returns a page identifier, so that the terminal knows which page the rendering data corresponds to, thereby ensuring the accuracy of the terminal display page.
[0169] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0170] In addition, the server stores the page identifier carried by the page access request in the parameter set of the executor, so that when the executor runs the corresponding function, it can read the page identifier of the page to be rendered from the parameter set of the executor, and then obtain the corresponding page data according to the read page identifier, and then render the obtained page data to obtain the rendering data of the target page. In this way, when the executor runs the corresponding function, the page rendering is performed based on the page identifier to ensure that the page rendered is the target page requested to be accessed by the page access request, thereby ensuring the accuracy of the page rendering.
[0171] In the above Figure 2 On the basis of the illustrated embodiment, in an embodiment of the present disclosure, page data of a target page is rendered through multiple executors, and the specific process is detailed in the following embodiment.
[0172] Figure 4 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 4 As shown, the method is executed by the server, and the method includes the following steps:
[0173] In step S401, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0174] The step S401 is the same as the above step S301 and will not be described again.
[0175] In step S402, based on the page type of the target page, multiple executors for rendering pages of the page type and a function corresponding to each executor are loaded, and the function is used to render pages of the page type.
[0176] In some embodiments, step S402 includes: based on the page type of the target page, querying the function set corresponding to the page type from the first correspondence relationship, the function set including an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence relationship including multiple page types and a function set corresponding to each page type; loading multiple executors for rendering a page of the page type and a function corresponding to each executor.
[0177] In an embodiment of the present disclosure, a first correspondence is set in the server, and the first correspondence includes a plurality of page types and a function set corresponding to each page type, and the function set corresponding to each page type is equivalent to the rendering logic corresponding to each page type. The server responds to a page access request, and based on the page type of the target page accessed by the page access request, queries from the first correspondence to query the function set corresponding to the page type of the target page. When the function set corresponding to the page type is queried, the plurality of executors in the function set are executors for rendering pages of the page type, and the function corresponding to each executor in the function set is the function that needs to be run when each executor renders a page of the page type. Therefore, the plurality of executors in the function set and the function corresponding to each executor are loaded so that the page data of the target page can be rendered later.
[0178] In some embodiments, step S402 includes: based on the page type of the target page, querying the executor corresponding to the page type and the function corresponding to the page type and the executor from the second correspondence relationship, the second correspondence relationship including multiple executors, the page type corresponding to each executor, and the function run when each executor renders a page of the corresponding page type; loading the executor for rendering the page of the page type and the function corresponding to the executor.
[0179] In the embodiment of the present disclosure, a second correspondence is set in the server, and the second correspondence includes multiple executors, the page type corresponding to each executor, and the function that runs when each executor renders a page of the corresponding page type. In the second correspondence, the executor corresponding to any page type and the function that runs when the executor corresponding to the page type renders a page of the page type are equivalent to the rendering logic of the page type. In response to the page access request, the server queries from the second correspondence based on the page type of the target page accessed by the page access request to query the multiple executors corresponding to the page type and the function that runs when each executor corresponding to the page type renders a page of the page type, and loads the queried multiple executors and the function corresponding to each executor so that the page data of the target page can be rendered later.
[0180] In step S403, a function corresponding to a first executor among the multiple executors is run to obtain page data of a target page, and the page data is stored in a common parameter set corresponding to the multiple executors.
[0181] In the embodiment of the present disclosure, the first executor is the first executor to be run among the multiple executors, and the first executor is used to obtain the page data of the page to be rendered, and the function corresponding to the first executor instructs the first executor to obtain the page data of the page to be rendered. In the process of the first executor running the corresponding function, the page data of the target page to be rendered can be obtained, and the obtained page data is stored in the common parameter set corresponding to the multiple executors, so that other executors can read the page data from the common parameter set and perform page rendering.
[0182] In the embodiment of the present disclosure, multiple executors correspond to a common parameter set, and the common parameter set is used to store common data of different executors, that is, the common parameter set can be accessed by different executors. The first executor stores the acquired page data of the target page in the common parameter set so that subsequent executors can access the common parameter set to read the page data of the target page therefrom. In the embodiment of the present disclosure, the multiple executors used to render the target page include the first executor and the second executor, and the common parameter set corresponding to the multiple executors is the common parameter set corresponding to the first executor and the second executor.
[0183] In some embodiments, the functions corresponding to the first executor include a Before function, a Run function, and an After function. By executing the Before function through the executor, a connection with a database storing page data can be established; thereafter, by running the Run function, page data of a target page can be obtained from the database based on the connection with the data; thereafter, by running the After function, the connection with the database storing page data can be canceled, thereby releasing the resources occupied by the first executor in running the corresponding function.
[0184] It should be noted that the process of the first executor acquiring the page data is the same as the process of acquiring the page data in the above steps S303 - S304 , and will not be described in detail here.
[0185] In step S404, a function corresponding to the second executor is run through the second executor among the multiple executors, page data is read from the common parameter set, and the page data is rendered to obtain rendering data of the target page.
[0186] In the embodiment of the present disclosure, the second executor is used to render a page based on the page data, and the function corresponding to the second executor instructs the second executor to read the page data of the page to be rendered from the public parameter set and render it. In the process of running the corresponding function by the second executor, the public parameter set can be accessed to read the page data of the page to be rendered from the public parameter set, and then render based on the read page data to obtain the rendering data of the target page.
[0187] In some embodiments, the function corresponding to the first executor includes a fifth function and a sixth function. The fifth function instructs the first executor to obtain page data of the page to be rendered, and the sixth function instructs the second executor to be called after the fifth function is completed. The process of obtaining rendering data includes: running the fifth function through the first executor to obtain page data of the target page, and storing the page data in a common parameter set corresponding to multiple executors; after the fifth function is completed, running the sixth function, calling the second executor, running the function corresponding to the second executor through the second executor, reading the page data from the common parameter set, rendering the page data, and obtaining rendering data of the target page.
[0188] In the embodiment of the present disclosure, the first executor and the second executor can cooperate to realize the rendering of the target page. The first executor is used to obtain the page data of the target page, and call the second executor to start the second executor to run, and render the page data obtained by the first executor to render the page data of the target page. In this way, the cooperation between different executors is realized to realize the rendering of the page, so that the same executor only needs to perform simple processing, and functions that call each other are configured in the two executors, which is convenient for developers to understand and configure the executors, ensuring the convenience of configuration of the rendering logic corresponding to each page type and ensuring the development efficiency of the rendering logic.
[0189] In some embodiments, the process of obtaining rendering data includes: running a function corresponding to a second executor among multiple executors, detecting in real time whether page data of a target page exists in a common parameter set, and when it is detected that page data of a target page exists in the common parameter set, reading the page data from the common parameter set, rendering the page data, and obtaining rendering data of the target page.
[0190] In the embodiment of the present disclosure, during the operation of the first executor, the second executor has started to run the corresponding function in order to detect in real time whether there is page data of the target page in the common parameter set, so that after the first executor stores the page data of the target page in the common parameter set, the second executor can obtain the page data of the target page from the common parameter set in a timely manner, thereby ensuring that the page data of the target page can be rendered in a timely manner, thereby ensuring the page rendering efficiency.
[0191] In some embodiments, the functions corresponding to the second executor include a Before function, a Run function, and an After function. By executing the Before function through the executor, a connection with the common parameter set can be established, and page data can be read from the common parameter set; thereafter, the Run function is run to render the page data of the target page; thereafter, the After function is run to release the resources occupied by the first executor in running the corresponding function.
[0192] It should be noted that the embodiment of the present disclosure is explained by taking the example of a first executor obtaining page data of a page to be rendered and a second executor rendering the page data. In another embodiment, there is no need to execute the above steps S402-S404, but other methods are adopted. Based on the page type of the target page, an executor for rendering a page of the page type and a function corresponding to the executor are loaded; through the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page.
[0193] In step S405, the rendering data of the target page is sent to the terminal.
[0194] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0195] Furthermore, the first executor is used to obtain page data of a target page, and the second executor is used to render the page data obtained by the first executor to render the page data of the target page. In this way, the rendering of the target page is achieved through the cooperation between the first executor and the second executor, so that the same executor only needs to perform simple processing, and there is no need to configure complex functions in the same executor, which is convenient for developers to understand and configure the executor, ensuring the convenience of configuration of the rendering logic corresponding to each page type, ensuring the development efficiency of the rendering logic, and at the same time, being able to ensure that the server implements the page rendering solution and ensures the page rendering efficiency.
[0196] In the above Figure 2 On the basis of the embodiment shown, the embodiment of the present disclosure uses multiple executors to render the page data of the target page, and different executors can be called. The specific process is detailed in the following embodiment.
[0197] Figure 5 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 5 As shown, the method is executed by the server, and the method includes the following steps:
[0198] In step S501, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0199] The step S501 is the same as the above step S301 and will not be described again.
[0200] In step S502, based on the page type of the target page, multiple executors for rendering pages of the page type and a function corresponding to each executor are loaded, and the function is used to render pages of the page type.
[0201] The step S502 is the same as the above step S402 and will not be described again.
[0202] In step S503, a first function corresponding to the third executor is run through the third executor among the multiple executors, and a fourth executor among the multiple executors is called.
[0203] In the embodiment of the present disclosure, the third executor is the first executor to be run among the multiple executors, and the third executor is used to render the page data of the page to be rendered. The function corresponding to the third executor includes a first function and a second function. The first function instructs the third executor to call the fourth executor so that the fourth executor obtains the page data of the page to be rendered, and the second function instructs the third executor to render the page data of the page to be rendered. The third executor runs the corresponding first function so that the fourth executor can obtain the page data of the page to be rendered later.
[0204] In step S504, a function corresponding to the fourth executor is run through the fourth executor to obtain page data of the target page, and the page data is stored in a common parameter set corresponding to the plurality of executors.
[0205] In the embodiment of the present disclosure, the fourth executor is used to obtain the page data of the page to be rendered. After the third executor runs the first function to call the fourth executor, the fourth executor starts to run. At this time, the fourth executor can run the corresponding function to obtain the page data of the current target page to be rendered, and store the obtained page data in the common parameter set corresponding to the multiple executors, so that other executors can read the page data from the common parameter set and render the page.
[0206] In the embodiment of the present disclosure, multiple executors correspond to a common parameter set, and the common parameter set is used to store common data of different executors, that is, the common parameter set can be accessed by different executors. The fourth executor stores the acquired page data of the target page in the common parameter set so that the third executor can access the common parameter set later to read the page data of the target page therefrom. In the embodiment of the present disclosure, the multiple executors used to render the target page include the third executor and the fourth executor, and the common parameter set corresponding to the multiple executors is the common parameter set corresponding to the third executor and the fourth executor.
[0207] It should be noted that the process of the fourth executor acquiring the page data is the same as the process of acquiring the page data in the above steps S303 - S304 , and will not be described in detail here.
[0208] In step S505, the second function corresponding to the third executor is run through the third executor, the page data is read from the public parameter set, the page data is rendered, and the rendering data of the target page is obtained.
[0209] In the embodiment of the present disclosure, when the fourth executor stores the page data of the target page in the public parameter set, the third executor can run the second function to read the page data of the target page from the public parameter set, thereby rendering the target page.
[0210] In some embodiments, step S505 includes: after the third executor completes running the first function, it runs the second function, and detects in real time whether there is page data of the target page in the public parameter set. When it is detected that there is page data of the target page in the public parameter set, the page data is read from the public parameter set, and the page data is rendered to obtain the rendering data of the target page.
[0211] In the embodiment of the present disclosure, after the third executor completes running the first function, the fourth executor has started running and runs the corresponding function to start obtaining the page data of the target page. The third executor automatically starts running the second function to detect in real time whether the page data of the target page exists in the public parameter set, so that the third executor can obtain the page data of the target page from the public parameter set in a timely manner to ensure that the page data of the target page can be rendered in a timely manner subsequently, thereby ensuring the page rendering efficiency.
[0212] In some embodiments, the function corresponding to the fourth executor includes a seventh function and an eighth function. The seventh function instructs the first to fourth executors to obtain page data of the page to be rendered, and the eighth function instructs to call the third executor after the seventh function is completed so that the third executor renders the page data. The process of obtaining the rendering data includes: running the seventh function through the fourth executor to obtain the page data of the target page, and storing the page data in a common parameter set corresponding to multiple executors; after the seventh function is completed, running the eighth function, calling the third executor, and running the second function corresponding to the third executor through the third executor, reading the page data from the common parameter set, rendering the page data, and obtaining the rendering data of the target page.
[0213] In the embodiment of the present disclosure, the third executor and the fourth executor can call each other so that the third executor and the fourth executor cooperate to realize the rendering of the target page. The third executor first runs the first function to call the fourth executor, so that the fourth executor runs the seventh function to obtain the page data of the target page and stores it in the common parameter set, and runs the eighth function to call the third executor, so that the third executor can continue to run the second function, read the page data from the common parameter set and render it, thereby realizing the cooperation between different executors to realize the page rendering scheme, and the same executor only needs to perform simple processing, and configures the functions that call each other in the two executors, which is convenient for developers to understand and configure the executors, ensuring the convenience of configuration of the rendering logic corresponding to each page type, and ensuring the development efficiency of the rendering logic.
[0214] It should be noted that the embodiment of the present disclosure is explained by taking the example of obtaining the rendering data of the target page through the third executor and the fourth executor, while in another embodiment, there is no need to execute the above steps S502-S505, but other methods are adopted. Based on the page type of the target page, the executor for rendering the page type and the function corresponding to the executor are loaded; through the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page.
[0215] In step S506, the rendering data of the target page is sent to the terminal.
[0216] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0217] Furthermore, the fourth executor is used to obtain page data of the target page, and the third executor is used to render the page data obtained by the fourth executor to render the page data of the target page. In this way, the rendering of the target page is achieved through the cooperation between the third executor and the fourth executor, so that the same executor only needs to perform simple processing, and there is no need to configure complex functions in the same executor, which is convenient for developers to understand and configure the executor, ensuring the convenience of configuration of the rendering logic corresponding to each page type, ensuring the development efficiency of the rendering logic, and at the same time, being able to ensure that the server implements the page rendering solution and ensures the page rendering efficiency.
[0218] In the above Figure 2 On the basis of the embodiment shown, the embodiment of the present disclosure realizes rendering of the target page by simulating the environment of terminal rendering page in the server. The specific process is detailed in the following embodiment.
[0219] Figure 6 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 6 As shown, the method is executed by the server, and the method includes the following steps:
[0220] In step S601, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0221] The step S601 is the same as the above step S301 and will not be described again.
[0222] In step S602, based on the page type of the target page, multiple executors for rendering pages of the page type and a function corresponding to each executor are loaded, and the function is used to render pages of the page type.
[0223] The step S602 is the same as the above step S402 and will not be described again.
[0224] In step S603, a function corresponding to the fifth executor is run through the fifth executor among the multiple executors to create a virtual environment, where the virtual environment is used to simulate an environment in which a terminal renders a page.
[0225] In the embodiment of the present disclosure, when the server renders the accessed page for the terminal, a virtual environment is created to simulate the environment in which the terminal renders the page. In this way, the server can subsequently render the page data of the target page in the virtual environment to ensure that the obtained rendering data is suitable for the terminal.
[0226] In an embodiment of the present disclosure, the multiple executors include a fifth executor and a sixth executor. The fifth executor is the first executor to run among the multiple executors. The fifth executor is used to create a virtual environment to simulate the environment of terminal rendering pages. After loading multiple executors for rendering target pages, by running the fifth executor, the fifth executor can run the corresponding function to create a virtual environment, which is convenient for subsequent rendering of page data of the target page in the virtual environment.
[0227] In step S604, a function corresponding to the sixth executor is executed by the sixth executor among the multiple executors to render the page data of the target page in the virtual environment to obtain the rendering data of the target page.
[0228] In the embodiment of the present disclosure, the sixth executor is used to render the page data of the page accessed by the terminal, and the second executor can run the corresponding function to obtain the page data of the target page and render the page data of the target page in a virtual environment to simulate the process of the terminal rendering the page data of the target page, thereby ensuring that the obtained rendering data is suitable for the terminal.
[0229] It should be noted that, in the embodiment of the present disclosure, the example of first running the fifth executor and then running the sixth executor is used for explanation. In another embodiment, the sixth executor can also be run first, and in the manner shown in steps S503-S505, the sixth executor runs a corresponding function, and the fifth executor can be called to enable the fifth executor to run the corresponding function to create a virtual environment. After that, the sixth executor executes another corresponding function, renders the page data of the target page in the virtual environment, and obtains the rendering data of the target page.
[0230] It should be noted that, in the process of the sixth executor obtaining page data, the sixth executor can obtain the target page data in the manner shown in the above step S304; it can also be in the manner shown in the above steps S403-S404, where other executors store the page data in a common parameter set, and then the sixth executor reads and renders from the common parameter set; it can also be in the manner shown in the above steps S503-S505, where other executors are called to obtain the page data of the target page and store it in a common parameter set, and then the sixth executor reads and renders from the common parameter set. Afterwards, when the sixth executor obtains the page data of the target page, it renders the page data of the target page in the virtual environment.
[0231] It should be noted that the embodiment of the present disclosure realizes the rendering of the target page by simulating the terminal rendering page environment in the server, while in another embodiment, there is no need to execute the above steps S602-S604, but other methods are adopted. Based on the page type of the target page, an executor for rendering the page type and the function corresponding to the executor are loaded; through the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page.
[0232] In step S605, the rendering data of the target page is sent to the terminal.
[0233] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0234] Furthermore, in the process of rendering the accessed page for the terminal, the server creates a virtual environment to simulate the environment of the terminal rendering the page, so that the server can subsequently render the page data of the target page in the virtual environment to ensure that the rendered data is suitable for the terminal, avoiding the situation where the rendered data rendered by the server cannot be adapted to the terminal, and ensuring the rendering accuracy. Furthermore, the rendering of the target page is achieved through the cooperation between the fifth executor and the sixth executor, so that the same executor only needs to perform simple processing, and there is no need to configure complex functions in the same executor, which is convenient for developers to understand and configure the executor, ensuring the convenience of configuring the rendering logic corresponding to each page type, ensuring the development efficiency of the rendering logic, and at the same time, being able to ensure that the server implements the page rendering solution and ensures the page rendering efficiency.
[0235] In the above Figure 2 On the basis of the illustrated embodiment, the executor in the embodiment of the present disclosure corresponds to a plurality of functions, and the specific process is detailed in the following embodiment.
[0236] Figure 7 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 7 As shown, the method is executed by the server, and the method includes the following steps:
[0237] In step S701, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0238] The step S701 is the same as the above step S301 and will not be described again.
[0239] In step S702, based on the page type of the target page, an executor for rendering a page of the page type and a plurality of functions corresponding to the executor are loaded, and the plurality of functions are used to render a page of the page type.
[0240] The step S702 is the same as the above step S402 and will not be described again.
[0241] In step S703, the third function corresponding to the executor is run through the executor to obtain the page data of the target page.
[0242] In the embodiment of the present disclosure, the executor corresponds to multiple functions, and different functions are used to implement different functions. The multiple functions corresponding to the executor include a third function and a fourth function, the third function is used to obtain page data of a target page, and the fourth function is used to render the page data of the target page obtained by the third function. Since the fourth function depends on the third data, the corresponding third function is run by the executor to obtain the page data of the target page, so as to ensure that the fourth function can be run subsequently.
[0243] It should be noted that the process of the executor running the third function to obtain the page data of the target page is the same as the process of obtaining the page data in the above steps S303-S304, which will not be repeated here.
[0244] In step S704, the fourth function corresponding to the executor is run through the executor to render the page data to obtain the rendering data of the target page.
[0245] In the embodiment of the present disclosure, after the executor completes running the third function, the page data of the target page has been obtained, and then the executor runs the fourth function to render the page data of the target page to obtain the rendering data of the target page.
[0246] In some embodiments, the executor has a parameter set, and the parameter set is used to store the results obtained by the executor during the execution of the function. The process of obtaining rendering data includes: during the process of the executor running the third function, the page data is stored in the parameter set of the executor; through the executor, the fourth function is run, the page data is read from the parameter set, the page data is rendered, and the rendering data of the target page is obtained.
[0247] In the embodiment of the present disclosure, the executor corresponds to a third function and a fourth function, and the fourth function depends on the result of the third function. During the process of the executor running the third function, the page data of the target page is obtained, and the page data of the target page is stored in the parameter set of the executor, so that when the executor runs the fourth function, the page data of the target page can be read from the parameter set and then rendered, thereby realizing the interaction between the executor running different functions, and can ensure the normal progress of the executor running multiple functions, thereby ensuring the rendering accuracy.
[0248] Among them, the parameter set of the executor can store the private data of the executor. The page data obtained by the executor by running the third function is equivalent to the private data of the executor, which is stored in the parameter set of the executor, so that the executor itself can access the private data in the parameter set.
[0249] It should be noted that the embodiment of the present disclosure is explained by taking the executor corresponding to multiple functions as an example. In another embodiment, there is no need to execute the above steps S702-S704. Instead, other methods are adopted to load the executor for rendering the page type and the function corresponding to the executor based on the page type of the target page; through the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page.
[0250] In step S705, the rendering data of the target page is sent to the terminal.
[0251] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0252] Moreover, for any page type, by configuring multiple functions for the executor, the executor can run multiple function sets to render the page data of the page type. There is no need to configure multiple executors for the same page type, which can reduce the required configuration data and facilitate developers to configure the executor. It ensures the convenience of configuring the rendering logic corresponding to each page type and the development efficiency of the rendering logic. At the same time, it can ensure that the server implements the page rendering solution and ensures the page rendering efficiency.
[0253] In the above Figure 2 On the basis of the illustrated embodiment, in the disclosed embodiment, the server will create a page rendering service for any page access request to respond to the page access request. The specific process is described in detail in the following embodiment.
[0254] Figure 8 is a flow chart of a page rendering method according to an exemplary embodiment. Figure 8 As shown, the method is executed by the server, and the method includes the following steps:
[0255] In step S801, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0256] The step S801 is the same as the above step S301 and will not be described again.
[0257] In step S802, in response to the page access request, a page rendering service is created.
[0258] In the embodiment of the present disclosure, the page rendering service is a virtual service created in the server, which is used to respond to the page access request so as to render the rendering data of the accessed page for the terminal.
[0259] Among them, the page rendering service is any type of virtual service. For example, the page rendering service is a FaaS (Function as a Service) application in the server. The FaaS application is a virtual application. In response to receiving a page access request sent by a terminal, the server starts the FaaS application so that the page access request can be responded to through the FaaS application later. Among them, FaaS is a way to implement Serverless (serverless architecture), allowing developers to deploy and execute code in the form of functions.
[0260] In step S803, through the page rendering service, based on the page type of the target page, the executor for rendering the page of the page type and the function corresponding to the executor are loaded into the page rendering service, and the function is used to render the page of the page type.
[0261] In an embodiment of the present disclosure, an executor and a function corresponding to the executor for rendering a target page are loaded through a page rendering service, and the executor and the function corresponding to the executor are loaded into the page rendering service, so that the executor can be subsequently run in the page rendering service and the corresponding function can be run by the executor to realize the rendering of the target page.
[0262] In step S804, the executor is run through the page rendering service.
[0263] In the disclosed embodiment, the executor is run through the page rendering service. At this time, the page rendering service is equivalent to the running environment of the executor, so that the subsequent executor can run the corresponding function and then render the target page.
[0264] It should be noted that the embodiment of the present disclosure is explained by taking the example of responding to a page access request by creating a page rendering service. In another embodiment, there is no need to execute the above steps S802-S804. Instead, other methods are adopted to load an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page, and the function is used to render a page of the page type.
[0265] In step S805, the function is run by the executor to render the page data of the target page to obtain the rendering data of the target page.
[0266] The step S805 is the same as the above step S203 and will not be described again.
[0267] In step S806, the rendering data of the target page is sent to the terminal.
[0268] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0269] In addition, in response to receiving a page access request sent by the terminal, the server creates a page rendering service for responding to the page access request, so that the executor for rendering the target page and the function corresponding to the executor are loaded into the page rendering service through the page rendering service, and an operating environment is provided for the executor, so that the executor can be run, so that the executor can run the corresponding function, and then the target page is rendered. In this way, the server can respond to the page access request, and the feasibility of the server to perform page rendering instead of the terminal is guaranteed, thereby ensuring the use of the server's capabilities to accelerate page rendering and further improve page rendering efficiency.
[0270] In the above Figure 8 On the basis of the illustrated embodiment, in the embodiment of the present disclosure, the interaction between the page rendering service and the executor is realized through the common parameter set corresponding to the executor. The specific process is detailed in the following embodiment.
[0271] Fig. 9 is a flow chart of a page rendering method according to an exemplary embodiment. Fig. 9 As shown, the method is executed by the server, and the method includes the following steps:
[0272] In step S901, a page access request sent by a terminal is received, where the page access request is used to access a target page.
[0273] The step S901 is the same as the above step S301 and will not be described again.
[0274] In step S902, in response to the page access request, a page rendering service is created.
[0275] In step S903, through the page rendering service, based on the page type of the target page, the executor and the function corresponding to the executor for rendering the page of the page type are loaded into the page rendering service, and the function is used to render the page of the page type.
[0276] The steps S902-S903 are similar to the above steps S802-S803 and will not be described again.
[0277] In step S904, a common parameter set corresponding to the executor is generated through the page rendering service, where the common parameter set includes parameters corresponding to the page to be rendered.
[0278] In the disclosed embodiment, a common parameter set corresponding to the executor is generated through a page rendering service. The common parameter set includes parameters corresponding to the page to be rendered, which is equivalent to completing the initialization of the common parameter set. In the subsequent process of rendering the target page through the executor, the obtained rendering data of the target page is stored in the common parameter set to ensure the storage of the rendering data of the target page, and also enable the subsequent page rendering service to manage the rendering data of the target page, and then provide feedback to the terminal.
[0279] The parameters corresponding to the page to be rendered are used to represent the page to be rendered. At this time, the parameters corresponding to the page to be rendered in the public parameter set are empty, indicating that the rendering data of the target page has not been generated. When the rendering data of the target page is obtained later, the rendering data can be stored in the public parameter set to update the parameters corresponding to the page to be rendered.
[0280] In step S905, the executor is run through the page rendering service.
[0281] The step S905 is the same as the above step S804 and will not be described again.
[0282] In step S906, the function is run by the executor to render the page data of the target page to obtain the rendering data of the target page.
[0283] The step S906 is the same as the above step S203 and will not be described again.
[0284] In step S907, the parameters corresponding to the page to be rendered in the common parameter set are updated to rendering data of the target page through the executor.
[0285] In the embodiment of the present disclosure, when the executor renders and obtains the rendering data of the target page, the rendering data of the target page can be stored in a common parameter set to update the parameters corresponding to the page to be rendered in the common parameter set. The updated parameters are the rendering data of the target page so that the subsequent page rendering service can read them.
[0286] In step S908, the page data is read from the public parameter set through the page rendering service, and the rendering data of the target page is sent to the terminal.
[0287] In the disclosed embodiment, the page rendering server can read the page data of the target page from the public parameter set and then feed back to the terminal, so that the page rendering service can respond to the page access request sent by the terminal.
[0288] It should be noted that the embodiment of the present disclosure is explained by taking the interaction between the page rendering service and the executor through the public parameter set corresponding to the executor as an example. In another embodiment, there is no need to execute the above steps S904 and S907-S908, but other methods are adopted to send the rendering data of the target page to the terminal.
[0289] In the disclosed embodiment, a common parameter set is generated for the executor through the page rendering service, so that after the executor renders the rendering data of the target page, the rendering data of the target page is stored in the common parameter set, thereby enabling the page rendering service to read the rendering data of the target page from the common parameter set and return it to the terminal. In this way, the interaction between the page rendering service and the executor is realized through the common parameter set, thereby ensuring that the page rendering service responds to the page access request, enabling the server to respond to the page access request, and also ensuring the feasibility of the server to perform page rendering instead of the terminal, thereby ensuring the use of the server's capabilities to accelerate page rendering and further improve page rendering efficiency.
[0290] Fig.10 is a flow chart of a page display method according to an exemplary embodiment. Fig.10 As shown, the method is executed by a terminal, and the method includes the following steps:
[0291] In step S1001, in response to an access operation to a target page, a page access request for the target page is sent to a server.
[0292] In the disclosed embodiment, the terminal can access any page. After detecting an access operation to any page, the terminal generates a page access request for the page and sends the page access request to the server so that the server helps the terminal render the page.
[0293] In step S1002, the rendering data of the target page returned by the receiving server in response to the page access request is obtained by the executor running the function to render the page data of the target page. The executor is used to render pages of page type, and the function is used to render pages of page type, and the page type is the page type of the target page.
[0294] In the embodiment of the present disclosure, the server renders rendering data of the target page in response to the page access request and returns the rendering data to the terminal, and the terminal can receive the page data of the target page sent by the server.
[0295] It should be noted that the process in which the server renders the rendering data of the target page in response to the page access request is similar to the above Figures 2 to 9 The same is true for the embodiment shown, which will not be described in detail here.
[0296] In step S1003 , the target page is displayed based on the rendering data.
[0297] In the disclosed embodiment, the terminal can display the target page based on the rendering data, thereby achieving access to the target page.
[0298] The rendering data of the target page is used to represent the content and layout of the target page, and the terminal can display the target page based on the rendering data of the target page.
[0299] In some embodiments, step S1003 includes: the terminal parses the rendering data of the target page, and renders the target page based on the parsed data.
[0300] In the disclosed embodiment, after the terminal parses the rendering data of the target page, it renders the target page based on the parsed data. In this way, there is no need for the terminal to render the rendering data of the target page. The server renders the rendering data of the target page instead of the terminal, and the server's capability is better than that of the terminal. The time required for the server to obtain the rendering data of the target page is short. This can shorten the time from triggering the access operation to the target page to displaying the target page, and can improve the rendering efficiency of the target page.
[0301] In the solution provided by the embodiment of the present disclosure, the terminal responds to the access operation to any page by interacting with the server, and the server renders the rendering data of the accessed page instead of the terminal, and then the accessed page can be displayed based on the rendering data. There is no need for the terminal to render the rendering data of the accessed page. The capability of the server is better than that of the terminal, and the time required for the server to render the rendering data of the accessed page is short. This can shorten the time from triggering the access operation to the target page to displaying the target page, and can improve the rendering efficiency of the target page.
[0302] In the above Figure 1 Based on the illustrated embodiment, the present disclosure further provides a page rendering system, which includes a terminal and a server;
[0303] The terminal is used to send a page access request for the target page to the server in response to the access operation to the target page;
[0304] The server is used to receive a page access request; based on the page type of the target page, loads an executor for rendering a page of the page type and a function corresponding to the executor, the function being used to render a page of the page type; through the executor, runs the function to render the page data of the target page to obtain the rendering data of the target page; and sends the rendering data of the target page to the terminal.
[0305] The terminal is also used to receive rendering data of the target page sent by the server; and display the target page based on the rendering data.
[0306] It should be noted that the steps performed by the above terminal and server are the same as those Figures 2 to 10 The same is true for the embodiment shown, which will not be described again here.
[0307] In the scheme provided by the embodiment of the present disclosure, the server responds to the page access request sent by the terminal, and loads the corresponding rendering logic according to the page type of the target page accessed by the terminal, that is, loads the executor and the function corresponding to the executor for rendering the page type, so that the corresponding function can be run through the executor, and in the process of running the corresponding function, the page data of the target page is rendered, and then the rendering data of the target page is obtained, and the rendering data of the target page is sent to the terminal to complete the response to the page access request, so that the subsequent terminal can display the target page based on the rendering data of the target page. In this way, the terminal does not need to render the page data of the accessed page, which can reduce the pressure on the terminal, and the page can be rendered with the help of the server's ability to shorten the time required for rendering the page, thereby improving the rendering efficiency of the page. In addition, when configuring the rendering logic of the page in the server, only the executor and the function corresponding to the executor are configured for the page type. This configuration method of the rendering logic uses a function to define the server-side running logic, which is convenient for developers to better understand its execution intention and execution process, and can facilitate development and improve development efficiency.
[0308] It should be noted that the above-mentioned multiple embodiments can be arbitrarily combined to form optional embodiments of the present disclosure, which will not be described one by one here.
[0309] It should be noted that, for the multiple executors corresponding to any page type and the functions corresponding to each executor, the above-mentioned multiple embodiments only show examples of the calling relationship between the multiple executors. In another embodiment, for the multiple executors corresponding to any page type, any calling relationship can be adopted to call each other. By configuring the functions corresponding to each executor, mutual calling between different executors can be realized.
[0310] In the field of Web (network) technology, the rendering time of a page is an important indicator for measuring page performance. If the rendering time of a page is too long, the user experience will be poor. In order to improve the rendering efficiency of the page and shorten the loading time of the page, the SSR (Server Side Render) method is adopted to optimize the page performance and improve the rendering efficiency of the page with the help of the server's capabilities. At present, SSR usually uses the Severless (serverless architecture) architecture. Severless is a relatively advanced architecture model in the current computer technology field. Developers do not need to pay attention to the management and operation of the underlying server, and take over the operation and maintenance through third-party developers. This architecture allows business developers to focus on business development, while operating and maintaining the server through a third party, which is conducive to unified scheduling of resources and reducing server costs. However, the current solution for page rendering through the server requires a poor rendering time, and the process of developing rendering logic on the server side is complicated, which has high requirements for developers, resulting in high development costs for rendering logic.
[0311] In the solution provided by the embodiment of the present disclosure, when configuring the rendering logic of the page in the server, an executor and a life cycle function (Hook) corresponding to the executor are introduced. In the process of configuring the rendering logic corresponding to any page type, the required executor and the life cycle function corresponding to each executor are configured for the page type. In this way, when rendering a page of this page type subsequently, the executor runs the corresponding life cycle function by running the configured executor, and even renders the rendering data of the page of this page type. This way of configuring the rendering logic can realize the reuse of the executor, facilitate the rapid configuration of the rendering logic of each page type, and thus improve the development efficiency. In addition, the code required to be executed by the executor is edited by configuring the life cycle function for the executor. Since the function can clearly describe the processing process required to be executed by the executor, it is convenient for developers to understand the execution intention and processing process of the executor, and it is also convenient for developers to customize the configuration of the executor, and provide variables for developers to configure the rendering logic of each page type, further improving the development efficiency.
[0312] In the embodiments of the present disclosure, the executor and the life cycle function corresponding to the executor are described in detail.
[0313] The executor is a standardized independent logic unit abstracted according to certain rules in the page rendering process, which describes the execution process of the page rendering process. During the operation, the executor can run the corresponding life cycle function, access the corresponding parameter set (i.e. Context), and call other executors.
[0314] The lifecycle functions corresponding to the executor are used to standardize the various execution processes of the executor, making it easier for developers to inject logic into the different stages of the executor. The lifecycle functions corresponding to the executor are used to describe the processes executed by the executor at different stages and can configure the execution logic of the executor.
[0315] The parameter set of an executor includes public parameters and private parameters. The parameter set of an executor can also be divided into a public sub-set and a private sub-set. The public sub-set is used to store public parameters, and the private sub-set is used to store private parameters. Each executor can access the parameters in its own parameter set during operation. For different executors, the public parameters in the parameter sets of different executors are the same, while the private parameters in the parameter sets of different executors are different. The executor can access the private parameters and public parameters in its own parameter set during the execution of the corresponding lifecycle function. The data in the parameter set of each executor can only be accessed by itself. Among them, public parameters include public attributes, public functions, etc. Private parameters include private attributes, private methods, etc. Public parameters are capabilities provided by the FaaS base. The FaaS base is provided for all businesses, centrally processes server-side logic, and is the basis for the operation of business cloud functions. For example, public parameters are services such as logs, caches, and file reading.
[0316] For example, the life cycle functions corresponding to the executor include Before function, Run function and After function. The process of the executor running the corresponding life cycle function is as follows: Fig.11 As shown, the executor runs the Before function first, then the Run function, and finally the After function. In the process of running each life cycle function, the executor can access its own parameter collection.
[0317] Based on the above Figures 2 to 11 Based on the embodiment shown in FIG. 1 , the embodiment of the present disclosure also provides a flow chart of a page rendering method, such as Fig.12 As shown, the method is executed by a server, and the method includes:
[0318] In step S1201, in response to a page access request for a target page sent by a terminal, a FaaS application is started.
[0319] In step S1202, after the FaaS application is started, based on the page type of the target page, the cloud function corresponding to the page type is first loaded. The cloud function includes an executor for rendering the page of the page type and a lifecycle function corresponding to the executor. The cloud function corresponding to the page type is loaded into the FaaS application.
[0320] In the disclosed embodiment, the rendering logic corresponding to each page type is stored in the form of cloud functions.
[0321] In step S1203, the FaaS application initializes the common parameters in the parameter set of the executor.
[0322] In the disclosed embodiment, the common parameters are various server capabilities and parameters that need to be processed this time, and the parameters that need to be processed this time are the parameters corresponding to the page to be rendered.
[0323] In step S1204, the entry executor is run through the FaaS application.
[0324] The entry executor is the first executor among multiple executors used to render pages of this page type. In the disclosed embodiment, the order of multiple executors has been declared in the cloud function, that is, the entry executor among multiple executors has been declared, or, based on the dependency relationship between the lifecycle functions of multiple executors, the entry executor can be determined from multiple executors.
[0325] In step S1205, during the operation of the entry executor, the private parameters in the parameter set of the entry executor will be initialized first; then, the Before function, Run function and After function will be executed in sequence; after the three life cycle functions are completed, the parameters in the parameter set of the entry executor will be released and the entry executor will exit.
[0326] In the disclosed embodiment, private parameters are parameters that the executor needs to use throughout its entire life cycle.
[0327] When the entry executor runs the three lifecycle functions, it can access the parameter set of the entry executor to use the private parameters or public parameters in the parameter set. In addition, when the entry executor runs the three lifecycle functions, it may call other executors to run other executors. The running process of other executors is the same as that of the above entry executor. After the entry executor runs the three lifecycle functions, it means that the business logic of the entry executor has been executed.
[0328] In step S1206, when the executors used to render pages of this page type have completed running the corresponding lifecycle functions, the rendering data of the target page will be output, and the parameters of the page to be rendered included in the common parameters in the parameter set will be updated to the rendering data of the target page. The FaaS application can then read the rendering data of the target page from the common parameters, and use the rendering data of the target page as the result of this FaaS application processing, and the FaaS application execution ends.
[0329] In an embodiment of the present disclosure, the FaaS application can return the rendering data of the target page to the terminal through other services, so that the terminal can display the target page based on the page data.
[0330] Based on the above-mentioned embodiment, for multiple executors used to render pages of any page type, the calling relationship between the multiple executors is as follows: Fig.13 As shown. Executor 1 is run first, and executor 2 and executor 3 can be called during the running of executor 1, and executor 4 can be called during the running of executor 2. Through the configuration of the four executors, the page data can be rendered and the page rendering data can be obtained.
[0331] Based on the above-mentioned embodiments, for e-commerce business scenarios, such as Fig.14 As shown in the figure, an SSR FaaS application is built based on the above new method. The page rendering logic of four page types can be implemented through three executors. The page rendering logic of each page type may be used for one, two or three executors, that is, four SSR FaaS applications are implemented, and each SSR FaaS application is used to implement the page rendering process of one page type.
[0332] In the disclosed embodiment, the HTML executor is used to execute the rendering logic and finally output HTML data as the rendered data obtained by rendering. The SSRJS preprocessing in the HTML executor refers to preprocessing the JavaScript code of the SSR scene before executing the rendering process to call the SSR executor. The rendering link control in the HTML executor is used to render the page data of the accessed page to obtain the rendered data of the accessed page.
[0333] The SSR environment construction in the SSR executor refers to the creation of a virtual environment to simulate the environment in which the terminal renders the page. The SSR identifier injection in the SSR executor is used to inject an indicator into the rendering data rendered by the HTML executor, which indicates that the rendering data is rendered by the server, so that the terminal can adopt a different display method from the rendering data rendered by itself, and display the accessed page based on the rendering data rendered by the server. Later, it can also record which pages are rendered based on the server based on the indicator of the rendering data.
[0334] The interface proxy in the Transport executor is used to implement the executor's access to other interfaces. For example, through the interface proxy in the Transport executor, the database used to store page data can be accessed so as to read the page data of the currently required rendered page from the database. The interface monitoring in the Transport executor can monitor the proxy status or access status of each interface, and can generate access logs for these situations to record the proxy status or access status of each interface.
[0335] For example, in the above Fig.14 On the basis of the executor shown, for the target page to be rendered, the HTML executor is first run. The HTML executor implements the above-mentioned SSRJS preprocessing process by executing the life cycle function and calls the SSR executor. During the operation of the SSR executor, the SSR environment construction process is implemented by executing the life cycle function to create a virtual environment. In addition, the Transport executor can also call the Transport executor during the SSRJS preprocessing process. The Transport executor implements the above-mentioned interface proxy process by executing the life cycle function, accesses the database for storing page data, so as to read the page data of the currently required rendered page from the database, and loads the page data into the virtual environment. In the process of implementing interface monitoring, the Transport executor generates an access log to record the proxy status or access status of each interface. The HTML executor implements the above-mentioned S rendering link control process by executing the life cycle function, so as to render the page data in the virtual environment and obtain the HTML data of the target page. In addition, in the process of implementing the SSR identifier injection by the SSR executor, the indication identifier is injected into the HTML data. The HTML executor outputs the HTML data of the target page and writes the HTML data into the parameters of the page to be rendered included in the public parameters.
[0336] In the solution provided by the embodiment of the present disclosure, the decoupling of the FaaS base and the business code is achieved. The FaaS base provides the underlying capabilities of the server for page rendering, and the business code (i.e., the executor and the lifecycle function corresponding to the executor) is used to be responsible for the business process. In addition, the server-side operation logic is defined in a function manner, which makes it easier for developers to understand its execution intention and execution process. In addition, by configuring the executor and the lifecycle function corresponding to the executor, a variety of SSR demands can be met without developing too many executors. The reuse of executors is achieved, ensuring the scalability and convenience of the page rendering logic in the server.
[0337] Fig.15 is a block diagram of a page rendering device according to an exemplary embodiment. Fig.15 , the device comprises:
[0338] The receiving unit 1501 is configured to execute a page access request sent by a receiving terminal, where the page access request is used to access a target page;
[0339] The loading unit 1502 is configured to execute the page type based on the target page, load an executor for rendering a page of the page type and a function corresponding to the executor, and the function is used to render a page of the page type;
[0340] The running unit 1503 is configured to execute the function through the executor, render the page data of the target page, and obtain the rendering data of the target page;
[0341] The sending unit 1504 is configured to send the rendering data of the target page to the terminal.
[0342] In some embodiments, the page access request carries a page identifier of the target page;
[0343] The loading unit 1502 is further configured to execute the storage of the page identifier into the parameter set of the executor;
[0344] The running unit 1503 is configured to execute the function through the executor, read the page identifier from the parameter set, obtain the page data corresponding to the page identifier based on the page identifier, render the page data of the target page, and obtain the rendering data of the target page.
[0345] In some embodiments, the executor for rendering a page of the page type includes a first executor and a second executor; the running unit 1503 is configured to execute through the first executor, run the function corresponding to the first executor, obtain the page data of the target page, and store the page data in the common parameter set corresponding to the first executor and the second executor; through the second executor, run the function corresponding to the second executor, read the page data from the common parameter set, render the page data, and obtain the rendering data of the target page.
[0346] In some embodiments, the executor for rendering a page of the page type includes a third executor and a fourth executor; the running unit 1503 is configured to execute through the third executor, run the first function corresponding to the third executor, and call the fourth executor; through the fourth executor, run the function corresponding to the fourth executor, obtain the page data of the target page, and store the page data in the common parameter set corresponding to the third executor and the fourth executor; through the third executor, run the second function corresponding to the third executor, read the page data from the common parameter set, render the page data, and obtain the rendering data of the target page.
[0347] In some embodiments, the executor for rendering a page of the page type includes a fifth executor and a sixth executor; the running unit 1503 is configured to execute through the fifth executor, run the function corresponding to the fifth executor, create a virtual environment, and the virtual environment is used to simulate the environment of the terminal rendering page; through the sixth executor, run the function corresponding to the sixth executor, render the page data of the target page in the virtual environment, and obtain the rendering data of the target page.
[0348] In some embodiments, the functions corresponding to the executor include a third function and a fourth function; the running unit 1503 is configured to execute the third function through the executor to obtain the page data of the target page; and to execute the fourth function through the executor to render the page data to obtain the rendering data of the target page.
[0349] In some embodiments, the loading unit 1502 is further configured to store the page data in a parameter set of the executor during the execution of the third function by the executor;
[0350] The running unit 1503 is configured to execute the fourth function through the executor, read the page data from the parameter set, render the page data, and obtain the rendering data of the target page.
[0351] In some embodiments, the loading unit 1502 is configured to execute a page type based on a target page, and query a function set corresponding to the page type from a first correspondence relationship, the function set including an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence relationship including multiple page types and a function set corresponding to each page type; or, based on the page type of the target page, query an executor corresponding to the page type and a function corresponding to the page type and the executor from a second correspondence relationship, the second correspondence relationship including multiple executors, a page type corresponding to each executor, and a function run when each executor renders a page of the corresponding page type; load an executor for rendering a page of the page type and a function corresponding to the executor.
[0352] In some embodiments, Fig.16 As shown, the device also includes:
[0353] The creation unit 1505 is configured to execute, in response to the page access request, the creation of a page rendering service;
[0354] The loading unit 1502 is configured to execute the page rendering service and load the executor and the function into the page rendering service based on the page type of the target page;
[0355] The running unit 1503 is further configured to execute the running executor through the page rendering service.
[0356] In some embodiments, Fig.16 As shown, the device also includes:
[0357] The generating unit 1506 is configured to execute the page rendering service to generate a common parameter set corresponding to the executor, wherein the common parameter set includes parameters corresponding to the page to be rendered;
[0358] The loading unit 1502 is further configured to execute, through the executor, updating the parameters corresponding to the to-be-rendered page in the common parameter set into rendering data of the target page;
[0359] The sending unit 1504 is configured to execute the page rendering service, read the page data from the public parameter set, and send the rendering data of the target page to the terminal.
[0360] It should be noted that the device provided in the above embodiment is only illustrated by the division of the above functional units. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the server is divided into different functional units to complete all or part of the functions described above. In addition, the page rendering device provided in the above embodiment and the page rendering method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0361] Fig.17 is a block diagram of a page display device according to an exemplary embodiment. Fig.17 , the device comprises:
[0362] The sending unit 1701 is configured to execute a page access request for the target page to the server in response to the access operation to the target page;
[0363] The receiving unit 1702 is configured to receive rendering data of a target page returned by the server in response to a page access request, the rendering data being obtained by an executor running a function to render page data of the target page, the executor being used to render a page of a page type, the function being used to render a page of a page type, and the page type being the page type of the target page;
[0364] The display unit 1703 is configured to display the target page based on the rendering data.
[0365] It should be noted that the device provided in the above embodiment is only illustrated by the division of the above functional units. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the terminal is divided into different functional units to complete all or part of the functions described above. In addition, the page display device provided in the above embodiment and the page display method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0366] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0367] When an electronic device is provided as a terminal, Fig.18 FIG. 1 is a block diagram of a terminal 1800 according to an exemplary embodiment. Fig.18 The structure block diagram of a terminal 1800 provided by an exemplary embodiment of the present disclosure is shown. Generally, the terminal 1800 includes: a processor 1801 and a memory 1802 .
[0368] The processor 1801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0369] The memory 1802 may include one or more computer-readable storage media, which may be non-transitory. The memory 1802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1802 is used to store at least one program code, which is used to be executed by the processor 1801 to implement the page display method provided in the method embodiment of the present disclosure.
[0370] In some embodiments, the terminal 1800 may also optionally include: a peripheral device interface 1803 and at least one peripheral device. The processor 1801, the memory 1802 and the peripheral device interface 1803 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1803 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1804, a display screen 1805, a camera assembly 1806, an audio circuit 1807 and a power supply 1808.
[0371] The peripheral device interface 1803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1801 and the memory 1802. In some embodiments, the processor 1801, the memory 1802, and the peripheral device interface 1803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1801, the memory 1802, and the peripheral device interface 1803 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0372] The radio frequency circuit 1804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1804 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1804 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 1804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1804 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.
[0373] The display screen 1805 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1805 is a touch display screen, the display screen 1805 also has the ability to collect touch signals on the surface or above the surface of the display screen 1805. The touch signal can be input to the processor 1801 as a control signal for processing. At this time, the display screen 1805 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1805 can be one, and the front panel of the terminal 1800 is set; in other embodiments, the display screen 1805 can be at least two, which are respectively set on different surfaces of the terminal 1800 or are folded; in some other embodiments, the display screen 1805 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 1800. Even, the display screen 1805 can also be set to a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 1805 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0374] The camera assembly 1806 is used to capture images or videos. Optionally, the camera assembly 1806 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1806 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0375] The audio circuit 1807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1801 for processing, or input them into the radio frequency circuit 1804 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1800. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1801 or the radio frequency circuit 1804 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1807 may also include a headphone jack.
[0376] The power supply 1808 is used to power various components in the terminal 1800. The power supply 1808 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1808 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0377] Those skilled in the art will understand that Fig.18 The structure shown in the figure does not constitute a limitation on the terminal 1800, and the terminal 1800 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0378] When the electronic device is provided as a server, Fig.19 It is a block diagram of a server 1900 according to an exemplary embodiment. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1901 and one or more memories 1902, wherein the memory 1902 stores at least one program code, and the at least one program code is loaded and executed by the processor 1901 to implement the page rendering method provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1900 may also include other components for implementing device functions, which will not be repeated here.
[0379] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory or a memory including instructions, and the above instructions can be executed by a processor of a terminal or a processor of a server to complete the above page rendering method or page display method. In some embodiments, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0380] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned page rendering method or page display method is implemented.
[0381] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure 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 description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0382] 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, characterized in that: The method comprises: Receiving a page access request sent by a terminal, wherein the page access request is used to access a target page; Based on the page type of the target page, loading an executor for rendering a page of the page type and a function corresponding to the executor, wherein the function is used to render a page of the page type; By means of the executor, the function is run to render the page data of the target page to obtain the rendering data of the target page; The rendering data of the target page is sent to the terminal.
2. The method according to claim 1, characterized in that The page access request carries the page identifier of the target page; and before the executor runs the function to render the page data of the target page and obtains the rendered data of the target page, the method further includes: Storing the page identifier in a parameter set of the executor; The step of running the function through the executor to render the page data of the target page to obtain the rendering data of the target page includes: The function is run through the executor, the page identifier is read from the parameter set, page data corresponding to the page identifier is obtained based on the page identifier, the page data of the target page is rendered, and the rendering data of the target page is obtained.
3. The method according to claim 1, characterized in that The executor for rendering the page of the page type includes a first executor and a second executor; the executor runs the function to render the page data of the target page to obtain the rendering data of the target page, including: By means of the first executor, a function corresponding to the first executor is run to obtain page data of the target page, and the page data is stored in a common parameter set corresponding to the first executor and the second executor; The function corresponding to the second executor is run through the second executor, the page data is read from the common parameter set, the page data is rendered, and the rendering data of the target page is obtained.
4. The method according to claim 1, characterized in that: The executor for rendering the page of the page type includes a third executor and a fourth executor; the executor runs the function to render the page data of the target page to obtain the rendering data of the target page, including: Running the first function corresponding to the third executor through the third executor, and calling the fourth executor; By means of the fourth executor, a function corresponding to the fourth executor is run to obtain page data of the target page, and the page data is stored in a common parameter set corresponding to the third executor and the fourth executor; The second function corresponding to the third executor is run through the third executor, the page data is read from the common parameter set, the page data is rendered, and the rendering data of the target page is obtained.
5. The method according to claim 1, characterized in that The executor for rendering the page of the page type includes a fifth executor and a sixth executor; The step of running the function through the executor to render the page data of the target page to obtain the rendering data of the target page includes: By means of the fifth executor, a function corresponding to the fifth executor is run to create a virtual environment, wherein the virtual environment is used to simulate an environment in which the terminal renders a page; The function corresponding to the sixth executor is run through the sixth executor, and the page data of the target page is rendered in the virtual environment to obtain the rendering data of the target page.
6. The method according to claim 1, characterized in that The functions corresponding to the executor include a third function and a fourth function; the executor runs the functions to render the page data of the target page to obtain the rendering data of the target page, including: By means of the executor, the third function is executed to obtain page data of the target page; The fourth function is run through the executor to render the page data to obtain rendering data of the target page.
7. The method according to claim 6, characterized in that After the executor executes the third function corresponding to the executor to obtain the page data of the target page, the method further includes: During the process of the executor running the third function, storing the page data in a parameter set of the executor; The step of running the fourth function corresponding to the executor through the executor to render the page data and obtain the rendering data of the target page includes: The fourth function is run through the executor, the page data is read from the parameter set, the page data is rendered, and the rendering data of the target page is obtained.
8. The method according to claim 1, characterized in that: The step of loading an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page includes: Based on the page type of the target page, query the function set corresponding to the page type from the first correspondence, the function set includes an executor for rendering a page of the page type and a function corresponding to the executor, the first correspondence includes multiple page types and a function set corresponding to each page type; or, based on the page type of the target page, query the executor corresponding to the page type and the function corresponding to the page type and the executor from the second correspondence, the second correspondence includes multiple executors, the page type corresponding to each executor, and the function run when each executor renders a page of the corresponding page type; Load an executor for rendering a page of the page type and a function corresponding to the executor.
9. The method according to claim 1, characterized in that: Before loading an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page, the method further includes: In response to the page access request, creating a page rendering service; The step of loading an executor for rendering a page of the page type and a function corresponding to the executor based on the page type of the target page includes: By means of the page rendering service, based on the page type of the target page, the executor and the function are loaded into the page rendering service; Before the executor runs the function to render the page data of the target page and obtains the rendered data of the target page, the method further includes: The executor is run through the page rendering service.
10. The method according to claim 9, characterized in that Before running the executor through the page rendering service, the method further includes: Generate a public parameter set corresponding to the executor through the page rendering service, wherein the public parameter set includes parameters corresponding to the page to be rendered; After the executor runs the function and renders the page data of the target page to obtain the rendering data of the target page, the method further includes: By means of the executor, the parameters corresponding to the page to be rendered in the common parameter set are updated to rendering data of the target page; The sending the rendering data of the target page to the terminal includes: The page data is read from the public parameter set through the page rendering service, and the rendering data of the target page is sent to the terminal.
11. A page display method, characterized in that: The method comprises: In response to the access operation to the target page, sending a page access request for the target page to the server; Receiving rendering data of the target page returned by the server in response to the page access request, the rendering data being obtained by an executor running a function to render page data of the target page, the executor being used to render a page of a page type, the function being used to render a page of the page type, and the page type being the page type of the target page; Based on the rendering data, the target page is displayed.
12. A page rendering device, characterized in that: The device comprises: A receiving unit, configured to execute a page access request sent by a receiving terminal, wherein the page access request is used to access a target page; a loading unit configured to execute, based on the page type of the target page, an executor for rendering a page of the page type and a function corresponding to the executor, wherein the function is used to render a page of the page type; an operating unit, configured to execute the function through the executor, render the page data of the target page, and obtain the rendering data of the target page; The sending unit is configured to send the rendering data of the target page to the terminal.
13. A page display device, characterized in that: The device comprises: A sending unit, configured to execute, in response to an access operation to a target page, sending a page access request for the target page to a server; a receiving unit, configured to receive rendering data of the target page returned by the server in response to the page access request, wherein the rendering data is obtained by an executor running a function to render page data of the target page, wherein the executor is used to render a page of a page type, and the function is used to render a page of the page type, and the page type is the page type of the target page; The display unit is configured to display the target page based on the rendering data.
14. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory for storing program code executable by the processor; The processor is configured to execute the program code to implement the page rendering method according to any one of claims 1 to 10; or to implement the page display method according to claim 11.
15. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the page rendering method as described in any one of claims 1 to 10; or to implement the page display method as described in claim 11.
16. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the page rendering method according to any one of claims 1 to 10; or, implements the page display method according to claim 11.