CN116662689A - Page processing method and device, electronic equipment and storage medium - Google Patents

Page processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116662689A
CN116662689A CN202310626662.9A CN202310626662A CN116662689A CN 116662689 A CN116662689 A CN 116662689A CN 202310626662 A CN202310626662 A CN 202310626662A CN 116662689 A CN116662689 A CN 116662689A
Authority
CN
China
Prior art keywords
page
server
access request
rendering
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310626662.9A
Other languages
Chinese (zh)
Inventor
胡安亭
侯振兵
周冬平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shareit Information Technology Co Ltd
Original Assignee
Beijing Shareit Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shareit Information Technology Co Ltd filed Critical Beijing Shareit Information Technology Co Ltd
Priority to CN202310626662.9A priority Critical patent/CN116662689A/en
Publication of CN116662689A publication Critical patent/CN116662689A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure relates to a page processing method, a device, an electronic device and a storage medium, wherein the method is applied to a server and comprises the following steps: acquiring a page access request sent by a client; determining the current page rendering task amount of the server according to the page access request; responding to the current page rendering task amount of the server side is larger than a preset request amount threshold, and returning an SPA page corresponding to a page requested by the page access request to the client side; the SPA page is used for rendering by the client. By the method, the load of the server can be reduced, so that the occurrence of the condition that the page requested by the page access request is blocked can be reduced.

Description

Page processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a page processing method, a page processing device, electronic equipment and a storage medium.
Background
With the rapid development of the internet, the number of users surfing the internet is increasing, and the access load borne by a large internet Application (APP) or a website is increasing. For a page requested by a user for page access, the server side usually renders the page, however, when the page access request of the user is more, the data volume of the page access request is larger, the corresponding rendering task volume is larger, so that the access pressure to a database or other data sources is very large, at the moment, the load of the server side is larger, and the page rendering is very time-consuming, so that the situation of page clamping occurs. Then, how to reduce the occurrence of the render page stuck in the case of the large-traffic page access request becomes a problem to be solved.
Disclosure of Invention
The disclosure provides a page processing method, a page processing device, electronic equipment and a storage medium.
According to a first aspect of an embodiment of the present disclosure, there is provided a page processing method, applied to a server, the method including:
acquiring a page access request sent by a client;
determining the current page rendering task amount of the server according to the page access request;
responding to the current page rendering task amount of the server side is larger than a preset request amount threshold, and returning an SPA page corresponding to a page requested by the page access request to the client side; the SPA page is used for rendering by the client.
In some embodiments, the method further comprises:
determining a rendered page corresponding to the page access request in response to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold;
and returning the rendered page to the client.
In some embodiments, the method further comprises:
acquiring a function configuration request sent by the client;
returning to a function configuration page corresponding to the function configuration request;
and receiving the preset request quantity threshold configured by the client based on the displayed function configuration page.
In some embodiments, the method further comprises:
receiving a page type of whether page caching is performed or not, which is configured by the client based on the displayed function configuration page;
generating a cache identifier for indicating whether a page corresponding to the page type is a cache page according to a configuration result of the page type of whether page cache is performed;
determining a target page type of a page requested by the page access request according to the page access request;
the responding to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold value, determining the rendered page corresponding to the page access request comprises the following steps:
and responding to the fact that the current page rendering task amount of the server side is smaller than or equal to the preset request amount threshold, and determining a rendering page corresponding to the page access request according to the cache identifier corresponding to the target page type.
In some embodiments, the determining, according to the cache identifier corresponding to the target page type, the rendered page corresponding to the page access request includes:
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, rendering and generating the page requested by the page access request, and obtaining the rendered page;
Responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, determining whether the cached rendering page exists in the page requested by the page access request, and determining the rendering page corresponding to the page access request according to the determination result of whether the cached rendering page exists.
In some embodiments, the determining, according to a determination result of whether the cached rendered page exists, the rendered page corresponding to the page access request includes:
responding to the determination result to represent that a cached rendering page exists, and taking the cached rendering page as a rendering page corresponding to the page access request;
and responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page.
In some embodiments, the preset request amount threshold includes a first preset request amount threshold corresponding to a cached page and a second preset request amount threshold corresponding to a non-cached page;
the responding to the current page rendering task amount of the server is larger than a preset request amount threshold, and the returning the SPA page corresponding to the page requested by the page access request to the client comprises the following steps:
Responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the first preset request amount threshold;
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the second preset request amount threshold; wherein the first preset request amount threshold is smaller than the second preset request amount threshold.
According to a second aspect of embodiments of the present disclosure, there is provided a page processing method, applied to a client, the method including:
sending a page access request to a server;
receiving an SPA page corresponding to a page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
Rendering the SPA page.
In some embodiments, the method further comprises:
sending a function configuration request to the server;
receiving and displaying a function configuration page corresponding to the function configuration request sent by the server;
based on the displayed function configuration page, acquiring the configured preset request quantity threshold value and sending the configured preset request quantity threshold value to the server.
In some embodiments, the method further comprises:
based on the displayed function configuration page, acquiring a configuration result of the page type of whether page caching is performed or not;
the configuration result is sent to the server; the configuration result is used for generating a cache identifier representing whether a page corresponding to the page type is a cache page or not by the server, wherein the cache identifier is used for determining that the current page rendering task amount is smaller than or equal to the preset request amount threshold value and determining a rendering page corresponding to the page access request by the server.
According to a third aspect of embodiments of the present disclosure, there is provided a page processing apparatus, applied to a server, the apparatus including:
the first acquisition module is used for acquiring a page access request sent by the client;
The first determining module is used for determining the current page rendering task amount of the server according to the page access request;
the first sending module is used for responding to the fact that the current page rendering task amount of the server side is larger than a preset request amount threshold value, and returning SPA pages corresponding to the pages requested by the page access request to the client side; the SPA page is used for rendering by the client.
In some embodiments, the apparatus further comprises:
the second determining module is used for determining a rendering page corresponding to the page access request in response to the fact that the current page rendering task amount of the server is smaller than or equal to the preset request amount threshold;
and the third sending module is used for returning the rendering page to the client.
In some embodiments, the apparatus further comprises:
the second acquisition module is used for acquiring the function configuration request sent by the client;
a fourth sending module, configured to return a function configuration page corresponding to the function configuration request;
and the second receiving module is used for receiving the preset request quantity threshold value configured by the client based on the displayed function configuration page.
In some embodiments, the apparatus further comprises:
The third receiving module is used for receiving the page type of whether the page cache is performed or not according to the displayed function configuration page configuration of the client;
the generation module is used for generating a cache identifier for representing whether the page corresponding to the page type is a cache page according to the configuration result of the page type of whether page cache is performed;
a third determining module, configured to determine, according to the page access request, a target page type to which a page requested by the page access request belongs;
the second determining module is further configured to determine, according to a cache identifier corresponding to the target page type, a rendered page corresponding to the page access request, in response to the current page rendering task amount of the server being less than or equal to the preset request amount threshold.
In some embodiments, the second determining module is further configured to render and generate the page requested by the page access request to obtain the rendered page, where the page requested by the page access request is represented as a non-cached page in response to the cache identifier corresponding to the target page type; responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, determining whether the cached rendering page exists in the page requested by the page access request, and determining the rendering page corresponding to the page access request according to the determination result of whether the cached rendering page exists.
In some embodiments, the second determining module is further configured to characterize, in response to the determination result, that a cached rendering page exists, and use the cached rendering page as the rendering page corresponding to the page access request; and responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page.
In some embodiments, the preset request amount threshold includes a first preset request amount threshold corresponding to a cached page and a second preset request amount threshold corresponding to a non-cached page;
the first sending module is further configured to, in response to the cache identifier corresponding to the target page type, characterize that a page requested by the page access request is a cache page, and the current page rendering task amount of the server side is greater than the first preset request amount threshold, return an SPA page corresponding to the page requested by the page access request to the client side; responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the second preset request amount threshold; wherein the first preset request amount threshold is smaller than the second preset request amount threshold.
According to a fourth aspect of embodiments of the present disclosure, there is provided a page processing apparatus, applied to a client, the apparatus including:
the second sending module is used for sending a page access request to the server;
the first receiving module is used for receiving an SPA page corresponding to the page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
and the rendering module is used for rendering the SPA page.
In some embodiments, the apparatus further comprises:
a fifth sending module, configured to send a function configuration request to the server;
the display module is used for receiving and displaying a function configuration page corresponding to the function configuration request sent by the server;
and the sixth sending module is used for acquiring the configured preset request quantity threshold based on the displayed function configuration page and sending the configured preset request quantity threshold to the server.
In some embodiments, the apparatus further comprises:
the third acquisition module is used for acquiring a configuration result of the page type of whether page caching is performed or not based on the displayed function configuration page;
A seventh sending module, configured to send the configuration result to the server; the configuration result is used for generating a cache identifier representing whether a page corresponding to the page type is a cache page or not by the server, wherein the cache identifier is used for determining that the current page rendering task amount is smaller than or equal to the preset request amount threshold value and determining a rendering page corresponding to the page access request by the server.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor implementing the method as described in the first or second aspect when executing the program.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method as described in the first or second aspect.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
in the embodiment of the disclosure, after the server side obtains the page access request sent by the client side, the current page rendering task amount of the server side is larger than the preset request amount threshold, and the SPA page corresponding to the page requested by the page access request is returned to the client side for rendering by the client side, so that when the page rendering task amount of the server side is larger, the server side is not required to render, the load of the server side can be reduced, and the occurrence of the condition that the page requested by the page access request is stuck can be reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic implementation flow diagram of a page processing method according to an embodiment of the disclosure.
Fig. 2 is a second schematic implementation flow diagram of a page processing method according to an embodiment of the disclosure.
Fig. 3 is a schematic diagram of an implementation flow of a page processing method according to an embodiment of the disclosure.
FIG. 4 is an interactive schematic diagram of a page processing system shown in an embodiment of the present disclosure.
Fig. 5 is a schematic diagram of a page processing apparatus applied to a server according to an embodiment of the disclosure.
Fig. 6 is a schematic diagram of a page processing apparatus applied to a client according to an embodiment of the disclosure.
Fig. 7 is a block diagram one of an electronic device shown in an embodiment of the disclosure.
Fig. 8 is a block diagram two of an electronic device shown in an embodiment of the disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is a schematic implementation flow diagram of a page processing method according to an embodiment of the present disclosure, which is applied to a server, as shown in fig. 1, and the method includes the following steps:
s101, acquiring a page access request sent by a client;
s102, determining the current page rendering task amount of the server according to the page access request;
s103, responding to the fact that the current page rendering task amount of the server side is larger than a preset request amount threshold, and returning an SPA page corresponding to the page requested by the page access request to the client side; the SPA page is used for rendering by the client.
The page processing method disclosed by the embodiment of the invention is applicable to the electronic equipment. The electronic device to which the present disclosure applies may be a server. The server side can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and an artificial intelligent platform.
In the disclosed embodiments, clients include, but are not limited to, smartphones, tablet computers, notebook computers, desktop computers, smartwatches, and smart devices, among others.
In the embodiment of the disclosure, a client sends a page access request to a server, and the server acquires the page access request sent by the client. The page access request may be a WAP page access request based on a wireless application protocol (Wireless Application Protocol, WAP), or a World Wide Web (WWW) page access request based on a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP), or the like. Its page access request includes, but is not limited to: access request modes, such as a GET method, for obtaining resources on a server, a send method, for submitting data to the server, etc.; access addresses for accessing pages, such as uniform resource locators (Uniform Resource Locator, URL), uniform resource names (Uniform Resource Name, URN) for pages; the file format of the access page, such as wireless markup Language (Wireless Markup Language, WML), hyperText markup Language (HTML), extensible HyperText markup Language (eXtensible HyperText Markup Language, XHTML) file.
In the embodiment of the disclosure, the server determines the current page rendering task amount of the server according to the page access request. After determining the current page rendering task amount, the server compares the current page rendering task amount with a preset request amount threshold. The current page rendering task amount of the server may be used to characterize the load of the server, and it may be understood that if the load of the server is lower, the more computing resources are available for processing rendering tasks, and the faster the rendering speed is. If the load of the server is higher, the computing resources for processing the rendering task are fewer, and the rendering speed is correspondingly slower. For example, if the server processes 1 ten thousand pieces of rendering data, which takes about more than one second, 10 ten thousand pieces of data are rendered at a time, which takes about 12 seconds, so that a rendering page corresponding to the rendering data is jammed, which is obviously not preferable. Considering timeliness of page rendering, the preset request quantity threshold value can be set to be 1 ten thousand pieces of rendering data, and if the current page rendering task quantity is smaller than or equal to 1 ten thousand pieces of rendering data, a page requested by a page access request can be rendered in time; if the current page rendering task amount is greater than 1 ten thousand pieces of rendering data, the page requested by the page access request may have a stuck condition.
In the embodiment of the present disclosure, the server may acquire the page access requests sent by a plurality of other clients while acquiring the page access request sent by the current client, and it may be understood that the plurality of page access requests may cause a larger amount of page rendering tasks corresponding to the server; in addition, there may be a large number of page rendering tasks before the server obtains the page access request sent by the current client. In contrast, when the current page rendering task amount is larger than a preset request amount threshold, the server returns a single-page application (Single Page Application, SPA) page corresponding to the page requested by the page access request to the client; the SPA page is used for client rendering. For example, the SPA page can be a server pre-generated unrendered cached page. In the embodiment of the disclosure, after receiving the SPA page corresponding to the page requested by the page access request sent by the server, the client may render and display the SPA page. Specifically, the server returns the SPA page file to the client, and the client renders and displays the corresponding SPA page after analyzing the SPA page file. Illustratively, the server returns the static HTML file corresponding to the SPA page to the client, which renders and displays (e.g., in a browser).
In the related art, since the client rendering (Client Side Rende, CSR) takes a long time, in order to shorten the rendering time, a server rendering (Server Side Render, SSR) is generally adopted, however, when the amount of the rendering task of the server is large, the access pressure to the database or other data sources is very large, and at this time, the page rendering takes a very long time, so that the server is easy to get stuck when performing the page rendering with respect to the current page access request.
In this regard, in the embodiment of the present disclosure, after the server obtains the page access request sent by the client, in response to the current page rendering task amount of the server being greater than the preset request amount threshold, the SPA page corresponding to the page requested by the page access request is returned to the client for rendering by the client, so that when the page rendering task amount of the server is greater, the server is not required to render, the load of the server can be reduced, and thus the occurrence of a jam of the page requested by the page access request can be reduced.
In some embodiments, the method further comprises:
determining a rendered page corresponding to the page access request in response to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold;
And returning the rendered page to the client.
In the embodiment of the disclosure, a server determines a rendered page corresponding to a page access request in response to the current page rendering task amount of the server being less than or equal to a preset request amount threshold; and returning the rendered page to the client. As described above, when the current page rendering task amount of the server is greater than the preset request amount threshold, the load of the server is higher, and correspondingly, when the current page rendering task amount of the server is less than or equal to the preset request amount threshold, the load of the server is smaller. And under the condition that the load of the server side is allowed, determining a rendering page corresponding to the page access request by the server side, and returning the rendering page to the client side. Specifically, the server may determine a rendering page corresponding to the page access request according to an address (e.g., URL address) in the page access request, then obtain data of the rendering page corresponding to the page access request from a database or other data sources, then render the page according to the data, generate a file (e.g., an HTML file) in a file format in the page access request, and then send the generated file to the client, where the file is parsed and displayed (e.g., displayed in a browser) by the client.
In the embodiment of the disclosure, the server determines a rendering page corresponding to a page access request in response to the current page rendering task amount of the server being less than or equal to a preset request amount threshold, and returns the rendering page to the client. On the one hand, the server side renders, the time for extracting data from the database by the server side is short, the speed for generating the rendered page is high, and on the other hand, the client side receives the rendered page, so that the response speed of the page is increased.
In some embodiments, the method further comprises:
acquiring a function configuration request sent by the client;
returning to a function configuration page corresponding to the function configuration request;
and receiving the preset request quantity threshold configured by the client based on the displayed function configuration page.
In the embodiment of the disclosure, a client sends a function configuration request to a server, and the server acquires the function configuration request sent by the client. It should be noted that the user who sends the function configuration request through the client may be different from the user who sends the page access request through the client. For example, the user who sends the function configuration request through the client may be a professional technician or a professional maintainer who develops the page processing method, and the user who sends the page access request through the client may be a mass user.
In the embodiment of the disclosure, a server returns a function configuration page corresponding to a function configuration request to a client, and the server generates a corresponding function configuration page file according to the function configuration request and returns the function configuration page file to the client. The server may generate a page structure of a corresponding function configuration page, a variable or static data corresponding to a page component, and the like according to the function configuration request, then render the page according to the page structure, the data corresponding to the page component, and the like, generate a function configuration page file corresponding to the function configuration request, and then send the generated function configuration page file to the client, where the client analyzes and displays the function configuration page file.
In the embodiment of the disclosure, the client may configure the preset request amount threshold based on the displayed function configuration page. For example, the client may configure one unified preset request amount threshold, or may configure a plurality of different preset request amount thresholds. Because of the data interaction between the server and the client, the server can receive a preset request quantity threshold value configured by the client based on the displayed functional configuration page. In the embodiment of the disclosure, the server may further modify the function configuration page file based on the received preset request amount threshold, and return the modified function configuration page file to the client. It should be noted that, the client does not need to configure the preset request amount threshold before sending the page access request to the server each time; the preset request amount threshold can be permanently configured before the page access request is sent for the first time, or can be configured when the preset request amount threshold needs to be modified.
In the embodiment of the disclosure, a server acquires a function configuration request sent by a client, returns a function configuration page corresponding to the function configuration request, and receives a preset request quantity threshold configured by the client based on the displayed function configuration page. Based on this, the client may dynamically set a preset request amount threshold.
In some embodiments, the method further comprises:
receiving a page type of whether page caching is performed or not, which is configured by the client based on the displayed function configuration page;
generating a cache identifier for indicating whether a page corresponding to the page type is a cache page according to a configuration result of the page type of whether page cache is performed;
determining a target page type of a page requested by the page access request according to the page access request;
the responding to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold value, determining the rendered page corresponding to the page access request comprises the following steps:
and responding to the fact that the current page rendering task amount of the server side is smaller than or equal to the preset request amount threshold, and determining a rendering page corresponding to the page access request according to the cache identifier corresponding to the target page type.
In the embodiment of the disclosure, the client terminal configures the page based on the displayed function, and can configure the page type of whether to perform page buffering or not besides configuring the preset request amount threshold. Exemplary pages for which page types correspond include active pages, personal centers, my orders, my coupons, pages on us, home pages, item detail pages, and the like. The page type may be a page type (e.g., active page, personal center, my order, my coupon, about us, etc.) for performing page caching, since the content of the page is easy to change, if the content changes, the page needs to be regenerated, and the generated page does not need to be cached; the page type may also be a page type (e.g., homepage, commodity detail page, etc.) that does not undergo page caching, and since the content of the page is unchanged, after the page is generated by primary rendering, in order to reduce the repeated rendering operations, the generated page may be subjected to caching operations. It should be noted that, the client does not need to configure whether the page corresponding to the page type needs to be cached before sending the page access request to the server each time; the page type may be permanently configured prior to the initial sending of the page access request, or may be configured when the page type needs to be modified.
In the embodiment of the disclosure, after receiving a page type of whether page caching is performed or not configured by a client based on a displayed function configuration page, a server generates a cache identifier indicating whether a page corresponding to the page type is a cache page according to a configuration result of whether page caching is performed or not. When the configuration result is a page type without page caching, correspondingly generating a cache identifier for representing that the page corresponding to the page type is a non-cache page, wherein the cache identifier can be represented by a numeral 0 by way of example; when the configuration result is that the page type of the page cache is performed, a cache identifier which indicates that the page corresponding to the page type is a cache page is correspondingly generated, and the cache identifier can be represented by the numeral 1 by way of example.
In addition, compared with the rendering task amount corresponding to the page whose content is unchanged, the rendering task amount corresponding to the page whose content is changed at the moment is larger, that is, the rendering task amount corresponding to the cache page is generally smaller than the rendering task amount corresponding to the non-cache page, based on this, it can be known that the rendering task amounts corresponding to different page types may be different, and therefore, in the embodiment of the present disclosure, the client may set different preset request amount thresholds based on different page types.
In the embodiment of the disclosure, after receiving the page request, the server determines the target page type to which the page requested by the page access request belongs, and determines the rendered page corresponding to the page access request according to the cache identifier corresponding to the target page type in response to the current page rendering task amount of the server being less than or equal to the preset request amount threshold. For example, if the cache identifier corresponding to the target page type characterizes that the page requested by the page access request is a non-cache page, the rendering page corresponding to the page access request is a non-cache page; if the cache identifier corresponding to the target page type characterizes that the page requested by the page access request is a cache page, the rendering page corresponding to the page access request is the cache page. In addition, in the embodiment of the present disclosure, after the corresponding rendering page is generated for the first time, the rendering page may be cached.
In the embodiment of the disclosure, a server determines a rendering page corresponding to a page access request according to a cache identifier corresponding to a target page type. For the cache identifier to represent that the page requested by the page access request is a rendering page corresponding to the cache page, there may be a cache, and the server may find the rendering page in the cache, so that the rendering pressure of the server may be reduced.
In some embodiments, the determining, according to the cache identifier corresponding to the target page type, the rendered page corresponding to the page access request includes:
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, rendering and generating the page requested by the page access request, and obtaining the rendered page;
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, determining whether the cached rendering page exists in the page requested by the page access request, and determining the rendering page corresponding to the page access request according to the determination result of whether the cached rendering page exists.
In the embodiment of the disclosure, a server side responds to a cache identifier corresponding to a target page type to represent that a page requested by a page access request is a non-cache page, renders and generates the page requested by the page access request, and obtains a rendered page.
In the embodiment of the disclosure, a server side responds to a cache identifier corresponding to a target page type to represent that a page requested by a page access request is a cache page, the server side firstly determines whether the cached rendering page exists in the page requested by the page access request, and then determines the rendering page corresponding to the page access request according to a determination result of whether the cached rendering page exists. The determination result may be a determination result indicating that the cached rendering page exists, or may be a determination result indicating that the cached rendering page does not exist.
In the embodiment of the disclosure, the server side responds to the cache identifier corresponding to the target page type to represent that the page requested by the page access request is a cache page, and determines whether the cached rendering page exists in the page requested by the page access request.
In some embodiments, the determining, according to a determination result of whether the cached rendered page exists, the rendered page corresponding to the page access request includes:
responding to the determination result to represent that a cached rendering page exists, and taking the cached rendering page as a rendering page corresponding to the page access request;
and responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page.
In the embodiment of the disclosure, a server side responds to a determination result to represent a cached rendering page, and the cached rendering page is used as a rendering page corresponding to a page access request; correspondingly, responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page. It can be understood that under the condition that the cached rendering page exists, the rendering pressure of the server can be reduced due to the existing cached page, and the response speed of the page is accelerated due to the fact that the page does not need to be generated by rendering.
In some embodiments, the preset request amount threshold includes a first preset request amount threshold corresponding to a cached page and a second preset request amount threshold corresponding to a non-cached page;
the responding to the current page rendering task amount of the server is larger than a preset request amount threshold, and the returning the SPA page corresponding to the page requested by the page access request to the client comprises the following steps:
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the first preset request amount threshold;
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the second preset request amount threshold; wherein the first preset request amount threshold is smaller than the second preset request amount threshold.
In the embodiment of the disclosure, the server-side preset request quantity threshold includes a first preset request quantity threshold corresponding to a cached page and a second preset request quantity threshold corresponding to a non-cached page. Based on the foregoing analysis, the rendering task amount corresponding to the cached page is generally smaller than the rendering task amount corresponding to the non-cached page, and for this reason, in the embodiment of the present disclosure, the first preset request amount threshold is smaller than the second preset request amount threshold.
In the embodiment of the disclosure, after determining a target page type to which a page requested by a page access request belongs, a server side responds to a cache identifier corresponding to the target page type to represent that the page requested by the page access request is a cache page, compares a current page rendering task amount with a first preset request amount threshold, and returns an SPA page corresponding to the page requested by the page access request to a client side if the current page rendering task amount of the server side is greater than the first preset request amount threshold.
Correspondingly, in the embodiment of the disclosure, the server side responds to the cache identifier corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, compares the current page rendering task amount with a second preset request amount threshold, and returns the SPA page corresponding to the page requested by the page access request to the client side if the current page rendering task amount of the server side is greater than the second preset request amount threshold.
In the embodiment of the disclosure, the server returns an SPA page corresponding to a page requested by a page access request to the client in response to the current page rendering task amount being greater than a preset request amount threshold corresponding to a target page type. Because the preset request quantity threshold values corresponding to different page types are different, according to the cache identification corresponding to the different page types, a more accurate comparison result of the current page rendering task quantity and the preset request quantity threshold value corresponding to the cache identification can be obtained, and therefore whether the load of the server side is overlarge can be judged more accurately.
Fig. 2 is a second implementation flow diagram of a page processing method according to an embodiment of the present disclosure, which is applied to a client, as shown in fig. 2, and the method includes the following steps:
s201, sending a page access request to a server;
s202, receiving an SPA page corresponding to a page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
and S203, rendering the SPA page.
The page processing method disclosed by the embodiment of the invention can be applied to the electronic equipment. The electronic device of the disclosed application may be a client device. The client comprises, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, a smart device and the like.
In the embodiment of the disclosure, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and an artificial intelligent platform.
In the embodiment of the disclosure, a client sends a page access request to a server, the server determines the current page rendering task amount of the server according to the page access request after obtaining the page access request sent by the client, and when the current page rendering task amount of the server is greater than a preset request amount threshold, the server returns an SPA page corresponding to a page requested by the page access request to the client.
In the embodiment of the disclosure, after receiving an SPA page corresponding to a page requested by a page access request sent by a server, a client renders and displays the SPA page. Specifically, after receiving an SPA page file corresponding to a page requested by a page access request returned by a server, a client analyzes the SPA page file, and renders and displays a corresponding SPA page.
In the embodiment of the disclosure, a client renders an SPA page corresponding to a page requested by a page access request sent by a receiving server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request. When the page rendering task amount is large, the client renders the SPA page without the server, so that the load of the server can be reduced, and the occurrence of the jam of the page requested by the page access request can be reduced.
In some embodiments, the method further comprises:
sending a function configuration request to the server;
receiving and displaying a function configuration page corresponding to the function configuration request sent by the server;
based on the displayed function configuration page, acquiring the configured preset request quantity threshold value and sending the configured preset request quantity threshold value to the server.
In the embodiment of the disclosure, a client sends a function configuration request to a server. It should be noted that the user who sends the function configuration request through the client may be different from the user who sends the page access request through the client.
In the embodiment of the disclosure, after acquiring a function configuration request sent by a client, a server generates a corresponding function configuration page file according to the function configuration request, returns the function configuration page file to the client, and the client receives and displays the function configuration page file.
In the embodiment of the disclosure, the client obtains the preset request amount threshold of configuration based on the displayed function configuration page and sends the preset request amount threshold to the server, and the client can receive the preset request amount threshold of the client configured based on the displayed function configuration page, modify the function configuration page file based on the received preset request amount threshold, and return the modified function configuration page file to the client. It should be noted that, the client does not need to configure the preset request amount threshold before sending the page access request to the server each time; the preset request amount threshold can be permanently configured before the page access request is sent for the first time, or can be configured when the preset request amount threshold needs to be modified.
In the embodiment of the disclosure, a client receives and displays a function configuration page corresponding to a function configuration request sent by a server; based on the displayed function configuration page, acquiring a preset request quantity threshold value of configuration and sending the preset request quantity threshold value to the server. Based on this, the client may dynamically set a preset request amount threshold.
In some embodiments, the method further comprises:
based on the displayed function configuration page, acquiring a configuration result of the page type of whether page caching is performed or not;
The configuration result is sent to the server; the configuration result is used for generating a cache identifier representing whether a page corresponding to the page type is a cache page or not by the server, wherein the cache identifier is used for determining that the current page rendering task amount is smaller than or equal to the preset request amount threshold value and determining a rendering page corresponding to the page access request by the server.
In the embodiment of the disclosure, the client terminal can configure the page type of whether to perform page caching or not based on the displayed function configuration page, besides the preset request amount threshold, acquire the configuration result of the page type, and send the acquired configuration result to the server terminal. It should be noted that, the client does not need to configure whether the page corresponding to the page type needs to be cached before sending the page access request to the server each time; the page type may be permanently configured prior to the initial sending of the page access request, or may be configured when the page type needs to be modified. After receiving the configuration result of the page type sent by the client whether to perform page caching, the server can generate a cache identifier indicating whether the page corresponding to the page type is a cache page according to the configuration result. The server side can also determine a rendered page corresponding to the page access request according to the cache identification when determining that the current page rendering task amount is smaller than or equal to a preset request amount threshold.
In the embodiment of the disclosure, the client obtains a configuration result of a page type of whether to perform page caching based on the displayed function configuration page, and the server determines a rendering page corresponding to the page access request according to a cache identifier corresponding to the target page type. For the cache identifier to represent that the page requested by the page access request is a rendering page corresponding to the cache page, there may be a cache, and the server may find the rendering page in the cache, so that the rendering pressure of the server may be reduced.
Fig. 3 is a schematic diagram of a realization flow of a page processing method according to an embodiment of the present disclosure, which is applied to a server, as shown in fig. 3, and the method includes the following steps:
s301, acquiring a page access request sent by a client.
In the embodiment of the disclosure, a client sends a request to a server, and the server obtains the request sent by the client. The request sent by the client to the server comprises a function configuration request and a page access request.
S302, judging whether the function configuration request is made; if yes, go to step S303; if not, go to step S304.
In the embodiment of the present disclosure, the server side determines whether the received request is a function configuration request, and if the function configuration request sent by the client side is obtained, step S303 is executed; if the page access request sent by the client is obtained, step S304 is executed.
S303, directly returning.
In the embodiment of the disclosure, the server returns a function configuration page corresponding to the function configuration request.
S304, obtaining the flow limiting strategy through the step S305, and analyzing the flow limiting strategy through the service flow limiting middleware.
In the embodiment of the present disclosure, the server obtains a current limiting policy (preset request amount threshold) through step S305, determines, according to a page access request, a target page type to which a page requested by the page access request belongs, and selects a corresponding preset request amount threshold according to the target page type.
S305, acquiring a current limiting strategy.
In the embodiment of the disclosure, a server acquires a preset request quantity threshold configured by a client based on a displayed function configuration page. The preset request quantity threshold value comprises a first preset request quantity threshold value corresponding to the cache page and a second preset request quantity threshold value corresponding to the non-cache page.
S306, obtaining a cache page current limiting strategy.
In the embodiment of the disclosure, a server acquires a first preset request amount threshold corresponding to a cache page.
S307, obtaining a non-cache page current limiting strategy.
In the embodiment of the disclosure, the server acquires a second preset request quantity threshold corresponding to the non-cache page.
S308, judging whether current limiting is needed; if yes, go to step S309; if not, go to step S310.
In the embodiment of the present disclosure, after determining the current page rendering task amount according to the page access request, the server determines whether the current page rendering task amount is greater than the preset request amount threshold according to the preset request amount threshold determined in step S304. If the current page rendering task amount is greater than the preset request amount threshold, executing step S309; if the current page rendering task amount is less than or equal to the preset request amount threshold, step S310 is performed.
S309, returning to the SPA page.
In the embodiment of the disclosure, the server returns the SPA page corresponding to the page requested by the page access request to the client, and the SPA page is rendered and displayed by the client.
S310, obtaining the cache configuration through the step S311, and analyzing the cache configuration through the cache middleware.
In the embodiment of the present disclosure, the server obtains the cache configuration (whether to perform the page type of the page cache) through step S311, and then analyzes the cache configuration (generates the cache identifier indicating whether the page corresponding to the page type is the cache page) according to the configuration result of the page type of the page cache.
S311, obtaining a cache configuration.
In the embodiment of the disclosure, a server acquires a page type of whether page caching is performed or not according to the displayed function configuration page configuration of a client.
S312, judging whether buffering is needed; if yes, go to step S313; if not, go to step S314.
In the embodiment of the disclosure, the server side judges whether caching is needed according to the generation of the cache identifier indicating whether the page corresponding to the page type is the cache page. If a cache identifier which indicates that the page corresponding to the page type is a cache page is generated, indicating that caching is needed; if a cache identifier indicating that the page corresponding to the page type is a non-cache page is generated, the cache is not needed.
S313, judging whether a cache exists or not; if yes, go to step S316; if not, go to step S314.
In the embodiment of the present disclosure, when generating the cache identifier that characterizes the page corresponding to the page type as the cached page, the server needs to further determine whether the page requested by the page access request has a cache.
S314, rendering through a renderer.
In the embodiment of the disclosure, a server side responds to a determination result to represent a rendering page without a cache, renders and generates a page requested by a page access request, and obtains the rendering page.
S315, storing the page into a cache.
In the embodiment of the disclosure, after obtaining a rendering page, the server stores the rendering page in a cache.
S316, returning the cache page data.
In the embodiment of the disclosure, a server side responds to a determination result to represent a cached rendering page, takes the cached rendering page as a rendering page corresponding to a page access request, and returns the rendering page to a client side.
In the embodiment of the disclosure, when the current page rendering task amount of the server side is greater than the preset request amount threshold, the server side returns the SPA page corresponding to the page requested by the page access request to the client side, and the client side renders the SPA page, so that when the page rendering task amount of the server side is greater, the server side does not need to render, the load of the server side can be reduced, and the occurrence of the jam of the page requested by the page access request can be reduced.
FIG. 4 is an interactive schematic diagram of a page processing system, as shown in FIG. 4, according to an embodiment of the disclosure, including the following steps:
s401, the client side sends a page access request to the server side.
In an embodiment of the disclosure, a page processing system includes a server and a client. The client sends a page access request to the server, and the server acquires the page access request sent by the client.
S402, the server determines the current page rendering task amount of the server according to the page access request.
In the embodiment of the disclosure, after acquiring a page access request sent by a client, a server determines the current page rendering task amount of the server according to the page access request.
S403, the server returns the SPA page corresponding to the page requested by the page access request to the client in response to the current page rendering task amount of the server being greater than the preset request amount threshold.
In the embodiment of the disclosure, the server returns the SPA page corresponding to the page requested by the page access request to the client in response to the current page rendering task amount of the server being greater than the preset request amount threshold.
S404, rendering the SPA page by the client.
In the embodiment of the disclosure, a client receives an SPA page corresponding to a page requested by a page access request sent by a server, and renders the SPA page.
In the embodiment of the disclosure, after the server side obtains the page access request sent by the client side, the current page rendering task amount of the server side is larger than the preset request amount threshold, and the SPA page corresponding to the page requested by the page access request is returned to the client side for rendering by the client side, so that when the page rendering task amount of the server side is larger, the server side is not required to render, the load of the server side can be reduced, and the occurrence of the condition that the page requested by the page access request is stuck can be reduced.
Fig. 5 is a schematic diagram of a page processing apparatus applied to a server according to an embodiment of the disclosure. As shown in fig. 5, the page processing apparatus 500 includes:
a first obtaining module 501, configured to obtain a page access request sent by a client;
a first determining module 502, configured to determine, according to the page access request, a current page rendering task amount of the server;
a first sending module 503, configured to return, to the client, an SPA page corresponding to a page requested by the page access request in response to the current page rendering task amount of the server being greater than a preset request amount threshold; the SPA page is used for rendering by the client.
In some embodiments, the apparatus further comprises:
a second determining module 504, configured to determine, in response to the current page rendering task amount of the server being less than or equal to the preset request amount threshold, a rendered page corresponding to the page access request;
and the third sending module 505 is configured to return the rendered page to the client.
In some embodiments, the apparatus further comprises:
a second obtaining module 506, configured to obtain a function configuration request sent by the client;
A fourth sending module 507, configured to return a function configuration page corresponding to the function configuration request;
and a second receiving module 508, configured to receive the preset request amount threshold configured by the client based on the displayed function configuration page.
In some embodiments, the apparatus further comprises:
a third receiving module 509, configured to receive a page type of whether the client performs page buffering based on the displayed function configuration page configuration;
the generating module 510 is configured to generate, according to a configuration result of a page type of whether to perform page caching, a cache identifier that characterizes whether a page corresponding to the page type is a cached page;
a third determining module 511, configured to determine, according to the page access request, a target page type to which a page requested by the page access request belongs;
the second determining module 504 is further configured to determine, according to a cache identifier corresponding to the target page type, a rendered page corresponding to the page access request, in response to the current page rendering task amount of the server being less than or equal to the preset request amount threshold.
In some embodiments, the second determining module 504 is further configured to render and generate the page requested by the page access request to obtain the rendered page in response to the cache identifier corresponding to the target page type indicating that the page requested by the page access request is a non-cached page; responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, determining whether the cached rendering page exists in the page requested by the page access request, and determining the rendering page corresponding to the page access request according to the determination result of whether the cached rendering page exists.
In some embodiments, the second determining module 504 is further configured to characterize, in response to the determination result, that a cached rendered page exists, and use the cached rendered page as the rendered page corresponding to the page access request; and responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page.
In some embodiments, the preset request amount threshold includes a first preset request amount threshold corresponding to a cached page and a second preset request amount threshold corresponding to a non-cached page;
the first sending module 503 is further configured to, in response to the cache identifier corresponding to the target page type indicating that the page requested by the page access request is a cache page, and the current page rendering task amount of the server is greater than the first preset request amount threshold, return an SPA page corresponding to the page requested by the page access request to the client; responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the second preset request amount threshold; wherein the first preset request amount threshold is smaller than the second preset request amount threshold.
Fig. 6 is a schematic diagram of a page processing apparatus applied to a client according to an embodiment of the disclosure. As shown in fig. 6, the page processing apparatus 600 includes:
a second sending module 601, configured to send a page access request to a server;
a first receiving module 602, configured to receive an SPA page corresponding to a page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
and the rendering module 603 is configured to render the SPA page.
In some embodiments, the apparatus further comprises:
a fifth sending module 604, configured to send a function configuration request to the server;
the display module 605 is configured to receive and display a function configuration page corresponding to the function configuration request sent by the server;
a sixth sending module 606, configured to obtain the configured preset request amount threshold based on the displayed function configuration page, and send the preset request amount threshold to the server.
In some embodiments, the apparatus further comprises:
a third obtaining module 607, configured to obtain a configuration result of a page type of whether to perform page caching based on the displayed function configuration page;
A seventh sending module 608, configured to send the configuration result to the server; the configuration result is used for generating a cache identifier representing whether a page corresponding to the page type is a cache page or not by the server, wherein the cache identifier is used for determining that the current page rendering task amount is smaller than or equal to the preset request amount threshold value and determining a rendering page corresponding to the page access request by the server.
Fig. 7 is a block diagram one of an electronic device 700 shown in an embodiment of the disclosure. Wherein the electronic device 700 may be a server. Referring to fig. 7, device 700 includes a processing component 722 that further includes one or more processors and memory resources represented by memory 732 for storing instructions, such as applications, executable by processing component 722. The application programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the network provisioning method described above.
The device 700 may also include a power component 726 configured to perform power management of the device 700, a wired or wireless network interface 750 configured to connect the device 700 to a network, and an input output (I/O) interface 758. The device 700 may operate based on an operating system stored in memory 732, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as memory 732, comprising instructions executable by processing component 722 of device 700 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of a server, enables the server to perform a page processing method, the method comprising:
acquiring a page access request sent by a client;
determining the current page rendering task amount of the server according to the page access request;
responding to the current page rendering task amount of the server side is larger than a preset request amount threshold, and returning an SPA page corresponding to a page requested by the page access request to the client side; the SPA page is used for rendering by the client.
Fig. 8 is a block diagram two of an electronic device 800, shown in accordance with an embodiment of the present disclosure. Wherein the electronic device 800 may be a client.
Referring to fig. 8, an electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen between the electronic device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of a user's contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as Wi-Fi,4G, or 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of electronic device 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of a client, enables the client to perform a page processing method, the method comprising:
sending a page access request to a server;
receiving an SPA page corresponding to a page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
rendering the SPA page.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A method for processing a page, which is applied to a server, the method comprising:
acquiring a page access request sent by a client;
determining the current page rendering task amount of the server according to the page access request;
responding to the current page rendering task amount of the server side is larger than a preset request amount threshold, and returning an SPA page corresponding to a page requested by the page access request to the client side; the SPA page is used for rendering by the client.
2. The method according to claim 1, wherein the method further comprises:
determining a rendered page corresponding to the page access request in response to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold;
and returning the rendered page to the client.
3. The method according to claim 2, wherein the method further comprises:
acquiring a function configuration request sent by the client;
returning to a function configuration page corresponding to the function configuration request;
and receiving the preset request quantity threshold configured by the client based on the displayed function configuration page.
4. A method according to claim 3, characterized in that the method further comprises:
receiving a page type of whether page caching is performed or not, which is configured by the client based on the displayed function configuration page;
generating a cache identifier for indicating whether a page corresponding to the page type is a cache page according to a configuration result of the page type of whether page cache is performed;
determining a target page type of a page requested by the page access request according to the page access request;
the responding to the current page rendering task amount of the server being smaller than or equal to the preset request amount threshold value, determining the rendered page corresponding to the page access request comprises the following steps:
and responding to the fact that the current page rendering task amount of the server side is smaller than or equal to the preset request amount threshold, and determining a rendering page corresponding to the page access request according to the cache identifier corresponding to the target page type.
5. The method of claim 4, wherein the determining the rendered page corresponding to the page access request according to the cache identifier corresponding to the target page type comprises:
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, rendering and generating the page requested by the page access request, and obtaining the rendered page;
Responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, determining whether the cached rendering page exists in the page requested by the page access request, and determining the rendering page corresponding to the page access request according to the determination result of whether the cached rendering page exists.
6. The method according to claim 5, wherein the determining the rendered page corresponding to the page access request according to the determination result of whether the cached rendered page exists comprises:
responding to the determination result to represent that a cached rendering page exists, and taking the cached rendering page as a rendering page corresponding to the page access request;
and responding to the determined result to represent the rendering page without the cache, rendering and generating the page requested by the page access request, and obtaining the rendering page.
7. The method of claim 4, wherein the preset request amount threshold comprises a first preset request amount threshold corresponding to a cached page and a second preset request amount threshold corresponding to a non-cached page;
the responding to the current page rendering task amount of the server is larger than a preset request amount threshold, and the returning the SPA page corresponding to the page requested by the page access request to the client comprises the following steps:
Responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the first preset request amount threshold;
responding to the cache identification corresponding to the target page type to represent that the page requested by the page access request is a non-cache page, and returning an SPA page corresponding to the page requested by the page access request to the client, wherein the current page rendering task amount of the server is larger than the second preset request amount threshold; wherein the first preset request amount threshold is smaller than the second preset request amount threshold.
8. A method for processing a page, the method being applied to a client, the method comprising:
sending a page access request to a server;
receiving an SPA page corresponding to a page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
Rendering the SPA page.
9. The method of claim 8, wherein the method further comprises:
sending a function configuration request to the server;
receiving and displaying a function configuration page corresponding to the function configuration request sent by the server;
based on the displayed function configuration page, acquiring the configured preset request quantity threshold value and sending the configured preset request quantity threshold value to the server.
10. The method according to claim 9, wherein the method further comprises:
based on the displayed function configuration page, acquiring a configuration result of the page type of whether page caching is performed or not;
the configuration result is sent to the server; the configuration result is used for generating a cache identifier representing whether a page corresponding to the page type is a cache page or not by the server, wherein the cache identifier is used for determining that the current page rendering task amount is smaller than or equal to the preset request amount threshold value and determining a rendering page corresponding to the page access request by the server.
11. A page processing apparatus, for application to a server, the apparatus comprising:
the first acquisition module is used for acquiring a page access request sent by the client;
The first determining module is used for determining the current page rendering task amount of the server according to the page access request;
the first sending module is used for responding to the fact that the current page rendering task amount of the server side is larger than a preset request amount threshold value, and returning SPA pages corresponding to the pages requested by the page access request to the client side; the SPA page is used for rendering by the client.
12. A page processing apparatus, for application to a client, the apparatus comprising:
the second sending module is used for sending a page access request to the server;
the first receiving module is used for receiving an SPA page corresponding to the page requested by the page access request sent by the server; the SPA page is sent after the server determines that the current page rendering task amount of the server is greater than a preset request amount threshold according to the page access request;
and the rendering module is used for rendering the SPA page.
13. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 or 8 to 10 when the program is executed.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any one of claims 1 to 7 or claims 8 to 10.
CN202310626662.9A 2023-05-30 2023-05-30 Page processing method and device, electronic equipment and storage medium Pending CN116662689A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310626662.9A CN116662689A (en) 2023-05-30 2023-05-30 Page processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310626662.9A CN116662689A (en) 2023-05-30 2023-05-30 Page processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116662689A true CN116662689A (en) 2023-08-29

Family

ID=87721866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310626662.9A Pending CN116662689A (en) 2023-05-30 2023-05-30 Page processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116662689A (en)

Similar Documents

Publication Publication Date Title
CN107329743B (en) Application page display method and device and storage medium
TWI528282B (en) Method for customizing launching of applications
CN105912693B (en) Network request processing method, network data acquisition method, network request processing device and network data acquisition device, and server
EP3561691B1 (en) Method and apparatus for displaying webpage content
JP6062608B2 (en) Web page access method, apparatus, server, terminal, program, and recording medium
US10909203B2 (en) Method and device for improving page display effect via execution, conversion and native layers
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
CN117390330A (en) Webpage access method and device
CN109040339B (en) Cross-domain request processing method, device and equipment based on AJAX
KR101777035B1 (en) Method and device for filtering address, program and recording medium
CN115061745A (en) Page resource preloading method and device and storage medium
CN110413169B (en) Information display method, device and medium
CN111159615A (en) Webpage processing method and device
CN109525652B (en) Information sharing method, device, equipment and storage medium
CN111639276A (en) Resource preloading method and device and storage medium
CN105808304B (en) Code deployment method, device and system
CN107220371B (en) Page display method and device and storage medium
CN111079040B (en) Resource sniffing method, device, terminal, server and storage medium
CN111695064B (en) Buried point loading method and device
CN105630948B (en) Network page display method and device
CN111782997A (en) Method and device for loading webpage and storage medium
CN116662689A (en) Page processing method and device, electronic equipment and storage medium
CN110390065B (en) Webpage acquisition method, device and system
CN109766501B (en) Crawler protocol management method and device and crawler system
CN108563712B (en) Webpage picture viewing method and device and storage equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination