CN112699326A - Webpage rendering control method and device - Google Patents

Webpage rendering control method and device Download PDF

Info

Publication number
CN112699326A
CN112699326A CN201911011662.8A CN201911011662A CN112699326A CN 112699326 A CN112699326 A CN 112699326A CN 201911011662 A CN201911011662 A CN 201911011662A CN 112699326 A CN112699326 A CN 112699326A
Authority
CN
China
Prior art keywords
webpage
rendering
client
determined
error code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911011662.8A
Other languages
Chinese (zh)
Other versions
CN112699326B (en
Inventor
赵淳煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN201911011662.8A priority Critical patent/CN112699326B/en
Publication of CN112699326A publication Critical patent/CN112699326A/en
Application granted granted Critical
Publication of CN112699326B publication Critical patent/CN112699326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to the technical field of computers, in particular to a webpage rendering control method and device, wherein a webpage rendering request sent by a client is received, a webpage is rendered, if rendering failure is determined, error codes with errors are determined, if the error codes are determined to be matched with error codes of pre-configured degradation rendering of a representation webpage, description data of the webpage are sent to the client, so that the client renders the webpage according to the description data of the webpage, the webpage can be automatically degraded when rendering failure is achieved, rendering is conducted by the client, rendering efficiency is improved, and difficulty in network operation and maintenance is reduced.

Description

Webpage rendering control method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling webpage rendering.
Background
Currently, Server Side Render (SSR) is a common technical means, and when a Server renders a web page, there is a situation of requesting the web page of a backend interface, and when an error or timeout occurs while requesting the backend interface, the Server rendering fails. In the prior art, after rendering of a server fails, manual intervention is often required to configure a webpage so as to convert rendering of the server into other rendering modes and realize normal display of the webpage.
Disclosure of Invention
The embodiment of the application provides a webpage rendering control method and device, which are used for improving the rendering control efficiency of a webpage and reducing the operation and maintenance difficulty.
The embodiment of the application provides the following specific technical scheme:
a webpage rendering control method comprises the following steps:
receiving a webpage rendering request sent by a client;
rendering the webpage, and if the rendering fails, determining error codes with errors;
and if the error code is determined to be matched with a pre-configured error code representing webpage degraded rendering, sending the description data of the webpage to the client so that the client renders the webpage according to the description data of the webpage.
Optionally, determining rendering failure specifically includes:
if it is determined that the data resource corresponding to the webpage acquired by the webpage rendering request is unsuccessful, rendering failure is determined;
or if it is determined that the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
and if the webpage does not start a preset webpage degradation rendering function, sending the error code to the client so that the client can display the error code.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
and if the error code is determined to be not matched with the error code of the degraded rendering of the pre-configured characterization webpage, sending the error code to the client so that the client can display the error code.
Optionally, after rendering the webpage, the method further includes:
and if the rendering is determined to be successful, sending the rendered webpage to the client so that the client outputs the rendered webpage.
A web page rendering control apparatus comprising:
the receiving module is used for receiving a webpage page rendering request sent by a client;
the first processing module is used for rendering the webpage, and if rendering failure is determined, error codes with errors are determined;
and the second processing module is used for sending the description data of the webpage to the client if the error code is determined to be matched with a pre-configured error code representing degraded rendering of the webpage, so that the client renders the webpage according to the description data of the webpage.
Optionally, the first processing module is specifically configured to:
if it is determined that the data resource corresponding to the webpage acquired by the webpage rendering request is unsuccessful, rendering failure is determined;
or if it is determined that the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
and the third processing module is used for sending the error code to the client if the preset webpage page degradation rendering function is not started on the webpage page, so that the client can display the error code.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
and the fourth processing module is used for sending the error code to the client if the error code is determined to be unable to be matched with the error code which characterizes the webpage degraded rendering, so that the client can display the error code.
Optionally, after rendering the webpage, the method further includes:
and the fifth processing module is used for sending the rendered webpage to the client if the rendering is determined to be successful, so that the client outputs the rendered webpage.
An electronic device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the webpage rendering control method.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned web page rendering control method.
In the embodiment of the application, after a webpage rendering request sent by a client is received by a server, the webpage is rendered, if the rendering is determined to be failed, the server can generate error codes with errors, the error codes are matched with error codes for representing webpage degradation rendering in a pre-configured mode, if the server is determined to be successfully matched, the server sends description data of the webpage to the client, and the webpage is rendered by the client.
Drawings
Fig. 1 is a schematic view of an application architecture of a web page rendering control method in an embodiment of the present application;
FIG. 2 is a flowchart of a method for controlling rendering of a webpage according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for controlling rendering of a web page according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a web page rendering control apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For the purpose of facilitating an understanding of the embodiments of the present application, a brief introduction of several concepts is provided below:
server Side Render (SSR): the method comprises the steps that a server analyzes a component or a webpage according to a template file stored in the server, then analyzes to generate a hypertext Markup Language (HTML) character string, then sends the HTML to a client, and after the client receives the HTML character string, the client analyzes the HTML character string according to the HTML character string, and outputs and displays the analyzed final result to a user.
Degradation: in an embodiment of the present application, demotion is the process of converting server rendering to client rendering.
5 XX: in the present application implementation, 5XX denotes an error code.
In the embodiment of the present application, the error codes may be specifically classified into the following two different types:
1) error code in which error occurred: when the server renders the webpage, an error may occur in the rendering process or the server cannot normally send the rendered webpage to the client, and at this time, the server may generate an error code in which an error occurs.
2) Preconfigured error codes characterizing degraded rendering of web page: in the embodiment of the application, error codes corresponding to automatic degraded rendering of a webpage can be preconfigured, the error codes which are preconfigured during specific implementation and used for representing the degraded rendering of the webpage are used for judging whether the error codes can be matched with error codes which have errors or not after rendering failure is determined, if the error codes can be matched with the error codes, rendering of a server can be converted into rendering of a client, namely the server sends description data of the webpage to the client, and the client renders the webpage according to the description data.
L0-L1: in the embodiment of the present application, L0-L1 represent more important web pages, such as: the channel page (animation zone, game zone, etc., and the following sub-partitions), the play page, the home page, etc., which are not limited in the embodiments of the present application.
L2-L3: in the embodiment of the present application, L2-L3 represent web pages with low importance or less browsing volume, such as: a leader board, an online people list and pages, an H5 space and a search page, etc., which are not limited in the embodiments of the present application.
SLB: and the company page general routing management is used for pre-configuring whether to start the webpage page degradation rendering function.
A configuration center: a notification tool that can update the content of a data asset in real time.
Server Side Render (SSR) is a common technical means, and when a Server renders a web page, there is a case of requesting the web page of a backend interface, and when an error or timeout occurs while requesting the backend interface, the Server rendering fails. In the prior art, after rendering of a server fails, operation and maintenance personnel are often required to manually intervene to configure a webpage so as to convert rendering of the server into other rendering modes and realize normal display of the webpage, but the method has low efficiency and high operation and maintenance difficulty.
In the embodiment of the application, a webpage rendering control method is provided, a server renders a webpage after receiving a webpage rendering request sent by a client, if rendering fails, an error code which generates an error is determined, if the error code cannot be matched with a preset error code which represents webpage degradation rendering, the server sends the generated error code to the client for displaying, and then the client can display the error code, if the error code which generates the error can be matched with the preset error code which represents webpage degradation rendering, the server sends description data of the webpage to the client so that the client renders the webpage according to the description data, and therefore, manual configuration is not needed, namely the server rendering can be automatically converted into client rendering when an error occurs, the rendering efficiency is improved, and the operation and maintenance difficulty is greatly reduced.
Fig. 1 is a schematic diagram of an application architecture of a web page rendering control method in the embodiment of the present application, including a client 100 and a server 200.
The client 100 may be installed and run on a terminal, which may be any intelligent device such as a smart phone, a tablet computer, a portable personal computer, and the like, for example, the client 100 is a browser client, in this embodiment of the present application, the client 100 may generate a webpage rendering request, and send the generated webpage rendering request to the server 200 through a communication connection with the server 200, and the client 100 may further receive an error code returned by the server 200, and display the error code.
The server 200 and the client 100 are connected via the internet to communicate with each other, and the server 200 can provide various network services for the client 100, such as: the server 200 can receive a webpage rendering request sent by the client 100, and the server 200 can send a generated error code to the client 100 when it is determined that rendering fails, so that the client 100 displays the error code, or the server 200 can send description data of the webpage to the client 100 when it is determined that rendering fails, and then the client 100 can render the webpage according to the description data.
The server 200 may be a server, a server cluster formed by a plurality of servers, or a cloud computing center.
The client 100 and the server 200 are connected through the internet to communicate with each other. Optionally, the internet described above uses standard communication techniques and/or protocols. The internet is typically the internet, but can be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), any combination of mobile, wireline or wireless networks, private or virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
It should be noted that the application architecture diagram in the embodiment of the present application is for more clearly illustrating the technical solution in the embodiment of the present application, and does not limit the technical solution provided in the embodiment of the present application, and the technical solution provided in the embodiment of the present application is also applicable to similar problems for other application architectures and business applications. In the following embodiments of the present application, a schematic description is given by taking an application architecture shown in fig. 1 as an example to which the webpage rendering control method is applied.
Based on the foregoing embodiment, the following describes a webpage rendering control method in an embodiment of the present application, and refer to fig. 2, which is a flowchart of a webpage rendering control method in an embodiment of the present application, and is mainly applied to a server, where the method includes:
step 200: and receiving a webpage page rendering request sent by a client.
Specifically, in the embodiment of the present application, for example, when a user needs to open a webpage, the client can generate a webpage rendering request, and then the client can send the webpage rendering request to the server, so that the server performs rendering according to the webpage rendering request.
For example, the web page rendering request may be a Uniform Resource Locator (URL) for an HTML document, and the client may send the web page rendering request to the server through the URL page request and may also request to obtain a data Resource corresponding to the web page.
Step 210: rendering the webpage, and if the rendering fails, determining error codes with errors.
When step 210 is executed, the method specifically includes:
s1: the server renders the webpage.
In the embodiment of the present application, a manner in which the server renders the webpage is not limited, where the server may use a local resource to render during the rendering process, and may also request a backend interface, that is, another server, to obtain a required data resource to render.
S2: and if the server determines that the rendering fails, determining an error code with an error.
In this embodiment of the present application, determining that rendering fails by the server may include the following two different cases, which are not limited in this embodiment of the present application, specifically:
in the first case: and if the data resource corresponding to the webpage acquired by the webpage rendering request is determined to be unsuccessful, determining that rendering fails.
In the embodiment of the application, specifically, when a data resource corresponding to a web page is requested, the data resource may be obtained by calling a backend interface, and if a request error occurs when the backend interface is called, a server cannot obtain the data resource corresponding to the web page, so that rendering of the server fails.
Or, when the request sent when the backend interface is called is overtime, the server cannot acquire the data resource corresponding to the webpage at this time, and rendering of the server fails.
In the second case: and if the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
Specifically, in the embodiment of the present application, during the process of rendering the webpage, the server may generate an error during the rendering process, and may also generate an error during the process of returning the webpage from the server.
In the embodiment of the application, whether the server fails in the process of rendering the webpage is determined by setting different conditions, so that the accuracy of determining the webpage rendering by the server can be improved.
Further, after the server renders the webpage, if the rendering is determined to be successful, the rendered webpage is sent to the client, so that the client outputs the rendered webpage.
Correspondingly, in this embodiment of the present application, the determination of the rendering success by the server may include the following several cases, and in this embodiment of the present application, the determination of the rendering success by the server is not limited, specifically:
in the first case: the server determines that the request for acquiring the data resource corresponding to the webpage is successful.
In the embodiment of the application, for example, when the server successfully acquires the requested webpage or the page requesting the backend interface or does not time out, it can be determined that the data resource corresponding to the requested webpage is successfully acquired.
In the second case: and the server determines that the rendered webpage is normally returned when the webpage is rendered.
In the embodiment of the application, for example, the server does not have an error in the process of rendering the webpage, and the rendered webpage can be normally returned, so that it can be determined that the rendering of the server is successful.
Step 220: and if the error codes are determined to be matched with the error codes which represent the webpage degraded rendering and are pre-configured, sending the description data of the webpage to the client so that the client renders the webpage according to the description data of the webpage.
In the embodiment of the application, if the server can determine that the error code is matched with the error code which is pre-configured and represents the webpage page degradation rendering, the server can degrade the server rendering into the client rendering, and the webpage page rendering can be automatically degraded.
The error codes representing the webpage page degraded rendering can be pre-configured by the relevant personnel, for example, the relevant personnel sets the error codes representing the webpage page degraded rendering to [0,504] in the interface panel, wherein 0 represents that the webpage page degraded rendering can be performed only when the pre-configured error codes representing the webpage page degraded rendering and the error codes generated by the server can be matched, and 504 represents that the relevant personnel sets the error codes representing the webpage page degraded rendering to 504. Thus, if it is determined that the rendering of the server fails, assuming that the error code generated by the server is 504, the server may match the preconfigured error code "504" representing the degraded rendering of the web page with the error code "504" generated by the server, and since the error code "504" and the error code "generated by the server are the same, it is determined that the matching is successful, and therefore, the server may send the description data of the web page to the client, that is, the degraded rendering of the web page, and the client renders the web page according to the description data of the web page.
Further, if the error code is determined to be unable to match with the error code of the pre-configured degraded rendering of the webpage, the error code is sent to the client, so that the client displays the error code.
In the embodiment of the present application, the matching error code may be divided into two different patterns, which is not limited in the embodiment of the present application.
The first mode is any mode, which indicates that matching can be determined no matter what error codes of the server for determining errors occur, for example, the error codes for representing degraded rendering of the web page can be set to be-1, when the server fails to render, the error codes for representing degraded rendering of the web page are determined to be-1, matching can be determined to be successful, further, the server rendering can be converted into client rendering, and the web page does not need to be updated additionally when being iterated.
The second mode is a defined matching mode, which means that the error codes representing the degraded rendering of the webpage page can be configured to be one or more defined error codes in advance, for example, set to 504, and then the error codes generated by the server can be automatically degraded and rendered by the client only when the error codes representing the degraded rendering of the webpage page can be matched with the error codes representing the degraded rendering of the webpage page and 504.
For the error code in the limited matching pattern, the relevant person may set according to actual experience, which is not limited in the embodiment of the present application.
Further, after the server determines that the error codes representing the webpage degraded rendering which are preconfigured cannot be matched with the error codes generated by the server, the server can report the generated error codes to an error stack to be stored locally, and can update the locally generated error codes to the error codes representing the webpage degraded rendering, so that if the webpage rendering is performed again, and the error codes generated after the rendering fails are still the error codes, the error codes representing the webpage degraded rendering can be matched because the error codes are already contained in the error codes.
Further, in order to improve control efficiency, in this embodiment of the present application, a function switch may be further configured to determine whether to start the automatic degraded rendering, so that when the preset webpage degraded rendering function is started, error code matching may be performed, it is determined whether to match an error code characterizing the webpage degraded rendering, and then it is determined whether to perform the degraded rendering, and when the preset webpage degraded rendering function is not started, it is not necessary to perform error code matching.
For example, in the embodiment of the present application, the web page may be divided into two different types, i.e., L0-L1 and L2-L3, and L0-L1 may be a channel page (animation area, game area, and the following sub-partitions), a play page, a home page, and the like, which is not limited in the embodiment of the present application, and L2-L3 are less important pages, for example: a leader board, an online list, an H5 space, a search page, etc., which are not limited in the embodiments of the present application.
In the embodiment of the application, a downgrade rendering function can be preset for the commonly used web pages L0-L1 through the SLB, and error codes representing downgrade rendering of the web pages are set for the commonly used web pages, so that when rendering of the server fails and the server generates error codes with errors, the pre-configured downgrade rendering function and the error code pages can be automatically downgraded, thereby improving rendering efficiency and reducing difficulty in network operation and maintenance.
And if the degraded rendering function is not started, the server directly sends the generated error code to the client for display.
Therefore, by judging whether the preset webpage degradation rendering function is started or not, the degradation rendering can be further controlled, and the control efficiency is improved.
In the embodiment of the application, after a webpage rendering request is sent to a server by a client, the server renders the webpage, if the rendering of the server is determined to be successful, the server sends the rendered webpage to the client for outputting, if the rendering of the server is determined to be failed, the server can generate an error code which generates an error, then the server matches the error code which generates the error with an error code which is pre-configured and characterizes the webpage degradation rendering, if the error code cannot be matched, the server sends the error code to the client for displaying, if the error code is determined to be matched with the error code which is pre-configured and characterizes the webpage degradation rendering, description data of the webpage is sent to the client for rendering the webpage by the client and outputting the rendered webpage, therefore, the server rendering can be automatically degraded into the client rendering according to the error codes without manual configuration, each iteration of the synchronization of the degraded webpage is guaranteed, the network operation and maintenance difficulty is greatly reduced, in addition, the degradation strategy in the related technology is applied to the operation and maintenance side and is an independent server, the automatic degradation strategy in the embodiment of the application can be directly applied to the server of the main station, namely the server responding to the service, the strategy forwarding is not required to be carried out by the server of the operation and maintenance side, the server rendering can be automatically degraded into the client rendering in the server of the main station, and therefore the rendering efficiency and the rendering effect can be greatly improved.
Based on the foregoing embodiment, the following describes an entirety of a webpage rendering control method in the embodiment of the present application by using a specific application scenario, and specifically refers to fig. 3, which is a flowchart of another webpage rendering control method in the embodiment of the present application.
Step 300: the request is initiated.
Step 301: and the server receives a webpage page rendering request sent by the client.
Step 302: the server renders the webpage.
Step 303: the server determines whether the request for acquiring the data resource corresponding to the web page is successful, if so, step 304 is executed, and if not, step 305 is executed.
Further, when the server can successfully acquire the data resource corresponding to the webpage, the data resource is stored locally.
Step 304: the server determines whether the rendered web page is returned normally when rendering the web page, if so, step 309 is executed, and if not, step 305 is executed.
Step 305: the server determines whether the web page starts a preset web page degradation rendering function, if so, executes step 306, and if not, executes step 308.
Step 306: the server judges whether the error codes can be matched with error codes which are pre-configured and represent webpage page degradation rendering, if so, the step 307 is executed, and if not, the step 308 is executed.
Step 307: and the server sends the description data of the webpage to the client so that the client renders the webpage according to the description data of the webpage.
At this time, after the rendering of the server fails, the rendering of the server can be degraded to the rendering of the client, the page can be returned to the normal degraded page of the user, and the rendered webpage can be displayed after the rendering of the client.
Step 308: the server sends the generated error code to the client so that the client can display the error code.
So that the client can return to the page for presenting the error code to prompt the user for a failed request.
Step 309: and the server sends the rendered webpage to the client so that the client outputs the rendered webpage.
Furthermore, the client outputs the rendered webpage, and the rendered webpage does not need to be updated additionally, so that the rendered webpage can be ensured to be synchronized with each iteration.
Step 310: the server reports the error code to the error stack.
Specifically, after an error code is generated, the server reports the error code to an error stack of the server for storage, so that relevant personnel can debug and improve webpage degraded rendering according to the error code in the error stack, that is, in the embodiment of the application, after rendering failure of the server, the error code is generated, and then screening can be performed, so that the webpage capable of being degraded is degraded to render a client.
Step 311: the request is ended.
In the embodiment of the application, a server performs webpage rendering according to a received webpage rendering request sent by a client, if the server rendering is determined to be successful, the server can send the rendered webpage to the client so that the client outputs the webpage, if the server rendering is determined to be failed, whether error codes for representing webpage degradation rendering in pre-configuration can be matched with the error codes is judged, if the error codes can be matched with the error codes, the webpage is sent to the client for rendering so that the client renders the webpage, and if the error codes cannot be matched with the error codes, the error codes are sent to the client for displaying.
Based on the same inventive concept, the embodiment of the present application further provides a web page rendering control device, where the web page rendering control device may be, for example, a server in the foregoing embodiment, and the web page rendering control device may be a hardware structure, a software module, or a hardware structure plus a software module. Based on the above embodiments, referring to fig. 4, a schematic structural diagram of a web page rendering control apparatus in an embodiment of the present application specifically includes:
a receiving module 400, configured to receive a webpage page rendering request sent by a client;
the first processing module 410 is configured to render a webpage, and if it is determined that rendering fails, determine an error code in which an error occurs;
a second processing module 420, configured to send the description data of the web page to the client if it is determined that the error code matches a preconfigured error code representing degraded rendering of the web page, so that the client renders the web page according to the description data of the web page.
Optionally, the first processing module 410 is specifically configured to:
if it is determined that the data resource corresponding to the webpage acquired by the webpage rendering request is unsuccessful, rendering failure is determined;
or if it is determined that the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
the third processing module 430 is configured to send the error code to the client if it is determined that the preset web page degraded rendering function is not started on the web page, so that the client displays the error code.
Optionally, if it is determined that rendering fails, after determining that an error code in error occurs, the method further includes:
a fourth processing module 440, configured to send the error code to the client if it is determined that the error code does not match with an error code pre-configured to characterize degraded rendering of a web page, so that the client displays the error code.
Optionally, after rendering the webpage, the method further includes:
a fifth processing module 450, configured to send the rendered web page to the client if it is determined that the rendering is successful, so that the client outputs the rendered web page.
Based on the above embodiments, fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
An embodiment of the present application provides an electronic device, which may include a processor 510 (CPU), a memory 520, an input device 530, an output device 540, and the like, wherein the input device 530 may include a keyboard, a mouse, a touch screen, and the like, and the output device 540 may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), and the like.
Memory 520 may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides processor 510 with program instructions and data stored in memory 520. In the embodiment of the present application, the memory 520 may be used to store a program of any one of the methods for controlling page rendering of a webpage in the embodiment of the present application.
The processor 510 is configured to execute any one of the methods for controlling webpage page rendering according to the embodiments of the present application by calling the program instructions stored in the memory 520.
Based on the foregoing embodiments, in the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the web page rendering control method in any of the above method embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A webpage rendering control method is characterized by comprising the following steps:
receiving a webpage rendering request sent by a client;
rendering the webpage, and if the rendering fails, determining error codes with errors;
and if the error code is determined to be matched with a pre-configured error code representing webpage degraded rendering, sending the description data of the webpage to the client so that the client renders the webpage according to the description data of the webpage.
2. The method of claim 1, wherein determining rendering failures includes:
if it is determined that the data resource corresponding to the webpage acquired by the webpage rendering request is unsuccessful, rendering failure is determined;
or if it is determined that the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
3. The method of claim 1 or 2, wherein after determining that an error code of an error has occurred if it is determined that rendering has failed, further comprising:
and if the webpage does not start a preset webpage degradation rendering function, sending the error code to the client so that the client can display the error code.
4. The method of claim 1 or 2, wherein, after determining that an error code in error has occurred if rendering is determined to have failed, further comprising:
and if the error code is determined to be unable to match with an error code which characterizes the webpage degraded rendering, sending the error code to the client so that the client can display the error code.
5. The method of claim 1, after rendering the web page, further comprising:
and if the rendering is determined to be successful, sending the rendered webpage to the client so that the client outputs the rendered webpage.
6. A web page rendering control apparatus, comprising:
the receiving module is used for receiving a webpage page rendering request sent by a client;
the first processing module is used for rendering the webpage, and if rendering failure is determined, error codes with errors are determined;
and the second processing module is used for sending the description data of the webpage to the client if the error code is determined to be matched with a pre-configured error code representing degraded rendering of the webpage, so that the client renders the webpage according to the description data of the webpage.
7. The apparatus of claim 6, wherein the first processing module is specifically configured to:
if it is determined that the data resource corresponding to the webpage acquired by the webpage rendering request is unsuccessful, rendering failure is determined;
or if it is determined that the rendered webpage is not returned normally when the webpage is rendered, determining that rendering fails.
8. The apparatus of claim 6 or 7, wherein after determining that an error code of an error occurs if it is determined that rendering fails, further comprising:
and the third processing module is used for sending the error code to the client if the preset webpage page degradation rendering function is not started on the webpage page, so that the client can display the error code.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1-5 are implemented when the program is executed by the processor.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a processor implementing the steps of the method of any one of claims 1 to 5.
CN201911011662.8A 2019-10-23 2019-10-23 Webpage rendering control method and device Active CN112699326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911011662.8A CN112699326B (en) 2019-10-23 2019-10-23 Webpage rendering control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911011662.8A CN112699326B (en) 2019-10-23 2019-10-23 Webpage rendering control method and device

Publications (2)

Publication Number Publication Date
CN112699326A true CN112699326A (en) 2021-04-23
CN112699326B CN112699326B (en) 2023-03-14

Family

ID=75505068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911011662.8A Active CN112699326B (en) 2019-10-23 2019-10-23 Webpage rendering control method and device

Country Status (1)

Country Link
CN (1) CN112699326B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645062A (en) * 2021-07-13 2021-11-12 阿里巴巴新加坡控股有限公司 Page data processing method and device and electronic equipment
CN114138397A (en) * 2021-12-10 2022-03-04 北京百度网讯科技有限公司 Page display method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513987A (en) * 2013-09-18 2014-01-15 小米科技有限责任公司 Rendering treatment method, device and terminal device for browser web page
CN105653968A (en) * 2014-11-14 2016-06-08 阿里巴巴集团控股有限公司 Overdue marking method, device, client, and server for displayed data
CN106846451A (en) * 2017-01-22 2017-06-13 南通大学 The sense of reality body of facing mobile apparatus is rendered and interactive system and its method of work
CN108334517A (en) * 2017-01-20 2018-07-27 华为技术有限公司 A kind of webpage rendering intent and relevant device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513987A (en) * 2013-09-18 2014-01-15 小米科技有限责任公司 Rendering treatment method, device and terminal device for browser web page
CN105653968A (en) * 2014-11-14 2016-06-08 阿里巴巴集团控股有限公司 Overdue marking method, device, client, and server for displayed data
CN108334517A (en) * 2017-01-20 2018-07-27 华为技术有限公司 A kind of webpage rendering intent and relevant device
CN106846451A (en) * 2017-01-22 2017-06-13 南通大学 The sense of reality body of facing mobile apparatus is rendered and interactive system and its method of work

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
INFOQ墨影: "如何搭建一个高可用的服务端渲染工程", 《HTTPS://CLOUD.TENCENT.COM/DEVELOPER/NEWS/451883,知乎》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645062A (en) * 2021-07-13 2021-11-12 阿里巴巴新加坡控股有限公司 Page data processing method and device and electronic equipment
CN114138397A (en) * 2021-12-10 2022-03-04 北京百度网讯科技有限公司 Page display method and device, electronic equipment and storage medium
CN114138397B (en) * 2021-12-10 2024-06-07 北京百度网讯科技有限公司 Page display method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112699326B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
US10805380B2 (en) Data transmission method and device
CN107733922B (en) Method and apparatus for invoking a service
US9210160B2 (en) Establishing and maintaining an improved single sign-on (SSO) facility
US20130238692A1 (en) Method, system, and computer program product for simulating an online session
US9621627B2 (en) Dynamically launching a server-based application on a mobile device
CN106936633B (en) Application installation package manufacturing method and server
CN112434818B (en) Model construction method, device, medium and electronic equipment
EP4105848A1 (en) Method and apparatus for evaluating joint training model
CN103268319A (en) Cloud browser based on webpages
CN112583815B (en) Operation instruction management method and device
CN113271296B (en) Login authority management method and device
CN112699326B (en) Webpage rendering control method and device
EP4254189A2 (en) Executing remote commands
CN105141632A (en) Method and device used for checking pages
CN112882863A (en) Method, device and system for recovering data and electronic equipment
CN111163074B (en) Gateway service control method and device
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN110018835B (en) YANG model configuration data processing method and device, terminal device and storage medium
US10713278B2 (en) Flexible configuration of offline synchronization scope
CN115733685A (en) Web session authentication management method and device, computer equipment and storage medium
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN109656535B (en) Voice skill off-line development method based on browser
CN111552898A (en) Flowchart drawing method and device based on Html5, computer equipment and storage medium
CN104423973B (en) Processing method, device and system for floating frame page loading information
JP2002041377A (en) Data communication system, data processor used for the communication system, session maintenance method using browser and recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant