Search

CN-121979524-A - Server rendering method, device and equipment

CN121979524ACN 121979524 ACN121979524 ACN 121979524ACN-121979524-A

Abstract

The embodiment of the specification discloses a server rendering method, a device and equipment. The method comprises the steps of generating and sending a first rendering request corresponding to page header content through a network edge node aiming at a current page so that a client obtains the page header content to render the current page, generating and sending a second rendering request corresponding to page static content through the network edge node based on the received first version number corresponding to the page header content so that the client obtains the page static content to render the current page, and generating and sending a third rendering request corresponding to page dynamic content through the network edge node based on the received second version number corresponding to the page static content so that the client obtains the page dynamic content to render the current page.

Inventors

  • LIU KUI
  • XIAO SHENGTAO
  • WEI HONGXU

Assignees

  • 支付宝(杭州)数字服务技术有限公司

Dates

Publication Date
20260505
Application Date
20260116

Claims (20)

  1. 1. A server rendering method comprises the following steps: Generating and sending a first rendering request corresponding to the page header content by a network edge node aiming at the current page, so that a client obtains the page header content to render the current page; generating and sending a second rendering request corresponding to the static content of the page based on the received first version number corresponding to the page header content by the network edge node, so that the client obtains the static content of the page and renders the current page; And generating and sending a third rendering request corresponding to the page dynamic content based on the received second version number corresponding to the page static content by the network edge node, so that the client obtains the page dynamic content to render the current page.
  2. 2. The method of claim 1, the method further comprising: feeding back the page header content through a content distribution network; And attempting to feed back the page static content and the page dynamic content through a content distribution network, and executing rendering action through a server for executing function rendering according to the first version number or the second version number when the attempt fails to obtain the corresponding page static content or page dynamic content.
  3. 3. The method of claim 2, performing a rendering action according to the first version number or the second version number to obtain the corresponding static content or the dynamic content of the page, specifically including: Aiming at the second rendering request, according to the first version number, executing a pre-rendering action through a corresponding server file to obtain the corresponding page static content; And aiming at the third rendering request, based on the execution result of the pre-rendering action, executing a restoration rendering action through a corresponding server file according to the second version number to obtain the corresponding page dynamic content.
  4. 4. The method of claim 1, wherein the obtaining the page header content renders the current page specifically comprises: aiming at a single streaming response, acquiring the head content of the hypertext markup language document corresponding to the page head content, and performing analysis rendering; the method for obtaining the static content of the page to render the current page specifically comprises the following steps: Acquiring root container part content of the hypertext markup language document corresponding to the page static content through the streaming response, and performing analysis rendering; the method for obtaining the page dynamic content to render the current page specifically comprises the following steps: and acquiring the additional content of the page dynamic content in the root container part content through the streaming response, and performing analysis rendering.
  5. 5. The method of claim 1, the method further comprising: if the static content processing of the page is abnormal or the edge logic processing is abnormal, rendering the current page through client rendering; if the page dynamic content processing is abnormal, marking the page dynamic content with the abnormality, and rendering the marked content through client rendering.
  6. 6. The method of claim 2, the method further comprising: if the dynamic content of the page fails to be fed back according to the cache attempt through the content distribution network, determining whether the current page corresponds to a preset service; If so, generating virtual page dynamic content corresponding to the appointed content in the page dynamic content according to the preset service through the content distribution network, and generating first actual page dynamic content corresponding to other contents in the page dynamic content according to the preset service through the server; Combining the virtual page dynamic content and the first actual page dynamic content to obtain page dynamic content, and feeding the page dynamic content back to a client so as to render a current page through the client; and generating second actual page dynamic content corresponding to the specified content according to the preset service through the server, and feeding back to the client so as to re-render the specified content in the current page through the client.
  7. 7. The method of claim 6, wherein the generating virtual page dynamic content corresponding to the specified content in the page dynamic content according to the preset service specifically comprises: Obtaining a corresponding virtualization confidence coefficient through weighted summation based on a plurality of influence factors corresponding to the preset service, wherein the influence factors comprise the data change amplitude of specified content corresponding to the preset service and the historical flow degree corresponding to the preset service; and determining the corresponding virtualization degree based on the virtualization confidence degree, so as to generate virtual page dynamic content corresponding to the appointed content in the page dynamic content according to the virtualization degree.
  8. 8. The method of claim 7, the method further comprising: Extracting corresponding user characteristics according to user identity information of the current user carried in the second rendering request through the content distribution network; determining a behavior mode of the current user according to the user characteristics, and determining the matching degree between the current user and the preset service according to the behavior mode; And adjusting the virtualization degree according to the matching degree.
  9. 9. The method of claim 7, generating virtual page dynamic content corresponding to the specified content in the page dynamic content according to the virtualization degree, specifically comprising: determining corresponding appointed content according to the appointed type in the page dynamic content, and determining a corresponding preset content template according to the appointed content; according to the virtualization degree, performing fuzzy description processing on the appointed content to generate corresponding filling content; and filling the filling content to the corresponding position of the preset content template through variable mapping to obtain the corresponding virtual page dynamic content.
  10. 10. The method of claim 2, the method further comprising: Determining, by the content distribution network, a degree of network stability with the client; and if the network stability degree is lower than a preset degree, adding corresponding description content into the page dynamic content to display the description content in the process of analyzing and rendering the page dynamic content by the client.
  11. 11. A server rendering device, comprising: the page head content rendering module generates and sends a first rendering request corresponding to the page head content through a network edge node aiming at the current page so that a client obtains the page head content to render the current page; The page static content rendering module generates and sends a second rendering request corresponding to the page static content based on the received first version number corresponding to the page head content through the network edge node, so that a client obtains the page static content to render a current page; and the page dynamic content rendering module generates and transmits a third rendering request corresponding to the page dynamic content based on the received second version number corresponding to the page static content through the network edge node, so that the client obtains the page dynamic content to render the current page.
  12. 12. The apparatus of claim 11, the apparatus further comprising a cache response module; the cache response module feeds back the page header content through a content distribution network; And attempting to feed back the page static content and the page dynamic content through a content distribution network, and executing rendering action through a server for executing function rendering according to the first version number or the second version number when the attempt fails to obtain the corresponding page static content or page dynamic content.
  13. 13. The apparatus of claim 12, the cache response module to perform a prerendering action on the second rendering request according to the first version number via a corresponding server file to obtain the corresponding static content of the page; And aiming at the third rendering request, based on the execution result of the pre-rendering action, executing a restoration rendering action through a corresponding server file according to the second version number to obtain the corresponding page dynamic content.
  14. 14. The apparatus of claim 11, wherein the page header content rendering module obtains header content of the hypertext markup language document corresponding to the page header content for a single streaming response and performs parsing rendering; The page static content rendering module acquires the root container part content of the hypertext markup language document corresponding to the page static content through the streaming response, and performs analysis rendering; And the page dynamic content rendering module acquires the additional content of the page dynamic content in the root container part content through the streaming response and performs analysis rendering.
  15. 15. The apparatus of claim 11, the apparatus further comprising an abnormal rollback module; The abnormal rollback module is used for rendering the current page through client rendering if the static content processing of the page is abnormal or the edge logic processing is abnormal; if the page dynamic content processing is abnormal, marking the page dynamic content with the abnormality, and rendering the marked content through client rendering.
  16. 16. The apparatus of claim 12, the apparatus further comprising a virtual content rendering module; the virtual content rendering module determines whether the current page corresponds to a preset service or not if the feedback of the dynamic content of the page is failed according to the cache attempt through the content distribution network; If so, generating virtual page dynamic content corresponding to the appointed content in the page dynamic content according to the preset service through the content distribution network, and generating first actual page dynamic content corresponding to other contents in the page dynamic content according to the preset service through the server; Combining the virtual page dynamic content and the first actual page dynamic content to obtain page dynamic content, and feeding the page dynamic content back to a client so as to render a current page through the client; and generating second actual page dynamic content corresponding to the specified content according to the preset service through the server, and feeding back to the client so as to re-render the specified content in the current page through the client.
  17. 17. The apparatus of claim 16, wherein the virtual content rendering module obtains a corresponding virtualization confidence through weighted summation based on a plurality of influence factors corresponding to the preset service, wherein the influence factors comprise a data change amplitude of specified content corresponding to the preset service and a historical flow degree corresponding to the preset service; and determining the corresponding virtualization degree based on the virtualization confidence degree, so as to generate virtual page dynamic content corresponding to the appointed content in the page dynamic content according to the virtualization degree.
  18. 18. The apparatus of claim 17, wherein the virtual content rendering module extracts, through the content distribution network, corresponding user characteristics according to user identity information of a current user carried in the second rendering request; determining a behavior mode of the current user according to the user characteristics, and determining the matching degree between the current user and the preset service according to the behavior mode; And adjusting the virtualization degree according to the matching degree.
  19. 19. The apparatus of claim 17, the virtual content rendering module to determine corresponding specified content according to a specified type in the page dynamic content and to determine a corresponding preset content template according to the specified content; according to the virtualization degree, performing fuzzy description processing on the appointed content to generate corresponding filling content; and filling the filling content to the corresponding position of the preset content template through variable mapping to obtain the corresponding virtual page dynamic content.
  20. 20. The apparatus of claim 12, further comprising a network state description module; the network state description module determines the network stability degree between the network state description module and the client through the content distribution network; and if the network stability degree is lower than a preset degree, adding corresponding description content into the page dynamic content to display the description content in the process of analyzing and rendering the page dynamic content by the client.

Description

Server rendering method, device and equipment Technical Field The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, and a device for server rendering. Background With the development of technology, a server rendering (SERVER SIDE RENDERING, SSR) scheme is proposed in the field of Web page (Web) development, and is used for rendering a Web page. In the traditional scheme, a client initiates a page request, a server integrates various resources required by a page, generates a complete and directly renderable HTML document, and returns the HTML document to the client at one time, so that the client can present the page content by directly analyzing and rendering without additional request resources in a browser. Based on this, when faced with an abnormal situation, a server rendering scheme capable of maintaining stability is required. Disclosure of Invention One or more embodiments of the present disclosure provide a server rendering method, apparatus, device, and storage medium to solve the technical problem that a server rendering scheme capable of maintaining stability is required when an abnormal situation is faced. To solve the above technical problems, one or more embodiments of the present specification are implemented as follows: one or more embodiments of the present disclosure provide a server rendering method, including: Generating and sending a first rendering request corresponding to the page header content by a network edge node aiming at the current page, so that a client obtains the page header content to render the current page; generating and sending a second rendering request corresponding to the static content of the page based on the received first version number corresponding to the page header content by the network edge node, so that a client obtains the static content of the page to render the current page; and generating and sending a third rendering request corresponding to the page dynamic content based on the received second version number corresponding to the page static content by the network edge node, so that the client obtains the page dynamic content and renders the current page. One or more embodiments of the present disclosure provide a server rendering apparatus, including: the page head content rendering module generates and sends a first rendering request corresponding to the page head content through a network edge node aiming at the current page so that a client obtains the page head content to render the current page; The page static content rendering module generates and sends a second rendering request corresponding to the page static content based on the received first version number corresponding to the page head content through the network edge node, so that a client obtains the page static content to render a current page; and the page dynamic content rendering module generates and transmits a third rendering request corresponding to the page dynamic content based on the received second version number corresponding to the page static content through the network edge node, so that the client obtains the page dynamic content to render the current page. One or more embodiments of the present disclosure provide a server rendering device, including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor, the instructions are executable by the at least one processor to enable the at least one processor to: Generating and sending a first rendering request corresponding to the page header content by a network edge node aiming at the current page, so that a client obtains the page header content to render the current page; generating and sending a second rendering request corresponding to the static content of the page based on the received first version number corresponding to the page header content by the network edge node, so that a client obtains the static content of the page to render the current page; and generating and sending a third rendering request corresponding to the page dynamic content based on the received second version number corresponding to the page static content by the network edge node, so that the client obtains the page dynamic content and renders the current page. One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer-executable instructions configured to: Generating and sending a first rendering request corresponding to the page header content by a network edge node aiming at the current page, so that a client obtains the page header content to render the current page; generating and sending a second rendering request corresponding to the static content of the page based on the received first version number corresponding to the page header content by the network edge node, so that a client obtains the st