CN114036416A - Page display method and device - Google Patents

Page display method and device Download PDF

Info

Publication number
CN114036416A
CN114036416A CN202110512779.5A CN202110512779A CN114036416A CN 114036416 A CN114036416 A CN 114036416A CN 202110512779 A CN202110512779 A CN 202110512779A CN 114036416 A CN114036416 A CN 114036416A
Authority
CN
China
Prior art keywords
page
target
plug
request information
container
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
CN202110512779.5A
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.)
Shanghai Hode Information Technology Co Ltd
Original Assignee
Shanghai Hode 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 Shanghai Hode Information Technology Co Ltd filed Critical Shanghai Hode Information Technology Co Ltd
Priority to CN202110512779.5A priority Critical patent/CN114036416A/en
Publication of CN114036416A publication Critical patent/CN114036416A/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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

The embodiment of the application provides a page display method, which is used for a background server, wherein the background server is provided with a frame for loading a plug-in; the frame and the plug-in are respectively provided with a first container and a second container for caching the page attributes, and a plurality of page attributes in the second container are synchronized from the first container; the method comprises the following steps: receiving page request information of a target page through a frame cache, and providing the page request information to a plug-in a state that the plug-in is started; and according to the plurality of page attributes in the second container and the target page attribute of the target page, generating and returning target page data to the browser for page display when the target page is determined to be writable by the plug-in. In the state that the plug-in is not opened, the page request information can be responded to through the frame. Through the arrangement of the second container, the pressure of the frame for responding to the page request information under high concurrency can be reduced under the state that the plug-in is opened, the response speed is improved, and the peak clipping effect is achieved under the high concurrency condition.

Description

Page display method and device
Technical Field
The embodiment of the application relates to the technical field of webpage, in particular to a webpage display method, a webpage display device, computer equipment and a computer-readable storage medium.
Background
Currently, the functional implementation of a structured social system based on a comment plug-in only depends on direct interaction between a front-end system and a back-end system of a webpage, that is, when the front-end system of the webpage sends a page request (for example, a new comment is added) to the back-end system, in response to the page request, the back-end system queries and returns page response data from a database stored therein to the front-end system. The process of the front-end system and the background system of the webpage responding to the page request to display the new page has the following problems: when a front-end system of a large number of browsers simultaneously sends page requests to a background system, the background system receives the high-concurrency page requests in a short time, so that the background system is prone to untimely writing of page data, data backlog is caused, and the efficiency of page data response is affected.
Disclosure of Invention
In view of this, embodiments of the present application provide a page display method, an apparatus, a computer device, and a computer-readable storage medium, which are used to solve the problems that, in a high concurrency condition of a background system of a web page, the page data written by the background system is not timely, and the efficiency of responding to the page data is low.
An aspect of an embodiment of the present application provides a page display system, including:
the browser is configured with a browser cache serving as a first-level cache and used for caching user information of a target user; the browser is used for generating page request information of a target page, and the page request information comprises the user information;
the proxy server is configured with a second-level cache and used for caching a first amount of page data and responding to the page request information to return target page data in the second-level cache to the browser or forward the page request information; and
the system comprises a background server side, a framework and a data cache, wherein the background server side is provided with a framework for loading plug-ins, and the framework is provided with a framework cache serving as a third-level cache and used for data caching; the plug-in is configured with a plug-in cache serving as a fourth-level cache and used for caching a second amount of page data; the background server is used for receiving the page request information forwarded by the proxy server through the frame cache, providing the page request information to the plug-in cache in a state that the plug-in is started, responding the page request information through the plug-in to generate target page data and returning the generated target page data to the browser for page display.
One aspect of the embodiments of the present application further provides a page display method, including:
generating page request information of a target page through a browser, wherein the page request information comprises user information of a target user; the browser is configured with a browser cache serving as a first-level cache and used for caching the user information of the target user;
responding the page request information through a proxy server to return target page data in the proxy server to the browser or forward the page request information; the proxy server is provided with a second-level cache used for caching a first amount of page data;
receiving the page request information forwarded by the proxy server through a background server; the background server is configured with a frame for loading the plug-in, and the frame is configured with a frame cache serving as a third-level cache and used for data caching; the plug-in is configured with a plug-in cache serving as a fourth-level cache and used for caching a second amount of page data; and storing the page request information forwarded by the proxy server in the frame cache, providing the page request information to the plug-in cache in a state that the plug-in is opened, responding the page request information through the plug-in to generate target page data, and returning the generated target page data to the browser for page display.
One aspect of the embodiments of the present application further provides a page display method, where the method includes:
receiving page request information of a target page provided by a browser through a proxy server, wherein the page request information comprises user information of a target user; the browser is provided with a first-level cache for caching the user information of the target user; the proxy server is configured with a second-level cache for caching a first amount of page data;
based on the page request information, inquiring and returning target page data from the second-level cache through the proxy server;
if the proxy server side does not return the target page data, forwarding the page request information to a background server; the background server is configured with a frame for loading the plug-in, and the frame is configured with a frame cache serving as a third-level cache and used for data caching; the plug-in is configured with a plug-in cache serving as a fourth-level cache and used for caching a second amount of page data, wherein the second amount of page data comprises page data with access frequency larger than a preset threshold value;
receiving the page request information through the frame cache, and providing the page request information to the plug-in a state that the plug-in is opened so as to inquire and return the target page data from the plug-in cache through the plug-in;
if the plug-in does not return the target page data, forwarding the page request information to a cache service end; the cache server is used as a fifth-level cache and used for caching a third amount of page data;
based on the page request information, inquiring and returning the target page data from the fifth-level cache through the cache server;
and if the cache server side does not return the target page data, forwarding the page request information to a database so as to inquire from the database and return the target page data to the browser for page display.
One aspect of the embodiments of the present application further provides a page display method, which is used for a background server, where the background server is configured with a frame for loading a plug-in; the frame is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the method comprises the following steps:
receiving page request information of a target page through the frame cache, and providing the page request information to the plug-in the state that the plug-in is started;
determining whether the target page is writable or not through the plug-in according to the multiple page attributes in the second container and the target page attribute of the target page;
if the target page is writable, generating the target page data, and returning the generated target page data to a browser for page display;
and if the target page is not writable, generating page non-writable information and returning the page non-writable information to the browser.
One aspect of the embodiments of the present application further provides a page display apparatus, including a backend server, where the backend server is configured with a frame for loading a plug-in; the frame is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the device further comprises:
the sending module is used for caching page request information of a target page through the frame and providing the page request information to the plug-in when the plug-in is started;
the judging module is used for determining whether the target page can be written or not through the plug-in according to the plurality of page attributes in the second container and the target page attribute of the target page;
the first generation module is used for generating the target page data if the target page is writable and returning the generated target page data to the browser for page display;
and the second generation module is used for generating page non-writable information and returning the page non-writable information to the browser if the target page is not writable.
An aspect of the embodiments of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the page display method when executing the computer program.
An aspect of the embodiments of the present application further provides a computer-readable storage medium, in which a computer program is stored, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the page display method as described above.
According to the page display method, the page display device, the computer equipment and the computer readable storage medium, page request information of a target page is received through a frame cache, and the page request information is provided for a plug-in unit in a state that the plug-in unit is started; and according to the plurality of page attributes in the second container and the target page attribute of the target page, generating and returning target page data to the browser for page display when the target page is determined to be writable by the plug-in. In the state that the plug-in is not opened, the page request information can be responded to through the frame. Through the arrangement of the second container, the pressure of the frame for responding to page request information under high concurrency can be reduced under the state that the plug-in is opened, the response speed is improved, and the peak clipping effect is achieved under the high concurrency condition.
Drawings
FIG. 1 is a schematic diagram illustrating an overall configuration of a page display system according to an embodiment of the present application;
FIGS. 2(a) -2 (c) are flowcharts illustrating steps of performing a write operation in a page display system according to a first embodiment of the present application;
FIG. 3 is a flowchart illustrating the overall steps of a page display method according to a second embodiment of the present application;
fig. 4 is a flowchart illustrating a step of processing page request information by an agent server in a page display method according to a second embodiment of the present application;
fig. 5 is a flowchart illustrating a step of analyzing page request information and authenticating a user right by a plug-in the page display method according to the second embodiment of the present application;
FIG. 6 is a flowchart illustrating a step of determining whether to start a syntax rendering module according to a second embodiment of the present application;
FIG. 7 is a flowchart illustrating syntax rendering of the user input content in the page display method according to the second embodiment of the present application;
FIG. 8 is a flowchart illustrating a step of determining sensitive information of target page data in the page display method according to the second embodiment of the present application;
FIG. 9 is a flowchart illustrating the overall steps of a page display method according to a third embodiment of the present application;
FIG. 10 is a flowchart illustrating a step of synchronizing target page data in a database according to an access frequency of the target page data in a third page display method according to an embodiment of the present application;
FIG. 11 is a flowchart illustrating steps of performing a playback operation in the page display method according to the third embodiment of the present application;
FIG. 12 is a flowchart illustrating the overall steps of a page displaying method according to a fourth embodiment of the present application;
fig. 13 is a flowchart illustrating a step of parsing page request information and authenticating a user right by a plug-in the page display method according to the fourth embodiment of the present application;
FIG. 14 is a flowchart illustrating a step of determining whether to start a syntax rendering module according to a fourth embodiment of the present application;
fig. 15 is a flowchart illustrating a syntax rendering process of the user input content in the page display method according to the fourth embodiment of the present application;
FIG. 16 is a block diagram of a fifth exemplary embodiment of a page display apparatus;
fig. 17 is a schematic hardware configuration diagram of a computer device according to a sixth embodiment of the present application.
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. 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.
It should be noted that the descriptions relating to "first", "second", etc. in the embodiments of the present application are for descriptive purposes only and 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 at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
In the description of the present application, it should be understood that the numerical references before the steps do not identify the sequence of executing the steps, but merely serve to facilitate the description of the present application and to distinguish each step, and therefore should not be construed as limiting the present application.
The following are some explanations of terms referred to in this application:
displaying back: the data processing operation is to respond to the same user or different users to the second page request information or the subsequent page request information of the same page to acquire and return the target page data to the browser. The second page request information represents a second request of the same user or different users for the same target page; the subsequent page request information represents the nth page request information of the same user or different users for the same target page, wherein N is more than or equal to 3 and is a natural number.
Through research, the applicant considers that the following defects mainly exist in the process of generating a new page by a current structured social system based on comments plug-in: (1) high concurrency, slow synchronization and untimely writing; (2) the echo synchronization is unstable, and the data backlog is easy; (3) when the query volume is large, the cache mechanism is not perfect, so that the symptoms such as interface overtime and the like are easily caused; (4) during writing, the comments plug-in only supports text writing, simply inputs the content input by a user, does not perform rendering processing on the wiki grammar, does not support the special functions of the wiki grammar such as template nesting and the like, and has obviously insufficient ductility; common PHP frames such as frames yii, larveral, thinkphp and the like in the market do not support page rendering nesting, nor do they support wiki syntax; (5) the style of the native plug-in is more ancient, the interest is not strong, the stickiness of the user is not strong, and the plug-ins are not classified according to the category registered by the page in the technical design; (6) interactive multi-scenes such as sensitive word review filtering, content review and the like are not considered.
In view of the above problems, the present application provides a layer-by-layer hierarchical manner of five-layer caches, and processes highly-concurrent page request information through a stepwise progressive combination of the five-layer caches. The five-layer cache is a browser cache, a frame cache, a Varnish cache, a Redis cache and an independent plug-in cache in the plug-in of the application.
The plug-in also extracts new elements that are out of and merged into the grammar rendering module (e.g., wiki grammar rendering module). Namely, grammar rendering (such as wiki grammar rendering) is newly added on user input content, the page review area is supported to circularly reference and nest the content of other pages, the bottom layer architecture design is pulled through, the unique ecology of a set of page display system is formed, and the configuration item is used as a binding port to form the internal closed loop of the plug-in. The template can be nested by a user through the configuration of the wiki grammar rendering module, and the user experience is improved. The method and the system also provide a set of complete background auditing system for the ecology of the page display system, and the background auditing system is also embedded into the plug-in.
In the present application, dynamic configuration is also provided in the form of configuration parameters, and the switches of the wiki grammar rendering module can be integrated in the form of a beam port. The user can freely configure the switch using or not using the syntax rendering module in the plug-in configuration. A developer can consider whether to configure the wiki grammar rendering module in the background service end.
In this application, take out from function switch, unified management entry, the configuration of pull-through bottom, through in the plug-in components closed loop access frame, cater to the operation mechanism of frame, the design loading of plug-in components and frame fuses as an organic whole, accomplishes to last stably, highly available, easy management.
In order to improve the system of the plug-in, the method and the system further expand additional services to increase user experience, wherein the additional services comprise a series of functions of praise, report, reply, deletion and the like added in the comments of the community.
The method and the device also carry out strict authority control on the user, control and classify the pages with different attributes, refine and unify the pages, monitor the sensitive words in the user input content, and add an auditing platform of a special page to carry out unified management.
In summary, the key points of the page display system described in the present application include, but are not limited to:
(1) a technical scheme for processing high flow and large concurrency by a five-layer cache mechanism based on a framework;
(2) the method comprises the steps that a community comment plug-in based on a frame is rendered by using a wiki grammar to achieve content nesting;
(3) classifying the page by capturing the type of the registered page of the frame to control whether the page loads the plug-in content or not, and providing different response contents in a classified manner by controlling the identity authority of the user; a background auditing system is customized for an administrator, and data auditing processing is facilitated.
In view of the above, the present application will provide one or more embodiments, which will explain the technical solutions of the present application in detail.
Example one
As shown in fig. 1, an overall architecture of the page display system described in the present application is schematically illustrated.
The page display system includes: browser 100, proxy server 102, background server 104 and cache server 106, wherein:
the browser 100: a browser cache 108 serving as a first-level cache is configured to cache user information of a target user; the browser 100 is configured to generate page request information of a target page, where the page request information includes the user information.
The user information cached in the browser cache 108 includes: user rights, cookies (access certificates) of the user, personal information (such as account information), information of a user identity rights group and the like; static resources are cached in the browser cache 108, wherein the static resources are page data which is not changed frequently; the page request information may be a request for requesting a page after new comments are added by a user, a request for requesting a page after modification when a user modifies a page, and the like. It should be noted that, if the static resource cached in the browser cache fails, when the browser cache sends the page request information, the page request information includes a request for the static resource in the target page data. In the application, the latest version number corresponding to the static resource and the latest static resource corresponding to the latest version number are returned to the browser through the static resource server by the request of the static resource in the target page data, and the latest static resource and the latest version number are cached in the browser cache.
The proxy server 102: the second-level cache 110 is configured to cache a first amount of page data, and to respond to the page request information to return the target page data in the second-level cache 110 to the browser 100 or forward the page request information. Second level cache 110 may be a Varnish cache. The Varnish cache is the cache of an http (hypertext transfer protocol) reverse proxy. The proxy server 102 receives the page request information from the browser 100, then attempts to acquire the target page data from the Varnish cache to respond to the page request information of the browser 100, and if the target page data cannot be acquired from the Varnish cache, forwards the page request information to a background server (backskend Servers)104, acquires the target page data, returns the target page data to the browser 100, and caches the target page data in the Varnish cache. And if the target page data is cached in the Varnish cache, directly acquiring the target page data from the Varnish cache based on the page request information. The page request information is responded by the Varnish, which is faster than the target page data obtained from the back-end server 104. That is, the page data is cached through the Varnish cache, so that the effects of high availability and peak clipping can be achieved.
The background server 104: a framework configured with a loading plug-in, the framework configured with a framework cache 112 as a third level cache for data caching; the plug-in is configured with a plug-in cache 114 as a fourth level cache for caching a second amount of page data; the background server 104 is configured to receive the page request information forwarded by the proxy server 102 through the frame cache 112, provide the page request information to the plug-in cache 114 in a state that the plug-in is turned on, respond to the page request information through the plug-in, generate target page data, and return the generated target page data to the browser 100 for page display.
The framework can be a framework (or other framework) supporting multi-person collaborative creation and connection of a group of web pages, and the plug-in loaded on the framework supporting multi-person collaborative creation and connection of a group of web pages can implement various functions, such as: comment, page modification, report, like, button listing, clear, mark, etc.
The cache server 106: a fifth-level cache 116 for caching a third amount of page data; the cache server 106 is configured to, after caching the target page data, return the target page data in the fifth-level cache 116 to the browser 100 in response to subsequent page request information of the target page data forwarded via the background server 104. Wherein, the fifth level cache 116 may be a Redis cache.
In order to respond to page request information more efficiently, the framework is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the background server 104 is configured to receive the page request information forwarded by the proxy server 102 through the frame cache 112, provide the page request information to the plug-in cache 114 in a state where the plug-in is turned on, determine whether the target page is writable according to a plurality of page attributes in the second container and a target page attribute of the target page through the plug-in, generate target page data if the target page is writable, and return the generated target page data to the browser 100 for page display.
The page request information sent by the browser 100 is used for providing the Varnish cache for identification; if the proxy server 102 does not respond to the page request information, the target page data is queried and obtained for page display based on the frame cache 112 and the plug-in cache 114. In the frame cache, directly intercepting page request information related to some classified pages with unopened permissions, and not responding to the page request information. Because other plug-ins are also configured in the framework, the framework can respond by running the native logic of the framework in response to user requests corresponding to the other plug-ins. In the state that the plug-in is not opened, the page request information can be responded to through the frame. The plug-in cache is configured in the frame, so that when the frame loads the plug-in and the plug-in is in an open state, the page request information is forwarded to the plug-in cache, and logic in the plug-in cache can be operated to respond to the page request information; that is, the page attribute is traversed in the second container, and if the second container includes the target page attribute, that is, the plug-in cache includes the target page attribute, the target page data may be directly generated by the plug-in cache, and the target page data is returned to the browser 100 without querying from the frame cache to obtain the target page data. And if the target page attribute cannot be inquired when the page attribute is traversed in the plug-in cache, forwarding the page request information back to the frame, traversing the page attribute in the first container, and responding the page request information through the frame cache. Compared with a mode of directly inquiring and acquiring target page data in the frame cache, the pressure of the frame for responding to the page request information under high concurrency can be reduced under the state that the plug-in is started through the arrangement of the second container, the response efficiency of responding to the page request data through the plug-in cache is higher, the response speed is improved, and the peak clipping effect is achieved under the condition of high concurrency; and the shunting effect can be better achieved under high concurrency. Judging whether the target page attribute of the target page is writable or not by the plug-in, if the target page is found to be unwritable, for example, the target page is unwritable due to forged page request information, or the target page is unwritable due to the fact that some special target pages of the request do not support writing, and the comment function is not allowed to be started, intercepting the page request information directly in the plug-in cache, namely, directly performing related operation on the page request information in the plug-in cache, and intercepting some page request information of fake, false or special pages in the plug-in cache, so that the waste of computer resources of the page display system is avoided.
According to the embodiment of the application, when the browser 100 sends the page request information, the page request information is processed in a progressive mode through the layer-by-layer caches of the browser cache 108, the second-level cache 110, the frame cache 112 and the plug-in cache 114, and when the page request information is responded, the effect that target page data is generated and returned to the browser 100 for page display is achieved. The page data is cached through the multiple layers of caches, so that the data writing of the page display system is timely, the page data response and display efficiency is improved, the peak clipping is achieved under the high-concurrency condition, and the user experience effect is improved.
In order to better achieve the effect of offloading the processing of the page request information through the second-level cache 110 in a state where the page request information is highly concurrent, the proxy server 102 is further configured to: judging whether the target user has the authority to acquire the target page data from the second-level cache 110 according to the user authority; if the target user has the right to acquire the target page data from the second-level cache 110, inquiring and acquiring the target page data from the second-level cache 110, and returning the target page data to the browser 100; and if the target user does not have the right to acquire the target page data from the second-level cache 110 or the second-level cache 110 does not provide the target page data, forwarding the page request information to the background server 104. The second level cache 110 (e.g., a Varnish cache) caches the page data according to the information of the page and the user authority, and subsequently, when accessing the same target page, if the Varnish cache has the target page, the target page data can be directly obtained in the Varnish cache and returned to the browser 100, so that the peak clipping effect is very obvious. In the Varnish cache, different page data are provided for different users through controlling the identity authority of the users.
In order to allocate computer resources of the page display system reasonably, the page display system further comprises: and a load balancing server, wherein the load balancing server comprises a reverse proxy service cluster (e.g., nginx cluster), and the reverse proxy service cluster comprises a plurality of reverse proxy servers (e.g., the nginx cluster comprises a plurality of nginx servers, wherein nginx is a high-performance http and reverse proxy server). For example, when receiving multiple pieces of page request information, the load balancing server issues the multiple pieces of page request information to the nginx cluster through a load balancing policy, so that the multiple pieces of page request information are distributed to the Varnish cache through the multiple nginx servers.
The page display system of the present application also controls the sorting of different pages, considering that the user may not wish to load the plug-in on a home page, a user-defined type of page, or other special page. In order to facilitate the classification and management of pages in the page display system, the background server 104 is further configured to: registering the page attributes into the first container and the second container in advance, and performing page classification operation according to the page attributes; the first container and the second container are further used for respectively updating the attributes of the pages in the first container and the second container when the page attributes of the pages are changed. When the framework is initialized, resources such as resource files (e.g., static resources), page information, and the like are loaded. And when the plug-in is loaded on the page, registering the information of the page into a second container through a hook function, caching the page attribute in the second container, and carrying out classification management on the page. Thus, in particular, specific functions can be turned on for specific types of pages, and control over the system is more refined. In the process of loading the plug-in by the framework, the plug-in can be registered in the first container according to different page attributes of the page, and the different page attributes are cached in the first container. The different pages are distinguished according to page attributes, such as template class pages, special class pages, structured discussion class pages, normal business class pages and the like, for example, the pages with more references register the pages with more references in a first container and a second container in a configuration form. The page classification is carried out by capturing the page attribute loaded by the registered plug-in the frame, which is equivalent to adding a layer of white list control to the page data, and the plug-in can be loaded only by the page data in the white list.
If a developer needs to modify the page attribute of a certain page in the background server 104, for example, the template page is modified into a special page, and for the page with the modified page attribute, the page is classified into a page type corresponding to the modified page attribute according to the modified page attribute; and the page attributes of the page cached in the first container and the second container are updated, and the frame cache 112 and the plug-in cache 114 are reset, so that the system can conveniently perform unified management. The page display system also comprises a switch for extracting the modification and classification of the page and injecting the extracted switch into a configuration file, so that the system can conveniently modify and classify the page attribute.
In the page display system and in the plug-in loading state, the authority of the user and the page can be authenticated through the plug-in. When the plug-in receives the page request information, the plug-in may analyze and authenticate the page request information, which specifically includes: authenticating the user authority; authenticating the user state of the target user, wherein the user state comprises a use permission state and a use prohibition state; distinguishing the target page attribute according to the page request information; determining user behavior according to the page request information; determining whether to respond to the page request information according to at least one of the user permission, the user state, the target page attribute and the user behavior: and if the page request information is determined to be responded, judging whether the target page is writable or not.
In this embodiment, the page request information may be parsed and authenticated by the plug-in one or more of the following ways:
(1) user authentication: authentication can be performed according to the user authority carried in the page request information to judge whether the target user has an authority request or modifies the target page.
(2) And (4) sealing and checking: whether the user account of the user is in the use permission state or not can be judged by acquiring the user state of the user account from the personal information of the user in the page request information. When the user state is a seal number or frozen, the authentication of the user state is not passed.
(3) Page registration type distinguishing: the page type of the target page requested by the user can be determined by extracting the target page attribute from the page request information and classifying the target page by the target page attribute.
(4) And (3) distinguishing user behaviors: user behavior may be determined by parsing the page request information. The developer matches corresponding functions for each user in advance according to the user authority, such as: like, report, button listing, clear, mark, etc.
(5) Self-defined pre-check: the rules can be customized to identify the legality of the content input by the user, judge whether the code of the page request information is abnormal, and the like.
In an exemplary embodiment, in order to increase interest of the web page and increase user stickiness, the frame is further configured with a grammar rendering module and a switch of the grammar rendering module. The switch of the grammar rendering module is used for providing the user with control over the on and off of the grammar rendering module, namely, the grammar rendering module is selected to be used or not used by the user. When the switch is turned on, the user input content can be rendered through the grammar rendering module. The background server 104 executes corresponding operations through different selections of the user on the switch, which are specifically as follows: if the target page is writable, generating the target page data according to the user input content in the page request information, wherein the target page data comprises: rendered page data or unrendered page data, wherein: when the grammar rendering module is in an open state, rendering the user input content to obtain rendered page data; and when the grammar rendering module is not in an open state, generating the unrendered page data according to the user input content.
In this embodiment, the switch is extracted for the syntax rendering module, in the development stage, a developer with configuration permission configures user permission allowing the switch for a part of users according to user information, that is, configures the switch for the part of users, the authorized user can decide to turn on or turn off the syntax rendering module by himself, the background server 104 distinguishes whether to turn on the syntax rendering module by receiving different identifiers transmitted by the browser 100, if not, the syntax rendering module is treated as a text for the user input content, and if the syntax rendering module is turned on. The method comprises the steps of extracting a switch of a grammar rendering module, and injecting the switch into a configuration file; the system has the function of judging whether to execute the rendering on the input content of the user according to different selections of the user for opening and closing the grammar rendering module.
In an exemplary embodiment, the frame is embedded with parsing rules of a target grammar, and the user input content can be rendered through the parsing rules of the target grammar; the system supports the introduction and nesting of the grammar template, greatly reduces the labor cost and efficiently realizes the complex page rendering process. Rendering the user input content to obtain the rendered page data may further be obtained by the following operations, specifically including: extracting a target file from the user input content, wherein the target file comprises a target grammar identifier and a target page title; inquiring to obtain a target template page according to the target page attribute and the target page title; extracting target template page content from the target template page; and according to the analysis rule of the target grammar, embedding the page content of the target template into the target file to obtain the rendered page data.
Taking a framework supporting collaborative creation and connection of a group of web pages by multiple persons as an example, the parsing rule of the target grammar is the parsing rule of the wiki grammar. In the state of starting the plug-in, the background server 104 determines that the user selects to start the grammar rendering module, and performs pre-verification such as data injection prevention, sensitive word filtering, token verification and the like on the user input content when receiving the user input content; after the preposed verification is passed, extracting a file containing a wiki grammar identifier from the input content of the user through the regular verification and the verification of the safety strategy of the interceptor; matching a target template page according to target page attributes and target page titles, calling a Hook function (Hook function) according to the page attributes and the parsing rules of the wiki grammar, finding out page contents in the target template page as embedded page resources of the target page, recursively calling nested contents, namely loading new elements acquired from other pages into the input contents of the user to obtain rendered page data, returning the rendered page data to the browser 100 to enable the user to display complete rendered page data when refreshing the page, and inputting the rendered page data into a database; and meanwhile, caching the rendered page data into a Varnish cache. It should be noted that, in the development stage, a developer matches different hook functions for the parsing rules of different target grammars, so that the subsequent system can render the user input content through different wiki grammars in the writing process conveniently.
For example, the user inputs "introduce our community [ [ community profile ] ], and if interest is felt, the game { { newly-built game } } -" can be created together, and in the state that the plug-in is opened, the file containing the wiki grammar identifier, such as [ [ community profile ] ], is extracted through the regular rule. And then through the target page attribute and the 'community brief introduction' text in the target page title (namely the 'community brief introduction' ]), wherein the target page title has a site attribute, a corresponding site is found according to the site attribute, a plurality of page data are stored in the site, a page named as 'community brief introduction' is found from the site through the target page attribute, the page is determined as a target template page, the page content of the target template page is extracted according to the analysis rule of target grammar, and the extracted page content is used for replacing the 'community brief introduction' ].
For example, the case containing the wiki grammar identifier is { { new game } }, the { { new game } } is rendered into a form of text plus hyperlinks through a wiki grammar rendering module, and then the original { { new game } } case is replaced. The writing of the front-end page with extremely high complexity can be completed through the parsing rule of the target grammar of the grammar rendering module, and the user participation sense and the user viscosity are effectively increased.
In an exemplary embodiment, there may also be recursive nesting when the page contents of nested other pages are called: assuming that the page A is a target page, the page B is a target template page, the content of comments newly added in the page A is nested with the page content of the page B in a way of rendering by using the wiki grammar, and the nested content in the page B refers to the template content in the page C; at the moment, the template content in the C page is embedded into the page content of the B page to form combined embedded content in a recursive embedding mode, and the combined embedded content replaces the newly added comment content in the A page. The background server 104 receives the user input content and extracts the corresponding target template page, and stores the content in KV (key value pair) form for querying and acquiring the content embedded in the target page. Taking a pair of KV (Key-Value) as an example, firstly searching in a first container and a second container, and then scanning a database to obtain page data when the database cannot be searched, wherein Key is the user input content, and Value is the wiki grammar in the target template page, and performing traversal and layer-by-layer stripping through the wiki grammar until the target template page is not nested with other page contents, and then replacing the file in the user input content with the text content corresponding to the wiki grammar subjected to layer-by-layer stripping.
To improve data management of write operations by the page display system, the framework is further configured to: judging whether the target page data comprises sensitive information or not; and if the target page data does not comprise the sensitive information, writing the target page data into a database. By monitoring the sensitive words of the input content of the user, only the target page data which does not comprise sensitive information can be seen by the public. In order to further maintain the stable culture of the webpage, an auditing platform of a special page is additionally arranged in the page display system to audit target page data including sensitive information, and only the approved comment content can be seen by the public.
In the embodiment of the application, the plug-in further has a function module for acquiring the head portrait picture information of the user through the configuration item of the plug-in selection switch. The configuration file of the page display system is also flexibly configured with a plug-in selection switch, and the plug-in selection switch is used for providing two plug-ins for a user to select when the function of acquiring the head portrait picture information of the user is realized: (1) supporting multiple persons to cooperatively create and connect a native plug-in a frame of a group of web pages, wherein the native plug-in is used for changing a configuration file image; set up in the top of the user's page, the user can view the present configuration file picture in order to change the picture through a menu option; and (2) the plug-in, which has the function of acquiring the head portrait picture information of the user.
In order to make the present application easier to understand, as shown in fig. 2(a) -2 (c), the following provides a flowchart of the overall steps for performing a write operation in the page display system.
In step S001, the browser (i.e., client)100 sends page request information, and the process proceeds to step S002.
Step S002, sending the page request information to a load balancing server (for example, in the nginx cluster, the nginx cluster includes a plurality of nginx servers) through one-layer load balancing, where LB1 indicates load balancing, and then step S003 is performed.
In step S003, the layer nginx server is mainly used for load balancing, and distributes the page request information to the Varnish cache of the designated proxy server 102 through the layer, and then the process goes to step S004.
Step S004, judging whether the Varnish cache comprises target page data or not, if the Varnish cache comprises the target page data, acquiring the target page data, and returning the target page data to the browser; if the target page data is not included in the Varnish cache, forwarding the page request information, and entering step S005;
step S005, through the load balancing of the service nginx cluster, sends the received page request information to the service layer (i.e. in the frame of the backend server 104), and proceeds to step S006, where LB2 indicates load balancing.
Step S006, judge whether the plug-in unit is opened, if the plug-in unit is in the unopened state, then generate the information that the current page can not be requested and return to the browser 100; if the plug-in is in the open state, go to step 007;
step S007, analyzing and authenticating the page request information through a plug-in, and entering step S008 after the analysis is completed and the authentication is passed; the analyzing and authenticating the page request information through the plug-in comprises the following steps: user authentication, seal check, page registration type distinction, user behavior distinction, self-defined pre-check and the like;
step S008, determining whether the target page is writable or not according to the multiple page attributes in the second container and the target page attribute of the target page through the plug-in; if the target page is not writable, generating page non-writable information and returning the page non-writable information to the browser; if the target page is writable, the method goes to step S009;
step S009, rechecking the authority content, including page attributes, page comment authority and the like; re-authenticating the user according to the user authority, and entering the step S010 after the authentication is passed;
step S010, the entity is converted back into a character string by checking the entity, namely, the received page request information is checked and converted to achieve the effect of data compression, and the step S011 is carried out;
step S011, judging whether to start the wiki grammar rendering; if the wiki rendering is determined to be started, the step S012 is entered; if the wiki rendering is determined not to be started; generating the unrendered page data according to the user input content, and entering step S013;
step S012, rendering the user input content to obtain the rendered page data, and proceeding to step S013;
step S013, judging whether the target page data comprises sensitive information, such as sensitive words; if the target page data does not include sensitive information, returning the target page data to the browser, and proceeding to step S014 to write the target page data into a database; if the target page data comprises sensitive information, auditing the target page data through an auditing platform of a management background, if the auditing is not passed, marking the target page data in a soft deleting mode, namely marking the target page data as not passed by a specific marking bit, returning to the browser to modify the input content of the user by the user, then auditing the regenerated target page data through the auditing platform of the management background until the auditing is passed, updating the specific marking bit of the latest target page data to indicate that the target page data is passed by the auditing, and entering step S014;
step S014, writing the target page data into a database, and entering step S015;
step S015, clearing cache of each level; for example, when page a is changed, after a new page B is generated, the page data of page a in the Varnish cache is cleared.
The page display system has at least the following beneficial effects:
(1) the page display system supports rendering of webpage grammar, such as rendering of wiki grammar, supports introduction and nesting of templates, can realize a complex rendering process of pages, and greatly reduces labor cost;
(2) for highly-concurrent page request information, page data is progressively cached layer by layer through five-level caching, a user can be quickly responded through five-level caching, and user experience is greatly improved;
(3) and different page attributes in the frame are classified, and the authority control of the system is further refined.
Example two
Referring to fig. 3, a flowchart illustrating steps of a page display method according to an embodiment of the present application is shown. It is to be understood that the flow charts in the embodiments of the present method are not used to limit the order in which the steps are performed.
As shown in fig. 3, the page display method may include steps S10 to S14, in which: step S10, generating page request information of a target page through a browser, wherein the page request information comprises user information of a target user; the browser is configured with a browser cache serving as a first-level cache and used for caching the user information of the target user; step S12, responding the page request information through the proxy server to return the target page data in the proxy server to the browser, or forwarding the page request information; the proxy server is provided with a second-level cache used for caching a first amount of page data; step S14, receiving the page request information forwarded by the proxy server through a background server; the background server is configured with a frame for loading the plug-in, and the frame is configured with a frame cache serving as a third-level cache and used for data caching; the plug-in is configured with a plug-in cache serving as a fourth-level cache and used for caching a second amount of page data; and storing the page request information forwarded by the proxy server in the frame cache, providing the page request information to the plug-in cache in a state that the plug-in is opened, responding the page request information through the plug-in to generate target page data, and returning the generated target page data to the browser for page display.
In an exemplary embodiment, the framework is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; step S14 may further include: determining whether the target page is writable or not through the plug-in according to the multiple page attributes in the second container and the target page attribute of the target page; and if the target page is writable, generating the target page data through the frame, and returning the generated target page data to the browser for page display.
In an exemplary embodiment, the method further comprises: and after caching the target page data, responding to subsequent page request information of the target page data forwarded by the background server by using a cache server, and returning the target page data in the fifth-level cache to the browser, wherein the cache server serves as the fifth-level cache and is used for caching a third amount of page data.
In an exemplary embodiment, as shown in fig. 4, the user information includes user rights; the step of responding the page request information by the proxy server to return the target page data in the second-level cache in the proxy server to the browser or forwarding the page request information includes steps S20 to S24, where: step S20, the proxy server judges whether the target user has the authority to obtain the target page data from the second-level cache according to the user authority; step S22, if the target user has the right to obtain the target page data from the second-level cache, inquiring and obtaining the target page data from the second-level cache, and returning the target page data to the browser; and step S24, if the target user has no right to obtain the target page data from the second-level cache or the second-level cache does not provide the target page data, forwarding the page request information to the background server.
In an exemplary embodiment, the method further comprises: registering the multiple page attributes into the first container and the second container in advance through the background server, and performing page classification operation through the multiple page attributes; the first container and the second container are further used for respectively updating the page attributes of the pages in the first container and the second container when the page attributes of the pages are changed.
In an exemplary embodiment, as shown in FIG. 5, the method further includes steps S30-S38, wherein: step S30, the user authority is authenticated through the plug-in; step S32, authenticating the user state of the target user through the plug-in, wherein the user state comprises a use-permitted state and a use-prohibited state; step S34, distinguishing the target page attribute according to the page request information through the plug-in; step S36, determining user behavior according to the page request information through the plug-in; step S38, determining, by the plug-in, whether to respond to the page request information according to at least one of the user permission, the user state, the target page attribute, and the user behavior: and if the page request information is determined to be responded, judging whether the target page is writable or not.
In an exemplary embodiment, the framework is further configured with a grammar rendering module. As shown in fig. 6, if the target page is writable, the step of generating the target page data through the frame includes steps S40 to S44: step S40, if the target page is writable, generating the target page data according to the user input content in the page request information, where the target page data includes: rendered page data or unrendered page data, wherein: step S42, when the grammar rendering module is in the open state, rendering the user input content to obtain the rendered page data; step S44, when the grammar rendering module is not in the on state, generating the unrendered page data according to the user input content.
In an exemplary embodiment, the framework is embedded with parsing rules for the target grammar. As shown in fig. 7, the rendering the user input content to obtain the rendered page data includes steps S50 to S56, where: step S50, extracting a target file from the user input content through the frame, wherein the target file comprises a target grammar identifier and a target page title; step S52, according to the target page attribute and the target page title, inquiring to obtain a target template page; step S54, extracting the content of the target template page from the target template page; step S56, according to the parsing rule of the target grammar, embedding the target template page content in the target pattern, so as to obtain the rendered page data.
In an exemplary embodiment, as shown in FIG. 8, the method further includes steps S60-S62, wherein: step S60, judging whether the target page data includes sensitive information through the frame; and step S62, if the target page data does not include the sensitive information, writing the target page data into a database.
EXAMPLE III
Referring to fig. 9, a flowchart illustrating steps of a page displaying method according to an embodiment of the present application is shown. It is to be understood that the flow charts in the embodiments of the present method are not used to limit the order in which the steps are performed. The embodiment of the application is used for solving the problems that page playback synchronization is unstable and data backlog is easy to occur.
As shown in fig. 9, the present application further provides a page display method, including steps S70 to S76, wherein:
step S70, receiving page request information of a target page provided by a browser through a proxy server, wherein the page request information comprises user information of a target user; the browser is provided with a first-level cache for caching the user information of the target user; the proxy server is configured with a second level cache for caching a first amount of page data.
Step S71, based on the page request information, querying and returning target page data from the second-level cache through the proxy server.
Step S72, if the proxy server side does not return the target page data, the page request information is forwarded to a background server; the background server is provided with a frame for loading the plug-ins, and the frame is provided with a frame cache serving as a third-level cache and used for data caching; the plug-in is configured with a plug-in cache serving as a fourth-level cache and used for caching a second amount of page data, wherein the second amount of page data comprises page data with access frequency larger than a preset threshold value.
Step S73, receiving the page request information through the frame cache, and providing the page request information to the plug-in a state where the plug-in is opened, so as to query and return the target page data from the plug-in cache through the plug-in.
Step S74, if the plug-in does not return the target page data, the page request information is forwarded to a cache server; and the cache server serves as a fifth-level cache and is used for caching a third amount of page data.
Step S75, based on the page request information, querying and returning the target page data from the fifth-level cache through the cache server.
Step S76, if the cache server does not return the target page data, forwarding the page request information to a database to query from the database and return the target page data to the browser for page display.
Wherein, the second-level cache can be a Varnish cache; the fifth level cache may be a Redis cache.
Taking the processing of the second page request information as an example, the above playback operation is exemplarily described as follows:
(1) receiving second page request information of a target page provided by a browser through the proxy server, and judging whether the target page data exists in the second-level cache or not; if the target page data exists in the second-level cache, inquiring and acquiring the target page data from the proxy server, and returning the target page data to the browser; or forwarding the second secondary page request information.
(2) Receiving the second page request information through the cache server, if the target page data exists in the fifth-level cache, inquiring and acquiring the target page data from the fifth-level cache, and returning the target page data to the browser; or forwarding the second-time page request information to a database, directly acquiring target page data from the database, returning the target page data in the database to the browser for page display, and synchronizing the target page data in the database to the second-level cache and the cache server or the plug-in cache and the cache server according to the access frequency of the target page data.
As shown in fig. 10, synchronizing the target page data in the database according to the access frequency of the target page data may further be obtained through the following operations, specifically including steps S77 to S79, where: step S77, obtaining the access frequency of the target page data in the database through the background server; step S78, if the access frequency of the target page data is less than a preset traffic threshold, determining to synchronize the target page data in the database to the second-level cache and the cache server; step S79, if the access frequency of the target page data is greater than a preset traffic threshold, determining to synchronize the target page data in the database to the second-level cache, the plug-in cache, and the cache server. Pages with access frequency larger than a preset flow threshold value are cached in the plug-in cache, and can be understood as popular pages. Because the popular pages are obtained by carrying out mathematical statistics classification on frequently visited pages, the popular pages are often accompanied by a large amount of traffic. And page data such as the page ID of the popular page and the corresponding page content are reserved and injected into the plug-in cache, when the user accesses for the second time, if the page request information penetrates through the Varnish cache, the page request information is intercepted in the plug-in, and the plug-in cache can block one layer of flow under the high concurrency condition, so that the effect of effective peak clipping is achieved.
Taking the processing of the subsequent page request information as an example, the above playback operation is exemplarily described as follows:
(1) receiving subsequent page request information of a target page provided by a browser through the proxy server, and judging whether the target page data exists in the second-level cache or not; if the target page data exists in the second-level cache, acquiring the quantity of the current page request information of the proxy server; if the current request information quantity of the proxy server is smaller than a first preset request threshold value, inquiring and acquiring the target page data from the proxy server, and returning the target page data to the browser; or, forwarding the page request information in any case when the target page data does not exist in the second-level cache and when the current request information quantity of the proxy server is greater than a first preset request threshold. The Varnish cache caches response data generated after responding to the page request information, and the response data is target page data. When users with the same permission group access the accessed page, namely when users with the same permission group send second page request information, the second page request information is intercepted in the Varnish cache, and flow control is performed in the Varnish cache.
(2) If the background server receives subsequent page request information forwarded by the proxy server, judging whether target page data exist in the plug-in cache or not; if the target page data exists in the plug-in cache, acquiring the current request information quantity of the plug-in cache; and if the current request information quantity of the plug-in cache is smaller than a second preset threshold value, inquiring and acquiring the target page data from the plug-in cache, and returning the target page data in the plug-in cache to the browser, or forwarding the subsequent page request information to the cache server under the condition that the current request information quantity of the plug-in cache is larger than the second preset request threshold value.
(3) If the cache server receives subsequent page request information sent by a background server, judging whether target page data exists in the cache server; if the target page data exists in the fifth-level cache, acquiring the current request information quantity of the cache server; if the current request information quantity of the cache server is smaller than a third preset threshold value, inquiring and acquiring the target page data from the cache server, and returning the target page data to the browser; and if the current request information quantity of the cache server is larger than a third preset request threshold value, forwarding the subsequent page request information to the background server so that the background server queries and acquires target page data from the database according to the subsequent page request information and returns the target page data to the browser.
In order to make the present application easier to understand, as shown in fig. 11, the following provides an overall step flowchart of performing a playback operation in the page display method.
(1) Step S020, sending next page request information (namely second page request information or subsequent page request information) through a browser (namely a client), and entering step S021;
(2) step S021, in the state that the plug-in is loaded and started, judging whether the Varnish cache comprises target page data or not, if the Varnish cache comprises the target page data, acquiring the target page data, and returning the target page data to the browser; if the Varnish cache does not include target page data or page request information penetrates through the Varnish cache, forwarding the page request information, and entering step S022;
(3) step S022, in order to improve the security of the playback operation, the functional module of the registered plug-in API in the framework needs to be authenticated, and whether the user has the right to use the functional module in the registered plug-in is judged; if the authentication is not passed, generating authentication non-passing information and returning the authentication non-passing information to the browser; if the authentication is passed, the step S023 is carried out;
(4) step S023, in order to improve the safety of the redisplay operation, the attribute of the target page needs to be authenticated through the plug-in; if the authentication is not passed, generating authentication non-passing information and returning the authentication non-passing information to the browser; if the authentication is passed, forwarding the next page request information and entering the step S024;
(5) step S024, judging whether the target page data is a popular page (namely a page with an access frequency greater than a preset threshold) through the plug-in, if the target page data is the popular page, and when the plug-in cache comprises the target page data, acquiring the target page data from the plug-in cache and returning the target page data to the browser; if the target page data is not a welcome page, forwarding next page request information and entering step S025;
(6) step S205, if the target page data exists in the Redis cache, the target page data is obtained from the Redis cache, the target page data is packaged and displayed back to the browser, and the target page data is synchronized to the plug-in cache and the Varnish cache; and if the target page data does not exist in the Redis cache, screening, filtering and inquiring the target page data from the database and returning the target page data to the browser, simultaneously inputting the target page data into the Redis cache, and synchronizing the target page data into the Varnish cache, the plug-in cache and the Redis cache.
Example four
Referring to fig. 12, a flowchart illustrating steps of a page displaying method according to an embodiment of the present application is shown. The page display method takes the background server 104 as an execution subject. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed.
The embodiment of the application also provides a page display method, which is used for a background server, wherein the background server is provided with a frame for loading the plug-in; the frame is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the method includes steps S80-S86, wherein:
step S80, receiving page request information of a target page through the frame cache, and providing the page request information to the plug-in when the plug-in is opened;
step S82, according to the multiple page attributes in the second container and the target page attribute of the target page, determining whether the target page is writable through the plug-in;
step S84, if the target page is writable, generating the target page data through the frame, and returning the generated target page data to the browser for page display;
step S86, if the target page is not writable, generating page non-writable information through the frame and returning the page non-writable information to the browser.
In an exemplary embodiment, the plug-in is configured with a plug-in cache, and the plug-in cache is used for caching page data with access frequency greater than a preset threshold; the method further comprises the following steps: and if the plug-in cache comprises the target page data, inquiring and returning the target page data from the plug-in cache.
In an exemplary embodiment, the method further comprises: registering the multiple page attributes into the first container and the second container in advance through the background server, and performing page classification operation through the multiple page attributes; the first container and the second container are further used for respectively updating the page attributes of the pages in the first container and the second container when the page attributes of the pages are changed.
In an exemplary embodiment, as shown in FIG. 13, the method further includes steps S90-S98, wherein: step S90, the user authority in the page request information is authenticated through the plug-in; step S92, authenticating the user state of the target user through the plug-in, wherein the user state comprises a use-permitted state and a use-prohibited state; step S94, distinguishing the target page attribute according to the page request information through the plug-in; step S96, determining user behavior according to the page request information through the plug-in; step S98, determining, by the plug-in, whether to respond to the page request information according to at least one of the user permission, the user state, the target page attribute, and the user behavior: and if the page request information is determined to be responded, judging whether the target page is writable or not.
In an exemplary embodiment, the framework is further configured with a grammar rendering module. As shown in fig. 14, if the target page is writable, the generating the target page data through the frame includes steps S100 to S104: step S100, if the target page is writable, generating the target page data according to the user input content in the page request information, wherein the target page data comprises: rendered page data or unrendered page data, wherein: step S102, when the grammar rendering module is in an open state, rendering the user input content to obtain rendered page data; and step S104, when the grammar rendering module is not in an open state, generating the unrendered page data according to the user input content.
In an exemplary embodiment, the framework is embedded with parsing rules for the target grammar. As shown in fig. 15, the rendering the user input content to obtain the rendered page data includes steps S200 to S206, where: step S200, extracting a target file from the user input content through the frame, wherein the target file comprises a target grammar identifier and a target page title; step S202, a target template page is obtained through inquiry according to the target page attribute and the target page title; step S204, extracting the content of the target template page from the target template page; step S206, according to the parsing rule of the target grammar, the target template page content is embedded in the target file, so as to obtain the rendered page data.
In an exemplary embodiment, the method further comprises: judging whether the target page data comprises sensitive information or not through the frame; and if the target page data does not comprise the sensitive information, writing the target page data into a database.
EXAMPLE five
Continuing to refer to FIG. 16, a program module diagram of page display device 20 is shown. In the present embodiment, the page display apparatus 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present application and implement the page display method. Program modules, as referred to herein, are defined as a series of computer program instructions capable of performing particular functions. The following description will specifically describe the functions of the program modules of the present embodiment:
the page display device 20 comprises a background server, and the background server is configured with a frame for loading plug-ins; the framework is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the device further comprises:
a sending module 300, configured to cache page request information of a target page through the framework, and provide the page request information to the plug-in when the plug-in is started;
a determining module 302, configured to determine, according to the multiple page attributes in the second container and the target page attribute of the target page, whether the target page is writable through the plug-in;
a first generating module 304, configured to generate the target page data through the frame if the target page is writable, and return the generated target page data to a browser for page display;
a second generating module 306, configured to generate page non-writable information through the frame and return the page non-writable information to the browser if the target page is not writable.
In an exemplary embodiment, the plug-in is configured with a plug-in cache, and the plug-in cache is used for caching page data with access frequency greater than a preset threshold; the page display device 20 further includes: a plug-in cache response module 308, wherein the plug-in cache response module 308 is configured to: and if the plug-in cache comprises the target page data, inquiring and returning the target page data from the plug-in cache.
In an exemplary embodiment, the background server in the page display device 20 registers the plurality of page attributes in the first container and the second container in advance, and performs a page classification operation according to the plurality of page attributes; the first container and the second container are further used for updating the attributes of the pages in the first container and the second container respectively when the page attributes of the pages are changed.
In an exemplary embodiment, the plug-in the page display apparatus 20 is further configured to: authenticating the user authority in the page request information; authenticating the user state of the target user, wherein the user state comprises a use permission state and a use prohibition state; distinguishing the target page attribute according to the page request information; determining user behavior according to the page request information; determining whether to respond to the page request information according to at least one of the user permission, the user state, the target page attribute and the user behavior: and if the page request information is determined to be responded, judging whether the target page is writable or not.
In an exemplary embodiment, the framework is further configured with a grammar rendering module. The first generation module 304 is further configured to: if the target page is writable, generating the target page data according to the user input content in the page request information, and rendering the user input content when the grammar rendering module is in an open state to obtain the rendered page data; and when the grammar rendering module is not in an open state, generating the unrendered page data according to the user input content.
In an exemplary embodiment, the framework is embedded with parsing rules for the target grammar. The first generation module 304 is further configured to: extracting a target file from the user input content through the frame, wherein the target file comprises a target grammar identifier and a target page title; inquiring to obtain a target template page according to the target page attribute and the target page title; extracting the content of the target template page from the target template page; and according to the analysis rule of the target grammar, embedding the page content of the target template into the target file to obtain the rendered page data.
In an exemplary embodiment, the page display apparatus 20 further includes a sensitive information detection module (not identified) for: judging whether the target page data comprises sensitive information or not through the frame; and if the target page data does not comprise the sensitive information, writing the target page data into a database.
EXAMPLE six
Fig. 17 is a schematic diagram of a hardware architecture of a computer device according to a sixth embodiment of the present application. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server or a server cluster composed of a plurality of servers). As shown in fig. 15, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a page display device 20, which are communicatively connected to each other through a system bus. Wherein:
in the present embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system installed in the computer device 2 and various application software, such as the program codes of the page display apparatus 20 of the above-mentioned embodiment. In addition, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to run the program codes stored in the memory 21 or process data, for example, run the page display apparatus 20, so as to implement the page display method of the above-described embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is typically used for establishing a communication connection between the computer device 2 and other electronic apparatuses. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 16 only shows the computer device 2 with components 20-23, but it is to be understood that not all of the shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the page display apparatus 20 stored in the memory 21 may be further divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present application.
For example, fig. 16 is a schematic diagram of program modules of a fifth embodiment of the page display apparatus 20, in which the page display apparatus 20 can be divided into a sending module 300, a determining module 302, a first generating module 304, and a second generating module 306. The program module referred to in this application refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the page display apparatus 20 in the computer device 2. The specific functions of the program modules 300 and 306 have been described in detail in the fifth embodiment, and are not described herein again.
EXAMPLE seven
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a service terminal, an App, etc., on which a computer program is stored, which when executed by a processor implements a corresponding function. The computer-readable storage medium of the present embodiment is used for storing the page display apparatus 20, and when executed by a processor, implements the page display method of the above-described embodiment.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the above embodiment method can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better embodiment.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. The page display method is characterized by being used for a background server, wherein the background server is provided with a frame for loading plug-ins; the frame is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the method comprises the following steps:
receiving page request information of a target page through the frame cache, and providing the page request information to the plug-in a state that the plug-in is started;
determining whether the target page is writable or not through the plug-in according to the multiple page attributes in the second container and the target page attribute of the target page;
if the target page is writable, generating the target page data, and returning the generated target page data to a browser for page display;
and if the target page is not writable, generating page non-writable information and returning the page non-writable information to the browser.
2. The page display method according to claim 1, wherein the plug-in is configured with a plug-in cache for caching page data having an access frequency greater than a preset threshold; the method further comprises the following steps:
and if the plug-in cache comprises the target page data, inquiring and returning the target page data from the plug-in cache.
3. The page display method according to claim 1, characterized in that the method further comprises:
registering the multiple page attributes into the first container and the second container in advance through the background server, and performing page classification operation through the multiple page attributes;
the first container and the second container are further used for respectively updating the page attributes of the pages in the first container and the second container when the page attributes of the pages are changed.
4. The page display method according to claim 1, characterized in that the method further comprises:
authenticating the user authority in the page request information through the plug-in;
authenticating the user state of the target user through the plug-in, wherein the user state comprises a use-permitted state and a use-prohibited state;
distinguishing the target page attribute according to the page request information through the plug-in;
determining user behavior according to the page request information through the plug-in;
determining, by the plug-in, whether to respond to the page request information according to at least one of the user permission, the user state, the target page attribute, and the user behavior: and if the page request information is determined to be responded, judging whether the target page is writable or not.
5. The page display method according to claim 1, wherein the frame is further configured with a grammar rendering module; if the target page is writable, generating the target page data, including:
if the target page is writable, generating the target page data according to the user input content in the page request information, wherein the target page data comprises: rendered page data or unrendered page data, wherein:
when the grammar rendering module is in an open state, rendering the user input content to obtain rendered page data;
and when the grammar rendering module is not in an open state, generating the unrendered page data according to the user input content.
6. The page display method according to claim 5, wherein the frame is embedded with parsing rules of a target grammar; the rendering the user input content to obtain the rendered page data includes:
extracting a target file from the user input content through the frame, wherein the target file comprises a target grammar identifier and a target page title;
inquiring to obtain a target template page according to the target page attribute and the target page title;
extracting target template page content from the target template page;
and according to the analysis rule of the target grammar, embedding the page content of the target template into the target file to obtain the rendered page data.
7. The page display method according to claim 5, characterized in that the method further comprises:
judging whether the target page data comprises sensitive information or not through the frame; and
and if the target page data does not comprise the sensitive information, writing the target page data into a database.
8. The page display device is characterized by comprising a background server, wherein the background server is provided with a frame for loading plug-ins; the frame is configured with a first container for page attribute caching, the plug-in is configured with a second container for page attribute caching, and a plurality of page attributes in the second container are synchronized from the first container; the device further comprises:
the sending module is used for caching page request information of a target page through the frame and providing the page request information to the plug-in when the plug-in is started;
the judging module is used for determining whether the target page can be written or not through the plug-in according to the page attributes in the second container and the target page attribute of the target page;
the first generation module is used for generating the target page data if the target page is writable and returning the generated target page data to the browser for page display;
and the second generation module is used for generating page non-writable information and returning the page non-writable information to the browser if the target page is not writable.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the page display method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which is executable by at least one processor for causing the at least one processor to carry out the steps of the page display method according to any one of claims 1 to 7.
CN202110512779.5A 2021-05-11 2021-05-11 Page display method and device Pending CN114036416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110512779.5A CN114036416A (en) 2021-05-11 2021-05-11 Page display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110512779.5A CN114036416A (en) 2021-05-11 2021-05-11 Page display method and device

Publications (1)

Publication Number Publication Date
CN114036416A true CN114036416A (en) 2022-02-11

Family

ID=80139732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110512779.5A Pending CN114036416A (en) 2021-05-11 2021-05-11 Page display method and device

Country Status (1)

Country Link
CN (1) CN114036416A (en)

Similar Documents

Publication Publication Date Title
US20230403275A1 (en) System and method of filtering internet traffic via client fingerprint
CN110943961B (en) Data processing method, device and storage medium
US8689276B2 (en) System and method for controlling access to files
WO2020147605A1 (en) Online diagnosis platform, permission management method and permission management system for online diagnosis platform
US11140153B2 (en) Techniques for identification of location of relevant fields in a credential-seeking web page
CN111541546B (en) Multi-platform login method, device, equipment and readable medium
KR20180074774A (en) How to identify malicious websites, devices and computer storage media
US10846338B2 (en) Data processing device, data processing method, and non-transitory computer readable medium
US20230195812A1 (en) Optimizing scraping requests through browsing profiles
CN110636038A (en) Account number analysis method, account number analysis device, security gateway and system
US11797617B2 (en) Method and apparatus for collecting information regarding dark web
CN108021339B (en) Method and device for reading and writing magnetic disk and computer readable storage medium
CN110674427B (en) Method, device, equipment and storage medium for responding to webpage access request
CN113420245B (en) Page display method and system
CN115039082A (en) Log writing method and device, electronic equipment and storage medium
CN114036416A (en) Page display method and device
CN115391188A (en) Scene test case generation method, device, equipment and storage medium
CN108460116B (en) Search method, search device, computer equipment, storage medium and search system
CN112153103B (en) Session management method, device, computer equipment and storage medium
CN113553332A (en) Decentralized data storage access method and device
CN110061864B (en) Method and system for automatically verifying domain name configuration
CN112269837A (en) Data processing method and device
CN112748960A (en) Process control method and device, electronic equipment and storage medium
CN110515905A (en) A kind of method, apparatus and server of the configuration of routing
CN117171108B (en) Virtual model mapping method and system

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