CN117193907A - Page processing method and device - Google Patents

Page processing method and device Download PDF

Info

Publication number
CN117193907A
CN117193907A CN202311086973.7A CN202311086973A CN117193907A CN 117193907 A CN117193907 A CN 117193907A CN 202311086973 A CN202311086973 A CN 202311086973A CN 117193907 A CN117193907 A CN 117193907A
Authority
CN
China
Prior art keywords
page
address
resource
code file
resource address
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
CN202311086973.7A
Other languages
Chinese (zh)
Inventor
林旭冬
谢凯森
关卓华
陈立豪
梁澍
张翔
胡裕源
沈乃严
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Internet Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Internet 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 China Mobile Communications Group Co Ltd, China Mobile Internet Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202311086973.7A priority Critical patent/CN117193907A/en
Publication of CN117193907A publication Critical patent/CN117193907A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application provides a page processing method and a page processing device, and relates to the technical field of Internet. The specific scheme is as follows: the method comprises the steps of storing relevant resources corresponding to a preloaded page in a local storage, and carrying out identification modification on an original resource address corresponding to a page to be displayed under the condition that the resources corresponding to the page to be displayed are stored locally, so as to obtain a second resource address containing a preset identification, so that interception of sending a request for obtaining relevant resources to a server is realized based on whether the second resource address contains the preset identification, and the resources are directly obtained from the local storage. Thereby improving the efficiency of page processing.

Description

Page processing method and device
Technical Field
The application relates to the technical field of Internet, in particular to a page processing method and device.
Background
The application program on the mobile terminal has an increasing demand for using hypertext markup language (html) pages, but the speed of loading html page resources is low, so that the user experience is poor. Therefore, how to increase the loading speed of the terminal device to html page resources is a problem that needs to be solved at present.
Disclosure of Invention
The application provides a page processing method and device.
According to an aspect of the present application, there is provided a page processing method, including:
responding to the starting of an application program, and acquiring a first page address list of a preloaded page corresponding to the application program;
the method comprises the steps of carrying out page resource preloading based on each first page address in a first page address list, obtaining and locally storing first page code files and first response data corresponding to each first page address, first resource addresses modified by original resource address identifiers in each first page code file, and resources corresponding to each first resource address;
for the second page address of the acquired page to be displayed of the application program, under the condition that second response data corresponding to the second page address is matched from the first response data stored locally, the second response data is checked, so that a second page code file corresponding to the second page address is acquired based on a check result, and a modified second resource address is identified in the original resource address in the second page code file;
under the condition that the identifier corresponding to the second resource address is a preset identifier, matching the resource corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses;
rendering the page to be displayed based on the resource corresponding to the second resource address.
According to another aspect of the present application, there is provided a page processing apparatus including:
the acquisition module is used for responding to the starting of the application program and acquiring a first page address list of the preloaded page corresponding to the application program;
the preloading module is used for preloading page resources based on each first page address in the first page address list, acquiring and locally storing a first page code file and first response data corresponding to each first page address, a first resource address with the original resource address identification in each first page code file modified, and resources corresponding to each first resource address;
the verification module is used for verifying the second response data under the condition that the second response data corresponding to the second page address is matched from the first response data stored locally aiming at the second page address of the page to be displayed of the obtained application program, so as to obtain a second page code file corresponding to the second page address based on a verification result, and a modified second resource address is identified in the original resource address in the second page code file;
the determining module is used for matching the resources corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses under the condition that the identifier corresponding to the second resource address is a preset identifier;
and the rendering module is used for rendering the page to be displayed based on the resource corresponding to the second resource address.
According to another aspect of the present application, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods of the embodiments described above.
According to another aspect of the present application, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to the above-described embodiments.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic flow chart of a page processing method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another page processing method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another page processing method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another page processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The page processing method, the device, the electronic equipment and the storage medium according to the embodiment of the application are described in detail below with reference to the accompanying drawings.
It should be noted that, the page processing method implemented by the present application is configured in a page processing apparatus (hereinafter referred to simply as a processing apparatus) for illustration, and the processing apparatus may be applied to an electronic device such as a terminal device, so as to increase the speed of loading an html page.
Fig. 1 is a flow chart of a page processing method according to an embodiment of the present application.
As shown in fig. 1, the method includes:
step 101, responding to the starting of an application program, and acquiring a first page address list of a preloaded page corresponding to the application program.
The first page address may be a uniform resource locator system (uniform resource locator, abbreviated URL), etc., which is not limited in the present application.
In the application, when a certain Application (APP) is monitored to start, a request for acquiring the information of the preloaded page can be sent to a server corresponding to the Application. After receiving the request, the server may send a first page address list of a page to be preloaded corresponding to the application program to the processing device. Thus, the processing device can acquire the first page address list of the preloaded page corresponding to the application program.
Step 102, preloading page resources based on each first page address in the first page address list, obtaining and locally storing a first page code file and first response data corresponding to each first page address, a first resource address modified by the original resource address identification in each first page code file, and resources corresponding to each first resource address.
In the application, the process of preloading page resources based on each first page address in the first page address list comprises the following steps: and acquiring a first page code file corresponding to the first page address, acquiring resources corresponding to the original resource address in the first page code file, and identifying the process of modifying the original resource address to generate the first resource address.
The process of obtaining the first page code file corresponding to the first page address is as follows: it is determined whether there is first response data stored in association with the first page address in the local store. In the case where there is no first response data stored in association with the first page address in the local storage, it is indicated that the preload is not performed for the first page address. Therefore, the page acquisition request of the first page code file corresponding to the first page address can be sent to the server based on the mode of loading the page in a preset mode. After receiving the page acquisition request, the server may send a feedback message to the processing device, where the feedback message includes a first page code file and a check identifier (etag) corresponding to the first page address. Thus, the processing device can acquire and store the first page code file corresponding to the first page address in an associated mode, and generate and store the first response data associated with the first page address based on etag.
In the case where there is first response data stored in association with the first page address in the local storage, it is explained that the preload has been performed for the first page address, and therefore, the first page code file corresponding to the first page address has been stored in the local storage. Then, the first page code file corresponding to the first page address can be directly obtained from the local storage.
The process of generating the first resource address by identifying and modifying the original resource address is as follows: after the first page code file is obtained, the first page code file can be analyzed, and the original resource address contained in the first page code file can be determined. For example, the original resource address may be extracted from the first page code file using a preset regular expression. It will be appreciated that the original resource address may be one or more.
And then, adding an identification field into the original resource address according to a preset rule to generate a first resource address corresponding to the original resource address. The identification field is used for identifying the resource of the original resource address corresponding to the stored first resource address in the local storage.
The process of obtaining the resource corresponding to the original resource address in the first page code file is as follows: and sending a resource acquisition request to the server based on the original resource addresses, and requesting to acquire the resources corresponding to each original resource address.
In the application, the first resource address and the resource association corresponding to the original resource address can be stored in the system. And after the page corresponding to the first page address is preloaded, the memory occupied by the preloading can be released, and the occupation of memory resources is avoided.
It can be understood that the resources such as the pages and the pictures of the application programs under the same product line are the same, after the original resource address in the first page code file is modified, the first resource address and the corresponding resource are associated and stored in the local storage, so that unified management of the page resources of the application programs is realized, and the resource multiplexing is facilitated.
Step 103, checking the second response data under the condition that the second response data corresponding to the second page address is matched from the first response data stored locally aiming at the acquired second page address of the page to be displayed, so as to acquire a second page code file corresponding to the second page address based on the checking result, and the original resource address in the second page code file identifies the modified second resource address.
In the present application, the second page address may be the same as or different from the first page address. The page to be displayed can be a top page when the application program is started, or can be a page to be switched when the application program is subjected to page switching. The application is not limited in this regard.
In the present application, the second page address may be matched with the first page address associated with each of the first response data. When the first page address associated with any one of the first response data is the same as the second page address, the first response data may be determined as the second response data associated with the second page address.
In the case where the second response data is determined, it is explained that the preloading of the page corresponding to the second page address has been completed. However, it is contemplated that the second page code file corresponding to the second page address may be updated. Thus, to ensure accuracy of the page processing, the second response data may be checked to determine if the second page code file is updated. And obtaining the second page code file from the local storage or the server according to the updating condition of the second page code file.
The process of verifying the second response data to determine whether the second page code file is updated is as follows: the second response data may be spliced into a new request header and an interrogation request sent to the server based on the request header and the second page address. After receiving the inquiry request, the server may determine whether the second page code file is updated based on the second response data in the inquiry request. When the server determines that the second page code file is not updated, an indicator "304" is returned to the processing device without returning the second page code file. Therefore, when the processing device determines that the server returns to 304, the processing device can determine that the second page code file is not updated, and can acquire the second page code file corresponding to the second page address from the local storage. When the server determines that the second page code file is updated, an indicator "200" is returned to the processing device and a new second page code file is returned. Thus, when the processing device determines that the server returns to 200, the processing device may determine that the second page code file is updated, and determine the new second page code file received from the server as the second page code file corresponding to the second page address.
And then analyzing the second page code file to determine the original resource address in the second page code file, and adding an identification field into the original resource address by utilizing a preset rule to generate a second resource address corresponding to the original resource address. Alternatively, when the second page code file is retrieved from the local store, it is indicated that the second page code file has been preloaded, and therefore the second resource address of the associated store of the second page code file may be retrieved from the local store. Wherein the preset rule for generating the second resource address is the same as the preset rule for generating the first resource address.
Step 104, matching the resources corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses under the condition that the identifier corresponding to the second resource address is the preset identifier.
In the application, the character of the preset position in the second resource address can be determined as the identifier corresponding to the second resource address, and the resource corresponding to the second resource address is preloaded in the local storage under the condition that the identifier corresponding to the second resource address is the preset identifier. Therefore, the second resource address can be matched with each first resource address, and when a certain first resource address is the same as the second resource address, the resource stored in association with the first resource address can be determined to be the resource corresponding to the second resource address.
Optionally, when the matching of the second response data corresponding to the second page address from the first response data stored locally fails, it is indicated that the page resource preloading operation is not performed on the page corresponding to the second page address. Therefore, a page acquisition request can be sent to the server corresponding to the application program to acquire a second page code file corresponding to the second page address, and the original resource address contained in the second page code file is directly determined as the second resource address. It can be understood that the identifier corresponding to the second resource address is not a preset identifier.
Optionally, when the identifier corresponding to the second resource address is not the preset identifier, the resource corresponding to the second resource address is not preloaded in the local storage. Therefore, the resource acquisition request for the second resource address can be sent to the server corresponding to the application program, and the server sends the resource corresponding to the second resource address to the processing device after receiving the resource acquisition request.
And 105, rendering the page to be displayed based on the resource corresponding to the second resource address.
In the application, after the resources corresponding to the second resource address are acquired, a preset arbitrary rendering method can be utilized to render the page to be displayed based on the resources corresponding to the second resource address.
In the present application, the processing device may start two threads, the auxiliary thread is used to perform the page preloading process of steps 101-102, and the main thread is used to perform the page displaying process of steps 103-105.
In addition, the page preloading process and the page presentation process may be performed synchronously or asynchronously. And the priority of the secondary thread is lower than that of the main thread, so that the process of preloading the page does not preempt the resources of the main service of the application program.
In the application, a first page address list of a preloaded page corresponding to an application program is obtained in response to the starting of the application program, page resource preloading is carried out based on each first page address in the first page address list, a first page code file and first response data corresponding to each first page address are obtained and locally stored, the first resource address corresponding to each first resource address is modified in each first page code file, the resource corresponding to each first resource address is obtained, then, for the obtained second page address of the page to be displayed, under the condition that second response data corresponding to the second page address is matched from the locally stored first response data, the second response data is checked, so as to obtain a second page code file corresponding to the second page address based on the check result, and the second resource address corresponding to the second resource address after the modification is identified in the second page code file, and under the condition that the identification corresponding to the second resource address is the preset identification, the resource corresponding to the second address is matched from the locally stored resources corresponding to the first resource address, and then, the rendering of the page resource corresponding to the page is carried out based on the second resource address to be displayed. Therefore, through storing relevant resources corresponding to the preloaded page in the local storage and carrying out identification modification on the original resource address corresponding to the page to be displayed under the condition that the resources corresponding to the page to be displayed are stored locally, a second resource address containing a preset identification is obtained, so that interception of sending a request for obtaining relevant resources to a server is realized based on whether the second resource address contains the preset identification or not, and the resources are directly obtained from the local storage. Thereby improving the efficiency of page processing.
Fig. 2 is a flow chart of a page processing method according to an embodiment of the present application.
As shown in fig. 2, the method includes:
in step 201, in response to the start of the application program, a first page address list of a preloaded page corresponding to the application program is obtained.
In the present application, the specific implementation process of step 201 may refer to the detailed description of any embodiment of the present disclosure, and will not be repeated herein.
Step 202, performing page preprocessing based on each first page address in the first page address list to obtain a first page code file and first response data corresponding to each first page address, and a first resource address after modification of an original resource address identifier in each first page code file.
The specific explanation of the first response data may be referred to the detailed description of any embodiment of the disclosure, and will not be repeated herein.
In the present application, it may be determined whether there is first response data stored in association with the first page address in the local storage. In the case where the first response data corresponding to the first page address exists in the local storage, it is explained that the first page code file corresponding to the first page address has already been stored in the local storage. However, since the first page code file may have been updated, to ensure the accuracy of the preloaded page, the first response data may be spliced into a new request header and an interrogation request sent to the server based on the request header and the first page address. After receiving the inquiry request, the server side can determine whether the first page code file is updated based on the first response data in the inquiry request. When the server determines that the first page code file is not updated, an indicator "304" is returned to the processing device without returning the first page code file. Therefore, when the processing device determines that the server returns the indication code '304', the processing device can determine that the first page code file is not updated, and can acquire the first page code file corresponding to the first page address from the local storage.
When the server determines that the first page code file is updated, feeding back a new first page code file corresponding to the first page address and a new check identifier (etag) to the processing device. Therefore, the processing device can acquire a new first page code file corresponding to the first page address, update the corresponding first page code file in the local storage by using the new first page code file, and update the first response data associated with the first page address by using the new etag. Thereby ensuring the timely update of the resources corresponding to the locally cached preloaded page.
In addition, after the new first page code file is acquired, the first page code file may be parsed to determine the original resource address contained in the first page code file. And then, replacing characters corresponding to the protocol type (scheme) in the original resource address by using the preset identifier to generate a first resource address corresponding to the original resource address.
Optionally, the characters corresponding to the protocol type (schema) in the original resource address corresponding to the different types of resources may be updated to different preset identifiers. For example, the scheme part in the original resource address corresponding to the media file resource such as video is replaced by 'mediaFile:///', and the scheme part in the original resource address corresponding to the code file resource is replaced by 'codeFile://'.
Step 203, when there is no resource corresponding to any first resource address in the local storage, sending a resource acquisition request to a server corresponding to the application program based on the original resource address corresponding to any first resource address.
In the application, whether the resources corresponding to the first resource address are stored in the local storage can be inquired and determined. When there is no resource corresponding to a certain first resource address in the local storage, a resource acquisition request may be sent to the server based on the original resource address corresponding to the first resource address, to request to acquire the resource corresponding to the first resource address. Therefore, repeated downloading of resources is avoided, and the page processing efficiency is improved.
Step 204, receiving the resource corresponding to any first resource address sent by the server.
Step 205, the first page code file and the first response data corresponding to each first page address, the first resource address modified by the original resource address identifier in each first page code file, and the resource corresponding to each first resource address are stored in the local storage in an associated manner.
Step 206, checking the second response data to obtain a second page code file corresponding to the second page address based on the checking result, and identifying the modified second resource address by the original resource address in the second page code file, under the condition that the second response data corresponding to the second page address is matched from the locally stored first response data, for the second page address of the page to be displayed of the application program.
Step 207, in the case that the identifier corresponding to the second resource address is the preset identifier, matching the resource corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses.
And step 208, rendering the page to be displayed based on the resource corresponding to the second resource address.
In the present application, the specific implementation process of step 206 to step 208 may refer to the detailed description of any embodiment of the present disclosure, and will not be repeated here.
In the application, page preprocessing can be performed based on each first page address in a first page address list to obtain a first page code file and first response data corresponding to each first page address, and a first resource address after modification of an original resource address identifier in each first page code file, then, if no resource corresponding to any first resource address exists in local storage, a resource acquisition request is sent to a server corresponding to an application program based on the original resource address corresponding to any first resource address, and a resource corresponding to any first resource address sent by the server is received, and then, the first page code file and the first response data corresponding to each first page address, the first resource address after modification of the original resource address identifier in each first page code file, and the resource corresponding to each first resource address are stored in the local storage in a correlated manner. Therefore, repeated downloading of resources is avoided, and the page processing efficiency is improved.
Fig. 3 is a flow chart of a page processing method according to an embodiment of the present application.
As shown in fig. 3, the method includes:
step 301, in response to the client start, obtains a preloaded first page address list.
Step 302, preloading page resources based on each first page address in the first page address list, obtaining and locally storing a first page code file and first response data corresponding to each first page address, a first resource address modified by the original resource address identifier in each first page code file, and resources corresponding to each first resource address.
Step 303, for the second page address of the page to be displayed of the obtained application program, under the condition that second response data corresponding to the second page address is matched from the locally stored first response data, checking the second response data, so as to obtain a second page code file corresponding to the second page address based on the checking result, and identifying the modified second resource address by the original resource address in the second page code file.
Step 304, under the condition that the identifier corresponding to the second resource address is a preset identifier, matching the resource corresponding to the second resource address from the locally stored resources corresponding to each first resource address.
In the present application, the specific implementation process of step 301 to step 304 may refer to the detailed description of any embodiment of the present disclosure, which is not repeated herein.
In step 305, in the case that the matching of the resources corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses fails, the download list is queried to determine whether the resources corresponding to the second resource address are to be downloaded or are being downloaded.
In the application, when the page preloading process and the page displaying process are the same as each other, and when the page to be displayed is the same as the preloaded page and the preloaded page is not completed, the resources corresponding to the second resource address may not be stored in the local storage.
Therefore, in the case that the matching of the resource corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses fails, the resource corresponding to the second resource address may be to be downloaded or is being downloaded. The downloading list can be obtained, and based on the original resource address corresponding to the second resource address, the task waiting for downloading in the downloading list and whether the task being downloaded is the downloading task of the resource corresponding to the second resource address are inquired and determined. When the task waiting for downloading in the downloading list and whether the task being downloaded is the downloading task of the resource corresponding to the second resource address, the resource corresponding to the second resource address can be determined to be downloaded or to be downloaded. When the task waiting for downloading in the downloading list and the task being downloaded are not the downloading task of the resource corresponding to the second resource address, a downloading resource abnormality prompt can be generated.
Step 306, when the resource corresponding to the second resource address is to be downloaded or is being downloaded, obtaining the resource corresponding to the second resource address after the downloading is completed.
In the application, when the resource corresponding to the second resource address is to be downloaded or is being downloaded, the resource corresponding to the second resource address can be acquired from the local storage after the resource is completely downloaded. Therefore, repeated downloading of resources is avoided, and the page processing efficiency is improved.
Or executing the process of matching the second resource address from the resources corresponding to the first resource addresses stored locally for a plurality of times at preset time intervals until the resources corresponding to the second resource address are matched from the resources corresponding to the first resource addresses stored locally.
Or executing the process of matching the second resource address from the resources corresponding to each first resource address stored locally for a plurality of times at preset time intervals until the number of times of executing the matching process is equal to a preset threshold value, stopping executing the matching process, and generating a download resource abnormality prompt.
And step 307, rendering the page to be displayed based on the resource corresponding to the first resource address.
In the present application, the specific implementation process of step 307 may be referred to the detailed description of any embodiment of the present disclosure, and will not be repeated here.
In the application, under the condition that the matching of the resources corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses fails, a downloading list is queried to determine whether the resources corresponding to the second resource address are to be downloaded or are being downloaded, and under the condition that the resources corresponding to the second resource address are to be downloaded or are being downloaded, after the downloading is completed, the resources corresponding to the second resource address are obtained. Therefore, repeated downloading of resources is avoided, and the page processing efficiency is improved.
Fig. 4 is a schematic structural diagram of a page processing apparatus according to an embodiment of the present application.
As shown in fig. 4, the page processing apparatus 400 includes: the system comprises an acquisition module 410, a preloading module 420, a verification module 430, a determination module 440 and a rendering module 450.
An obtaining module 410, configured to obtain a first page address list of a preloaded page corresponding to an application in response to an application start;
the preloading module 420 is configured to perform page resource preloading based on each first page address in the first page address list, obtain and locally store a first page code file and first response data corresponding to each first page address, a first resource address modified by an original resource address identifier in each first page code file, and a resource corresponding to each first resource address;
the verification module 430 is configured to verify, for the obtained second page address of the page to be displayed by the application program, the second response data under the condition that the second response data corresponding to the second page address is matched from the locally stored first response data, so as to obtain a second page code file corresponding to the second page address based on a verification result, and identify a modified second resource address by an original resource address in the second page code file;
the determining module 440 is configured to match, when the identifier corresponding to the second resource address is a preset identifier, a resource corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses;
and the rendering module 450 is configured to render the page to be displayed based on the resource corresponding to the second resource address.
In one possible implementation of the embodiment of the present application, the preloading module 420 is configured to:
performing page preprocessing based on each first page address in the first page address list to obtain a first page code file and first response data corresponding to each first page address, wherein the first resource address is modified by the original resource address identification in each first page code file;
under the condition that no resource corresponding to any first resource address exists in the local storage, a resource acquisition request is sent to a server corresponding to an application program based on the original resource address corresponding to any first resource address;
receiving a resource corresponding to any first resource address sent by a server;
and storing the first page code file and the first response data corresponding to each first page address, the first resource address after the original resource address identification modification in each first page code file, and the resources corresponding to each first resource address in a local storage in a correlated manner.
In one possible implementation of the embodiment of the present application, the preloading module 420 is configured to:
under the condition that first response data corresponding to the first page address exists in the local storage, sending an inquiry request to the server side based on the first response data and the first page address so as to determine whether a first page code file corresponding to the first page address is updated or not;
under the condition that a first page code file corresponding to the first page address is updated, acquiring an updated first page code file corresponding to the first page address sent by the server side and an updated original resource address contained in the updated first page code file;
and replacing the character corresponding to the protocol type in the original resource address by using the preset identifier to generate a first resource address corresponding to the original resource address.
In one possible implementation of the embodiment of the present application, the preloading module 420 is configured to:
and under the condition that the first response data corresponding to the first page address does not exist in the local storage, sending a page acquisition request to the server to acquire the first response data corresponding to the first page address, the first page code file corresponding to the first page address and the original resource address contained in the first page code file.
In one possible implementation manner of the embodiment of the present application, the determining module 440 is configured to:
under the condition that the matching of the resources corresponding to the second resource address from the locally stored resources corresponding to the first resource addresses fails, inquiring a downloading list to determine whether the resources corresponding to the second resource address are to be downloaded or are being downloaded;
and under the condition that the resources corresponding to the second resource address are to be downloaded or are being downloaded, after the downloading is completed, acquiring the resources corresponding to the second resource address.
In one possible implementation of the embodiment of the present application, the preloading module 420 is further configured to:
under the condition that the matching of the second response data corresponding to the second page address from the locally stored first response data fails, sending a page acquisition request to a server corresponding to the application program to acquire a second page code file corresponding to the second page address;
the original resource address contained in the second page code file is determined to be the second resource address.
In one possible implementation manner of the embodiment of the present application, the method further includes:
and the receiving and transmitting module is used for transmitting a resource acquisition request to a server corresponding to the application program to acquire the resource corresponding to the second resource address under the condition that the identifier corresponding to the second resource address is not a preset identifier.
It should be noted that the explanation of the foregoing embodiment of the page processing method is also applicable to the apparatus of this embodiment, and thus will not be repeated here.
In the application, a first page address list of a preloaded page corresponding to an application program is obtained in response to the starting of the application program, page resource preloading is carried out based on each first page address in the first page address list, a first page code file and first response data corresponding to each first page address are obtained and locally stored, the first resource address corresponding to each first resource address is modified in each first page code file, the resource corresponding to each first resource address is obtained, then, for the obtained second page address of the page to be displayed, under the condition that second response data corresponding to the second page address is matched from the locally stored first response data, the second response data is checked, so as to obtain a second page code file corresponding to the second page address based on the check result, and the second resource address corresponding to the second resource address after the modification is identified in the second page code file, and under the condition that the identification corresponding to the second resource address is the preset identification, the resource corresponding to the second address is matched from the locally stored resources corresponding to the first resource address, and then, the rendering of the page resource corresponding to the page is carried out based on the second resource address to be displayed. Therefore, through storing relevant resources corresponding to the preloaded page in the local storage and carrying out identification modification on the original resource address corresponding to the page to be displayed under the condition that the resources corresponding to the page to be displayed are stored locally, a second resource address containing a preset identification is obtained, so that interception of sending a request for obtaining relevant resources to a server is realized based on whether the second resource address contains the preset identification or not, and the resources are directly obtained from the local storage. Thereby improving the efficiency of page processing.
According to an embodiment of the application, the application further provides an electronic device and a readable storage medium.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device may include:
a memory 501 in which executable program codes are stored;
a processor 502 coupled to the memory 501;
wherein the processor 502 invokes executable program code stored in the memory 501 to perform the page processing method provided by any embodiment of the present application.
The computer device embodiment and the method embodiment are embodiments based on the same inventive concept, and the relevant points can be referred to each other. The computer device embodiment corresponds to the method embodiment, and has the same technical effects as the method embodiment, and the specific description refers to the method embodiment.
The embodiment of the application discloses a computer readable storage medium storing a computer program, wherein the computer program enables a computer to execute the page processing method provided by any embodiment of the application.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (10)

1. A method of processing a page, comprising:
responding to the starting of an application program, and acquiring a first page address list of a preloaded page corresponding to the application program;
carrying out page resource preloading based on each first page address in the first page address list, and obtaining and locally storing a first page code file and first response data corresponding to each first page address, a first resource address with a modified original resource address identifier in each first page code file, and a resource corresponding to each first resource address;
for the acquired second page address of the page to be displayed of the application program, under the condition that second response data corresponding to the second page address is matched from the locally stored first response data, checking the second response data to acquire a second page code file corresponding to the second page address based on a checking result, and identifying a modified second resource address by an original resource address in the second page code file;
under the condition that the identifier corresponding to the second resource address is a preset identifier, matching the resource corresponding to the second resource address from the locally stored resources corresponding to each first resource address;
and rendering the page to be displayed based on the resource corresponding to the second resource address.
2. The method of claim 1, wherein the preloading of the page resources based on the first page addresses in the first page address list, obtaining and locally storing the first page code file and the first response data corresponding to each first page address, the modified first resource address identified by the original resource address in each first page code file, and the resource corresponding to each first resource address, includes:
performing page preprocessing based on each first page address in the first page address list to obtain a first page code file corresponding to each first page address, first response data and a first resource address with a modified original resource address identifier in each first page code file;
under the condition that no resource corresponding to any first resource address exists in the local storage, a resource acquisition request is sent to a server corresponding to the application program based on an original resource address corresponding to any first resource address;
receiving a resource corresponding to any first resource address sent by the server;
and storing the first page code file and the first response data corresponding to each first page address, the first resource address modified by the original resource address identification in each first page code file, and the resources corresponding to each first resource address in a local storage in a correlated manner.
3. The method of claim 2, wherein the performing page preprocessing based on each first page address in the first page address list comprises:
under the condition that first response data corresponding to the first page address exists in the local storage, sending an inquiry request to the server based on the first response data and the first page address so as to determine whether a first page code file corresponding to the first page address is updated or not;
under the condition that a first page code file corresponding to the first page address is updated, acquiring an updated first page code file corresponding to the first page address and sent by the server, and an updated original resource address contained in the updated first page code file;
and replacing characters corresponding to the protocol type in the original resource address by the preset identifier to generate a first resource address corresponding to the original resource address.
4. A method as recited in claim 3, further comprising:
and under the condition that the first response data corresponding to the first page address does not exist in the local storage, sending a page acquisition request to the server to acquire the first response data corresponding to the first page address, the first page code file corresponding to the first page address and the original resource address contained in the first page code file.
5. The method of claim 1, further comprising, prior to the rendering of the page to be presented based on the resource corresponding to the second resource address:
under the condition that matching of the resources corresponding to the second resource addresses from the locally stored resources corresponding to the first resource addresses fails, inquiring a downloading list to determine whether the resources corresponding to the second resource addresses are to be downloaded or are being downloaded;
and under the condition that the resources corresponding to the second resource address are to be downloaded or are being downloaded, acquiring the resources corresponding to the second resource address after the downloading is completed.
6. The method of claim 1, further comprising, prior to the rendering of the page to be presented based on the resource corresponding to the second resource address:
under the condition that the matching of the second response data corresponding to the second page address from the locally stored first response data fails, sending a page acquisition request to a server corresponding to the application program to acquire a second page code file corresponding to the second page address;
and determining the original resource address contained in the second page code file as a second resource address.
7. The method as recited in claim 1, further comprising:
and sending a resource acquisition request to a server corresponding to the application program under the condition that the identifier corresponding to the second resource address is not a preset identifier so as to acquire the resource corresponding to the second resource address.
8. A page processing apparatus, comprising:
the acquisition module is used for responding to the starting of the application program and acquiring a first page address list of the preloaded page corresponding to the application program;
the preloading module is used for preloading page resources based on each first page address in the first page address list, and obtaining and locally storing a first page code file and first response data corresponding to each first page address, a first resource address modified by an original resource address identifier in each first page code file and resources corresponding to each first resource address;
the verification module is used for verifying the second response data under the condition that the second response data corresponding to the second page address is matched from the first response data stored locally aiming at the second page address of the page to be displayed of the application program, so as to obtain a second page code file corresponding to the second page address based on a verification result, and a modified second resource address is identified in the second page code file by the original resource address;
the determining module is used for matching the resources corresponding to the second resource address from the locally stored resources corresponding to each first resource address under the condition that the identifier corresponding to the second resource address is a preset identifier;
and the rendering module is used for rendering the page to be displayed based on the resource corresponding to the second resource address.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202311086973.7A 2023-08-25 2023-08-25 Page processing method and device Pending CN117193907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311086973.7A CN117193907A (en) 2023-08-25 2023-08-25 Page processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311086973.7A CN117193907A (en) 2023-08-25 2023-08-25 Page processing method and device

Publications (1)

Publication Number Publication Date
CN117193907A true CN117193907A (en) 2023-12-08

Family

ID=88997145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311086973.7A Pending CN117193907A (en) 2023-08-25 2023-08-25 Page processing method and device

Country Status (1)

Country Link
CN (1) CN117193907A (en)

Similar Documents

Publication Publication Date Title
CN107948314B (en) Business processing method and device based on rule file and server
CN111240653B (en) Interface document generation method, device and readable storage medium
US11184465B2 (en) Network communication for establishing a QUIC connection
CN109558320B (en) System testing method, device, system, equipment and computer readable storage medium
CN110059269B (en) Page tracking method and device, electronic equipment and computer readable storage medium
CN110704381A (en) Data analysis method, device and storage medium
CN108256014B (en) Page display method and device
CN103078945A (en) Method and system for processing browser crash data
CN110968478A (en) Log collection method, server and computer storage medium
CN105704177A (en) UA identification method and device
EP3896940A1 (en) Resource description file processing, and page resource obtaining method and device
CN114091409A (en) Method, system, equipment and storage medium for distributed asynchronous Excel analysis
CN110674427B (en) Method, device, equipment and storage medium for responding to webpage access request
CN111274091B (en) Log processing method, device, computer equipment and storage medium
CN111177601A (en) Page rendering processing method, device and equipment and readable storage medium
CN107277087B (en) Data processing method and device
US10095791B2 (en) Information search method and apparatus
CN111381847A (en) Information processing method and device
CN111046316B (en) Application on-shelf state monitoring method, intelligent terminal and storage medium
CN103139298B (en) Method for transmitting network data and device
CN117193907A (en) Page processing method and device
CN107483294B (en) Method and device for monitoring network request
CN111339170A (en) Data processing method and device, computer equipment and storage medium
CN110209959B (en) Information processing method and device
CN110618934A (en) Front-end automatic test debugging method and device and computer readable storage medium

Legal Events

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