CN113238754A - Server rendering method and device, server and storage medium - Google Patents

Server rendering method and device, server and storage medium Download PDF

Info

Publication number
CN113238754A
CN113238754A CN202110610251.1A CN202110610251A CN113238754A CN 113238754 A CN113238754 A CN 113238754A CN 202110610251 A CN202110610251 A CN 202110610251A CN 113238754 A CN113238754 A CN 113238754A
Authority
CN
China
Prior art keywords
server
browser
character string
rendering
data
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.)
Pending
Application number
CN202110610251.1A
Other languages
Chinese (zh)
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.)
Xiaovo Technology Co ltd
China United Network Communications Group Co Ltd
China Unicom Online Information Technology Co Ltd
Original Assignee
Xiaovo Technology Co ltd
China United Network Communications Group Co Ltd
China Unicom Online Information 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 Xiaovo Technology Co ltd, China United Network Communications Group Co Ltd, China Unicom Online Information Technology Co Ltd filed Critical Xiaovo Technology Co ltd
Priority to CN202110610251.1A priority Critical patent/CN113238754A/en
Publication of CN113238754A publication Critical patent/CN113238754A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • 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

Landscapes

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

Abstract

The application provides a server rendering method, a server rendering device, a server and a storage medium, wherein the method comprises the steps of obtaining a URL (uniform resource locator) input by a user based on a browser of a client through a node server, further sending the URL to a back-end server, enabling the back-end server to return data to be processed corresponding to the URL to the node server according to the URL, enabling the node server to generate a static page character string according to the data to be processed, returning the static page character string to the browser, enabling the browser to render a target page according to the static page character string and display the target page, achieving page rendering of the server, enabling the client to obtain the corresponding page only by rendering the static page character string, and solving the problems that existing client rendering consumes client performance, is time-consuming in page rendering and the like.

Description

Server rendering method and device, server and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a server rendering method and apparatus, a server, and a storage medium.
Background
With the increasing development of computer technology and the wide application of web page application programs and the like, in order to provide a page more suitable for user requirements, performance optimization needs to be performed on a web page, and the page subjected to performance optimization is rendered and then displayed to a user through a browser.
The page rendering comprises server side rendering and client side rendering. In the era that the client and the Server are not separated, almost all websites use dynamic Server Pages (ASPs), Java and PHP as Server rendering. With the acceleration of the network, the performance of the client is improved, the performance of the js is improved, and the client page is separated from the server. The popularity of ajax technology and the rise of the three front-end frameworks (Angular, fact, Vue) make client rendering increasingly mainstream.
However, the client rendering has the problems of consuming the client performance, consuming more time for page rendering and the like. Therefore, how to solve the disadvantage of client rendering on the premise of keeping the separation of the client and the server becomes a hot issue concerned in the industry.
Disclosure of Invention
In order to solve the problems in the prior art, the application provides a server rendering method, a server rendering device, a server and a storage medium.
In a first aspect, an embodiment of the present application provides a server rendering method, where the method is applied to a node server, and the method includes the following steps:
acquiring a Uniform Resource Locator (URL) input by a user based on a browser of a client;
sending the URL to a back-end server so that the back-end server returns data to be processed corresponding to the URL to the node server according to the URL;
generating a static page character string according to the data to be processed;
and returning the static page character string to the browser so that the browser renders the static page character string to obtain a target page and displays the target page.
In one possible implementation, the method further includes:
acquiring an interactive request input by a user based on a browser;
sending the interaction request to the back-end server so that the back-end server returns interaction data corresponding to the interaction request to the node server according to the interaction request;
and returning the interactive data to the browser so that the browser adjusts the target page according to the interactive data and displays the adjusted target page.
In a possible implementation manner, the generating a static page character string according to the data to be processed includes:
invoking Presender. io middleware;
and processing the data to be processed by using the render. io middleware to obtain the static page character string.
In a possible implementation manner, the processing the data to be processed by using the render.
Acquiring a character string template corresponding to the data to be processed;
and acquiring the static page character string based on the character string template and the data to be processed by utilizing the render. io middleware.
In a second aspect, an embodiment of the present application provides another server rendering method, where the method is applied to a client, and the method includes the following steps:
sending a URL (uniform resource locator) input by a user based on a browser to a node server so that the node server sends the URL to a back-end server, generating a static page character string according to data to be processed corresponding to the URL and returned by the back-end server, and returning the static page character string to the browser;
and rendering the static page character string by using the browser to obtain a target page and displaying the target page.
In one possible implementation, the method further includes:
sending an interaction request input by a user based on the browser to the node server, so that the node server sends the interaction request to the back-end server, and returns interaction data corresponding to the interaction request returned by the back-end server to the browser;
and adjusting the target page based on the interactive data by utilizing the browser, and displaying the adjusted target page.
In a possible implementation manner, the rendering the static page character string to obtain a target page and displaying the target page by using the browser includes:
calling chrome middleware in the browser;
and rendering the static page character string by using the chrome middleware to obtain and display the target page.
In a third aspect, an embodiment of the present application provides a server rendering apparatus, where the apparatus is applied to a node server, and the apparatus includes:
the acquisition module is used for acquiring a URL (uniform resource locator) input by a user based on a browser of a client;
the first sending module is used for sending the URL to a back-end server so that the back-end server returns data to be processed corresponding to the URL to the node server according to the URL;
the generating module is used for generating a static page character string according to the data to be processed;
and the returning module is used for returning the static page character string to the browser so that the browser renders the static page character string to obtain a target page and displays the target page.
In a possible implementation manner, the obtaining module is further configured to obtain an interaction request input by a user based on a browser;
the first sending module is further configured to send the interaction request to the back-end server, so that the back-end server returns interaction data corresponding to the interaction request to the node server according to the interaction request;
the returning module is further configured to return the interaction data to the browser, so that the browser adjusts the target page according to the interaction data and displays the adjusted target page.
In a possible implementation manner, the generating module is specifically configured to:
invoking Presender. io middleware;
and processing the data to be processed by using the render. io middleware to obtain the static page character string.
In a possible implementation manner, the generating module is specifically configured to:
acquiring a character string template corresponding to the data to be processed;
and acquiring the static page character string based on the character string template and the data to be processed by utilizing the render. io middleware.
In a fourth aspect, an embodiment of the present application provides another server rendering apparatus, where the apparatus is applied to a client, and the apparatus includes:
the second sending module is used for sending the URL input by the user based on the browser to a node server so that the node server sends the URL to a back-end server, generating a static page character string according to the data to be processed corresponding to the URL and returned by the back-end server, and returning the static page character string to the browser;
and the rendering module is used for rendering the static page character string by using the browser to obtain a target page and displaying the target page.
In a possible implementation manner, the second sending module is further configured to send an interaction request input by a user based on the browser to the node server, so that the node server sends the interaction request to the backend server, and returns interaction data corresponding to the interaction request returned by the backend server to the browser;
and the rendering module is further used for adjusting the target page based on the interaction data by using the browser and displaying the adjusted target page.
In a possible implementation manner, the rendering module is specifically configured to:
calling chrome middleware in the browser;
and rendering the static page character string by using the chrome middleware to obtain and display the target page.
In a fifth aspect, an embodiment of the present application provides a server, including:
a node server;
a back-end server;
a memory; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the node server, the computer program comprising instructions for performing the method of the first aspect.
In a sixth aspect, an embodiment of the present application provides a client, including:
a processor;
a memory; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of the second aspect.
In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program enables a server to execute the method in the first aspect.
In an eighth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program enables a client to execute the method of the second aspect.
In a ninth aspect, the present application provides a computer program product, which includes computer instructions for executing the method of the first aspect by a processor.
In a tenth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions for executing the method of the second aspect by a processor.
According to the server rendering method, the server rendering device, the server and the storage medium, the URL input by a user based on a browser of a client is obtained through a node server, and then the URL is sent to a back-end server, so that the back-end server returns data to be processed corresponding to the URL to the node server according to the URL, the node server generates a static page character string according to the data to be processed, the static page character string is returned to the browser, the browser renders according to the static page character string to obtain a target page and displays the target page, page rendering of the server is achieved, the client only needs to render the static page character string to obtain the corresponding page, and the problems that the client performance is consumed, the page rendering time is long and the like in the existing client rendering are solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a server rendering system architecture according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a server rendering method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another server rendering method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another server rendering method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a server rendering apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of another server rendering apparatus according to an embodiment of the present application;
fig. 7A is a schematic diagram of a basic hardware architecture of a server according to the present application;
fig. 7B is a schematic diagram of a basic hardware architecture of a client according to 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.
The terms "first," "second," "third," and "fourth," if any, in the description and claims of this application and the above-described figures are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, page rendering is a process of outputting a visual page from a URL of a web page according to resources corresponding to the URL.
The page rendering comprises server side rendering and client side rendering. In the era that the client and the server are not separated, almost all websites use ASP, Java and PHP as server rendering. With the acceleration of the network, the performance of the client is improved, the performance of the js is improved, and the client page is separated from the server. The popularity of ajax technology and the rise of the three front-end frameworks (Angular, fact, Vue) make client rendering increasingly mainstream.
However, the client rendering has the problems of consuming the client performance, consuming more time for page rendering, and the like. Therefore, how to solve the disadvantage of client rendering on the premise of keeping the separation of the client and the server becomes a hot issue concerned in the industry.
In order to solve the above problems, an embodiment of the present application provides a server rendering method, which is implemented by a server, that is, the server may fill data in a specific area and a specific symbol to generate a complete page file character string, and return the page file character string to a client, so that the client can obtain a corresponding page only by rendering the character string, and thus, the problems that the client performance is consumed and the page rendering time is long in the existing client rendering are solved.
Optionally, the server rendering method provided by the present application may be applied to the architecture diagram of the server rendering system shown in fig. 1, and as shown in fig. 1, the system may include a node server 101, a backend server 102, and a client 103.
In a specific implementation process, a user may input a URL in a browser of the client 103, and then the client 103 may send the URL to the node server 101.
The node server 101 acquires the URL and transmits the URL to the backend server 102. The backend server 102 returns the data to be processed corresponding to the URL to the node server 101. The node server 101 generates a pagefile character string according to the data to be processed, and returns the pagefile character string to the client 103. The client 103 renders the page file character string by using a browser to obtain a corresponding page, and solves the problems that the existing client rendering consumes client performance, consumes more time for page rendering and the like.
It should be understood that the above-described system is only an exemplary system, and when implemented, may be configured according to application requirements.
It can be understood that the illustrated structure of the embodiment of the present application does not form a specific limitation on the architecture of the server rendering system. In other possible embodiments of the present application, the foregoing architecture may include more or less components than those shown in the drawings, or combine some components, or split some components, or arrange different components, which may be determined according to practical application scenarios, and is not limited herein. The components shown in fig. 1 may be implemented in hardware, software, or a combination of software and hardware.
In addition, the system architecture described in the embodiment of the present application is for more clearly illustrating the technical solution of the embodiment of the present application, and does not form a limitation on the technical solution provided in the embodiment of the present application, and it can be known by a person skilled in the art that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems along with the evolution of the system architecture and the appearance of new service scenarios.
The technical solutions of the present application are described below with several embodiments as examples, and the same or similar concepts or processes may not be described in detail in some embodiments.
The technical solutions of the present application are described below with several embodiments as examples, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a schematic flow diagram of a server rendering method provided in an embodiment of the present application, where an execution subject of the embodiment may be a node server in the embodiment shown in fig. 1, and as shown in fig. 2, the method may include:
s201: and acquiring the URL input by the user based on the browser of the client.
Here, the user may input a URL in a browser of the client, where the URL may be understood as a network address of a target page rendered by a subsequent client, and may be determined according to actual situations.
The method for the node server to obtain the URL may be determined according to actual conditions, for example, after the client obtains the URL, the client may send the URL to the node server, and the node server obtains the URL, or the node server may monitor the client, for example, whether a URL input by a user based on a browser of the client exists is monitored, and if so, the URL is obtained from the client, and the like, so that application requirements of different application scenarios are met.
S202: and sending the URL to a back-end server so that the back-end server returns the data to be processed corresponding to the URL to a node server according to the URL.
For example, the backend server may pre-store the correspondence between the URL and the data to be processed. After the node server sends the URL to the back-end server, the back-end server may determine, according to the correspondence, to-be-processed data corresponding to the URL, and return the to-be-processed data to the node server.
S203: and generating a static page character string according to the data to be processed.
Here, after acquiring the to-be-processed data returned by the back-end server, the node server may call a render.
For example, the node server may obtain a character string template corresponding to the data to be processed, and then obtain the static page character string based on the character string template and the data to be processed by using the render.
The node server can prestore the corresponding relation between the data to be processed and the character string template. After obtaining the to-be-processed data returned by the back-end server, the node server may obtain a character string template corresponding to the to-be-processed data according to the correspondence, and further, fill the to-be-processed data in a corresponding position in the character string template by using the render.
S204: and returning the static page character string to the browser so that the browser renders the static page character string to obtain a target page and displays the target page.
After the node server generates the static page character string, the static page character string is returned to the browser, the browser can call the chrome middleware, the chrome middleware is utilized to render the static page character string, and the target page is obtained and displayed.
The node server fills data in a specific area and a specific symbol to generate a static page character string, the static page character string is returned to the client, and the client can obtain a corresponding page only by rendering the character string, so that the problems that the client performance is consumed and the time consumption of page rendering is high in the conventional client rendering are solved.
In addition, the node server may further obtain an interaction request (e.g., a page turning request, a comment request, etc.) input by the user based on the browser, and send the interaction request to the back-end server, so that the back-end server returns interaction data corresponding to the interaction request to the node server according to the interaction request. And the node server returns the interactive data to the browser so that the browser adjusts the target page according to the interactive data and displays the adjusted target page.
Here, the node server generates a static page character string and sends the static page character string to the browser, if the node server obtains an interaction request input by a user based on the browser, the interaction request can be sent to the back-end server to obtain interaction data corresponding to the interaction request, and then the interaction data is returned to the browser.
In the embodiment of the application, before obtaining a URL input by a user based on a browser of a client, a node server may log in a render.
According to the method and the device, the URL input by a user based on the browser of the client is obtained through the node server, and then the URL is sent to the back-end server, so that the back-end server returns the data to be processed corresponding to the URL to the node server according to the URL, the node server generates the static page character string according to the data to be processed, the static page character string is returned to the browser, the browser obtains the target page and displays the target page according to the static page character string rendering, the page rendering of the server side is achieved, the client can obtain the corresponding page only by rendering the static page character string, and the problems that the client performance is consumed, more time is consumed in the existing client rendering are solved.
In addition, the embodiment of the application has a complete static page at the back end, so that the crawler can crawl to obtain information more easily, and Search Engine Optimization (seo) is facilitated. In addition, the backend of the embodiment of the application generates a staticized file. Namely, a cache segment is generated, and if the subsequent page changes, the changed file can be efficiently generated based on the staticized file, so that the method is suitable for application.
The method for rendering the server according to the embodiment of the present application is described in detail from the node server side in the above embodiment, and the method for rendering the server according to the embodiment of the present application is described in detail from the client side in combination with the following embodiment. It should be understood that certain concepts, features, etc. of the node server-side description correspond to those of the client-side description, and the repeated description is appropriately omitted for the sake of brevity.
Fig. 3 is a flowchart illustrating another server rendering method according to an embodiment of the present application, where an execution subject of the embodiment may be the client in fig. 1, and as shown in fig. 3, the method may include the following steps:
s301: and sending the URL input by the user based on the browser to a node server so that the node server sends the URL to a back-end server, generating a static page character string according to the data to be processed corresponding to the URL returned by the back-end server, and returning the static page character string to the browser.
S302: and rendering the static page character string by using a browser to obtain a target page and displaying the target page.
Here, the client may also send an interaction request input by the user based on the browser to the node server, so that the node server sends the interaction request to the back-end server, and returns interaction data corresponding to the interaction request returned by the back-end server to the browser; and adjusting the target page based on the interactive data by using a browser, and displaying the adjusted target page.
When the client renders the static page character string to obtain a target page and displays the target page by using the browser, a chrome middleware in the browser can be called, and the static page character string is rendered by using the chrome middleware to obtain the target page and displays the target page.
According to the method and the device, the client side sends the URL input by the user based on the browser to the node server, and then the node server sends the URL to the back-end server, so that the back-end server returns the data to be processed corresponding to the URL to the node server according to the URL, the node server generates the static page character string according to the data to be processed, the static page character string is returned to the browser, the client side renders the static page character string by using the browser to obtain the target page and displays the target page, page rendering of the server side is achieved, the client side only needs to render the static page character string to obtain the corresponding page, and the problems that the client side performance is consumed in existing client side rendering, the time consumed in page rendering is large and the like are solved.
In addition, an embodiment of the present application further provides another server rendering method, which is interactively explained from a client, a node server, and a backend server, and as shown in fig. 4, the method may include:
s401: and the client sends the URL input by the user based on the browser to the node server.
S402: and the node server sends the URL to a back-end server.
S403: and the back-end server returns the data to be processed corresponding to the URL to the node server according to the URL.
S404: and the node server generates a static page character string according to the data to be processed.
Here, the node server may call a render. io middleware, and process the data to be processed by using the render. io middleware to obtain the static page character string.
S405: and the node server returns the static page character string to the browser.
S406: and the client renders the static page character string to obtain a target page by using the browser and displays the target page.
Here, the client may call a chrome middleware in the browser, and render the static page character string by using the chrome middleware, so as to obtain and display the target page.
In addition, the client can also send an interaction request input by the user based on the browser to the node server, and then the node server sends the interaction request to the back-end server and returns interaction data corresponding to the interaction request returned by the back-end server to the browser. And the client adjusts the target page based on the interactive data by using the browser and displays the adjusted target page.
According to the method and the device, the URL input by a user based on the browser of the client can be obtained through the node server, and then the URL is sent to the back-end server, so that the back-end server returns the data to be processed corresponding to the URL to the node server according to the URL, the node server generates the static page character string according to the data to be processed, and the static page character string is returned to the browser, so that the browser obtains the target page and displays the target page according to the static page character string rendering, the page rendering of the server side is realized, the client can obtain the corresponding page only by rendering the static page character string, and the problems that the client performance is consumed, more time is consumed in the conventional client rendering are solved.
Fig. 5 is a schematic structural diagram of a server rendering apparatus according to an embodiment of the present application, corresponding to the server rendering method according to the foregoing embodiment. For convenience of explanation, only portions related to the embodiments of the present application are shown. Fig. 5 is a schematic structural diagram of a server rendering apparatus according to an embodiment of the present application, where the server rendering apparatus 50 includes: an acquisition module 501, a first sending module 502, a generation module 503, and a return module 504. The server rendering device may be the node server itself, or a chip or an integrated circuit that implements the functions of the node server. It should be noted that the division of the obtaining module, the first sending module, the generating module, and the returning module is only a division of logical functions, and the obtaining module, the first sending module, the generating module, and the returning module may be integrated or independent physically.
The obtaining module 501 is configured to obtain a URL input by a user based on a browser of a client.
A first sending module 502, configured to send the URL to a back-end server, so that the back-end server returns to-be-processed data corresponding to the URL to the node server according to the URL.
A generating module 503, configured to generate a static page character string according to the to-be-processed data.
A returning module 504, configured to return the static page character string to the browser, so that the browser renders the static page character string to obtain a target page and displays the target page.
In a possible implementation manner, the obtaining module 501 is further configured to obtain an interaction request input by a user based on a browser;
the first sending module 502 is further configured to send the interaction request to the back-end server, so that the back-end server returns interaction data corresponding to the interaction request to the node server according to the interaction request;
the returning module 504 is further configured to return the interaction data to the browser, so that the browser adjusts the target page according to the interaction data, and displays the adjusted target page.
In a possible implementation manner, the generating module 503 is specifically configured to:
invoking Presender. io middleware;
and processing the data to be processed by using the render. io middleware to obtain the static page character string.
In a possible implementation manner, the generating module 503 is specifically configured to:
acquiring a character string template corresponding to the data to be processed;
and acquiring the static page character string based on the character string template and the data to be processed by utilizing the render. io middleware.
The apparatus provided in the embodiment of the present application may be used to implement the technical solution of the method embodiment in fig. 2, which has similar implementation principles and technical effects, and is not described herein again in the embodiment of the present application.
Fig. 6 is a schematic structural diagram of another server rendering apparatus according to an embodiment of the present application. The server rendering apparatus 60 includes: a second sending module 601 and a rendering module 602. The server rendering device may be the client itself, or a chip or an integrated circuit that implements the functions of the client. It should be noted here that the division of the second sending module and the rendering module is only a division of logical functions, and the two may be integrated or independent physically.
The second sending module 601 is configured to send a URL input by a user based on a browser to a node server, so that the node server sends the URL to a back-end server, generate a static page character string according to-be-processed data corresponding to the URL and returned by the back-end server, and return the static page character string to the browser.
And a rendering module 602, configured to render the static page character string to obtain a target page and display the target page by using the browser.
In a possible design, the second sending module 601 is further configured to send an interaction request input by a user based on the browser to the node server, so that the node server sends the interaction request to the backend server, and returns interaction data corresponding to the interaction request returned by the backend server to the browser;
the rendering module 602 is further configured to adjust the target page based on the interaction data by using the browser, and display the adjusted target page.
In a possible implementation manner, the rendering module 602 is specifically configured to:
calling chrome middleware in the browser;
and rendering the static page character string by using the chrome middleware to obtain and display the target page.
The apparatus provided in the embodiment of the present application may be used to implement the technical solution of the method embodiment in fig. 3, which has similar implementation principles and technical effects, and is not described herein again in the embodiment of the present application.
Alternatively, fig. 7A and 7B schematically provide one possible basic hardware architecture of the server and the client, respectively, described herein.
Referring to fig. 7A and 7B, the server and the client include at least one processor 701 and a communication interface 703. Further optionally, a memory 702 and a bus 704 may also be included.
Among them, the number of the processors 701 in the server and the client may be one or more, and fig. 7A and 7B only illustrate one of the processors 701. Alternatively, the processor 701 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or a Digital Signal Processor (DSP). If the server and the client have multiple processors 701, the types of the multiple processors 701 may be different, or may be the same. Alternatively, the multiple processors 701 of the server and the client may also be integrated into a multi-core processor.
Memory 702 stores computer instructions and data; the memory 702 may store computer instructions and data required to implement the server rendering methods provided herein, e.g., the memory 702 stores instructions for implementing the steps of the server rendering methods described above. Memory 702 can be any one or any combination of the following storage media: nonvolatile memory (e.g., Read Only Memory (ROM), Solid State Disk (SSD), hard disk (HDD), optical disk), volatile memory.
The communication interface 703 may provide information input/output for the at least one processor. Any one or any combination of the following devices may also be included: a network interface (e.g., an ethernet interface), a wireless network card, etc. having a network access function.
Optionally, the communication interface 703 may also be used for data communication between the server and the client and other computing devices or clients.
Further alternatively, fig. 7A and 7B show the bus 704 by a thick line. The bus 704 may connect the processor 701 with the memory 702 and the communication interface 703. Thus, via bus 704, processor 701 may access memory 702 and may also utilize communication interface 703 for data interaction with other computing devices or clients.
In the present application, the server and the client execute the computer instructions in the memory 702, so that the server and the client implement the server rendering method provided in the present application, or the server and the client deploy the server rendering apparatus.
From the viewpoint of logical functional division, illustratively, as shown in fig. 7A, the memory 702 may include therein an obtaining module 501, a first sending module 502, a generating module 503, and a returning module 504. The inclusion herein merely refers to that the instructions stored in the memory may, when executed, implement the functions of the obtaining module, the first sending module, the generating module and the returning module, respectively, and is not limited to a physical structure.
In one possible design, as shown in fig. 7B, the second sending module 601 and the rendering module 602 are included in the memory 702, and the inclusion merely refers to that the instructions stored in the memory can implement the functions of the second sending module and the rendering module, respectively, when executed, and is not limited to a physical structure.
In addition, the server rendering apparatus may be implemented by software as shown in fig. 7A and 7B, or may be implemented by hardware as a hardware module or as a circuit unit.
The present application provides a computer-readable storage medium, and the computer program product includes computer instructions that instruct a computing device to execute the above server rendering method provided in the present application.
An embodiment of the present application provides a computer program product, which includes computer instructions, where the computer instructions are executed by a processor to perform the above server rendering method provided in the present application.
The present application provides a chip comprising at least one processor and a communication interface providing information input and/or output for the at least one processor. Further, the chip may also include at least one memory for storing computer instructions. The at least one processor is used for calling and running the computer instruction so as to execute the server rendering method provided by the application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

Claims (11)

1. A server rendering method is applied to a node server, and comprises the following steps:
acquiring a uniform resource locator input by a user based on a browser of a client;
sending the uniform resource locator to a back-end server so that the back-end server returns data to be processed corresponding to the uniform resource locator to the node server according to the uniform resource locator;
generating a static page character string according to the data to be processed;
and returning the static page character string to the browser so that the browser renders the static page character string to obtain a target page and displays the target page.
2. The method of claim 1, further comprising:
acquiring an interaction request input by a user based on the browser;
sending the interaction request to the back-end server so that the back-end server returns interaction data corresponding to the interaction request to the node server according to the interaction request;
and returning the interactive data to the browser so that the browser adjusts the target page according to the interactive data and displays the adjusted target page.
3. The method according to claim 1 or 2, wherein the generating a static page character string according to the data to be processed comprises:
invoking Presender. io middleware;
and processing the data to be processed by using the render. io middleware to obtain the static page character string.
4. The method as claimed in claim 3, wherein said processing said data to be processed by using said pre render. io middleware to obtain said static page character string comprises:
acquiring a character string template corresponding to the data to be processed;
and acquiring the static page character string based on the character string template and the data to be processed by utilizing the render. io middleware.
5. A server rendering method is applied to a client, and comprises the following steps:
sending a uniform resource locator input by a user based on a browser to a node server so that the node server sends the uniform resource locator to a back-end server, generating a static page character string according to data to be processed corresponding to the uniform resource locator returned by the back-end server, and returning the static page character string to the browser;
and rendering the static page character string by using the browser to obtain a target page and displaying the target page.
6. The method of claim 5, further comprising:
sending an interaction request input by a user based on the browser to the node server, so that the node server sends the interaction request to the back-end server, and returns interaction data corresponding to the interaction request returned by the back-end server to the browser;
and adjusting the target page based on the interactive data by utilizing the browser, and displaying the adjusted target page.
7. The method according to claim 5 or 6, wherein the rendering the static page character string to obtain a target page and displaying the target page by using the browser comprises:
calling chrome middleware in the browser;
and rendering the static page character string by using the chrome middleware to obtain and display the target page.
8. A server rendering apparatus, wherein the apparatus is applied to a node server, and the apparatus comprises:
the acquisition module is used for acquiring a uniform resource locator input by a user based on a browser of a client;
the first sending module is used for sending the uniform resource locator to a back-end server so that the back-end server returns data to be processed corresponding to the uniform resource locator to the node server according to the uniform resource locator;
the generating module is used for generating a static page character string according to the data to be processed;
and the returning module is used for returning the static page character string to the browser so that the browser renders the static page character string to obtain a target page and displays the target page.
9. A server, comprising:
a node server;
a back-end server;
a memory; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the node server, the computer program comprising instructions for performing the method of any of claims 1-4.
10. A computer-readable storage medium, characterized in that it stores a computer program that causes a server to execute the method of any one of claims 1-4.
11. A computer program product comprising computer instructions for executing the method of any one of claims 1 to 4 by a processor.
CN202110610251.1A 2021-06-01 2021-06-01 Server rendering method and device, server and storage medium Pending CN113238754A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110610251.1A CN113238754A (en) 2021-06-01 2021-06-01 Server rendering method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110610251.1A CN113238754A (en) 2021-06-01 2021-06-01 Server rendering method and device, server and storage medium

Publications (1)

Publication Number Publication Date
CN113238754A true CN113238754A (en) 2021-08-10

Family

ID=77136253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110610251.1A Pending CN113238754A (en) 2021-06-01 2021-06-01 Server rendering method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN113238754A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742112A (en) * 2021-09-15 2021-12-03 武汉联影智融医疗科技有限公司 Electrocardio image generation method and system and electronic device
CN113836455A (en) * 2021-09-18 2021-12-24 北京百度网讯科技有限公司 Special effect rendering method, device, equipment, storage medium and computer program product
CN114500484A (en) * 2021-12-24 2022-05-13 中国电信股份有限公司 Page rendering method and device, electronic equipment and readable medium
CN115499452A (en) * 2022-11-15 2022-12-20 四川蜀天信息技术有限公司 Data synchronization method based on next
CN116484132A (en) * 2023-06-26 2023-07-25 北京轻松筹信息技术有限公司 Method, device, equipment and readable storage medium for rendering page

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190303500A1 (en) * 2018-03-27 2019-10-03 Capital One Services, Llc Systems and methods for single page application server side renderer
CN111859224A (en) * 2020-07-31 2020-10-30 平安健康保险股份有限公司 Server rendering method and device based on node server and computer equipment
CN112287256A (en) * 2020-09-21 2021-01-29 北京沃东天骏信息技术有限公司 Page display method, terminal device, cloud server, system and storage medium
CN112667945A (en) * 2020-12-25 2021-04-16 政和科技股份有限公司 SEO optimization method for developing website based on front-end and back-end separation technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190303500A1 (en) * 2018-03-27 2019-10-03 Capital One Services, Llc Systems and methods for single page application server side renderer
CN111859224A (en) * 2020-07-31 2020-10-30 平安健康保险股份有限公司 Server rendering method and device based on node server and computer equipment
CN112287256A (en) * 2020-09-21 2021-01-29 北京沃东天骏信息技术有限公司 Page display method, terminal device, cloud server, system and storage medium
CN112667945A (en) * 2020-12-25 2021-04-16 政和科技股份有限公司 SEO optimization method for developing website based on front-end and back-end separation technology

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742112A (en) * 2021-09-15 2021-12-03 武汉联影智融医疗科技有限公司 Electrocardio image generation method and system and electronic device
CN113742112B (en) * 2021-09-15 2024-04-16 武汉联影智融医疗科技有限公司 Electrocardiogram image generation method, system and electronic device
CN113836455A (en) * 2021-09-18 2021-12-24 北京百度网讯科技有限公司 Special effect rendering method, device, equipment, storage medium and computer program product
CN114500484A (en) * 2021-12-24 2022-05-13 中国电信股份有限公司 Page rendering method and device, electronic equipment and readable medium
CN115499452A (en) * 2022-11-15 2022-12-20 四川蜀天信息技术有限公司 Data synchronization method based on next
CN115499452B (en) * 2022-11-15 2023-02-28 四川蜀天信息技术有限公司 Data synchronization method based on next
CN116484132A (en) * 2023-06-26 2023-07-25 北京轻松筹信息技术有限公司 Method, device, equipment and readable storage medium for rendering page

Similar Documents

Publication Publication Date Title
CN113238754A (en) Server rendering method and device, server and storage medium
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
CN106991154B (en) Webpage rendering method and device, terminal and server
US20220308900A1 (en) Method and apparatus of pre-rendering page, electronic device, and storage medium
CN106933871B (en) Short link processing method and device and short link server
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN109542427B (en) System customization method and device, electronic equipment and storage medium
CN107066631A (en) Display methods, device and the electronic equipment of the page
US10284671B2 (en) Dynamic bundling of web components for asynchronous delivery
JP7167222B2 (en) APPLET DATA ACQUISITION METHOD, APPARATUS, DEVICE, AND STORAGE MEDIUM
US20120240019A1 (en) Method and system for tracking web link usage
CN105095280A (en) Caching method and apparatus for browser
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
CN111859224A (en) Server rendering method and device based on node server and computer equipment
US9645983B1 (en) Modifying a document at a script processing server using a client device's state information
CN110515631B (en) Method for generating application installation data packet, server and computer storage medium
US9516088B2 (en) Systems and methods to consistently generate web content
JP6568985B2 (en) Batch optimized rendering and fetch architecture
US20140156736A1 (en) Apparatus and method for managing threads to perform divided execution of software
CN113569173A (en) Page loading method and device, storage medium and electronic equipment
JP2013168156A (en) Determination of standby time of content server
CN116185825A (en) Front-end self-test method, front-end device, and computer-readable storage medium
CN112565472B (en) Static resource processing method and device
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113961298A (en) Page switching method, device, equipment and 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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210810