CN113971251A - Webpage output method, system and computer readable storage medium - Google Patents

Webpage output method, system and computer readable storage medium Download PDF

Info

Publication number
CN113971251A
CN113971251A CN202111262688.7A CN202111262688A CN113971251A CN 113971251 A CN113971251 A CN 113971251A CN 202111262688 A CN202111262688 A CN 202111262688A CN 113971251 A CN113971251 A CN 113971251A
Authority
CN
China
Prior art keywords
page
data
rendered
rendering
real
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
CN202111262688.7A
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.)
Shenzhen Beisiqi Innovation Technology Co ltd
Original Assignee
Shenzhen Beisiqi Innovation 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 Shenzhen Beisiqi Innovation Technology Co ltd filed Critical Shenzhen Beisiqi Innovation Technology Co ltd
Priority to CN202111262688.7A priority Critical patent/CN113971251A/en
Publication of CN113971251A publication Critical patent/CN113971251A/en
Pending legal-status Critical Current

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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • 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)
  • 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 embodiment of the invention discloses a webpage output method, which comprises the following steps: generating a selection parameter based on a comparison result of real-time request data and a preset first routing table, wherein the real-time request data is read by a server side, and a plurality of webpage template data are stored in the first routing table; acquiring a corresponding page to be rendered according to the selection parameters; and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying. In addition, the invention also discloses a webpage output system and a computer storage medium applying the webpage output method. The method and the device can flexibly select the main body of the page rendering, improve the flexibility of the webpage operation, and are beneficial to reducing the first screen time and the display accuracy of the webpage display.

Description

Webpage output method, system and computer readable storage medium
Technical Field
The present invention relates to the field of front-end development technologies, and in particular, to a method and a system for outputting a web page and a computer-readable storage medium.
Background
In the internet front-end development technology, human-computer interaction is realized by designing a webpage, the rendering of the webpage can well improve the interaction effect and the user experience, and the current webpage output modes generally include two types: one is that the server directly sends resource files such as HTML and the like to the user side for application construction and corresponding rendering, and further webpage output is realized; the other is that the user side directly receives the HTML file constructed and rendered by the server side and then directly displays the HTML file; the first mode realizes that the first screen display time of the webpage display is longer due to the fact that rendering operation needs to be carried out on a user side; in the second method, when the server is heavily loaded, rendering errors may occur, and during the process of transmitting the HTML file from the server to the client, the file may be lost.
In summary, the existing control flow of webpage output has the problems of long first screen time and inaccurate display, and how to solve the problems is an urgent need to be solved in the prior art.
Disclosure of Invention
In view of this, the present invention provides a method, a system, and a computer-readable storage medium for outputting a web page, which are beneficial to improve the first screen time and display accuracy of web page display by flexibly selecting an execution subject of web page rendering.
In a first aspect, an embodiment of the present invention provides a method for outputting a web page, where the method includes:
generating a selection parameter based on a comparison result of real-time request data and a preset first routing table, wherein the real-time request data is read by a server side, and a plurality of webpage template data are stored in the first routing table;
acquiring a corresponding page to be rendered according to the selection parameters;
and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying.
Optionally, the generating a selection parameter based on a comparison result between the real-time request data and a preset first routing table includes:
acquiring unique identification information corresponding to each webpage template data, wherein the unique identification information is used for distinguishing each webpage template data;
and generating a corresponding set based on the unique identification information of all the webpage template data, and generating the first routing table according to the set.
Optionally, the obtaining a corresponding page to be rendered according to the selection parameter includes:
judging whether the webpage template data corresponding to the real-time request data exists in the first routing table;
if yes, generating a corresponding page to be rendered based on the selection parameters and the first routing table;
if not, acquiring a preset display page based on the selection parameters, rendering the preset display page by the server side based on the real-time request data, and transmitting the rendered preset display page to a browser side for displaying.
Optionally, the performing a rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page includes:
determining all page component data required for generating the target output page based on the first routing table;
and rendering the page to be rendered according to all the page components to generate the target output page.
Optionally, the performing a rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page includes:
acquiring the page to be rendered sent by the server and rendering demand data corresponding to the page to be rendered;
and constructing a corresponding application based on the rendering demand data, and rendering the page to be rendered according to the application to generate the target output page.
Optionally, the constructing a corresponding application based on the rendering requirement data, and rendering the page to be rendered according to the application to generate the target output page includes:
acquiring page component data corresponding to the page to be rendered in a preset second routing table based on the application, wherein the second routing table is arranged at a browser end;
rendering the page to be rendered by the browser end based on the page component data to generate the target output page.
Optionally, rendering, by the browser end, the page to be rendered based on the page component data to generate the target output page, including:
acquiring the page to be rendered sent by the server and first DOM (Document Object Model) data corresponding to the page to be rendered;
acquiring second DOM data corresponding to the application;
judging whether the first DOM data is matched with the second DOM data;
if so, outputting the target output page by the browser end, and performing event binding operation on the target output page based on the first DOM data or the second DOM data;
if not, the browser end feeds back corresponding unmatched preset information to the server end; or
Acquiring the request times generated by the target output page request based on the real-time request data;
under the condition that the request frequency is not less than one time, the server side sends the target output page to the browser side again and generates corresponding prompt information; or
And displaying and outputting the target output page as the display page by the browser.
Optionally, the determining whether the first DOM data and the second DOM data are matched includes:
acquiring the number of page nodes contained in the target output page;
selecting a preset comparison algorithm based on the number of the page nodes;
and judging whether the first DOM data is matched with the second DOM data according to the comparison algorithm.
In a second aspect, an embodiment of the present invention further provides a web page output system, where the web page output system includes: the system comprises a browser end and a server end, wherein the browser end and the server end both comprise a page rendering module and a page generating module, the browser end further comprises a page output module, and the server end further comprises a data comparison module and a selection module; wherein the content of the first and second substances,
the data comparison module is used for generating selection parameters based on comparison results of real-time request data and a preset first routing table, the real-time request data are read by a server side, and a plurality of webpage template data are stored in the first routing table;
the selection module is used for acquiring a corresponding page to be rendered according to the selection parameters;
the page rendering module is used for performing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page;
the page generating module is used for generating the target output page after the page rendering module executes rendering operation;
the page output module is used for carrying out transmission output and display output on the target output page.
In a third aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the web page output method as described in any one of the above.
According to the webpage output method, the webpage output system and the computer-readable storage medium, when a server receives real-time request data corresponding to a page display request sent by a user, a selection parameter is determined according to comparison between the real-time request data and a first routing table arranged at the server end, the acquisition mode of a page to be rendered can be determined based on the selection parameter, namely whether the page to be rendered corresponding to the real-time request parameter exists in the first routing table or not is determined, and if the page to be rendered exists in the first routing table, the server end acquires the page to be rendered from the first routing table, renders the page and sends the page to be rendered to a browser end; if not, the server renders a preset display interface and then sends the rendered preset display interface to the browser end; and finally, outputting and displaying through a browser end for the user to use. According to the webpage output method, the webpage rendering flexibility is improved by flexibly selecting the webpage rendering main body, and because the rendering of the server side on the webpage to be rendered is only limited to the most basic page component required by the user, the problems of long first screen time caused by rendering of the browser side and incorrect webpage display caused by rendering of the server side can be solved, and good operation experience is provided for the user in the rendering process.
Drawings
Fig. 1 is a flowchart of a method for outputting a web page according to an embodiment of the present invention;
FIG. 2 is a flow chart of a first routing table according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a selection process of a page to be rendered according to an embodiment of the present invention;
FIG. 4 is a flowchart of an implementation of web page rendering according to an embodiment of the present invention;
FIG. 5 is a flowchart of another implementation of web page rendering according to an embodiment of the present invention;
FIG. 6 is a flowchart of yet another implementation of web page rendering according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a web page output system according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. The terms "first", "second", etc. are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "plurality", "batch" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
In the internet technology, a user can have good interactive experience with the internet through a proper interactive page, so that an interface to be displayed to the user is generally rendered to a certain extent in the process of displaying a webpage. However, in the prior art, if rendering is performed only through a browser end, the first screen time of page display may be long; if the rendering is performed through the server side, there may be a certain loss of the webpage data transmitted to the browser side after the rendering is completed. The browser end can be a desktop browser of each platform, such as Windows, Macos, Android, iPhone ios and the like; and sending corresponding webpage requirements through an application of a browser end, wherein the application refers to desktop applications such as Chrome, Firfox, QQ browser and Edga used in various platforms (such as Windows, Macos, Android, iPhone ios and the like). The user inputs a URL (Uniform Resource Locator) address in the browser address bar or clicks a hyperlink to make an access request. Further, if a webpage request needs to be made through other applications, a browser engine Webkit needs to be built in the applications; specifically, the built-in Webview of other applications such as WeChat and nailing needs to be a standard browser. The server side is a WEB server side constructed by nodeJs, and the server side constructs application by JS.
Based on the problems in the prior art, the embodiment of the invention provides a webpage output method, which can guarantee the accuracy of webpage display and give a user good use experience while giving consideration to the first screen display time of the webpage display. Referring to fig. 1, the method for outputting a web page includes the following steps:
step S10: and generating a selection parameter based on a comparison result of the real-time request data and a preset first routing table.
The real-time request data refers to real-time data generated when a user provides a webpage requirement at a browser end, the real-time request data is transmitted to a server end through the browser end, and the server end reads the real-time request data to determine real-time request content of the user, such as URL request data.
The first routing table stores a plurality of webpage template data, the webpage template data can be selected according to historical requirements of a previous browser end and can also be selected according to a certain page display field, and the first routing table only refers to all available webpage template data stored in the server end in a general mode. In particular, the first routing table may be stored in a database on the server side.
In this embodiment, it may be determined whether the web page template data corresponding to the real-time request data exists in the first routing table based on the generated selection data, specifically, if the web page template data corresponding to the real-time request data can be obtained in the first routing table in the traversal comparison process of the real-time request data and the first routing table, the generated selection data is used by the server end to locate the corresponding web page template data in the first routing table; if the webpage template data corresponding to the real-time request data cannot be acquired in the traversal comparison process, the generated selection data is used for the server side to acquire and output the corresponding webpage data at other places outside the first routing list.
According to the embodiment, more development options can be provided for a webpage developer according to the traversal comparison operation of the real-time request data and the first routing table, and the webpage rendering flexibility is improved.
In order to facilitate the traversal comparison between the real-time request data and the first routing table, the traversal comparison process can be rapidly and accurately implemented, and meanwhile, in order to substantially distinguish and classify each webpage template data, in an embodiment of the present invention, the identification of unique information is performed on each webpage template data, specifically, as shown in fig. 2, the process of distinguishing and classifying each webpage template data is as follows:
step S11: acquiring unique identification information corresponding to each webpage template data, wherein the unique identification information is used for distinguishing each webpage template data;
specifically, based on the diversification of the existing webpage requirement types, if a large number of templates are placed together without corresponding distinguishing information, the data in the whole database is easily confused and unclear, and for this reason, the embodiment sets unique identification information with uniqueness for each webpage template data. For example, the restaurant web page design template may be classified as a type a, the electronic web page design template may be classified as a type B, and the like, and the templates may be further subdivided into a1, a2 … AN, B1, B2 … BN, and the like. An index may be set for each piece of web page template data, and the index may be used as unique identification information. Of course, it is particularly to be noted that the unique identification information is used for distinguishing the webpage template data, and therefore, the embodiment of the present invention is not limited to the above two modes, and may be specifically selected according to actual requirements.
Step S12: and generating a corresponding set based on the unique identification information of all the webpage template data, and generating the first routing table according to the set.
According to step S11, the web page data templates may be classified into different categories, so that the web page template data of the same category may be used as a set of the same type, that is, the unique identification information may be used as an element of the set, and then a corresponding first routing table is generated from the set; it should be particularly noted that, the number of the first routing table is not limited or fixed in the embodiment of the present invention, and as long as the same type of web page template data is divided according to the same category, the first routing table may be used as a part of the first routing table, that is, the first routing table is only used to indicate that the embodiment of the present invention can perform a function of classifying the web page template data, and the number of the first routing table and the number of different types of sets of web page template data in the first routing table are not limited.
By distinguishing the unique identification information of each webpage template data, the orderliness and the queryability of the webpage template data in the first routing table can be improved, namely the acquisition speed and the efficiency of the webpage can be improved, correspondingly, the webpage development efficiency is improved to a certain extent, and faster interactive response can be given to a user.
Step S20: and acquiring a corresponding page to be rendered according to the selection parameters.
Based on the descriptions of the step S10, the step S11, and the step S12, the page to be rendered is the web page template data stored in the first routing table determined by the selection parameter, and generally, the page template data is generally a frame of one type of page, and includes functional modules including few or no pages; the preset display page may also be sent by the server, where the preset display page is not included in the first routing table, and may be stored in a data storage device such as a database of the server.
As shown in fig. 3, in an embodiment, the obtaining of the page to be rendered corresponding to the selection parameter includes the following steps: step S21: judging whether the webpage template data corresponding to the real-time request data exists in the first routing table; step S22: if yes, generating a corresponding page to be rendered based on the selection parameters and the first routing table; step S23: if not, acquiring a preset display page based on the selection parameters, rendering the preset display page by the server side based on the real-time request data, and transmitting the rendered preset display page to a browser side for displaying.
Specifically, because the webpage template data are stored in the first routing table, when the selection parameter is determined based on the real-time request parameter, the webpage related data of the actual demand corresponding to the user request are obtained, and therefore, whether the page to be rendered is obtained from the webpage template data pre-stored in the first routing table or the preset display page is obtained from other parts of the server side can be determined; when the webpage template data corresponding to the selection parameters exist in the first routing table, the webpage to be rendered can be directly obtained from the first routing table; otherwise, the server side sends a preset display page to the browser side, the preset display page is that after the server side analyzes the real-time request data, the webpage template data which is closest to the type of the real-time request data or the closest to the page component and sent by the server side is not stored in the first routing table. In the actual application process, the preset display page may be stored in a database at the server, or obtained by the server through scheduling via an interface, or a preset display page sent by the server for redirection based on the real-time request data.
Step S30: and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying.
In a specific embodiment, the real-time request data includes all request data required by the user when making a page request, for example, parameters such as the type of the page, all constituent elements of the displayed page, and the local time of the location of the requesting user, and based on the relevant parameters in the fact request data, the page to be rendered may be rendered, so as to obtain a target output page required by the user; the target output interface is output and displayed by a browser end operated by a user, for example, the target output interface is displayed to the user through a computer screen, a mobile phone screen and the like, and at the moment, the user can perform corresponding operation on a page to realize page interaction operation.
In a specific embodiment, a page finally displayed to a user comprises a plurality of components, for example, a Taobao display page comprises a picture display area of related products, an area corresponding to model selection and a product condition detailed explanation and comment area; in the rendering process of the page, the parts need to be effectively integrated and processed, so that the parts give the best display effect to the user, that is, the page needs to be rendered, as shown in fig. 4, in an embodiment, the process of implementing the rendering operation on the page to be rendered includes:
step S310: determining all page component data required for generating the target output page based on the first routing table; step S311: and rendering the page to be rendered according to all the page components to generate the target output page.
Actually, in order to reduce the first screen time of the browser during the interaction process, the embodiment of the present invention performs rendering operation on the page to be rendered to obtain the minimum unit required by the user for display, that is, it is required to ensure that, during the interaction process, through the rendering operation at the server side, the initial page displayed at the browser side is an interface including all functions in the user's visual range, for example, a login interface, and all components (a user name, a user password, a login button, and the like) required by the login box must be included.
Therefore, after determining that the page template data corresponding to the real-time request data exists in the first routing table, the page to be rendered and other page composition data required by the display page required by the real-time request data can be obtained from the first routing table, and the page to be rendered is rendered through the page composition data, so that an interactive page for a user to perform interactive operation, namely a target output page, can be generated.
In the webpage output method of the embodiment, when a server side obtains a page to be rendered based on real-time request data to request a page, all page composition data required by the page requested by the corresponding real-time request data are obtained at the same time, the server side only carries out rendering operation of a minimum page composition unit required by interaction with a user, and other required data are sent to a browser side in a synchronous or asynchronous mode; through the rendering operation performed by the server side, the short time of the first screen when the page is displayed to the user can be reduced, only the rendering part of the page to be rendered (namely the smallest operable component page displayed to the user) is treated, and the problems of data transmission errors, loss or interruption and the like when the server side sends overlarge data to the browser side can be avoided.
In an embodiment, if a server side is required to request other port servers to obtain page component data required by page rendering, the following steps are specifically required to be executed: determining to generate first page component data based on the first routing table; rendering the page to be rendered by the server side according to the first page component data to generate an initial output page; sending second page component data to the browser end by the server end based on the real-time request data; and rendering the initial output page by the browser end in real time based on the second page component data to generate the target output page.
The page operation is carried out based on the server, the rendering can be carried out based on the data range of the server, the corresponding data can be scheduled to be rendered based on the interface associated with the server, and the rendering at the server is limited, so that the accuracy and the integrity of the webpage rendering data which are sent to the browser end by the server end can be improved while the time of the first screen of the browser is reduced. And the method is also beneficial to enriching the operability of rendering and provides more flexible operation for development.
As shown in fig. 5, in an embodiment, because the server side only sends the minimum page composition unit available for user interaction to the browser side, in order to enrich all functions of the page, after the server side sends the page rendered at the server side, the following operations need to be performed:
step S320: and acquiring the page to be rendered sent by the server and rendering demand data corresponding to the page to be rendered.
Specifically, the rendering demand data refers to resource request data sent from the server to the browser based on the real-time request data, that is, the browser can request corresponding rendering resources from the server through the rendering demand data to complete rendering operation of the display page; for example, the rendering requirement data may be JS request script data, and based on the JS request script data, the browser end may initiate a static resource (such as JS, CSS, and the like) request to the server end, so that an application required for displaying a page is built at the browser end through the JS script, so as to complete various required functions of the page.
Step S321: and constructing a corresponding application based on the rendering demand data, and rendering the page to be rendered according to the application to generate the target output page.
The application refers to some functional applications included in the display page, that is, corresponding functional operations are added to an original single page, for example, a function of jumping after clicking the page, a function of clicking a chat button for communication, and the like. In practice, however, all the applications need the server side to construct the JS request script returned to the browser side according to the real-time request data, and obtain the static resources required for rendering based on the JS request script, so that after the application corresponding to the page is constructed, the application can be rendered, and therefore, all the applications of the page are guaranteed to have a good display effect, the functions corresponding to the application can be normally realized, and the high quality and the high performance of the finally output target output page are guaranteed.
Specifically, in an embodiment, as shown in fig. 6, a specific process of generating a target output page based on rendering requirement data and a page to be rendered at a browser end includes the following steps:
step S3211: acquiring page component data corresponding to the page to be rendered in a preset second routing table based on the application; step S3212: rendering the page to be rendered by the browser end based on the page component data to generate the target output page.
The second routing table is arranged at the browser end and is obtained by configuration based on actual requirements; the second routing table stores page component data for rendering a display page, and the page component data is used for enriching the page to be rendered visually and functionally when the browser receives the page to be rendered, for example, in a page of an electronic product class, a flicker phenomenon is added for a click operation to enhance the technology of the page, or a description of a certain module not only has a corresponding functional introduction, but also adds an answer link corresponding to theoretical knowledge, and the like.
Therefore, in the process of rendering the page, the page to be rendered is rendered through the page component data, so that the development selectivity can be effectively enhanced, the development functionality and integrity are enriched, and better user experience and function experience are provided for users.
After rendering is completed, in order to ensure that a page to be rendered sent by a server end is matched with a page finally displayed by a browser end, whether the page to be rendered is matched needs to be further checked, and specifically, the page to be rendered sent by the server end and first DOM data corresponding to the page to be rendered need to be acquired firstly; acquiring second DOM data corresponding to the application; and then judging whether the first DOM data is matched with the second DOM data.
Specifically, the first DOM data is sent to the browser end by the server end based on the analysis feedback of the real-time request data, the second DOM data is generated when the application of the page to be rendered is built on the browser end based on the second routing table, namely the second DOM data is determined by how many applications are built in the real-time rendering process of the page to be rendered, so that whether the final display page is completed or not can be judged through the second DOM data under the condition that the final display page is composed of the applications; and the first DOM data is determined by the real-time request data, and the real-time request data has the corresponding constituent elements of the final displayed page, so that whether the final displayed page corresponds to the real-time request data or not can be determined by judging whether the first DOM data is matched with the second DOM data or not, namely whether the browser end finally displays the page corresponding to the real-time request data or not.
Specifically, the comparison of whether the first DOM data is actually matched with the second DOM data may be performed by comparing the specific number of page nodes included in the target output page; actually, each display page includes a plurality of functions, that is, a plurality of pages, and each function can be calculated as a node, so that each display page can be used as a set corresponding to all the functional page nodes; similarly, the first DOM data sent by the server to the browser has the same meaning. Therefore, whether the finally displayed page meets the actual requirements of the user can be determined according to the comparison of the first DOM data and the second DOM data.
In one embodiment of the present invention, in order to improve the flexibility of development, different comparison algorithms may be selected according to the size of the data volume of the first DOM data or the second DOM data to perform matching calculation; for example, the Diff algorithm may be selected when the data amount of the first DOM data and/or the second DOM data is small, and the fact Diff algorithm may be selected to be implemented when the data amount of the DOM data and/or the second DOM data is large. Of course, the embodiment of the present invention does not limit or fix the selection of the comparison algorithm, and can rotate according to actual requirements.
In the embodiment of the present invention, if the first DOM data is matched with the second DOM data, it indicates that the target output page obtained through rendering finally corresponds to the real-time request data and meets the actual requirements of the user, and at this time, the browser outputs the target output page, and performs event binding operation on the target output page based on the first DOM data or the second DOM data. The event binding refers to the event binding of data (HTML files) corresponding to a target output page generated by final rendering through a browser event mechanism, so that the realization of the function of the page is guaranteed; how to implement event binding is a conventional technique in the prior art, and details are not described herein.
In addition, if the first DOM data is not matched with the second DOM data, it is said that the markup output page does not conform to the actual request page corresponding to the real-time request data, in this case, in order to give a good interactive experience to a user, in the embodiment of the present invention, on one hand, the comparison result is fed back from the browser end to the server end, and the feedback operation can be specifically realized by setting preset information; in addition, in actual operation, in order to reduce user request operation, request times may be set in the real-time request data of the corresponding page, so that, if the first request is a result of obtaining a match between the first DOM data and the second DOM data, the server may be requested again to send the web page corresponding to the real-time request data to the browser, that is, the request times generated by the target output page request are obtained based on the real-time request data, and when the request times are not less than one, the server sends the target output page again to the browser and generates corresponding prompt information.
Further, the target output page can be displayed and output by the browser as the display page; or the server side sends a preset display page as a display page to be displayed to the user, and the user is reminded of making mistakes in the request.
By matching and comparing the corresponding second DOM data in the application construction process of the target output page with the first DOM data fed back by the server side based on the real-time request data, the accuracy of the finally output page can be ensured.
According to the webpage output method, when a server receives real-time request data corresponding to a page display request sent by a user, a selection parameter is determined according to comparison between the real-time request data and a first routing table arranged at the server, the acquisition mode of a page to be rendered can be determined based on the selection parameter, namely whether the page to be rendered corresponding to the real-time request parameter exists in the first routing table or not is determined, and if the page to be rendered exists in the first routing table, the server acquires the page to be rendered from the first routing table, renders the page and sends the page to be rendered to a browser end; if not, the server renders a preset display interface and then sends the rendered preset display interface to the browser end; and finally, outputting and displaying through a browser end for the user to use. According to the webpage output method, the webpage rendering flexibility is improved by flexibly selecting the webpage rendering main body, and because the rendering of the server side on the webpage to be rendered is only limited to the most basic page component required by the user, the problems of long first screen time caused by rendering of the browser side and incorrect webpage display caused by rendering of the server side can be solved, and good operation experience is provided for the user in the rendering process.
Example two
An embodiment of the present invention provides a web page output system 300, and fig. 7 is a schematic structural diagram of the system, and as shown in fig. 7, the web page output system includes: the system comprises a browser end 310 and a server end 320, wherein the browser end 310 and the server end 320 both comprise a page rendering module 350 and a page generating module 360, the browser end further comprises a page output module 370, and the server end further comprises a data comparison module 330 and a selection module 340.
In an embodiment, the data comparison module 330 is configured to generate a selection parameter based on a comparison result between real-time request data and a preset first routing table, where the real-time request data is read by a server, and a plurality of web page template data are stored in the first routing table; the selection module 340 is configured to obtain a corresponding page to be rendered according to the selection parameter; the page rendering module 350 is configured to perform a rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page; the page generating module 360 is configured to generate the target output page after the page rendering module performs a rendering operation; the page output module 370 is configured to perform transmission output and display output on the target output page.
EXAMPLE III
Fig. 8 is a schematic structural diagram of a computer device according to a third embodiment of the present invention, as shown in fig. 8, the computer device includes a processor, a memory, a non-volatile storage medium, and a network interface; the number of processors in the computer device may be one or more, and one processor is taken as an example in fig. 8; the processor, memory, non-volatile storage medium, and network interface in the computer device may be connected by a bus or other means, as exemplified by the bus connection in fig. 8.
The memory, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the web page output method in the embodiments of the present invention (e.g., the data comparison module 330, the selection module 340, the page rendering module 350, the page generation module 360, and the page output module 370 in the web page output system). The processor executes various functional applications and data processing of the computer device by executing the software programs, instructions and modules stored in the memory, that is, the above-described web page output method is realized.
Namely:
generating a selection parameter based on a comparison result of real-time request data and a preset first routing table, wherein the real-time request data is read by a server side, and a plurality of webpage template data are stored in the first routing table;
acquiring a corresponding page to be rendered according to the selection parameters;
and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying.
The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some instances, the memory may further include memory located remotely from the processor, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Example four
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for outputting a web page, where the method includes: generating a selection parameter based on a comparison result of real-time request data and a preset first routing table, wherein the real-time request data is read by a server side, and a plurality of webpage template data are stored in the first routing table; acquiring a corresponding page to be rendered according to the selection parameters; and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the above method operations, and may also perform related operations in the web page output method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a computer device, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for outputting a web page, the method comprising:
generating a selection parameter based on a comparison result of real-time request data and a preset first routing table, wherein the real-time request data is read by a server side, and a plurality of webpage template data are stored in the first routing table;
acquiring a corresponding page to be rendered according to the selection parameters;
and executing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page, and outputting a target output interface by a browser end for displaying.
2. The method for outputting web pages according to claim 1, wherein the generating of the selection parameters based on the comparison result of the real-time request data and the preset first routing table comprises:
acquiring unique identification information corresponding to each webpage template data, wherein the unique identification information is used for distinguishing each webpage template data;
and generating a corresponding set based on the unique identification information of all the webpage template data, and generating the first routing table according to the set.
3. The method for outputting the web page according to claim 1 or 2, wherein the obtaining the corresponding page to be rendered according to the selection parameter includes:
judging whether the webpage template data corresponding to the real-time request data exists in the first routing table;
if yes, generating a corresponding page to be rendered based on the selection parameters and the first routing table;
if not, acquiring a preset display page based on the selection parameters, rendering the preset display page by the server side based on the real-time request data, and transmitting the rendered preset display page to a browser side for displaying.
4. The method for outputting the web page according to claim 3, wherein the performing the rendering operation on the page to be rendered based on the real-time request data to generate the corresponding target output page comprises:
determining all page component data required for generating the target output page based on the first routing table;
and rendering the page to be rendered according to all the page components to generate the target output page.
5. The method for outputting the web page according to claim 3, wherein the performing the rendering operation on the page to be rendered based on the real-time request data to generate the corresponding target output page comprises:
acquiring the page to be rendered sent by the server and rendering demand data corresponding to the page to be rendered;
and constructing a corresponding application based on the rendering demand data, and rendering the page to be rendered according to the application to generate the target output page.
6. The method for outputting web pages according to claim 5, wherein the constructing a corresponding application based on the rendering requirement data, and rendering the page to be rendered according to the application to generate the target output page comprises:
acquiring page component data corresponding to the page to be rendered in a preset second routing table based on the application, wherein the second routing table is arranged at a browser end;
rendering the page to be rendered by the browser end based on the page component data to generate the target output page.
7. The method for outputting the web page according to claim 6, wherein rendering the page to be rendered by the browser end based on the page component data to generate the target output page comprises:
acquiring the page to be rendered sent by the server and first DOM data corresponding to the page to be rendered;
acquiring second DOM data corresponding to the application;
judging whether the first DOM data is matched with the second DOM data;
if so, outputting the target output page by the browser end, and performing event binding operation on the target output page based on the first DOM data or the second DOM data;
if not, the browser end feeds back corresponding unmatched preset information to the server end; or
Acquiring the request times generated by the target output page request based on the real-time request data;
under the condition that the request frequency is not less than one time, the server side sends the target output page to the browser side again and generates corresponding prompt information; or
And displaying and outputting the target output page as the display page by the browser.
8. The method for outputting a web page according to claim 7, wherein the determining whether the first DOM data and the second DOM data match comprises:
acquiring the number of page nodes contained in the target output page;
selecting a preset comparison algorithm based on the number of the page nodes;
and judging whether the first DOM data is matched with the second DOM data according to the comparison algorithm.
9. A web page output system, characterized in that the web page output system comprises: the system comprises a browser end and a server end, wherein the browser end and the server end both comprise a page rendering module and a page generating module, the browser end further comprises a page output module, and the server end further comprises a data comparison module and a selection module; wherein the content of the first and second substances,
the data comparison module is used for generating selection parameters based on comparison results of real-time request data and a preset first routing table, the real-time request data are read by a server side, and a plurality of webpage template data are stored in the first routing table;
the selection module is used for acquiring a corresponding page to be rendered according to the selection parameters;
the page rendering module is used for performing rendering operation on the page to be rendered based on the real-time request data to generate a corresponding target output page;
the page generating module is used for generating the target output page after the page rendering module executes rendering operation;
the page output module is used for carrying out transmission output and display output on the target output page.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the web page output method according to any one of claims 1 to 8.
CN202111262688.7A 2021-10-28 2021-10-28 Webpage output method, system and computer readable storage medium Pending CN113971251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111262688.7A CN113971251A (en) 2021-10-28 2021-10-28 Webpage output method, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111262688.7A CN113971251A (en) 2021-10-28 2021-10-28 Webpage output method, system and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113971251A true CN113971251A (en) 2022-01-25

Family

ID=79588779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111262688.7A Pending CN113971251A (en) 2021-10-28 2021-10-28 Webpage output method, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113971251A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179183A1 (en) * 2022-03-23 2023-09-28 支付宝(杭州)信息技术有限公司 Subprogram synchronization processing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023179183A1 (en) * 2022-03-23 2023-09-28 支付宝(杭州)信息技术有限公司 Subprogram synchronization processing

Similar Documents

Publication Publication Date Title
CN108628741B (en) Webpage testing method and device, electronic equipment and medium
CN111782330B (en) Page data acquisition method, device and equipment based on Web application
US9262396B1 (en) Browser compatibility checker tool
CN106997298B (en) Application resource acquisition method and device
CN107508720B (en) Automatic testing method and device
US20160380915A1 (en) Rules-Based Workflow Messaging
CN112068824A (en) Webpage development preview method and device and electronic equipment
US11890540B2 (en) User interface processing method and device
CN112988599B (en) Page debugging method and device, electronic equipment and storage medium
CN111444696A (en) Report display and editing method and device
CN110727429A (en) Front-end page generation method, device and equipment
CN114036439A (en) Website building method, device, medium and electronic equipment
US20180089154A1 (en) Computer implemented system and method for transforming web content for display on multiple form factors
US20100169457A1 (en) Social user script service by service proxy
US11579948B2 (en) Application programming interface for web page and visualization generation
CN113971251A (en) Webpage output method, system and computer readable storage medium
CN105005596B (en) page display method and device
CN113190229A (en) Method and device for generating government affair page
US11836510B2 (en) Snapshot capture of computing device user interfaces
CN110874278A (en) Embedding method of external system, workflow system, device and storage medium
CN116166533A (en) Interface testing method, device, terminal equipment and storage medium
CN113687884B (en) File delivery method, device, system, equipment and storage medium
CN113626392A (en) Method and device for updating document data, electronic equipment and storage medium
US20210136011A1 (en) System and method for dynamic chat message customization
CN114691486A (en) Program debugging method and device and computer equipment

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