CN114186148A - Page loading method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114186148A
CN114186148A CN202111357221.0A CN202111357221A CN114186148A CN 114186148 A CN114186148 A CN 114186148A CN 202111357221 A CN202111357221 A CN 202111357221A CN 114186148 A CN114186148 A CN 114186148A
Authority
CN
China
Prior art keywords
interface
request
data
uniform resource
page loading
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
CN202111357221.0A
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.)
Chengdu Yuntian Lifei Technology Co ltd
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Chengdu Yuntian Lifei Technology Co ltd
Shenzhen Intellifusion Technologies 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 Chengdu Yuntian Lifei Technology Co ltd, Shenzhen Intellifusion Technologies Co Ltd filed Critical Chengdu Yuntian Lifei Technology Co ltd
Priority to CN202111357221.0A priority Critical patent/CN114186148A/en
Publication of CN114186148A publication Critical patent/CN114186148A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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

Abstract

The invention discloses a page loading method, a page loading device, electronic equipment and a storage medium, wherein the page loading method comprises the steps of obtaining a page loading request, wherein the page loading request comprises a plurality of interface requests; according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; the comparison result is used for indicating a data path for acquiring page loading; acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result; and loading the page based on the data to be loaded. Therefore, interface cache data or interface requests can be quickly returned, the page loading speed is increased, the application page presentation speed is greatly improved during loading and switching, the server load is reduced, and a plurality of repeated requests are omitted.

Description

Page loading method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computer application, in particular to a page loading method and device, electronic equipment and a storage medium.
Background
As the new features related to HTML5 become more widely used, web applications are given more functions, with greater expressiveness and more complex interaction logic. This often means that a larger volume of static resources needs to be loaded, several underlying data interfaces are requested as preconditions before the web page load \ switch is completed — these preconditions may bring a poor page user experience: such as "white screen" or page partial display anomalies; in addition, the redundant interface requests may bring extra load to the server: such as a page being refreshed or switched, a series of interfaces will repeat the request, however the returned content of these interfaces is likely to be identical to the previous request. That is, in the prior art, the page loading speed is slow due to redundant interface requests, the application page is dull in loading and switching, and the server load is high, so that many repeated requests are increased.
Disclosure of Invention
The embodiment of the invention provides a page loading method, which can realize the quick return of interface cache data or an interface request by comparing a uniform resource locator in the interface request with a uniform resource locator in a configuration table, has the advantages of accelerating the page loading speed, greatly improving the presentation speed of an application page during loading and switching, reducing the load of a server and omitting a plurality of repeated requests.
In a first aspect, an embodiment of the present invention provides a page loading method, including:
acquiring a page loading request, wherein the page loading request comprises a plurality of interface requests;
according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; the comparison result is used for indicating a data path for acquiring page loading;
acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result;
and loading the page based on the data to be loaded.
Optionally, the comparing, according to the multiple interface requests, the uniform resource locator in the interface request with the uniform resource locator in the configuration table to obtain a comparison result includes:
intercepting the plurality of interface requests included in the page loading request, and acquiring uniform resource locators of the interface requests;
for each interface request, determining whether a uniform resource locator of the interface request hits a uniform resource locator in the configuration table to obtain the comparison result;
if the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, determining that the interface request is a first type data request for acquiring request data in a cache mode;
and if the uniform resource locator of the interface request is not hit in the uniform resource locator in the configuration table, determining that the interface request is a second-class data request for acquiring the request data in a network request mode.
Optionally, the page loading method further includes:
based on a transactional database encapsulation tool class, using a character string generated by a user identifier, a request parameter key name and a uniform resource locator as a unique identifier of interface cache data, wherein the unique identifier is used as index information to retrieve corresponding interface cache data;
integrating the tool classes to construct an objective function of the interface cache data, and adding the objective function to a global function;
constructing the request adapter through an open source library according to the tool class and the preset caching rule;
adding the request adapter into a global function to intercept each interface request; wherein the target function is to be called within the global function.
Optionally, the obtaining, according to the comparison result, request data corresponding to the plurality of interface requests as data to be loaded includes:
when the interface request is a first-class data request, generating a unique identifier of the interface request data based on a uniform resource locator in the first-class data request and a user identifier, a request parameter and a request parameter key name carried in the interface request data corresponding to the hit uniform resource locator;
and inquiring interface cache data according to the unique identifier to determine the interface cache data corresponding to the unique identifier as the data to be loaded.
Optionally, the querying interface cache data according to the unique identifier to determine interface cache data corresponding to the unique identifier, where as the data to be loaded, includes:
inquiring interface cache data according to the unique identifier, and judging whether index information of the associated interface cache data exists or not;
and when index information of the associated interface cache data exists, determining the interface cache data corresponding to the unique identifier according to the associated index information.
Optionally, when there is index information of the associated interface cache data, determining, according to the associated index information, the interface cache data corresponding to the unique identifier includes:
when index information of associated interface cache data exists, determining cache time corresponding to the interface cache data according to a character string of the index information;
judging whether the interface cache data is expired according to the cache time;
when the interface cache data is not expired, taking the interface cache data as data to be loaded;
and when the interface cache data is expired, determining the network request data corresponding to the unique identifier as the data to be loaded.
Optionally, obtaining, according to the comparison result, request data corresponding to the plurality of interface requests as data to be loaded includes:
when the interface request is a second-class data request, determining corresponding network request data according to a uniform resource locator of the interface request;
and taking the network request data as data to be loaded for loading.
In a third aspect, an embodiment of the present invention provides a page loading apparatus, where the apparatus includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a page loading request which comprises a plurality of interface requests;
the comparison module is used for comparing the uniform resource locators in the interface requests and the uniform resource locators in the configuration table to obtain comparison results according to the plurality of interface requests; the comparison result is used for indicating a data path for acquiring page loading;
the determining module is used for acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result;
and the loading module is used for loading the page based on the data to be loaded.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the page loading method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps in the page loading method provided by the embodiment of the invention when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the page loading method provided in the embodiment of the present invention.
The page loading method provided by the invention firstly obtains a page loading request, wherein the page loading request comprises a plurality of interface requests; according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; according to the comparison result, acquiring request data corresponding to the plurality of interface requests as data to be loaded; and loading the page based on the data to be loaded. Therefore, interface cache data or interface requests can be quickly returned, the page loading speed is increased, the application page presentation speed is greatly improved during loading and switching, the server load is reduced, and a plurality of repeated requests are omitted.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a network architecture diagram of a page loading method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a page loading method according to an embodiment of the present invention;
fig. 3 is a specific flowchart of step S20 in the page loading method according to the embodiment of the present invention;
fig. 4 is a specific flowchart of step S30 in the page loading method according to the embodiment of the present invention;
fig. 5 is another flowchart of step S30 in the page loading method according to the embodiment of the present invention;
FIG. 6 is another flowchart of a page loading method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, the network architecture of the present invention relates to a client and a server, and the execution subject may be a Web browsing system, an image analysis system, etc. in the client, the client includes but is not limited to a Web end and an APP end, such as a computer, a mobile phone, or a tablet computer of a user, etc., when the user browses using the computer, the user can browse various different pages through the Web browsing system on the computer, so as to increase the speed of loading the pages and reduce the load of the server.
Referring to fig. 2, fig. 2 is a flowchart of a page loading method according to an embodiment of the present invention, and as shown in fig. 2, the page loading method includes the following steps:
and S10, acquiring a page loading request.
In this embodiment, the page loading request includes multiple interface requests, and a user can load an HTML5 page through the client to browse, so that the client obtains the page loading request and sends the page loading request to the server, so that the server can receive the multiple interface requests fed back by the client and return a page according to the interface requests, it can be understood that each interface request may correspond to a different page; therefore, when the client acquires the page recording request, the page loading request can be acquired through a front-end webpage or a visual interface, and the interface request is sent to the server.
When the page loading request is obtained, the client can feed the interface request back to the server through the operation of clicking the page by the user, such as refreshing the page or switching the page, so that the server performs subsequent operations such as returning the page according to the interface request.
S20, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table according to the plurality of interface requests to obtain comparison results; and the comparison result is used for indicating the data path for acquiring the page loading.
In this embodiment, the data path for page loading may include network request data and local cache data; the uniform resource locator indicates that each information resource has a uniform and unique address on the network; and the interface request and the configuration table both have uniform resource locators, and whether the network request data or the local cache data is directly returned or not is determined according to a comparison result by comparing the uniform resource locators in the interface request with the uniform resource locators in the configuration table.
Specifically, as shown in fig. 3, the specific implementation manner of step S20 includes:
s21, intercepting a plurality of interface requests included in the page loading request, and acquiring uniform resource locators of the interface requests;
s22, determining whether the uniform resource locator of the interface request hits the uniform resource locator in the configuration table or not aiming at each interface request to obtain a comparison result;
s23, if the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, determining that the interface request is a first type data request for obtaining the requested data in a cache mode;
and S24, if the uniform resource locator of the interface request is not hit in the uniform resource locator in the configuration table, determining that the interface request is a second type data request for acquiring the request data in a network request mode.
In this embodiment, the interface request may be intercepted based on the request adapter, and the uniform resource locator of the interface request and the uniform resource locator in the configuration table may be compared with each other, so as to determine whether the uniform resource locator of a certain interface request hits a certain uniform resource locator in the configuration table, so as to obtain a comparison result.
The first type of data request can be a cache data request, and the second type of data request can be a network data request; when the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, the interface request is repeated, the interface request can obtain corresponding request data from the local in a cache mode, and page loading is carried out through the locally obtained request data; when the uniform resource locator of the interface request does not hit the uniform resource locator in the configuration table, the interface request is represented as new request data, and the corresponding request data can be obtained through the network request.
For example, when a user sends a page loading request through a client, in the page loading process, when a received interface request causes a page abnormal state, the user reloads or refreshes the page, when the interface request is refreshed or loaded, the request adapter can intercept the interface request and determine a uniform resource locator of the interface request, by comparing the uniform resource locator in the interface request with the uniform resource locator in the configuration table, when the uniform resource locator of the interface request does not hit the uniform resource locator in the configuration table, it is determined that the comparison result is inconsistent, and request data corresponding to the interface request can be obtained through a network request to load the page; when the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, the comparison result is determined to be consistent, thereby indicating that the corresponding request data can be determined locally through the configuration table.
Specifically, the step S21 of pre-configuring the request adaptor includes: based on a transactional database encapsulation tool class, a character string generated by a user identifier, a request parameter key name and a uniform resource locator corresponding to an interface request is used as a unique identifier of interface cache data, and the unique identifier is used as index information to retrieve the corresponding interface cache data; integrating the tool classes to construct a target function of interface cache data, and adding the target function into the global function; constructing a request adapter through an axios library according to the tool class and a preset cache rule; adding a request adapter into a global function to intercept each interface request; wherein the target function is to be called within the global function.
In this embodiment, the transactional database may be an IndexEDDB, which is a transactional database system, similar to an SQL-based RDBMS. Moreover, IndexedDB is not like RDBMS using a fixed list, IndexedDB is a JavaScript-based object-oriented database; packaging the tool class through the IndexDB so that the tool class can realize various operation options for the data in the database, for example, the tool class can be connected with the database and establish configuration table operation, and can add, delete, check and change the data in the database and support options such as storage time and the like; the user identification, the request parameter key name and the character string generated by the uniform resource locator corresponding to the interface request can be used as a unique identification through a tool class, so that when the corresponding interface cache data is determined locally, the query can be carried out through the unique identification; and integrating the tool classes of the transactional database to form a target function, so that when a global function is called, operation options such as storage of the request data can be realized through the target function, and the request data can be stored in the transactional database.
It can be understood that, through the tool class of the transactional database and the predetermined caching rule, the request adapter is constructed according to the specification of the axios library and is added to the packaged global function, so that when the global function is called, the interface request can be intercepted by the request adapter, and the uniform resource locator of the interface request is compared with the uniform resource locator of the configuration table, so as to obtain a comparison result; axios is a premium-based HTTP library which can be used in browsers and nodes, and the specification of the axios library can simplify codes and facilitate later update maintenance, and support interception of request and response data.
And S30, acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result.
In this embodiment, the plurality of interface requests have network request data and interface cache data corresponding thereto, the network request data may be loaded from a network, and the interface cache data may be stored in a transactional database, so that when a uniform resource locator of an interface request hits a uniform resource locator in the configuration table, local interface cache data may be determined as data to be loaded; when the uniform resource locator requested by the interface does not hit the uniform resource locator in the configuration table, the network request data can be determined as the data to be loaded; it will be appreciated that matching through the configuration table avoids increasing the load on the server.
Furthermore, when the interface request and the configuration table are successfully matched, the interface cache data consistent with the interface request exists in the database, and when the interface request is consistent with the interface cache data, the corresponding interface cache data can be called through the configuration table, and the page is loaded through the interface cache data, so that repeated requests can be avoided, and the loading speed is higher.
Wherein, the page returned by the server comprises a hypertext markup language (HTML, English full name: Hyper Text Mark-up language), a Cascading Style sheet (CSS, English full name: capturing Style Sheets) and an interpreted or instant compiling programming language (JavaScript, JS); and the server may also return picture, video, font, and plug-in type resources.
As shown in fig. 4, a specific implementation manner of the step S30 includes:
s31, when the interface request is a first-class data request, generating a unique identifier of the interface request data based on the uniform resource locator in the first-class data request and the user identifier, the request parameter and the request parameter key name carried in the interface request data corresponding to the hit uniform resource locator;
and S32, inquiring the interface cache data according to the unique identifier to determine the interface cache data corresponding to the unique identifier as the data to be loaded.
The specific implementation manner of step S32 includes: inquiring interface cache data according to the unique identifier, and judging whether index information of the associated interface cache data exists or not; and when the index information of the associated interface cache data exists, determining the interface cache data corresponding to the interface request according to the associated index information.
In this embodiment, the index information corresponding to the interface cache data may be queried in the configuration table through the unique identifier corresponding to the interface request, and when the index information associated with the interface cache data is obtained through querying, it indicates that the transactional database has the interface cache data corresponding to the interface request, and the interface cache data may be retrieved through the index information, so that the interface cache data may be called by a tool class of the transactional database to load a page, thereby avoiding generating a repeat request; it can be understood that, by performing the query in the configuration table through the unique identifier, the query efficiency can be made faster, the server load can be reduced, and the interface cache data return speed can be made faster.
And S40, loading the page based on the data to be loaded.
As shown in fig. 6, when there is index information of the associated interface cache data, the determining, according to the associated index information, the interface cache data corresponding to the interface request further includes:
s311, when index information of the associated interface cache data exists, determining cache time corresponding to the interface cache data according to a character string of the index information;
s312, judging whether the interface cache data is overdue according to the cache time;
s313, when the interface cache data is not expired, taking the interface cache data as data to be loaded;
and S314, when the interface cache data is out of date, determining the network request data corresponding to the unique identifier as the data to be loaded and caching.
In this embodiment, the configuration table has index information associated with the interface cache data, and the character string of the index information includes cache time of the interface cache data, so that when the associated interface cache data is determined, the cache time of the interface cache data can be judged through the character string of the index information to determine whether the interface cache data is expired, and when the interface cache data is not expired, the page is loaded by calling the interface cache data, so that the page loading speed can be faster; when the interface cache data is out of date, the page is loaded according to the network request data corresponding to the interface request, and the network request data can be cached in the transactional database, so that the request data can be quickly responded to be loaded in the subsequent page loading request, and the page loading speed is improved.
As shown in fig. 5, the step S30 further includes:
s33, when the interface request is a second type data request, determining corresponding network request data according to the uniform resource locator of the interface request;
and S34, loading the network request data as the data to be loaded.
When the uniform resource locator of the interface request does not hit the uniform resource locator of the configuration table, determining that the interface request does not generate a repeated request, enabling the client to initiate a network request to the server, and acquiring network request data corresponding to the interface request to load a page, so that the load of the server is reduced, and the loading speed of the page is increased; it can be understood that, when the page is loaded, the page may be rendered by requesting data through the network, and then the rendered page is returned to the client for display.
The page loading method provided by the embodiment of the invention firstly obtains a page loading request, wherein the page loading request comprises a plurality of interface requests; according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; according to the comparison result, acquiring request data corresponding to the plurality of interface requests as data to be loaded; and loading the page based on the data to be loaded. Therefore, interface cache data or interface requests can be quickly returned, the page loading speed is increased, the application page presentation speed is greatly improved during loading and switching, the server load is reduced, and a plurality of repeated requests are omitted.
It should be noted that the page loading method provided by the embodiment of the present invention may be applied to devices such as a smart phone, a computer, and a server that can perform page loading.
Optionally, referring to fig. 7, fig. 7 is a page loading apparatus 10 according to an embodiment of the present invention, where the page loading apparatus 10 includes:
the acquiring module 11 is configured to acquire a page loading request, where the page loading request includes multiple interface requests;
a comparison module 12, configured to compare the uniform resource locator in each interface request with the uniform resource locator in the configuration table according to the multiple interface requests, so as to obtain a comparison result; the comparison result is used for indicating a data path for acquiring page loading;
the determining module 13 is configured to obtain, according to the comparison result, request data corresponding to the plurality of interface requests as data to be loaded;
and the loading module 14 is used for loading the page based on the data to be loaded.
The page loading device 10 provided in the embodiment of the present invention first obtains a page loading request, where the page loading request includes a plurality of interface requests; according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; according to the comparison result, acquiring request data corresponding to the plurality of interface requests as data to be loaded; and loading the page based on the data to be loaded. The method can realize the quick return of interface cache data or interface requests, accelerate the page loading speed, greatly improve the presentation speed of the application page during loading and switching, reduce the server load and omit a plurality of repeated requests.
It should be noted that the page loading device provided in the embodiment of the present invention may be applied to devices such as a smart phone, a computer, and a server that can perform page loading.
The page loading device provided by the embodiment of the invention can realize each process realized by the page loading method in the method embodiment, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 8, including: memory 202, processor 201 and a computer program of a page loading method stored on the memory 202 and executable on the processor 201, wherein:
the processor 201 is used for calling the computer program stored in the memory 202, and executing the following steps:
acquiring a page loading request, wherein the page loading request comprises a plurality of interface requests;
according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; the comparison result is used for indicating a data path for acquiring page loading;
according to the comparison result, acquiring request data corresponding to the plurality of interface requests as data to be loaded;
and loading the page based on the data to be loaded.
Optionally, the comparing, performed by the processor 201, the uniform resource locator in the interface request with the uniform resource locator in the configuration table according to multiple interface requests to obtain a comparison result includes:
intercepting a plurality of interface requests included in a page loading request, and acquiring uniform resource locators of the interface requests;
determining whether the uniform resource locator of the interface request hits the uniform resource locator in the configuration table or not aiming at each interface request so as to obtain a comparison result;
if the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, determining that the interface request is a first type data request for acquiring the requested data in a cache mode;
and if the uniform resource locator of the interface request is not hit in the uniform resource locator in the configuration table, determining that the interface request is a second-class data request for acquiring the request data in a network request mode.
Optionally, the page loading method executed by the processor 201 further includes:
based on a transactional database encapsulation tool class, a character string generated by a user identifier, a request parameter key name and a uniform resource locator corresponding to an interface request is used as a unique identifier of interface cache data, and the unique identifier is used as index information to retrieve the corresponding interface cache data;
integrating the tool classes to construct a target function of interface cache data, and adding the target function into the global function;
constructing a request adapter through an open source library according to the tool class and a preset cache rule;
adding a request adapter into a global function to intercept each interface request; wherein the target function is to be called within the global function.
Optionally, the obtaining, by the processor 201, request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result includes:
when the interface request is a first-class data request, generating a unique identifier of the interface request data based on a uniform resource locator in the first-class data request and a user identifier, a request parameter and a request parameter key name carried in the interface request data corresponding to the hit uniform resource locator;
and inquiring interface cache data according to the unique identifier to determine the interface cache data corresponding to the unique identifier as the data to be loaded.
Optionally, the querying, performed by the processor 201, the interface cache data according to the unique identifier to determine the interface cache data corresponding to the unique identifier, where the interface cache data serving as the data to be loaded includes:
inquiring interface cache data according to the unique identifier, and judging whether index information of the associated interface cache data exists or not;
and when the index information of the associated interface cache data exists, determining the interface cache data corresponding to the unique identifier according to the associated index information.
Optionally, when there is index information of the associated interface cache data, determining, by the processor 201, the interface cache data corresponding to the unique identifier according to the associated index information includes:
when index information of the associated interface cache data exists, determining cache time corresponding to the interface cache data according to the character string of the index information;
judging whether interface cache data is overdue according to the cache time;
when the interface cache data is not expired, taking the interface cache data as data to be loaded;
and when the interface cache data is expired, determining the network request data corresponding to the unique identifier as the data to be loaded.
Optionally, the obtaining, by the processor 201, request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result includes:
when the interface request is a second-class data request, determining corresponding network request data according to a uniform resource locator of the interface request;
and taking the network request data as the data to be loaded for loading.
It should be noted that the electronic device provided by the embodiment of the present invention may be applied to a smart phone, a computer, a server, and other devices that can perform page loading.
The electronic equipment provided by the embodiment of the invention can realize each process realized by the page loading method in the method embodiment, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
The computer-readable storage medium provided in the embodiments of the present invention stores a computer program thereon, and when the computer program is executed by a processor, the computer program implements each process of the page loading method or the application page loading method provided in the embodiments of the present invention, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A page loading method is characterized by comprising the following steps:
acquiring a page loading request, wherein the page loading request comprises a plurality of interface requests;
according to the plurality of interface requests, comparing the uniform resource locators in the interface requests with the uniform resource locators in the configuration table to obtain comparison results; the comparison result is used for indicating a data path for acquiring page loading;
acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result;
and loading the page based on the data to be loaded.
2. The page loading method according to claim 1, wherein the comparing, according to the multiple interface requests, the uniform resource locator in the interface request with the uniform resource locator in the configuration table to obtain a comparison result comprises:
intercepting the plurality of interface requests included in the page loading request, and acquiring uniform resource locators of the interface requests;
for each interface request, determining whether a uniform resource locator of the interface request hits a uniform resource locator in the configuration table to obtain the comparison result;
if the uniform resource locator of the interface request hits the uniform resource locator in the configuration table, determining that the interface request is a first type data request for acquiring request data in a cache mode;
and if the uniform resource locator of the interface request is not hit in the uniform resource locator in the configuration table, determining that the interface request is a second-class data request for acquiring the request data in a network request mode.
3. The page loading method according to claim 2, wherein the page loading method further comprises:
based on a transactional database encapsulation tool class, using a user identifier, a request parameter key name and a character string generated by a uniform resource locator corresponding to the interface request as a unique identifier of interface cache data, wherein the unique identifier is used as index information to retrieve the corresponding interface cache data;
integrating the tool classes to construct an objective function of the interface cache data, and adding the objective function to a global function;
constructing the request adapter through an open source library according to the tool class and the preset caching rule;
adding the request adapter into a global function to intercept each interface request; wherein the target function is to be called within the global function.
4. The page loading method according to claim 3, wherein the obtaining, according to the comparison result, request data corresponding to the plurality of interface requests as data to be loaded includes:
when the interface request is a first-class data request, generating a unique identifier of the interface request data based on a uniform resource locator in the first-class data request and a user identifier, a request parameter and a request parameter key name carried in the interface request data corresponding to the hit uniform resource locator;
and inquiring interface cache data according to the unique identifier to determine the interface cache data corresponding to the unique identifier as the data to be loaded.
5. The page loading method according to claim 4, wherein the querying interface cache data according to the unique identifier to determine interface cache data corresponding to the unique identifier, as the data to be loaded, includes:
inquiring interface cache data according to the unique identifier, and judging whether index information of the associated interface cache data exists or not;
and when index information of the associated interface cache data exists, determining the interface cache data corresponding to the unique identifier according to the associated index information.
6. The page loading method according to claim 5, wherein when there is index information of the associated interface cache data, determining the interface cache data corresponding to the unique identifier according to the associated index information comprises:
when index information of associated interface cache data exists, determining cache time corresponding to the interface cache data according to a character string of the index information;
judging whether the interface cache data is expired according to the cache time;
when the interface cache data is not expired, taking the interface cache data as data to be loaded;
and when the interface cache data is expired, determining the network request data corresponding to the unique identifier as the data to be loaded.
7. The page loading method according to claim 2, wherein the obtaining, according to the comparison result, request data corresponding to the plurality of interface requests as data to be loaded includes:
when the interface request is a second-class data request, determining corresponding network request data according to a uniform resource locator of the interface request;
and taking the network request data as data to be loaded for loading.
8. An apparatus for page loading, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a page loading request which comprises a plurality of interface requests;
the comparison module is used for comparing the uniform resource locators in the interface requests and the uniform resource locators in the configuration table to obtain comparison results according to the plurality of interface requests; the comparison result is used for indicating a data path for acquiring page loading;
the determining module is used for acquiring request data corresponding to the plurality of interface requests as data to be loaded according to the comparison result;
and the loading module is used for loading the page based on the data to be loaded.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the page loading method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps in the page loading method according to any one of claims 1 to 7.
CN202111357221.0A 2021-11-16 2021-11-16 Page loading method and device, electronic equipment and storage medium Pending CN114186148A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111357221.0A CN114186148A (en) 2021-11-16 2021-11-16 Page loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111357221.0A CN114186148A (en) 2021-11-16 2021-11-16 Page loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114186148A true CN114186148A (en) 2022-03-15

Family

ID=80540218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111357221.0A Pending CN114186148A (en) 2021-11-16 2021-11-16 Page loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114186148A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745363A (en) * 2022-03-18 2022-07-12 成都数联云算科技有限公司 Method, system, device and medium for processing front-end application request message

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745363A (en) * 2022-03-18 2022-07-12 成都数联云算科技有限公司 Method, system, device and medium for processing front-end application request message
CN114745363B (en) * 2022-03-18 2023-12-15 成都数联云算科技有限公司 Front-end application request message processing method, system and device and medium

Similar Documents

Publication Publication Date Title
US20190251143A1 (en) Web page rendering method and related device
US10839038B2 (en) Generating configuration information for obtaining web resources
CN108804707B (en) Page processing method and device and related equipment
CN105095280B (en) Browser caching method and device
US20170154013A9 (en) Ad blocking page display method and device
US20140006487A1 (en) Methods for making ajax web applications bookmarkable and crawable and devices thereof
US20210081263A1 (en) System for offline object based storage and mocking of rest responses
CN112115396B (en) Webpage rendering method, device, equipment and storage medium
US10594764B2 (en) Request cache to improve web applications performance
US11775518B2 (en) Asynchronous predictive caching of content listed in search results
CN110928767A (en) Webpage analysis method, device, equipment and storage medium
US9648078B2 (en) Identifying a browser for rendering an electronic document
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN111259283B (en) Page resource preloading processing method and device, and electronic and storage equipment
CN114329281A (en) Rendering server, webpage rendering method and webpage rendering device
CN114186148A (en) Page loading method and device, electronic equipment and storage medium
US10095791B2 (en) Information search method and apparatus
WO2024011899A1 (en) Widget loading method and apparatus, device, and storage medium
US9742818B2 (en) Pushing events to web pages used for interaction with applications
CN115062250A (en) Page management method, server, development front end, portal webpage end and system
CN113934954A (en) Webpage first screen rendering method and device in application program
CN111339461A (en) Page access method of application program and related product
US11716405B1 (en) System and method for identifying cache miss in backend application
CN115495694B (en) Webpage data processing method and device
US20210357465A1 (en) Method and System for High Speed Serving of Webpages

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