Webpage page rendering method, apparatus, device, and storage medium

HK40091042BActive Publication Date: 2026-08-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
HK42023079953
Authority / Receiving Office
HK · HK
Patent Type
Patents
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

Existing server-side rendering frameworks are only suitable for single front-end framework scenarios and cannot be compatible with multiple front-end frameworks, resulting in wasted resources and limited SEO optimization effects.

Method used

By inserting plugins into the front-end and back-end frameworks, the server-side rendering process of web pages is implemented. The front-end plugins are applicable to various front-end framework scenarios and switch to client-side rendering when server-side rendering fails.

Benefits of technology

It achieves server-side rendering compatibility across front-end frameworks, saves server-side resources, improves first-screen loading speed, and supports SEO optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The application discloses a webpage page rendering method and device, equipment and storage medium, and belongs to the technical field of webpage development. The method comprises the following steps: running a front-end plug-in in a front-end application, the front-end plug-in corresponding to a server-side plug-in running in a server; in response to an opening operation of a webpage page, requesting the server-side plug-in to render webpage source code of the webpage page through the front-end plug-in; and receiving a rendering result of the webpage page fed back by the server-side plug-in through the front-end plug-in. The application realizes the server-side rendering process of the webpage page by inserting the plug-in in the front-end framework and the back-end framework, so that the front-end framework with the front-end plug-in inserted can be applied to various front-end framework scenes according to the difference of the front-end plug-in.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of web page development technology, and in particular to a method, apparatus, device, and storage medium for rendering web pages. Background Technology

[0002] Common web page rendering methods mainly include Server-Side Rendering (SSR) and Client-Side Rendering (CSR). SSR works by assembling the Hypertext Markup Language (HTML) page and its corresponding dynamic data on the server side, and then directly presenting the complete page (rendered result) to the client. CSR, on the other hand, assembles the HTML page and its dynamic data on the client side.

[0003] Among related technologies, by being compatible with both server-side and client-side rendering, the server-side rendering framework based on the front-end framework achieves effects such as saving server-side resources, fast first-screen loading of server-side rendering, and search engine optimization (SEO).

[0004] However, in the above scheme, the server-side rendering framework can only support a single front-end framework. That is, the server-side rendering framework corresponds one-to-one with the front-end framework, and the server-side rendering framework is only applicable to a single front-end framework scenario. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for rendering web pages. The technical solution is as follows:

[0006] According to one aspect of this application, a method for rendering a webpage is provided, the method comprising:

[0007] A front-end plugin runs in the front-end application, which corresponds to a server-side plugin running on the server. The server-side plugin is used to provide web page rendering functionality on the server.

[0008] In response to the opening operation of the webpage, the front-end plugin requests the server-side plugin to render the webpage source code of the webpage;

[0009] The front-end plugin receives the rendering result of the webpage from the server-side plugin.

[0010] According to one aspect of this application, a method for rendering a webpage is provided, the method comprising:

[0011] A server-side plugin is run on the server side, which corresponds to the front-end plugin running in the front-end application. The server-side plugin is used to provide web page rendering functionality on the server side.

[0012] The rendering result of the webpage is obtained by rendering the webpage source code of the webpage requested by the front-end plugin through the server-side plugin;

[0013] The rendering result of the webpage is fed back to the front-end plugin.

[0014] According to one aspect of this application, a webpage rendering apparatus is provided, the apparatus comprising:

[0015] The runtime module is used to run front-end plugins in the front-end application. The front-end plugins correspond to the server-side plugins running on the server. The server-side plugins are used to provide web page rendering functions on the server.

[0016] The rendering module is used to respond to the opening operation of the web page by requesting the server-side plugin to render the web page source code of the web page through the front-end plugin.

[0017] The receiving module is used to receive the rendering result of the webpage fed back by the server-side plugin through the front-end plugin.

[0018] According to one aspect of this application, the running module is further configured to run a front-end plugin corresponding to a first front-end framework in the front-end application, wherein the first front-end framework is a front-end framework used by the front-end application.

[0019] Among them, the front-end plugins corresponding to different front-end frameworks have the same running logic but different adaptation designs.

[0020] According to one aspect of this application, the rendering module includes:

[0021] The sending unit is used to respond to the opening operation of the web page by sending a client request to the server plugin through the front-end plugin. The client request carries application layer protocol information parameters.

[0022] The client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0023] According to one aspect of this application, the receiving module is further configured to receive a downgraded rendering result fed back by the server-side plugin through the front-end plugin, wherein the downgraded rendering result is the rendering result obtained by the server-side plugin when rendering the webpage source code of the webpage fails.

[0024] According to one aspect of this application, the rendering module includes:

[0025] The rendering unit is used to perform client-side rendering based on the downgraded rendering result through the front-end plugin to obtain the rendering result of the web page.

[0026] The webpage source code includes page layout layer code and actual page content display layer code. The page layout layer code is code in the webpage source code that is unrelated to the application logic, while the actual page content display layer code is code in the webpage source code that is related to the application logic.

[0027] The downgraded rendering result is the rendering result obtained by the server-side plugin rendering the page layout layer code.

[0028] According to one aspect of this application, the rendering module further includes:

[0029] The acquisition unit is used to obtain the actual content display layer code of the page from the server through the front-end plugin.

[0030] The rendering unit is further configured to use the front-end plugin to render page content related to the application logic in the rendering skeleton based on the actual page content display layer code, using the downgraded rendering result as the rendering skeleton, to obtain the rendering result of the web page.

[0031] According to one aspect of this application, a webpage rendering apparatus is provided, the apparatus comprising:

[0032] The runtime module is used to run server-side plugins on the server side. The server-side plugins correspond to the front-end plugins running in the front-end application. The server-side plugins are used to provide web page rendering functions on the server side.

[0033] The rendering module is used to render the webpage source code of the webpage requested by the front-end plugin through the server-side plugin to obtain the rendering result of the webpage.

[0034] The feedback module is used to provide feedback on the rendering result of the webpage to the front-end plugin.

[0035] According to one aspect of this application, the running module is further configured to run a server-side plugin corresponding to the first backend framework on the server side, wherein the first backend framework is a backend framework used by the server side.

[0036] Among them, the service plugins corresponding to different backend frameworks have the same running logic but different adaptation designs.

[0037] According to one aspect of this application, the rendering module includes:

[0038] The receiving unit is used to receive client requests sent by the front-end plugin through the server-side plugin, wherein the client requests carry application layer protocol information parameters.

[0039] The determining unit is used to determine the rendering mode of the webpage based on the application layer protocol information parameters;

[0040] A rendering unit is used to render the webpage source code based on the rendering mode to obtain the rendering result of the webpage.

[0041] According to one aspect of this application, in the event of an error occurring during the runtime or data loading of the server-side plugin, the server-side plugin fails to render the source code of the webpage and obtains a downgraded rendering result.

[0042] The feedback module is used to provide feedback on the downgraded rendering result to the front-end plugin.

[0043] According to one aspect of this application, the webpage source code of the webpage includes page layout layer code and page actual content display layer code, wherein the page layout layer code is code in the webpage source code that is unrelated to the application logic, and the page actual content display layer code is code in the webpage source code that is related to the application logic;

[0044] The downgraded rendering result is obtained by the server-side plugin rendering the page layout layer code.

[0045] According to another aspect of this application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one computer program, the at least one computer program being loaded and executed by the processor to implement the web page rendering method as described above.

[0046] According to another aspect of this application, a computer storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the web page rendering method as described above.

[0047] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium; the computer instructions are read from the computer-readable storage medium and executed by a processor of a computer device, causing the computer device to perform the web page rendering method as described above.

[0048] The beneficial effects of the technical solution provided in this application include at least the following:

[0049] The front-end application runs a front-end plugin; in response to the opening of a webpage, the front-end plugin requests the server-side plugin to render the webpage's source code; and the front-end plugin receives the rendering result of the webpage from the server-side plugin. The technical solution provided in this application implements the server-side rendering process of a webpage by inserting plugins into the front-end and back-end frameworks, thereby enabling the front-end framework with inserted plugins to be suitable for various front-end framework scenarios depending on the different plugins. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a schematic diagram of the system configuration of a web page rendering system provided in an exemplary embodiment of this application;

[0052] Figure 2 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0053] Figure 3 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0054] Figure 4 This is a schematic diagram illustrating the adaptation design of a front-end plugin provided in an exemplary embodiment of this application;

[0055] Figure 5 This is a schematic diagram of the overall structural framework including a front-end plugin and a server-side plugin provided in an exemplary embodiment of this application;

[0056] Figure 6 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0057] Figure 7 This is a schematic diagram of a rendering mode degradation process framework provided in an exemplary embodiment of this application;

[0058] Figure 8 This is a schematic diagram of a rendering mode degradation process framework provided in an exemplary embodiment of this application;

[0059] Figure 9 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0060] Figure 10 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0061] Figure 11 This is a flowchart of a webpage rendering method provided in an exemplary embodiment of this application;

[0062] Figure 12 This is a block diagram of a web page rendering apparatus provided in an exemplary embodiment of this application;

[0063] Figure 13 This is a block diagram of a web page rendering apparatus provided in an exemplary embodiment of this application;

[0064] Figure 14 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application;

[0065] Figure 15 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0067] Please refer to Figure 1 This illustrates a schematic diagram of the system configuration of a webpage rendering system according to various embodiments of this application. For example... Figure 1 As shown, the system includes a server 120, a database 140, and several clients 160.

[0068] Server 120 is a single server, or a combination of several servers, or a virtualization platform, or a cloud computing service center.

[0069] Server 120 may consist of one or more functional units. Optional, such as Figure 1 As shown, server 120 may include: permission management unit 120a, page data management unit 120b, etc.

[0070] The permission management unit 120a is used to generate, update and maintain the permissions corresponding to each user account, and to provide each client 160 with information such as the permissions that the client 160 has in the current login state.

[0071] The page data management unit 120b is used to manage the page data in the pages developed by the developers, accept requests from the client 160, and send the page data requested by the client 160 to the client 160 for display.

[0072] The aforementioned database 140 can be a Redis database, or it can be another type of database. Database 140 is used to store various types of data, such as user accounts, the permissions of each user account, and page data for each page, etc.

[0073] Client 160 can be a terminal device with network connectivity and page display capabilities, such as a mobile phone, tablet computer, e-book reader, smart glasses, smartwatch, and in-vehicle terminal, etc.

[0074] For example, client 160 may have a browser or other web applications (such as web clients) installed.

[0075] The client 160 and the server 120 are connected via a communication network. Optionally, this communication network can be a wired network or a wireless network.

[0076] Optionally, the system may also include a management device ( Figure 1 (Not shown), the management device is connected to the server 120 via a communication network. Optionally, the communication network can be a wired network or a wireless network.

[0077] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats, including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0078] Figure 2 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Client 160 in the system shown. The method includes:

[0079] Step 202: Run the front-end plugin in the front-end application. The front-end plugin corresponds to the server-side plugin running on the server.

[0080] The front end refers to the front-end part of a website, which is the webpage displayed to users on browsers such as PCs and mobile devices.

[0081] Front-end plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the client side. Server-side plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the server side.

[0082] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0083] A page object refers to an object of various granularities within a webpage that can be controlled independently by a front-end plugin. For example, the page itself can be considered a page object, each page component within the page can be considered a page object, and each page element within a page component can also be considered a page object.

[0084] In the embodiments of this application, the page object can be the current page itself, or the page object can be a page component in the current page, or the page object can be an element in a page component in the current page.

[0085] The aforementioned page component is a container that encapsulates one or more elements. For example, the page component can be an input box or a dropdown list on the page. Optionally, when the page is a webpage, the page component can also be a webpage component or a Web component.

[0086] Step 204: In response to the opening of the webpage, the front-end plugin requests the server-side plugin to render the webpage source code.

[0087] Web page source code refers to human-readable text written in a specific programming language, which can represent elements (images, videos, music, text, etc.) on a web page in a standard language.

[0088] For example, in response to the opening of a webpage, the client requests page resources from the server, that is, the client requests the server plugin to render the webpage source code through the front-end plugin.

[0089] Step 206: Receive the rendering result of the webpage from the server-side plugin via the front-end plugin.

[0090] After the client sends a URL request to the server for page resources, the server-side plugin in the server obtains the webpage source code and renders it. After rendering is complete, the server sends the rendering result of the webpage back to the client, and the client receives the rendering result of the webpage from the server-side plugin through the front-end plugin.

[0091] In summary, the method provided in this embodiment runs a front-end plugin in the front-end application. Responding to the opening of a webpage, the front-end plugin requests the server-side plugin to render the webpage's source code, and the front-end plugin receives the rendering result of the webpage from the server-side plugin. This embodiment implements the server-side rendering process of the webpage by inserting plugins into the front-end and back-end frameworks. The front-end plugin completes the rendering of the webpage by receiving the rendering result from the server-side plugin. The front-end framework with the inserted plugin can be suitable for various front-end framework scenarios depending on the specific plugin.

[0092] Figure 3 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Client 160 in the system shown. The method includes:

[0093] Step 302: Run the front-end plugin corresponding to the first front-end framework in the front-end application. The first front-end framework is the front-end framework used by the front-end application.

[0094] The front end refers to the front-end part of a website, which is the webpage displayed to users on browsers such as PCs and mobile devices.

[0095] Front-end plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the client side. Server-side plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the server side.

[0096] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0097] A front-end framework is a framework with customizable directives, such as the World Wide Web development framework React, the progressive front-end framework Vue 2.0, the progressive front-end framework Vue 3.0, etc. These frameworks encapsulate some basic functions, such as HTML document manipulation and various controls (buttons, forms, etc.).

[0098] For example, a front-end plugin corresponding to the front-end framework used by the front-end application is run within the front-end application. Front-end plugins for different front-end frameworks share the same operational logic but differ in their adaptation design. That is, by changing different plugins, the rendering process of a webpage can be adapted to various front-end framework scenarios.

[0099] Optionally, different front-end frameworks include at least two of the following: the World Wide Web development framework React, the progressive front-end framework Vue 2.0, and the progressive front-end framework Vue 3.0.

[0100] For example, such as Figure 4 The diagram shows the adaptation design of the front-end plugin. The adaptation design of the front-end plugin 401 includes its own construction logic 402, startup logic 405, plugin dependency logic 408, configuration capability 410, and running logic 412, but is not limited thereto. This application embodiment does not limit this.

[0101] For example, the build logic 402 of the front-end plugin 401 refers to bundling and classifying the source code or acquired data based on the bundling module Webpack 403. At the same time, the hot update logic 404 based on the bundling module Webpack 403 can realize partial rendering of the web page while retaining the current page state, such as the selected state of checkboxes and the input of input boxes.

[0102] For example, the startup logic 405 of front-end plugin 401 refers to performing route initialization 406 and data management model initialization 407 on front-end plugin 401 when it starts running. Route initialization 406 refers to initializing the correspondence between page objects in the webpage and the webpage source code; data management model initialization 407, also known as store initialization, refers to initializing the data model in front-end plugin 401 when it starts. The data management model is used to manage all data in the front-end components and to operate on and modify all data in the front-end components.

[0103] For example, plugin dependency 408 for front-end plugin 401 means that the dependency conditions required by the current front-end plugin 401 in the current framework scenario do not require additional configuration 409. That is, front-end plugin 401 includes the dependency conditions required for the current front-end plugin 401 to run in the current framework scenario, and no additional configuration is required.

[0104] For example, the configuration capability 410 of the front-end plugin 401 means that the front-end plugin 401 can process and merge user configurations 411. By merging the personalized configurations of different users, the front-end plugin can be adapted to different application scenarios.

[0105] For example, the running logic 412 of the front-end plugin 401 refers to the ability to prefetch data 413, that is, to return the page to the client after rendering the web page by prefetching the data required for rendering.

[0106] For example, such as Figure 5 The diagram shows the overall structural framework including the front-end plugin and the server-side plugin. The command execution interface 501 displays all the functional interfaces of the plugin. The server-side plugin and / or front-end plugin can be edited by clicking the start button 502. After editing the server-side plugin and / or front-end plugin, clicking the build button 503 completes the operation and allows for deployment.

[0107] A front-end framework refers to a front-end framework with customizable command functionality. For example, pluggable front-end framework plugins include any one of the following: React plugin 507, Vue 2.0 plugin 508, and Vue 3.0 plugin 509, but are not limited thereto. This application embodiment does not limit this.

[0108] Optionally, the entry logic 510 of the front-end framework includes the execution logic and startup logic of the front-end plugin. For a detailed description of the execution logic and startup logic, please refer to... Figure 4 The description in section 511 details the framework configuration capabilities of the front-end plugin. Figure 4 The descriptions in the text will not be repeated here.

[0109] Optionally, the front-end framework supports the module bundling tool Webpack512 and the front-end build tool vite513, but is not limited thereto, and the embodiments of this application do not limit this.

[0110] A backend framework refers to a backend framework with customizable command functionality. For example, pluggable backend frameworks include NestJS development framework plugin 504, Midway development framework plugin 505, etc., but are not limited to these. A proxy server 506 is built into the server plugin, eliminating the need to set up a proxy server separately, thus allowing all the functions required by the server plugin to be executed directly.

[0111] Step 304: In response to the opening of the webpage, the front-end plugin requests the server-side plugin to render the webpage source code.

[0112] Web page source code refers to human-readable text written in a specific programming language, which can represent elements (images, videos, music, text, etc.) on a web page in a standard language.

[0113] For example, in response to the opening of a webpage, the client sends a client request to the server plugin through the front-end plugin. The client request carries application layer protocol information parameters.

[0114] Among them, the client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0115] Optionally, the rendering mode includes server-side rendering mode and client-side rendering mode. Server-side rendering mode means that the process of rendering the webpage source code mainly occurs on the server side; client-side rendering mode means that the process of rendering the webpage source code mainly occurs on the client side.

[0116] Optionally, application layer protocol information parameters refer to parameters carried in the client request that can determine the rendering mode. Application layer protocol information parameters include at least one of the following: request query parameters, request headers, and request header information cookies, but are not limited thereto. This application embodiment does not limit this.

[0117] For example, taking the application layer protocol information parameter in the client request as the request header as an example, the information format of the request header is request.headers['csr']. The server plugin determines the rendering mode of the web page by reading the information of the request header. For example, when csr=1, the rendering mode of the web page is server rendering, and when csr≠1, the rendering mode of the web page is client rendering. However, it is not limited to this. The embodiments of this application do not specifically limit the process of determining the rendering mode of the web page.

[0118] Step 306: Receive the rendering result of the webpage from the server-side plugin via the front-end plugin.

[0119] After the client sends a URL to the server to request page resources, the server-side plugin obtains the webpage source code based on the URL and renders the webpage source code. After rendering is complete, the server sends the rendering result of the webpage back to the client, and the client receives the rendering result of the webpage from the server-side plugin through the front-end plugin.

[0120] In summary, the method provided in this embodiment runs a front-end plugin in the front-end application. Responding to the opening of a webpage, the rendering mode of the webpage is determined by the application layer protocol information parameters in the client request sent by the front-end plugin to the server plugin. The front-end plugin receives the rendering result of the webpage from the server plugin. This embodiment implements the webpage rendering process by inserting plugins into the front-end and back-end frameworks. The front-end plugin completes the rendering of the webpage by receiving the rendering result from the server plugin. The front-end framework with the inserted plugin can be suitable for various front-end framework scenarios depending on the specific plugin.

[0121] Figure 6 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Client 160 in the system shown. The method includes:

[0122] Step 602: Run the front-end plugin in the front-end application. The front-end plugin corresponds to the server-side plugin running on the server.

[0123] The front end refers to the front-end part of a website, which is the webpage displayed to users on browsers such as PCs and mobile devices.

[0124] Front-end plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the client side; server-side plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the server side.

[0125] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0126] A front-end framework is a framework that allows for custom directives. Examples include the World Wide Web development framework React, the progressive front-end framework Vue 2.0, and the progressive front-end framework Vue 3.0. These frameworks encapsulate basic functionalities such as HTML document manipulation and various controls (buttons, forms, etc.).

[0127] For example, a front-end plugin corresponding to the front-end framework used by the front-end application is run within the front-end application. Front-end plugins for different front-end frameworks share the same operational logic but differ in their adaptation design. That is, by changing different plugins, the rendering process of a webpage can be adapted to various front-end framework scenarios.

[0128] Optionally, the different front-end frameworks include at least two of the following: the World Wide Web development framework React, the progressive front-end framework Vue 2.0, and the progressive front-end framework Vue 3.0.

[0129] Step 604: In response to the opening of the webpage, the front-end plugin requests the server-side plugin to render the webpage source code.

[0130] For example, in response to the opening of a webpage, the client sends a client request to the server plugin through the front-end plugin. The client request carries application layer protocol information parameters.

[0131] Among them, the client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0132] Optionally, the rendering mode includes server-side rendering mode and client-side rendering mode. Server-side rendering mode means that the process of rendering the webpage source code mainly occurs on the server side; client-side rendering mode means that the process of rendering the webpage source code mainly occurs on the client side.

[0133] Step 606: Receive the downgraded rendering result from the server plugin via the front-end plugin.

[0134] The source code of a webpage includes the layout layer code and the actual content display layer code. The layout layer code is the code in the webpage source code that is not related to the application logic, while the actual content display layer code is the code in the webpage source code that is related to the application logic.

[0135] Degraded rendering results refer to the rendering results obtained by the server-side plugin rendering the page layout layer code when the server-side plugin fails to render.

[0136] For example, the page layout layer code includes at least one of the following: page title information code, page description code of page title, and logic code for generating static resource file addresses of page, but is not limited thereto, and the embodiments of this application do not limit it.

[0137] After the client sends a URL request to the server for page resources, the server-side plugin in the server obtains the webpage source code based on the URL and renders the webpage source code. If the rendering fails, the server sends the degraded rendering result of the webpage back to the client. The client receives the degraded rendering result of the webpage fed back by the server-side plugin through the front-end plugin. That is, the client receives the rendering result obtained by the server-side plugin rendering the page layout layer code through the front-end plugin.

[0138] like Figure 7The diagram illustrates the rendering mode degradation process framework. The client sends a client request (701) to the server plugin through the front-end plugin. The client request (701) carries application layer protocol information parameters. Based on the application layer protocol information parameters, the rendering mode of the webpage is determined. If the rendering mode of the webpage is server-side rendering mode (702), the server plugin obtains the page layout layer code and renders the page layout layer code (703). Then, the server plugin obtains the actual content display layer code of the page and renders the actual content display layer code (704), that is, renders the page content related to the application logic, and finally obtains the rendering result of the webpage.

[0139] If the server-side plugin fails to render the actual content display layer code of the page, that is, if an error occurs during the runtime of the server-side plugin or when loading data, the rendering mode of the web page is downgraded from server-side rendering mode 702 to client-side rendering mode 705. The server uses the rendering result of the server-side plugin rendering the page layout layer code as the downgraded rendering result, and the front-end plugin performs further rendering work on the downgraded rendering result. That is, the client performs further rendering based on the server-side rendering of the page layout layer code 706.

[0140] Step 608: Render the webpage using the front-end plugin based on the downgraded rendering result.

[0141] For example, the client obtains the actual content presentation layer code of the page from the server through a front-end plugin. Using the degraded rendering result as a rendering skeleton, the client renders the page content related to the application logic within the rendering skeleton based on the actual content presentation layer code, thus obtaining the rendered webpage.

[0142] like Figure 8The diagram illustrates the rendering mode degradation process framework. Taking a browser as an example, the client responds to the webpage opening operation in the browser. The client sends a client request (801) to the server plugin through the front-end plugin. Client request (801) carries application layer protocol information parameters. Based on the application layer protocol information parameters, the rendering mode of the webpage is determined. If the rendering mode of the webpage is server-side rendering mode (802), the server obtains data (803), that is, the server plugin obtains the page layout layer code and the actual content display layer code of the page, and renders the page components in the webpage (804), that is, it renders the page layout layer code and the actual content display layer code to obtain the rendering result of the webpage, and sends the rendering result of the webpage to the browser in the client. The browser activates the Document Object Model (DOM) (805), causing the browser to respond to the webpage opening operation and perform route switching, that is, jump to the webpage. Thus, the client obtains data (806), that is, the client displays the obtained rendering result on the webpage in the browser. The Document Object Model (DOM) is a tree structure model that constitutes the page objects and the relationships between page objects in the webpage.

[0143] In the event of an error occurring when the server-side plugin renders the actual content display layer code of the page—that is, when an error occurs during the server-side plugin's runtime or data loading, causing the server-side plugin to fail to render the webpage's source code—the webpage's rendering mode is downgraded from server-side rendering mode 802 to client-side rendering mode 807. The server uses the rendering result of the server-side plugin rendering the page layout layer code as the downgraded rendering result, and the front-end plugin performs further rendering on the downgraded rendering result 808. The client, through the front-end plugin, uses the downgraded rendering result as the rendering skeleton, and the client obtains data 809. That is, the client obtains the actual content display layer code of the page from the server through the front-end plugin, and renders the page content related to the application logic based on the actual content display layer code in the rendering skeleton. That is, the client renders the page components in the webpage 810 and performs route switching, i.e., redirecting to the webpage, thereby obtaining data 811, enabling the client to display the rendering result on the browser's webpage.

[0144] In summary, the method provided in this embodiment runs a front-end plugin in the front-end application. Responding to the opening of a webpage, the rendering mode of the webpage is determined by the application layer protocol information parameters in the client request sent by the front-end plugin to the server-side plugin. When the server-side plugin fails to render the webpage's source code, the rendering mode is downgraded from server-side rendering mode to client-side rendering mode. The front-end plugin then performs client-side rendering based on the downgraded rendering result, ultimately obtaining the rendered webpage. This embodiment implements the server-side rendering process of the webpage by inserting plugins into the front-end and back-end frameworks. It also enables rapid switching of the rendering mode in the event of server-side rendering failure, ensuring the normal operation of the webpage rendering process.

[0145] Figure 9 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Server 120 in the system shown. The method includes:

[0146] Step 902: Run the server-side plugin on the server side. The server-side plugin corresponds to the front-end plugin running in the front-end application.

[0147] The front end refers to the front-end part of a website, which is the webpage displayed to users on browsers such as PCs and mobile devices.

[0148] Front-end plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the client side. Server-side plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the server side.

[0149] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0150] A page object refers to an object of various granularities within a webpage that can be controlled independently by a front-end plugin. For example, the page itself can be considered a page object, each page component within the page can be considered a page object, and each page element within a page component can also be considered a page object.

[0151] In the embodiments of this application, the page object can be the current page itself, or the page object can be a page component in the current page, or the page object can be an element in a page component in the current page.

[0152] The aforementioned page component is a container that encapsulates one or more elements. For example, the page component can be an input box or a dropdown list on the page. Optionally, when the page is a webpage, the page component can also be a webpage component or a Web component.

[0153] Step 904: Render the webpage source code requested by the front-end plugin using the server-side plugin to obtain the rendering result of the webpage.

[0154] Web page source code refers to human-readable text written in a specific programming language, which can represent elements (images, videos, music, text, etc.) on a web page in a standard language.

[0155] For example, the client requests page resources from the server, the server plugin obtains the web page source code of the web page requested by the front-end plugin, the server plugin renders the web page source code, and obtains the rendering result of the web page.

[0156] Step 906: Feedback the rendering result of the webpage to the front-end plugin.

[0157] The server-side plugin obtains the source code of the webpage and renders it. After rendering, the server sends the rendering result back to the client, which receives the rendering result from the server-side plugin through the front-end plugin.

[0158] In summary, the method provided in this embodiment runs a server-side plugin on the server side. The server-side plugin renders the source code of the webpage requested by the front-end plugin to obtain the rendering result of the webpage; and then feeds back the rendering result of the webpage to the front-end plugin. This embodiment implements the server-side rendering process of the webpage by inserting plugins into the front-end and back-end frameworks. The server-side plugin renders the source code of the webpage requested by the front-end plugin, and the back-end framework with the server-side plugin allows server-side rendering to be applied to various rendering scenarios depending on the plugin.

[0159] Figure 10 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Server 120 in the system shown. The method includes:

[0160] Step 1002: Run the server-side plugin corresponding to the first backend framework on the server side. The first backend framework is the backend framework used by the server.

[0161] The first backend framework is the backend framework used by the server. Different backend frameworks have service plugins that have the same running logic but different adaptation designs.

[0162] Server-side plugins are plugins with customizable command functionality, used to provide web page rendering capabilities on the server side.

[0163] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0164] A backend framework refers to a backend framework with custom command functionality, such as the NestJS development framework and the Midway development framework. These frameworks encapsulate some basic functionalities.

[0165] Step 1004: Render the source code of the webpage requested by the front-end plugin through the server-side plugin to obtain the rendering result of the webpage.

[0166] Web page source code refers to human-readable text written in a specific programming language, which can represent elements (images, videos, music, text, etc.) on a web page in a standard language.

[0167] For example, the server-side plugin receives client requests sent by the front-end plugin through the server-side plugin. The client requests carry application layer protocol information parameters.

[0168] The server-side plugin determines the rendering mode of the webpage based on the application layer protocol information parameters.

[0169] The server-side plugin renders the webpage source code based on the rendering mode to obtain the rendered webpage result.

[0170] Among them, the client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0171] Optionally, the rendering mode includes server-side rendering mode and client-side rendering mode. Server-side rendering mode means that the process of rendering the webpage source code mainly occurs on the server side; client-side rendering mode means that the process of rendering the webpage source code mainly occurs on the client side.

[0172] Optionally, application layer protocol information parameters refer to parameters carried in the client request that can determine the rendering mode. Application layer protocol information parameters include at least one of the following: request query parameters, request headers, and request header information cookies, but are not limited thereto. This application embodiment does not limit this.

[0173] Step 1006: Feedback the rendering result of the webpage to the front-end plugin.

[0174] The server-side plugin in the server obtains the source code of the webpage and renders it. After rendering is complete, the server sends the rendering result of the webpage back to the client.

[0175] In summary, the method provided in this embodiment runs a server-side plugin on the server side. The server-side plugin receives client requests sent by the front-end plugin, determines the rendering mode of the webpage based on the application layer protocol information parameters in the received client request, renders the webpage source code based on the rendering mode, obtains the rendering result of the webpage, and feeds the rendering result back to the client. This embodiment implements the server-side rendering process of the webpage by inserting plugins into the front-end and back-end frameworks. The server-side plugin renders the webpage source code requested by the front-end plugin, and the back-end framework with the server-side plugin allows server-side rendering to be applied to various rendering scenarios depending on the plugin.

[0176] Figure 11 This is a flowchart illustrating a webpage rendering method provided in an exemplary embodiment of this application. This method can be applied to a computer device to render a webpage. The computer device can be... Figure 1 Server 120 in the system shown. The method includes:

[0177] Step 1102: Run the server-side plugin on the server side. The server-side plugin corresponds to the front-end plugin running in the front-end application.

[0178] The front end refers to the front-end part of a website, which is the webpage displayed to users on browsers such as PCs and mobile devices.

[0179] Front-end plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the client side; server-side plugins are plugins with customizable command functionality, used to provide web page rendering functionality on the server side.

[0180] Web page rendering refers to the process of converting the source code corresponding to page objects in a web page into a visual image.

[0181] A front-end framework is a framework with customizable directives, such as the World Wide Web development framework React, the progressive front-end framework Vue 2.0, the progressive front-end framework Vue 3.0, etc. These frameworks encapsulate some basic functions, such as HTML document manipulation and various controls (buttons, forms, etc.).

[0182] A backend framework refers to a backend framework with custom command functionality, such as the NestJS development framework and the Midway development framework. These frameworks encapsulate some basic functionalities.

[0183] For example, a front-end plugin corresponding to the front-end framework used by the front-end application is run within the front-end application. Front-end plugins for different front-end frameworks share the same operational logic but differ in their adaptation design. That is, by changing different plugins, the rendering process of a webpage can be adapted to various front-end framework scenarios.

[0184] Optionally, the different front-end frameworks include at least two of the following: the World Wide Web development framework React, the progressive front-end framework Vue 2.0, and the progressive front-end framework Vue 3.0.

[0185] Step 1104: Render the webpage source code requested by the front-end plugin using the server-side plugin to obtain the rendering result of the webpage.

[0186] Web page source code refers to human-readable text written in a specific programming language, which can represent elements (images, videos, music, text, etc.) on a web page in a standard language.

[0187] For example, the server-side plugin receives client requests sent by the front-end plugin through the server-side plugin. The client requests carry application layer protocol information parameters.

[0188] The server-side plugin determines the rendering mode of the webpage based on the application layer protocol information parameters.

[0189] The server-side plugin renders the webpage source code based on the rendering mode to obtain the rendered webpage result.

[0190] Among them, the client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0191] Optionally, the rendering mode includes server-side rendering mode and client-side rendering mode. Server-side rendering mode means that the process of rendering the webpage source code mainly occurs on the server side; client-side rendering mode means that the process of rendering the webpage source code mainly occurs on the client side.

[0192] Step 1106: If an error occurs during the runtime of the server-side plugin or when loading data, the server-side plugin fails to render the webpage source code and results in a downgraded rendering result.

[0193] The source code of a webpage includes the layout layer code and the actual content display layer code. The layout layer code is the code in the webpage source code that is not related to the application logic, while the actual content display layer code is the code in the webpage source code that is related to the application logic.

[0194] Degraded rendering results refer to the rendering results obtained by the server-side plugin rendering the page layout layer code when the server-side plugin fails to render.

[0195] For example, the page layout layer code includes at least one of the following: page title information code, page description code of page title, and logic code for generating static resource file addresses of page, but is not limited thereto, and the embodiments of this application do not limit it.

[0196] After receiving the client request sent by the client to the server, the server-side plugin in the server-side obtains the source code of the web page and renders the source code of the web page. If the rendering fails, the server uses the rendering result obtained from the current rendering of the page layout layer code as the degraded rendering result.

[0197] Step 1108: Feedback the downgraded rendering result to the front-end plugin.

[0198] For example, the server-side plugin in the server obtains the source code of the web page and renders the source code of the web page. If the rendering fails, the server sends the degraded rendering result of the web page back to the client.

[0199] In summary, the method provided in this embodiment runs a server-side plugin on the server side. Based on the application layer protocol information parameters in the received client request, it determines the rendering mode of the webpage. When the server-side plugin fails to render the webpage's source code, the rendering mode is downgraded from server-side rendering to client-side rendering, and the downgraded rendering result is fed back to the client for further rendering. This embodiment implements the webpage rendering process by inserting plugins into the front-end and back-end frameworks. It also enables rapid switching of the rendering mode in the event of server-side rendering failure, ensuring the normal operation of the webpage rendering process.

[0200] Figure 12 A block diagram of a webpage rendering apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes:

[0201] The running module 1202 is used to run a front-end plugin in the front-end application. The front-end plugin corresponds to the server-side plugin running on the server. The server-side plugin is used to provide web page rendering functions located on the server.

[0202] The rendering module 1204 is used to respond to the opening operation of the web page by requesting the server-side plugin to render the web page source code of the web page through the front-end plugin.

[0203] The receiving module 1206 is used to receive the rendering result of the web page fed back by the server plugin through the front-end plugin.

[0204] In one possible implementation, the running module 1202 is further configured to run a front-end plugin corresponding to a first front-end framework in the front-end application, wherein the first front-end framework is the front-end framework used by the front-end application; wherein the front-end plugins corresponding to different front-end frameworks have the same running logic and different adaptation designs.

[0205] In one possible implementation, the rendering module 1204 is further configured to respond to the opening operation of the webpage by sending a client request to the server plugin through the front-end plugin, the client request carrying application layer protocol information parameters.

[0206] The client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

[0207] In one possible implementation, the receiving module 1206 is further configured to receive a downgraded rendering result fed back by the server-side plugin through the front-end plugin, wherein the downgraded rendering result is the rendering result obtained by the server-side plugin when rendering the webpage source code of the webpage fails.

[0208] In one possible implementation, the rendering module 1204 is further configured to perform client-side rendering based on the downgraded rendering result through the front-end plugin to obtain the rendering result of the web page.

[0209] The webpage source code includes page layout layer code and actual page content display layer code. The page layout layer code is code in the webpage source code that is unrelated to the application logic, while the actual page content display layer code is code in the webpage source code that is related to the application logic.

[0210] The downgraded rendering result is the rendering result obtained by the server-side plugin rendering the page layout layer code.

[0211] In one possible implementation, the rendering module 1204 is further configured to obtain the actual content display layer code of the page from the server through the front-end plugin; and render page content related to the application logic in the rendering skeleton based on the actual content display layer code of the page through the front-end plugin using the downgraded rendering result as the rendering skeleton, thereby obtaining the rendering result of the web page.

[0212] Figure 13 A block diagram of a webpage rendering apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes:

[0213] The running module 1302 is used to run a server-side plugin on the server side. The server-side plugin corresponds to the front-end plugin running in the front-end application. The server-side plugin is used to provide web page rendering functions located on the server side.

[0214] The rendering module 1304 is used to render the webpage source code of the webpage requested by the front-end plugin through the server-side plugin to obtain the rendering result of the webpage.

[0215] Feedback module 1306 is used to provide feedback on the rendering result of the webpage to the front-end plugin.

[0216] A server-side plugin corresponding to the first backend framework is run on the server side, where the first backend framework is the backend framework used by the server side.

[0217] Among them, the service plugins corresponding to different backend frameworks have the same running logic but different adaptation designs.

[0218] In one possible implementation, the rendering module 1304 is further configured to receive a client request sent by the front-end plugin through the server-side plugin, the client request carrying application layer protocol information parameters; determine the rendering mode of the webpage based on the application layer protocol information parameters; and render the webpage source code based on the rendering mode to obtain the rendering result of the webpage.

[0219] In one possible implementation, the feedback module 1306 is further configured to, in the event of an error occurring during the runtime of the server-side plugin or during data loading, cause the server-side plugin to fail to render the source code of the webpage and obtain a degraded rendering result; and to feed back the degraded rendering result to the front-end plugin.

[0220] The webpage source code includes page layout layer code and actual content display layer code. The page layout layer code is code in the webpage source code that is unrelated to the application logic, while the actual content display layer code is code in the webpage source code that is related to the application logic. The downgraded rendering result is obtained by the server-side plugin rendering the page layout layer code.

[0221] Figure 14 A schematic diagram of a computer device 1400 provided in an exemplary embodiment of this application is shown. The computer device 1400 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), or MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1400 may also be referred to as a user device, portable terminal, or other names.

[0222] Typically, computer device 1400 includes a processor 1401 and a memory 1402.

[0223] Processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0224] The memory 1402 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store at least one instruction, which is executed by the processor 1401 to implement the web page rendering method provided in the embodiments of this application.

[0225] In some embodiments, the computer device 1400 may also optionally include: a peripheral device interface 1403 and at least one peripheral device. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1404, a touch display screen 1405, a camera 1406, an audio circuit 1407, and a power supply 1408.

[0226] Peripheral device interface 1403 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1401 and memory 1402. In some embodiments, processor 1401, memory 1402 and peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1401, memory 1402 and peripheral device interface 1403 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0227] The radio frequency (RF) circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1404 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1404 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, etc. The RF circuit 1404 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1404 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0228] The touch display screen 1405 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1405 also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to the processor 1401 for processing. The touch display screen 1405 is used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one touch display screen 1405, located on the front panel of the computer device 1400; in other embodiments, there may be at least two touch display screens, respectively located on different surfaces of the computer device 1400 or in a folded design; in some embodiments, the touch display screen 1405 may be a flexible display screen, located on a curved or folded surface of the computer device 1400. Furthermore, the touch display screen 1405 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The touch display screen 1405 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).

[0229] The camera assembly 1406 is used to acquire images or videos. Optionally, the camera assembly 1406 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is used for video calls or selfies, and the rear-facing camera is used for taking photos or videos. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, and a wide-angle camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, and panoramic shooting and VR (Virtual Reality) shooting by fusion of the main camera and the wide-angle camera. In some embodiments, the camera assembly 1406 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0230] Audio circuitry 1407 provides an audio interface between the user and computer device 1400. Audio circuitry 1407 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to processor 1401 for processing, or input to radio frequency circuitry 1404 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different location within computer device 1400. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from processor 1401 or radio frequency circuitry 1404 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, audio circuitry 1407 may also include a headphone jack.

[0231] Power supply 1408 is used to supply power to the various components in computer device 1400. Power supply 1408 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1408 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0232] In some embodiments, the computer device 1400 further includes one or more sensors 1409. The one or more sensors 1409 include, but are not limited to, an accelerometer 1410, a gyroscope 1411, a pressure sensor 1412, an optical sensor 1413, and a proximity sensor 1414.

[0233] Accelerometer 1410 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by computer device 1400. For example, accelerometer 1410 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1401 can control touchscreen display 1405 to display the user interface in landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1410. Accelerometer 1410 can also be used for games or for acquiring user motion data.

[0234] The gyroscope sensor 1411 can detect the orientation and rotation angle of the computer device 1400. The gyroscope sensor 1411 can work in conjunction with the accelerometer sensor 1410 to acquire 3D motion data from the user on the computer device 1400. Based on the data acquired by the gyroscope sensor 1411, the processor 1401 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0235] Pressure sensor 1412 can be disposed on the side bezel of computer device 1400 and / or on the lower layer of touch display screen 1405. When pressure sensor 1412 is disposed on the side bezel of computer device 1400, it can detect the user's grip signal on computer device 1400 and perform left / right hand recognition or quick operation based on the grip signal. When pressure sensor 1412 is disposed on the lower layer of touch display screen 1405, it can control operable controls on the UI interface based on the user's pressure operation on touch display screen 1405. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0236] Optical sensor 1413 is used to collect ambient light intensity. In one embodiment, processor 1401 can control the display brightness of touch display screen 1405 based on the ambient light intensity collected by optical sensor 1413. Specifically, when the ambient light intensity is high, the display brightness of touch display screen 1405 is increased; when the ambient light intensity is low, the display brightness of touch display screen 1405 is decreased. In another embodiment, processor 1401 can also dynamically adjust the shooting parameters of camera assembly 1406 based on the ambient light intensity collected by optical sensor 1413.

[0237] The proximity sensor 1414, also known as a distance sensor, is typically located on the front of the computer device 1400. The proximity sensor 1414 is used to detect the distance between the user and the front of the computer device 1400. In one embodiment, when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 is gradually decreasing, the processor 1401 controls the touch display screen 1405 to switch from a screen-on state to a screen-off state; when the proximity sensor 1414 detects that the distance between the user and the front of the computer device 1400 is gradually increasing, the processor 1401 controls the touch display screen 1405 to switch from a screen-off state to a screen-on state.

[0238] Those skilled in the art will understand that Figure 14 The structure shown does not constitute a limitation on the computer device 1400, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0239] Figure 15 This illustration shows a schematic diagram of a computer device provided in an exemplary embodiment of this application. The computer device may be... Figure 1 The server 120 in this embodiment. Specifically, the computer device 1500 includes a Central Processing Unit (CPU) 1501, a system memory 1504 including Random Access Memory (RAM) 1502 and Read Only Memory (ROM) 1503, and a system bus 1505 connecting the system memory 1504 and the CPU 1501. The computer device 1500 also includes a basic input / output system (I / O system) 1506 to facilitate the transfer of information between various devices within the computer, and a mass storage device 1507 for storing the operating system 1513, application programs 1514, and other program modules 1515.

[0240] The basic input / output system 1506 includes a display 1508 for displaying information and an input device 1509 for user input, such as a mouse or keyboard. Both the display 1508 and the input device 1509 are connected to the central processing unit 1501 via an input / output controller 1510 connected to the system bus 1505. The basic input / output system 1506 may also include the input / output controller 1510 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1510 also provides output to a display screen, printer, or other types of output devices.

[0241] The mass storage device 1507 is connected to the central processing unit 1501 via a mass storage controller (not shown) connected to the system bus 1505. The mass storage device 1507 and its associated computer-readable storage media provide non-volatile storage for the computer device 1500. That is, the mass storage device 1507 may include computer-readable storage media (not shown), such as a hard disk or a CD-ROM drive.

[0242] Without loss of generality, the computer-readable storage medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1504 and mass storage device 1507 described above can be collectively referred to as memory.

[0243] The memory stores one or more programs, which are configured to be executed by one or more central processing units 1501. The one or more programs contain instructions for implementing a scheduling method for virtual objects in the virtual environment described above. The central processing unit 1501 executes the one or more programs to implement the web page rendering method provided in the various method embodiments described above.

[0244] According to various embodiments of this application, the computer device 1500 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1500 can be connected to a network 1512 via a network interface unit 1511 connected to the system bus 1505, or the network interface unit 1511 can be used to connect to other types of networks or remote computer systems (not shown).

[0245] The memory further includes one or more programs stored in the memory, and the one or more programs include the steps executed by the server in the web page rendering method provided in the embodiments of this application.

[0246] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to implement the web page rendering method provided in the above-described method embodiments.

[0247] This application also provides a computer storage medium, which stores at least one computer program. The at least one computer program is loaded and executed by a processor to implement the web page rendering method provided in the above-described method embodiments.

[0248] This application also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. The computer instructions are read from the computer-readable storage medium and executed by a processor of a computer device, causing the computer device to execute the web page rendering method provided in the above-described method embodiments.

[0249] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0250] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0251] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent switching, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for rendering a webpage, characterized in that, The method includes: A front-end plugin corresponding to a first front-end framework runs in the front-end application. The first front-end framework is the front-end framework used by the front-end application. The front-end plugin corresponds to a server-side plugin running in the server. The server-side plugin is used to provide web page rendering functionality on the server. In response to the opening operation of the webpage, the front-end plugin requests the server-side plugin to render the webpage source code of the webpage; The front-end plugin receives the rendering result of the webpage from the server-side plugin. Among them, the front-end plugins corresponding to different front-end frameworks have the same running logic and different adaptation designs, and the running logic is used to implement data prefetching.

2. The method according to claim 1, characterized in that, The step of responding to the opening operation of the webpage by requesting the server-side plugin to render the webpage source code through the front-end plugin includes: In response to the opening operation of the web page, the front-end plugin sends a client request to the server plugin, the client request carrying application layer protocol information parameters; The client request is used to request the server plugin to render the webpage source code, and the application layer protocol information parameters are used to instruct the server plugin to determine the rendering mode of the webpage.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The front-end plugin receives the downgraded rendering result fed back by the server-side plugin. The downgraded rendering result is the rendering result obtained by the server-side plugin when the rendering of the web page source code of the web page fails. The client-side rendering is performed by the front-end plugin based on the downgraded rendering result to obtain the rendering result of the web page.

4. The method according to claim 3, characterized in that, The webpage source code includes page layout layer code and actual page content display layer code. The page layout layer code is code in the webpage source code that is unrelated to the application logic, while the actual page content display layer code is code in the webpage source code that is related to the application logic. The downgraded rendering result is the rendering result obtained by the server-side plugin rendering the page layout layer code.

5. The method according to claim 4, characterized in that, The step of performing client-side rendering based on the downgraded rendering result using the front-end plugin to obtain the rendered webpage includes: The front-end plugin obtains the actual content display layer code of the page from the server. Using the degraded rendering result as a rendering skeleton, the front-end plugin renders page content related to the application logic within the rendering skeleton based on the actual page content display layer code, thus obtaining the rendering result of the webpage.

6. A method for rendering a webpage, characterized in that, The method includes: A server-side plugin corresponding to the first backend framework runs on the server side. The first backend framework is the backend framework used by the server side. The server-side plugin corresponds to the frontend plugin running in the frontend application. The server-side plugin is used to provide web page rendering functions on the server side. The rendering result of the webpage is obtained by rendering the webpage source code of the webpage requested by the front-end plugin through the server-side plugin; The rendering result of the webpage is fed back to the front-end plugin; Among them, the service plugins corresponding to different backend frameworks have the same running logic and different adaptation designs, and the running logic is used to implement data prefetching.

7. The method according to claim 6, characterized in that, The step of rendering the webpage source code of the webpage requested by the front-end plugin through the server-side plugin to obtain the rendering result of the webpage includes: The server-side plugin receives client requests sent by the front-end plugin, and the client requests carry application layer protocol information parameters. The rendering mode of the webpage is determined based on the application layer protocol information parameters; The webpage source code is rendered based on the rendering mode to obtain the rendering result of the webpage.

8. The method according to claim 6 or 7, characterized in that, The method further includes: If an error occurs during the runtime of the server-side plugin or when loading data, the server-side plugin will fail to render the source code of the webpage and result in a downgraded rendering result. The degraded rendering result is fed back to the front-end plugin.

9. The method according to claim 8, characterized in that, The webpage source code includes page layout layer code and actual page content display layer code. The page layout layer code is code in the webpage source code that is unrelated to the application logic, while the actual page content display layer code is code in the webpage source code that is related to the application logic. The downgraded rendering result is obtained by the server-side plugin rendering the page layout layer code.

10. A webpage rendering device, characterized in that, The device includes: The runtime module is used to run a front-end plugin corresponding to a first front-end framework in the front-end application. The first front-end framework is the front-end framework used by the front-end application. The front-end plugin corresponds to a server-side plugin running in the server. The server-side plugin is used to provide web page rendering functionality on the server. The rendering module is used to respond to the opening operation of the web page by requesting the server-side plugin to render the web page source code of the web page through the front-end plugin. A receiving module is used to receive the rendering result of the webpage fed back by the server-side plugin through the front-end plugin; Among them, the front-end plugins corresponding to different front-end frameworks have the same running logic and different adaptation designs, and the running logic is used to implement data prefetching.

11. A webpage rendering device, characterized in that, The device includes: The running module is used to run a server-side plugin corresponding to the first backend framework on the server side. The first backend framework is the backend framework used by the server side. The server-side plugin corresponds to the frontend plugin running in the frontend application. The server-side plugin is used to provide web page rendering functions on the server side. The rendering module is used to render the webpage source code of the webpage requested by the front-end plugin through the server-side plugin to obtain the rendering result of the webpage. The feedback module is used to provide feedback on the rendering result of the webpage to the front-end plugin; Among them, the service plugins corresponding to different backend frameworks have the same running logic and different adaptation designs, and the running logic is used to implement data prefetching.

12. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the web page rendering method as described in any one of claims 1 to 9.

13. A computer storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the web page rendering method as described in any one of claims 1 to 9.

14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; the computer instructions are read from and executed by a processor of a computer device, causing the computer device to perform the webpage rendering method as described in any one of claims 1 to 9.