CN113420245B - Page display method and system - Google Patents
Page display method and system Download PDFInfo
- Publication number
- CN113420245B CN113420245B CN202110511232.3A CN202110511232A CN113420245B CN 113420245 B CN113420245 B CN 113420245B CN 202110511232 A CN202110511232 A CN 202110511232A CN 113420245 B CN113420245 B CN 113420245B
- Authority
- CN
- China
- Prior art keywords
- page
- target
- cache
- request information
- plug
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application provides a page display method, which comprises browser cache for caching user information of a target user in a browser, second-level cache for caching first quantity of page data in a proxy server, frame cache for caching data in a background server and plug-in cache for caching second quantity of page data. The page display system data is written in timely through the multi-layer cache buffer page data, the page data response and display efficiency is improved, and the peak clipping effect is achieved under the condition of high concurrency. The embodiment of the application also provides a page display system.
Description
Technical Field
The embodiment of the application relates to the technical field of web pages, in particular to a page display method and system.
Background
Currently, the functional implementation of a structured social system based on comment plug-ins depends only on direct interaction between a front-end system and a back-end system of a web page, i.e. when the front-end system of the web page sends a page request (e.g. newly adds a comment) to the back-end system, the back-end system queries from a database stored therein and returns page response data to the front-end system in response to the page request. The front-end system and the background system of the web page have the following problems in the process of responding to a page request to display a new page: when a large number of front-end systems of the browsers send page requests to the background system at the same time, the background system receives the high-concurrency page requests in a short time, so that the background system is not timely when writing page data, data backlog is caused, and the response efficiency of the page data is affected.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, a system, a computer device, and a computer readable storage medium for displaying a page, which are used to solve the problem that a background system of a web page is not in time to write page data and has low efficiency in responding to page data when the background system is in high concurrency.
One 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 is 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 for caching the first quantity of page data and responding to the page request information to return the target page data in the second-level cache to the browser or forward the page request information; and
The background server is provided with a framework loaded with plug-ins, and the framework is provided with a framework cache serving as a third-level cache and used for data cache; 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 framework cache, providing the page request information to the plug-in cache in a state that the plug-in is opened, responding to 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.
An aspect of the embodiment 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 is used for caching user information of the target user;
responding to 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 configured with a second-level cache for caching the first quantity of page data;
receiving the page request information forwarded by the proxy server through a background server; the background server is configured with a framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; 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; 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 the state that the plug-in is opened, responding to 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.
An aspect of the embodiment 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 configured with a first-level cache for caching user information of the target user; the proxy server is configured with a second-level cache for caching the first quantity of page data;
inquiring and returning target page data from the second-level cache through the proxy server based on the page request information;
if the proxy server does not return the target page data, forwarding the page request information to a background server; the background server is configured with a framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; the plug-in is configured with a plug-in cache serving as a fourth-level cache and is used for caching a second amount of page data, wherein the second amount of page data comprises page data with the access frequency being greater than a preset threshold value;
receiving the page request information through the framework cache, and providing the page request information for the plug-in the 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 server; the cache server is used as a fifth level cache for caching the third quantity of page data;
inquiring and returning the target page data from the fifth-level cache through the cache server based on the page request information;
and if the cache server side does not return the target page data, forwarding the page request information to a database to inquire from the database and return the target page data to the browser for page display.
One aspect of the embodiment of the application also provides a page display method, which is used for a background server, wherein the background server is configured with a framework 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 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 opened;
Determining whether the target page is writable or not through the plug-in according to a plurality of page attributes in the second container and the target page attribute of the target page;
if the target page is writable, generating target page data, and returning the generated target page data to a browser for page display;
and if the target page is unwritable, generating page unwritable information and returning the page unwritable information to the browser.
One aspect of the embodiment of the application also provides a page display device, which comprises a background server, wherein the background server is provided with a framework 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 apparatus further comprises:
the sending module is used for caching page request information of a target page through the framework and providing the page request information for the plug-in when the plug-in is started;
the judging module is used for determining whether the target page is writable 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 non-writable.
An aspect of an embodiment of the present application further provides a computer apparatus, where the computer apparatus includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and where the processor implements the steps of the page display method as described above when the processor executes the computer program.
An aspect of an embodiment of the present application further provides a computer-readable storage medium having stored therein a computer program 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 system, the computer equipment and the computer readable storage medium, after page request information is generated by the browser, the page request information is processed in a progressive manner through the browser cache, the second-level cache, the frame cache and the layer-by-layer cache of the plug-in cache, and when the page request information is responded, the effect that target page data are generated and returned to the browser for page display is achieved. The page display system data is written in timely through the multi-layer cache buffer page data, the page data response and display efficiency is improved, and the peak clipping effect is achieved under the condition of high concurrency.
Drawings
FIG. 1 is a schematic diagram of an overall architecture of a page display system according to a first embodiment of the present application;
FIGS. 2 (a) -2 (c) are flowcharts illustrating steps for performing a write operation in a page display system according to a first embodiment of the present application;
FIG. 3 is a flowchart showing the overall steps of a page display method according to a second embodiment of the present application;
FIG. 4 is a flowchart illustrating steps performed by a proxy server in processing page request information in a page display method according to a second embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of analyzing page request information and authenticating user rights by a plug-in a page display method according to a second embodiment of the present application;
FIG. 6 is a flowchart illustrating a page display method according to a second embodiment of the present application for determining whether to turn on a syntax rendering module;
FIG. 7 is a flowchart illustrating a method for displaying a page according to a second embodiment of the present application;
FIG. 8 is a flowchart illustrating a step of performing sensitive information determination on target page data in a page display method according to a second embodiment of the present application;
FIG. 9 is a flowchart showing the overall steps of a page display method according to a third embodiment of the present application;
FIG. 10 is a flowchart showing steps for synchronizing target page data in a database according to the access frequency of the target page data in a page display method according to a third embodiment of the present application;
FIG. 11 is a flowchart illustrating steps for performing a redisplay operation in a page display method according to a third embodiment of the present application;
FIG. 12 is a flowchart showing the overall steps of a page display method according to a fourth embodiment of the present application;
FIG. 13 is a flowchart illustrating steps of analyzing page request information and authenticating user rights by a plug-in a page display method according to a fourth embodiment of the present application;
FIG. 14 is a flowchart showing steps of a page display method according to a fourth embodiment of the present application for determining whether to turn on a syntax rendering module;
FIG. 15 is a flowchart illustrating a method for displaying a page according to a fourth embodiment of the present application;
FIG. 16 is a schematic diagram illustrating a program module of a page display device according to a fifth embodiment of the present application;
fig. 17 is a schematic hardware structure of a computer device according to a sixth embodiment of the application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the descriptions of "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 a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in 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 order in which the steps are performed, but are merely used to facilitate description of the present application and to distinguish between each step, and thus should not be construed as limiting the present application.
The following are some term interpretations of the application:
and (5) back display: the data processing operation is that the second page request information or the subsequent page request information of the same page is responded to by the same user or different users so as 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, N is more than or equal to 3, and N is a natural number.
Through research, the inventor considers that the following defects mainly exist in the process of generating a new page based on a structured social system of comments (comments) plug-in at present: (1) High concurrency, slow synchronization and untimely writing; (2) the back display synchronization is unstable, and data backlog is easy; (3) When the query volume is large, the cache mechanism is not sound, and symptoms such as interface overtime and the like are easily caused; (4) When writing, the comments plug-in only supports text writing, simply inputs the content input by a user, does not perform rendering processing of 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; and PHP frames such as the frame yii, larveral, thinkphp which are common in the market do not support page rendering nesting and do not support wiki grammar; (5) The original plug-in style is ancient, the interestingness and the user viscosity are not strong, and the plug-ins are not classified according to the category registered by the page in the technical design; (6) The interaction multi-scene such as sensitive word auditing and filtering, content auditing and the like are not considered.
In view of the above problems, the present application provides a hierarchical manner of five-layer caches, and the page request information under high concurrency is processed by progressive combination of five-layer caches in stages. The five layers of caches are respectively a browser cache, a frame cache, a Varnish cache, a Redis cache and a set of independent plug-in caches in the plug-in.
The plug-in also pulls new elements out of the grammar rendering module (e.g., wiki grammar rendering module) and merging into the grammar rendering module. That is, grammar rendering (for example, wiki grammar rendering) is newly added on the user input content, the page comment area is supported to circularly reference the content of other nested pages, the design of the underlying architecture is pulled through, a set of ecology unique to the page display system is formed, and the configuration items are used as the bundle ports to form the internal closed loop of the plug-in. The template can be nested by the user through the configuration of the wiki grammar rendering module, so that the user experience is improved. The application also provides a set of complete background auditing system for ecology of the page display system, and the background auditing system is also embedded into the plug-in.
In the application, dynamic configuration is also provided in a mode of configuration parameters, and the switch of the wiki grammar rendering module can be integrated into one in a beam port mode. The user may freely configure the switch with or without the use of the syntax rendering module in the plug-in configuration. The developer may consider whether to configure the wiki grammar rendering module in the background server.
In the application, the function switch is pulled out, the entrance is managed uniformly, the bottom layer configuration is pulled through, the plug-in is closed-loop and connected into the frame, the plug-in caters to the operation mechanism of the frame, and the design and loading of the plug-in and the frame are integrated, so that the device is stable and continuous, high in availability and easy to manage.
In order to perfect the system of the plug-in, the application further expands additional services to increase user experience, wherein the additional services comprise a series of functions such as praise, report, reply, delete and the like added in comments of communities.
The application also carries out strict authority control on the user, carries out control classification on pages with different attributes, realizes refinement and unification, monitors sensitive words in the input content of the user, and adds an audit platform of special pages to carry out unified management.
In summary, key points of the page display system in the present application include, but are not limited to:
(1) The technical scheme of processing high-flow large concurrency based on a five-layer cache mechanism of a frame;
(2) Based on the community comment plug-in of the framework, rendering is carried out by using wiki grammar to realize content nesting;
(3) The method comprises the steps of classifying the pages by capturing the types of the frame registration pages to control whether the pages load plug-in contents, and classifying and providing different response contents by controlling the user identity authority; a background auditing system is customized for an administrator, so that auditing processing of data is facilitated.
In view of this, the present application will provide one or more embodiments to explain the technical solution of the present application in detail.
Example 1
As shown in fig. 1, the overall architecture of the page display system according to the present application is schematically shown.
The page display system includes: browser 100, proxy server 102, background server 104, and cache server 106, wherein:
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, user cookies (access credentials), personal information (e.g., account information), and user identity rights group information, etc.; the browser cache 108 also has a static resource, wherein the static resource is page data which is not changed frequently; the page request information may be a request for requesting a page after the comment is newly added by the user, a request for requesting a page after the modification by the user when the page is modified, and the like. It should be noted that if the static resources cached in the browser cache are invalid, when the browser cache sends page request information, the page request information includes a request of the static resources in the target page data. In the application, through the request of the static resource in the target page data, 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, and the latest static resource and the latest version number are cached in the browser cache.
Proxy server 102: a second level cache 110 is configured for caching a first amount of page data and for responding to the page request information to return target page data in the second level cache 110 to the browser 100 or to forward the page request information. The second level cache 110 may be a varish cache. The Varnish cache is a cache of http (hypertext transfer protocol) reverse proxies. The proxy server 102 receives the page request information from the browser 100, then tries to obtain the target page data from the Varnish cache in response to the page request information of the browser 100, if the target page data cannot be obtained from the Varnish cache, forwards the page request information to a background server (background Servers) 104, obtains the target page data and returns the target page data to the browser 100, and simultaneously 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. Responding to the page request information via Varnish is faster than retrieving the target page data from the backend server 104. That is, the page data is cached by the Varnish cache, so that the effects of high availability and peak clipping can be achieved.
Background server 104: a framework configured with a load plug-in, the framework configured with a framework cache 112 as a third level cache for data caching; the plugin is configured with a plugin cache 114 as a fourth level cache for caching a second amount of page data; the background server 104 is configured to receive, through the frame cache 112, the page request information forwarded by the proxy server 102, and provide the page request information to the plug-in cache 114 in a state where the plug-in is turned on, respond to the page request information through the plug-in, so as to generate target page data, and return the generated target page data to the browser 100 for page display.
The framework may be a framework (or other framework) supporting collaborative creation and connection of a set of web pages by multiple persons, and the plug-in loading onto the framework supporting collaborative creation and connection of a set of web pages by multiple persons may perform various functions, such as: comment, page modification, report, praise, button listing, clear, mark, etc.
Cache server 106: as a fifth level cache 116 for caching a third amount of page data; the cache server 106 is configured to return the target page data in the fifth level cache 116 to the browser 100 after caching the target page data, in response to subsequent page request information of the target page data forwarded via the background server 104. The fifth level cache 116 may be a dis 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, through the frame cache 112, the page request information forwarded by the proxy server 102, and provide the page request information to the plug-in cache 114 in a state where the plug-in is opened, determine, through the plug-in, 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, and if the target page is writable, generate the target page data, 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 being provided for the Varnish cache for identification; if the proxy server 102 does not respond to the page request information, the frame buffer 112 and the plug-in buffer 114 are based to query and obtain the target page data for page display. In the frame cache, directly intercepting page request information related to classified pages with unopened authorities, and not responding to the page request information. Since other plug-ins are also configured in the framework, in responding to user requests corresponding to the other plug-ins, the response may be through the native logic of the running framework. In the state that the plug-in is not opened, page request information can be responded through the framework. The plug-in cache is configured in the framework, so that when the framework loads the plug-in and the plug-in is in an open state, 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, 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 through 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. If the target page attribute is not queried 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 to the page request information through the frame cache. Compared with the mode of directly inquiring and acquiring the target page data in the frame cache, the pressure of responding to the page request information under the high concurrency of the frame can be relieved by setting the second container under the state that the plug-in is opened, the response efficiency of responding to the page request data is faster by the plug-in cache, the response speed is improved, and the peak clipping effect is achieved under the high concurrency condition; and can better achieve the effect of shunt under high concurrency. Judging whether the target page attribute of the target page is writable or not through the plug-in, if the target page is found to be unwritable, for example, the forged page request information causes the target page to be unwritable, or the requested special target page does not support writing, the comment function is not allowed to be started, and the target page is unwritable, the page request information is directly intercepted in the plug-in cache, which is equivalent to directly carrying out related operation on the page request information in the plug-in cache, and the page request information of the forged, false or special page is intercepted in the plug-in cache, thereby avoiding wasting the computer resources of the page display system.
When the browser 100 sends the page request information, the embodiment of the application processes the page request information in stages by 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 responding to the page request information, the effect of generating target page data and returning the target page data to the browser 100 for page display is achieved. The page data is cached through the multi-layer cache, so that the page display system data is written in timely, the page data response and display efficiency is improved, peak clipping is achieved under the condition of high concurrency, 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 the state of high concurrency of the page request information, the proxy server 102 is further configured to: judging whether the target user has authority to acquire the target page data from the second-level cache 110 according to the user authority; if the target user has permission to acquire the target page data from the second-level cache 110, querying 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 permission 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) is used for caching page data according to page information and user rights, and when users corresponding to different browsers 100 but having the same identity rights group access the same target page, if the Varnish cache has the target page, the data of the target page can be directly obtained from 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 to different users through control of user identity permissions.
In order to reasonably allocate the computer resources of the page display system, the page display system further comprises: the load balancing server comprises a reverse proxy service cluster (for example, an nginx cluster), wherein the reverse proxy service cluster comprises a plurality of reverse proxy servers (for example, the nginx cluster comprises a plurality of nginx servers, and the nginx is a high-performance http and reverse proxy server). For example, when receiving a plurality of page request information, the load balancing server issues the plurality of page request information to the nginx cluster through a load balancing policy, so as to distribute the plurality of page request information to the Varnish cache through a plurality of ginx servers.
The page display system of the present application also performs control classification for different pages, considering that the user may not wish to load the plug-in on the home page, 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 plurality of page attributes into the first container and the second container in advance, and performing page classification operation through the plurality of page attributes; and the first container and the second container are also 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. When the framework is initialized, resources such as resource files (such as static resources), page information and the like are loaded. And when the plug-in unit loads 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 classifying and managing the page. Thus, particular functionality may be turned on, particularly for particular types of pages, and control of the system is more refined. During the loading of the plug-in by the framework, the plug-in will register into the first container according to the different page attributes of the page and cache these different page attributes in the first container. Different pages are distinguished according to page attributes, such as a template class page, a special class page, a structured discussion class page, a normal service class page and the like, for example, more pages are referred to, and a developer registers the more pages to a first container and a second container in a configuration mode. The page classification is carried out by capturing the page attribute loaded by the registered plug-in the framework, which is equivalent to adding a layer of white list control to the page data, and only the page data in the white list can be loaded by the plug-in.
If the developer needs to modify the page attribute of a certain page in the background server 104, if the template page is modified into a special page, classifying the page into the page type corresponding to the modified page attribute according to the modified page attribute aiming at the page with the modified page attribute; and updating the page attribute of the page cached in the first container and the second container, the frame cache 112 and the plug-in cache 114 are reset, so that the system is convenient to perform unified management. The page display system also comprises a switch for extracting the modification and classification of the page and injecting the switch into a configuration file to facilitate the configuration of the system for modifying and classifying the page attribute.
In order to identify the authority of the user and the page through the plug-in the page display system and in the plug-in loading state. When the plug-in receives the page request information, the plug-in can analyze and authenticate the page request information, which specifically comprises: authenticating the user authority; authenticating a 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 response to the page request information is determined, judging whether the target page is writable.
In this embodiment, the parsing and authentication of the page request information may be performed by the plugin through one or more of the following manners:
(1) User authentication: authentication can be performed according to the user authority carried in the page request information, so as to judge whether the target user has authority to request or modify the target page.
(2) And (5) sealing and checking: the user state of the user account can be obtained from the personal information of the user in the page request information, and whether the user account of the user is in the use permission state or not can be judged. When the user state is a seal number or frozen, the user state is not authenticated.
(3) Page registration type differentiation: 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 according to the target page attribute.
(4) User behavior differentiation: 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 rights, such as: praise, report, button listing, clear, mark, etc.
(5) And (3) self-setting pre-calibration: the user can also define rules to identify the legality of the content input by the user, judge whether the codes of the page request information are abnormal or not, and the like.
In an exemplary embodiment, in order to increase the interest of web pages and increase the user's viscosity, the framework 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 of the on and off of the grammar rendering module, namely, the grammar rendering module is 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 performs corresponding operations through different selections of the switch by the user, specifically as follows: and if the target page is writable, generating target page data according to 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 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 this embodiment, the switch is removed from the grammar rendering module, in the development stage, a developer with configuration authority configures, for a part of users, user authority that allows to use the switch according to user information, that is, configures the switch for the part of users, and the authorized user can decide to turn on or off the grammar rendering module by himself, and the background server 104 distinguishes whether to turn on the grammar rendering module by receiving different identifications transmitted by the browser 100, if not, processes the user input content as text, and if the grammar rendering module is turned on. The application withdraws the switch of the grammar rendering module and injects the switch into the configuration file; the system is provided with a function of judging whether to execute rendering on the content input by the user according to different selections of opening and closing of the grammar rendering module by the user.
In an exemplary embodiment, the frame is embedded with a parsing rule of the target grammar, and the user input content can be rendered through the parsing rule of the target grammar; the system supports the introduction nesting of grammar templates, greatly reduces labor cost and efficiently realizes a complex page rendering process. Rendering the user input content to obtain the rendered page data may further be obtained by: extracting a target document from the user input content, wherein the target document 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 contents from the target template page; and embedding the target template page content into the target document according to the analysis rule of the target grammar so as to obtain the rendered page data.
Taking a framework supporting the collaborative creation and connection of multiple people with a group of web pages as an example, the parsing rule of the target grammar is the parsing rule of the wiki grammar. In the state of opening the plug-in, the background server 104 determines that the user selects to open the grammar rendering module, and when receiving user input content, performs pre-verification such as data injection prevention, sensitive word filtration, token verification and the like on the user input content; after the pre-verification is passed, extracting a document containing a wiki grammar identifier from the input content of the user through the verification of the regular verification and the interceptor security policy; according to the target page attribute and the target page title, matching the target template page, calling a Hook function according to the analysis rule of the page attribute and the wiki grammar, finding out page content 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, and returning the rendered page data to the browser 100 to enable the user to display complete rendered page data and enter the rendered page data into a database; and simultaneously, the rendered page data is cached in a Varnish cache. In the development stage, a developer matches different hook functions for the analysis rules of different target grammars, so that a subsequent system can conveniently render user input contents through different wiki grammars in the writing process.
For example, the user input content is "introduce our community [ [ community introduction ] ], if interested, the content of { { { new game } -" can be created together, and in the state that the plug-in is on, the text containing the wiki grammar identifier, such as [ [ community introduction ] ], can be extracted through the regular rule. And then a page named as a community profile is found from the site through the target page attribute and the target page title (namely a text of the community profile in the community profile), wherein the target page title is provided with the site attribute, a corresponding site is found according to the site attribute, a plurality of page data are stored in the site, the page named as the community profile 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 the target grammar, and the extracted page content is used for replacing the community profile.
For example, the document containing the wiki grammar identifier is { { new game }, the { { new game } is rendered into a text hyperlink by the wiki grammar rendering module, and then the original { new game } } document is replaced. The writing of the front-end page with extremely high complexity can be completed through the analysis rule of the target grammar of the grammar rendering module, and the participation feeling and the viscosity of the user are effectively increased.
In an exemplary embodiment, when calling page content that nests other pages, there may also be a recursive nesting scenario: assuming the page A as a target page, the page B as a target template page, and the content of the newly added comment in the page A, the page content of the page B is nested in a wiki grammar rendering mode, and the nested content in the page B refers to the template content in the page C; at this time, the template content in the C page is nested into the page content of the B page in a recursion nesting mode to form combined nested content, and then the combined nested content is used for replacing the content of the newly added comment in the A page. When the background server 104 receives the user input content and extracts the corresponding target template page, the content is saved in KV (key value pair) form to query and acquire the embedded content of the target page. Taking a pair of KV (Key-Value) as an example, firstly searching in a first container and a second container, searching a database to acquire page data, wherein Key is user input content, value is wiki grammar in a target template page, traversing through the wiki grammar, performing layer-by-layer stripping until other page content is not nested in the target template page, and replacing a text in the user input content with text content corresponding to the wiki grammar which is stripped layer-by-layer.
To enhance the data management of the write operations by the page display system, the framework is further 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 sensitive word monitoring of user input content, only target page data that does not include sensitive information is visible to the general public. In order to further maintain stable civilization of the webpage, an auditing platform of a special webpage is additionally arranged in the webpage display system to audit the target webpage data comprising the sensitive information, and only the comment content passing the auditing can be seen by the masses.
In the embodiment of the application, the plug-in unit is also provided with a functional module for acquiring the head portrait picture information of the user through the configuration item of the plug-in unit selection switch. The configuration file of the page display system is 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 framework of a set of web pages, the native plug-in being used to alter a profile image; the method comprises the steps that the method is arranged at the top of a user page, and a user can view a current configuration file image through a menu option to change the image; (2) The plug-in has the function of acquiring the head portrait picture information of the user.
To make the application easier to understand, as in fig. 2 (a) -2 (c), an overall step flow diagram for performing a write operation in the page display system is provided below.
In step S001, the browser (i.e., client) 100 transmits the page request information, and the process advances to step S002.
In step S002, the page request information is sent to the load balancing server through a layer of load balancing (for example, in the nginx cluster, where the nginx cluster includes a plurality of nginx servers), where LB1 represents load balancing, and step S003 is entered.
In step S003, the layer of 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 proceeds to step S004.
Step S004, judging whether the Varnish cache comprises target page data, if the Varnish cache comprises the target page data, acquiring the target page data, and returning to the browser; if the Varnish cache does not contain the target page data, forwarding the page request information, and entering step S005;
step S005, through load balancing of the service nginx cluster, the received page request information is sent to the service layer (i.e. in the framework of the background server 104), and step S006 is entered, where LB2 represents load balancing.
Step S006, judging whether the plug-in is started, if the plug-in is in a non-started state, generating information that the current page cannot request, and returning the information 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 the 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 unit comprises the following steps: user authentication, seal verification, page registration type distinction, user behavior distinction, self-defined pre-verification and other operations;
step S008, determining, by the plug-in, whether the target page is writable according to the plurality of page attributes in the second container and the target page attribute of the target page; 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 step S009 is entered;
step S009, rechecking authority content, including page attribute, page comment authority and the like; re-authenticating the user according to the user authority, and entering step S010 after passing the authentication;
step S010, converting the entity back to the character string by checking the entity, namely, checking and converting the received page request information to play a role in compressing data, and entering step S011;
Step S011, judging whether to start wiki grammar rendering; if it is determined that wiki rendering is turned on, the process proceeds to step S012; if the wiki rendering is determined not to be started; generating the unrendered page data according to the user input content, and proceeding to 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 entering 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-delete mode, namely marking the target page data as being not passed through the auditing through a specific marking bit, returning to the browser, modifying user input content, auditing 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 through the auditing, and entering step S014;
Step S014, writing the target page data into a database, and entering step S015;
step S015, clearing all levels of caches; for example, when the page a is changed, after a new page B is generated, the page data of the 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 webpage grammar rendering, such as wiki grammar rendering, supports template introduction nesting, can realize a complex page rendering process, and greatly reduces labor cost;
(2) For high concurrent page request information, the application carries out the caching of page data layer by layer in a progressive way through five layers of caches, and can quickly respond to users through five layers of caches, thereby greatly improving the user experience;
(3) The 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 application is shown. It will be appreciated that the flow charts in the method embodiments are not intended 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 is used for caching user information of the target user; step S12, responding to the page request information through the proxy server to return the target page data in the proxy server to the browser or forward the page request information; the proxy server is configured with a second-level cache for caching the first quantity 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 framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; 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; 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 the state that the plug-in is opened, responding to 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 a plurality of page attributes in the second container and the target page attribute of the target page; and if the target page is writable, generating target page data through the framework, and returning the generated target page data to the browser for page display.
In an exemplary embodiment, the method further comprises: after the target page data is cached by the cache server, responding to subsequent page request information of the target page data forwarded by the background server, and returning the target page data in the fifth-level cache to the browser, wherein the cache server is used as the fifth-level cache for caching the third quantity of page data.
In an exemplary embodiment, as shown in FIG. 4, the user information includes user rights; the responding the page request information by the proxy server side to return the target page data in the second-level cache in the proxy server side to the browser or forward the page request information comprises the steps of S20-S24, wherein: step S20, judging whether the target user has authority to acquire the target page data from the second-level cache according to the user authority through the proxy server; step S22, if the target user has permission to acquire the target page data from the second-level cache, inquiring and acquiring 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 does not have permission to acquire 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 plurality of page attributes into the first container and the second container in advance through the background server, and carrying out page classification operation through the plurality of page attributes; and the first container and the second container are also 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 to S38, wherein: step S30, authenticating the user authority 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 permission state and a use prohibition state; step S34, distinguishing the target page attribute according to the page request information through the plug-in; step S36, determining user behaviors according to the page request information through the plug-in; step S38, determining, by the plugin, 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 response to the page request information is determined, judging whether the target page is writable.
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 frame generates the target page data, including steps S40 to S44: step S40, if the target page is writable, generating target page data according to 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 an open state, rendering the user input content to obtain the rendered page data; step S44, when the syntax 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 has parsing rules for the target grammar embedded therein. 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 document from the user input content through the framework, wherein the target document comprises a target grammar identifier and a target page title; step S52, inquiring to obtain a target template page according to the target page attribute and the target page title; step S54, extracting target template page content from the target template page; and step S56, embedding the target template page content into the target file according to the analysis rule of the target grammar so as to obtain the rendered page data.
In an exemplary embodiment, as shown in fig. 8, the method further includes steps S60 to S62, wherein: step S60, judging whether the target page data comprises sensitive information or not through the framework; and step S62, if the target page data does not comprise the sensitive information, writing the target page data into a database.
Example III
Referring to fig. 9, a flowchart illustrating steps of a page display method according to an embodiment of the application is shown. It will be appreciated that the flow charts in the method embodiments are not intended to limit the order in which the steps are performed. The embodiment of the application is used for solving the problems of unstable page back display synchronization and easy data backlog.
As shown in fig. 9, the present application further provides a page display method, which includes 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 configured with a first-level cache for caching 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, inquiring and returning target page data from the second-level cache through the proxy server based on the page request information.
Step S72, if the proxy server does not return the target page data, forwarding the page request information to a background server; the background server is configured with a framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; the plug-in is configured with a plug-in cache serving as a fourth-level cache and is used for caching a second amount of page data, wherein the second amount of page data comprises page data with the access frequency being greater than a preset threshold value.
Step S73, receiving the page request information through the frame cache, and providing the page request information to the plugin in the on state of the plugin, so as to query and return the target page data from the plugin cache through the plugin.
Step S74, if the plug-in does not return the target page data, forwarding the page request information to a cache server; the cache server is used as a fifth-level cache for caching the third quantity of page data.
Step S75, based on the page request information, the target page data is queried and returned 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.
The second-level cache may be a varish cache; the fifth level cache may be a Redis cache.
Taking the processing of the second page request information as an example, the above-mentioned operation of the echo is illustrated 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 exist in the second-level cache; if the target page data exist 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 page request information.
(2) Receiving the second page request information through the cache server, if the target page data exist 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 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 to the second-level cache, 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 by specifically including steps S77 to S79, where: step 77, 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 smaller than a preset flow 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 the preset flow 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. Since popular pages are obtained by performing mathematical statistical classification on frequently visited pages, popular pages tend to be accompanied by a large amount of traffic. And (3) reserving and injecting page data such as page IDs of popular pages and corresponding page contents into a plug-in cache, and when a user accesses for the second time, if page request information penetrates through a Varnish cache, the page request information is intercepted in the plug-in, and the plug-in cache can block one layer of traffic under the condition of high concurrency, so that the effect of effective peak clipping is achieved.
Taking the processing of the subsequent page request information as an example, the above-mentioned operation of the echo is illustrated, specifically 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 exist in the second-level cache; if the target page data exist in the second-level cache, acquiring the current page request information quantity of the proxy server; if the current request information quantity of the proxy server is smaller than a first preset request threshold, 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 of the situation that the target page data does not exist in the second-level cache and the situation that the current request information quantity of the proxy server is larger than a first preset request threshold value. The Varnish cache caches response data generated after responding to the page request information, wherein the response data is target page data. When a user in the same authority group accesses a page which has been accessed, namely, when the user in the same authority group sends second page request information, the second page request information is intercepted in a Varnish cache, and flow control is carried out in the Varnish cache.
(2) If the background server receives the subsequent page request information forwarded by the proxy server, judging whether target page data exists in the plug-in cache; if the target page data exist in the plug-in cache, acquiring the current request information quantity of the plug-in cache; and if the number of the current request information of the plug-in cache is smaller than a second preset threshold, 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 number of the current request information of the plug-in cache is larger than the second preset request threshold.
(3) If the cache server receives the subsequent page request information sent by the background server, judging whether the cache server has target page data or not; if the target page data exist in the fifth-level cache, acquiring the current request information quantity of the cache server side; if the current request information quantity of the cache server is smaller than a third preset threshold, inquiring and acquiring the target page data from the cache server, and returning the target page data to the browser; and if the number of the current request information of the cache server side is larger than a third preset request threshold, forwarding the subsequent page request information to the background server side, so that the background server side 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, a flowchart of overall steps for performing the echo operation in the page display method is provided below.
(1) Step S020, sending the next page request information (i.e. the second page request information or the subsequent page request information) through the browser (i.e. the client), and entering step S021;
(2) Step S021, judging whether the Varnish cache comprises target page data or not under the loading and starting state of the plug-in, if the Varnish cache comprises the target page data, acquiring the target page data, and returning to the browser; if the Varnish cache does not include the target page data or the page request information penetrates through the Varnish cache, forwarding the page request information, and proceeding to step S022;
(3) Step S022, in order to improve the security of the back display operation, the functional module of the registered plug-in API in the framework needs to be authenticated, and whether the user has permission 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 entered;
(4) Step S023, in order to improve the security of the back display 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 proceeding to step S024;
(5) Step S024, judging whether the target page data is a popular page (namely, a page with the access frequency larger than a preset threshold value) 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 to the browser; if the target page data is not a popular page, forwarding the next page request information and proceeding to step S025;
(6) Step S205, if target page data exist in the Redis cache, the target page data are obtained from the Redis cache, the target page data are packaged and back-displayed to the browser, and the target page data are synchronized to the plug-in cache and the Varnish cache; if the target page data does not exist in the Redis cache, filtering and inquiring the target page data from the database, returning the target page data to the browser, 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 IV
Referring to fig. 12, a flowchart of steps of a page display method according to an embodiment of the application is shown. The page display method takes the background server 104 as an execution main body. It will be appreciated that the flow charts in the method embodiments 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 the background server, wherein the background server is provided with a framework 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 method comprises the steps of S80 to 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 the state that the plug-in is opened;
step S82, determining whether the target page is writable or not through the plug-in according to the page attributes in the second container and the target page attribute of the target page;
step S84, if the target page is writable, generating target page data through the frame, and returning the generated target page data to a browser for page display;
and step S86, if the target page is not writable, generating page non-writable information through the framework and returning the page non-writable information to the browser.
In an exemplary embodiment, the plugin is configured with a plugin cache, and the plugin cache is used for caching page data with the access frequency being greater than a preset threshold value; the method further comprises the steps of: 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 plurality of page attributes into the first container and the second container in advance through the background server, and carrying out page classification operation through the plurality of page attributes; and the first container and the second container are also 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 to S98, wherein: step S90, authenticating the user authority in the page request information 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 permission state and a use prohibition 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 plugin, 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 response to the page request information is determined, judging whether the target page is writable.
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 frame generates the target page data, including steps S100 to S104: step S100, if the target page is writable, generating target page data according to user input content in the page request information, where the target page data includes: 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 the rendered page data; step S104, when the grammar rendering module is not in an on state, the unrendered page data is generated according to the user input content.
In an exemplary embodiment, the framework has parsing rules for the target grammar embedded therein. 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 document from the user input content through the framework, wherein the target document comprises a target grammar identifier and a target page title; step S202, inquiring to obtain a target template page according to the target page attribute and the target page title; step S204, extracting target template page content from the target template page; step S206, embedding the target template page content into the target document according to the analysis rule of the target grammar 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 framework; and if the target page data does not comprise the sensitive information, writing the target page data into a database.
Example five
With continued reference to fig. 16, a program module diagram of the page display device 20 is shown. In this embodiment, the page display device 20 may include or be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors to accomplish the present application and may implement the page display method described above. Program modules in the present application are referred to as a series of computer program instruction segments capable of performing particular functions. The following description will specifically describe functions of each program module of the present embodiment:
the page display device 20 includes a background server, where the background server is configured with a framework 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 apparatus further comprises:
The sending module 300 is configured to cache, through the framework, page request information of a target page, and provide the page request information to the plug-in when the plug-in is turned on;
a judging module 302, configured to determine, according to the plurality of page attributes in the second container and the target page attribute of the target page, whether the target page is writable through the plugin;
a first generating module 304, configured to generate, if the target page is writable, the target page data through the frame, and return the generated target page data to a browser for page display;
and a second generating module 306, configured to generate page non-writable information through the framework and return the page non-writable information to the browser if the target page is non-writable.
In an exemplary embodiment, the plugin is configured with a plugin cache, and the plugin cache is used for caching page data with the access frequency being greater than a preset threshold value; the page display device 20 further includes: a plug-in cache response module 308, the plug-in cache response module 308 being 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 through the plurality of page attributes; and the first container and the second container are also 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, the plug-in the page display device 20 is further configured to: authenticating the user authority in the page request information; authenticating a 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 response to the page request information is determined, judging whether the target page is writable.
In an exemplary embodiment, the framework is further configured with a grammar rendering module. The first generating module 304 is further configured to: if the target page is writable, generating target page data according to 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 has parsing rules for the target grammar embedded therein. The first generating module 304 is further configured to: extracting a target document from the user input content through the framework, wherein the target document 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 contents from the target template page; and embedding the target template page content into the target document according to the analysis rule of the target grammar so as to obtain the rendered page data.
In an exemplary embodiment, the page display device 20 further includes a sensitive information detection module (not identified) that is further configured to: judging whether the target page data comprises sensitive information or not through the framework; 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 this 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-mounted server, a blade server, a tower server, or a rack-mounted server (including an independent server, or a server cluster formed by multiple servers), or the like. 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 communicably connected to each other via a system bus. Wherein:
in this embodiment, the memory 21 includes at least one type of computer-readable storage medium including flash memory, a hard disk, a multimedia card, a card 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 memory 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) or the like, which are provided on the computer device 2. Of course, the memory 21 may also include both internal storage units of the computer device 2 and external storage devices. In the present embodiment, the memory 21 is typically used to store an operating system and various types of application software installed on the computer device 2, such as program codes of the page display device 20 of the above embodiment. Further, the memory 21 may be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a central processing unit (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 the present embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the page display device 20, to implement the page display method of the above embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, which network interface 23 is typically used for establishing a communication connection between the computer apparatus 2 and other electronic devices. 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 an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or other wireless or wired network.
It is noted that fig. 16 shows only the computer device 2 with components 20-23, but it is understood that not all of the illustrated components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the page display device 20 stored in the memory 21 may also be divided into one or more program modules, which are stored in the memory 21 and executed by one or more processors (the processor 22 in this embodiment) to complete the present application.
For example, fig. 16 shows a schematic diagram of a program module for implementing the fifth embodiment of the page display device 20, where the page display device 20 may be divided into a sending module 300, a judging module 302, a first generating module 304, and a second generating module 306. Program modules in the present application are understood to mean a series of computer program instruction segments capable of performing a specific function, more suitable than a program for describing the execution of the page display device 20 in the computer apparatus 2. The specific functions of the program modules 300-306 are described in detail in the fifth embodiment, and are not described herein.
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 server, an App application store, etc., on which a computer program is stored, which when executed by a processor, performs a corresponding function. The computer readable storage medium of the present embodiment is used to store the page display device 20, and when executed by a processor, implements the page display method of the above embodiment.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (12)
1. A page display method, characterized by comprising:
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 is used for caching user information of the target user;
responding to 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 configured with a second-level cache for caching the first quantity of page data;
receiving the page request information forwarded by the proxy server through a background server; the background server is configured with a framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; 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; 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 the state that the plug-in is opened, responding to 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;
After the target page data is cached by the caching server, responding to subsequent page request information of the target page data forwarded by the background server, and returning the target page data in the caching server to the browser, wherein the caching server serves as a fifth-level cache and is used for caching third quantity of page data.
2. The page display method as recited in claim 1, wherein,
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 responding to the page request information through the plug-in unit to generate target page data and return the generated target page data to the browser for page display comprises the following steps:
determining whether the target page is writable or not through the plug-in according to a plurality of page attributes in the second container and the target page attribute of the target page;
and if the target page is writable, generating target page data through the framework, and returning the generated target page data to the browser for page display.
3. The page display method as recited in claim 1, wherein the user information includes user rights; the 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 forward the page request information comprises the following steps:
judging whether the target user has authority to acquire the target page data from the second-level cache according to the user authority through the proxy server;
if the target user has permission to acquire the target page data from the second-level cache, inquiring and acquiring the target page data from the second-level cache, and returning the target page data to the browser; and
And if the target user does not have permission to acquire 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.
4. The page display method as recited in claim 2, wherein the method further comprises:
registering the plurality of page attributes into the first container and the second container in advance through the background server, and carrying out page classification operation through the plurality of page attributes;
And the first container and the second container are also 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.
5. A page display method as recited in claim 3, further comprising:
authenticating the user authority through the plug-in;
authenticating a user state of the target user through the plug-in, 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 through the plug-in;
determining user behavior according to the page request information through the plug-in;
determining, by the plugin, 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 response to the page request information is determined, judging whether the target page is writable.
6. The page display method as recited in claim 2, wherein the frame is further configured with a syntax rendering module; and if the target page is writable, generating the target page data through the framework, wherein the method comprises the following steps:
And if the target page is writable, generating target page data according to 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 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.
7. The page display method as recited in claim 6, wherein the frame has parsing rules for target grammar embedded therein; the rendering the user input content to obtain the rendered page data includes:
extracting a target document from the user input content through the framework, wherein the target document 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 contents from the target template page;
and embedding the target template page content into the target document according to the analysis rule of the target grammar so as to obtain the rendered page data.
8. The page display method as recited in claim 6, further comprising:
judging whether the target page data comprises sensitive information or not through the framework; and
And if the target page data does not comprise the sensitive information, writing the target page data into a database.
9. A page display system, comprising:
the browser is configured with a browser cache serving as a first-level cache and is 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 for caching the first quantity of page data and responding to the page request information to return the target page data in the second-level cache to the browser or forward the page request information; and
The background server is provided with a framework loaded with plug-ins, and the framework is provided with a framework cache serving as a third-level cache and used for data cache; 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 framework cache, providing the page request information to the plug-in cache in a state that the plug-in is opened, responding to 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;
The cache server is used as a fifth-level cache and used for caching the third quantity of page data; and the cache server side is used for responding to the subsequent page request information of the target page data forwarded by the background server side after caching the target page data, and returning the target page data in the fifth-level cache to the browser.
10. A method of displaying a page, the method comprising:
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 configured with a first-level cache for caching user information of the target user; the proxy server is configured with a second-level cache for caching the first quantity of page data;
inquiring and returning target page data from the second-level cache through the proxy server based on the page request information;
if the proxy server does not return the target page data, forwarding the page request information to a background server; the background server is configured with a framework for loading plug-ins, and the framework is configured with a framework cache serving as a third-level cache and used for data cache; the plug-in is configured with a plug-in cache serving as a fourth-level cache and is used for caching a second amount of page data, wherein the second amount of page data comprises page data with the access frequency being greater than a preset threshold value;
Receiving the page request information through the framework cache, and providing the page request information for the plug-in the 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 server; the cache server is used as a fifth level cache for caching the third quantity of page data;
inquiring and returning the target page data from the fifth-level cache through the cache server based on the page request information;
and if the cache server side does not return the target page data, forwarding the page request information to a database to inquire from the database and return the target page data to the browser for page display.
11. 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 of claims 1 to 8 when the computer program is executed by the processor.
12. A computer-readable storage medium, having stored therein a computer program executable by at least one processor to cause the at least one processor to perform the steps of the page display method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110511232.3A CN113420245B (en) | 2021-05-11 | 2021-05-11 | Page display method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110511232.3A CN113420245B (en) | 2021-05-11 | 2021-05-11 | Page display method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113420245A CN113420245A (en) | 2021-09-21 |
CN113420245B true CN113420245B (en) | 2023-10-27 |
Family
ID=77712220
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110511232.3A Active CN113420245B (en) | 2021-05-11 | 2021-05-11 | Page display method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113420245B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114265996A (en) * | 2021-12-27 | 2022-04-01 | 中国电信股份有限公司 | Data caching method and device, storage medium and electronic equipment |
CN117435515B (en) * | 2023-12-21 | 2024-09-10 | 云和恩墨(北京)信息技术有限公司 | SQL statement auditing method, device, equipment and medium based on database |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2606326A1 (en) * | 2005-04-29 | 2006-11-09 | Bharosa Inc. | System and method for fraud monitoring, detection, and tiered user authentication |
CN103838813A (en) * | 2012-11-21 | 2014-06-04 | 通用电气公司 | Dicom image viewer in a web-browser |
WO2014107197A1 (en) * | 2013-01-06 | 2014-07-10 | Intel Corporation | A method, apparatus, and system for distributed pre-processing of touch data and display region control |
CN107291940A (en) * | 2017-07-07 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Content of pages management method, device and associated server |
CN108055302A (en) * | 2017-12-05 | 2018-05-18 | 竞技世界(北京)网络技术有限公司 | A kind of image cache processing method, system and server |
CN108509229A (en) * | 2017-12-26 | 2018-09-07 | 平安普惠企业管理有限公司 | Method, terminal device and the computer readable storage medium of the cross-domain control of window |
CN110096659A (en) * | 2019-03-27 | 2019-08-06 | 北京三快在线科技有限公司 | A kind of page display method, device, equipment and readable storage medium storing program for executing |
CN111444455A (en) * | 2020-03-25 | 2020-07-24 | 平安医疗健康管理股份有限公司 | Browser compatible method, system, computer device and storage medium |
-
2021
- 2021-05-11 CN CN202110511232.3A patent/CN113420245B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2606326A1 (en) * | 2005-04-29 | 2006-11-09 | Bharosa Inc. | System and method for fraud monitoring, detection, and tiered user authentication |
CN103838813A (en) * | 2012-11-21 | 2014-06-04 | 通用电气公司 | Dicom image viewer in a web-browser |
WO2014107197A1 (en) * | 2013-01-06 | 2014-07-10 | Intel Corporation | A method, apparatus, and system for distributed pre-processing of touch data and display region control |
CN107291940A (en) * | 2017-07-07 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Content of pages management method, device and associated server |
CN108055302A (en) * | 2017-12-05 | 2018-05-18 | 竞技世界(北京)网络技术有限公司 | A kind of image cache processing method, system and server |
CN108509229A (en) * | 2017-12-26 | 2018-09-07 | 平安普惠企业管理有限公司 | Method, terminal device and the computer readable storage medium of the cross-domain control of window |
CN110096659A (en) * | 2019-03-27 | 2019-08-06 | 北京三快在线科技有限公司 | A kind of page display method, device, equipment and readable storage medium storing program for executing |
CN111444455A (en) * | 2020-03-25 | 2020-07-24 | 平安医疗健康管理股份有限公司 | Browser compatible method, system, computer device and storage medium |
Non-Patent Citations (5)
Title |
---|
NSTL综合运维管理系统应用实践;张婧等;数字图书馆论坛(第07期);68-72 * |
research on multi level security framework for openID;junyin Wei等;2010 third international symposium on electronic commerce and security;393-397 * |
一种基于对象属性的Web缓存替换策略;李乔等;智能计算机与应用;第4卷(第3期);1-4+10 * |
利用Linux和Squid建立缓存代理服务器的优化方案研究;郑炳伦;魏欢;;软件导刊(第04期);56-58 * |
基于Web应用的缓存技术概述;甘桂梅;;中国科技信息(第17期);95-96 * |
Also Published As
Publication number | Publication date |
---|---|
CN113420245A (en) | 2021-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230328109A1 (en) | Data access policies | |
CN110943961B (en) | Data processing method, device and storage medium | |
US20230195812A1 (en) | Optimizing scraping requests through browsing profiles | |
CN110300124A (en) | Access control method, system, electronic device and readable medium | |
WO2020147605A1 (en) | Online diagnosis platform, permission management method and permission management system for online diagnosis platform | |
KR102090982B1 (en) | How to identify malicious websites, devices and computer storage media | |
CN109684873B (en) | Data access control method and device, computer equipment and storage medium | |
US11140153B2 (en) | Techniques for identification of location of relevant fields in a credential-seeking web page | |
CN115039082B (en) | Log writing method, device, electronic device, and storage medium | |
CN113420245B (en) | Page display method and system | |
US8689276B2 (en) | System and method for controlling access to files | |
CN111625782A (en) | Method and device for controlling access authority of source code, computer equipment and storage medium | |
CN103036910B (en) | A kind of user's web access Behavior-Based control method and device | |
CN111083093A (en) | Method and device for calling terminal capability | |
CN110636038A (en) | Account analysis method, device, security gateway and system | |
CN111741010B (en) | Docker operation request processing method and device based on proxy and computing equipment | |
CN113722114B (en) | A data service processing method, device, computing device and storage medium | |
CN107623662B (en) | Access control method, device and system | |
Sazonov et al. | Digital object architecture as an approach to identifying internet of things devices | |
CN103067398A (en) | Method and equipment for achieving third-party application accessing user data | |
CN108319868A (en) | Guard method, device, storage medium and the terminal device of picture access | |
CN114036416A (en) | Page display method and device | |
CN116975839A (en) | Resource sharing method, equipment and medium based on STRUTS2 component | |
CN116094814A (en) | VPN access method, device, electronic equipment and storage medium | |
CN112748960B (en) | Process control method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |