Search

CN-115270023-B - Page data caching method and related equipment thereof

CN115270023BCN 115270023 BCN115270023 BCN 115270023BCN-115270023-B

Abstract

The embodiment of the application provides a page data caching method and related equipment thereof, which are used for reducing the loading time of pages and improving the user experience. The method is applied to a client, when an application program of the client is started, target cache configuration information is acquired from a cache interface of a server corresponding to the application program, the target cache configuration information comprises target page parameter information of pages and target page identification information matched with the target page parameter information one by one, when a first page is accessed, the first page parameter information of the first page and the first page identification information matched with the first page parameter information are acquired, whether the first page identification information is identical to any one page identification information in the target page identification information or not is checked, whether the client does not store the first page identification information or not is judged, and if the first page identification information is identical and does not store the first page identification information, a data cache instruction is sent to the cache interface according to the target page parameter information so as to acquire the target page cache information.

Inventors

  • KE WENTAO
  • LI LEILEI
  • LI WEILIANG

Assignees

  • 深圳乐信软件技术有限公司

Dates

Publication Date
20260512
Application Date
20220719

Claims (10)

  1. 1. A method for caching page data, applied to a client, the method comprising: When an application program of the client is started, acquiring target cache configuration information from a cache interface of a server corresponding to the application program, wherein the target cache configuration information comprises target page parameter information of pages and target page identification information which is matched with the target page parameter information one by one, and the target page identification information comprises an information summarization algorithm MD5; when a first page is accessed, acquiring first page parameter information of the first page and first page identification information matched with the first page parameter information; Checking whether the first page identification information is the same as any page identification information in the target page identification information and whether the client does not store the first page identification information; If the first page identification information is the same and the first page identification information is not stored, sending a data caching instruction to the caching interface according to the target page parameter information so as to acquire target page caching information; the method further comprises the steps of: locally storing the target page cache information according to a preset format; the locally storing the target page cache information according to the preset format comprises the following steps: Naming the target page cache information according to the matching relation between the target page parameter information and the target page identification information to form naming information of the target page cache information; storing the target page cache information to the client according to the format of the naming information; And storing the target matching relation between the target page parameter information and the naming information to the client.
  2. 2. The method according to claim 1, wherein after the target matching relationship between the target page parameter information and the naming information is saved to the client, the method further comprises: when a second page is accessed, acquiring second page parameter information of the second page; judging whether to update the target matching relationship according to the second page parameter information; If yes, acquiring first cache configuration information corresponding to the second page from the cache interface to determine whether the first cache configuration information has page identification information identical to the target page identification information; if not, accessing the second page according to the hypertext transfer HTTPS protocol.
  3. 3. The method of claim 2, wherein the first cache configuration information includes second page identification information that matches the second page parameter information, and wherein determining whether the first cache configuration information has the same page identification information as the target page identification information includes: Judging whether the target page identification information contains the second page identification information or not; If yes, updating the target page parameter information into the second page parameter information; and if not, executing the step of accessing the second page according to the hypertext transfer HTTPS protocol.
  4. 4. The method of claim 3, wherein after locally storing the target page cache information in a predetermined format, the method further comprises: and when any one of the pages is accessed, performing page rendering on the any one page according to the locally stored target page cache information.
  5. 5. The method of claim 4, wherein the page rendering of the arbitrary page according to the locally stored target page cache information comprises: Sending the data caching instruction to the caching interface according to the second page parameter information so as to acquire target page caching information corresponding to the second page parameter information; and performing page rendering on the second page according to the target page cache information corresponding to the locally stored second page parameter information.
  6. 6. The method of claim 1, wherein after locally storing the target page cache information in a predetermined format, the method further comprises: when the target page cache information is acquired, acquiring real-time information; And writing the real-time information into the target page cache information, and storing the target page cache information after writing the real-time information in a local place.
  7. 7. The method of claim 6, wherein after writing the real-time information into the target page cache information and storing the target page cache information locally, the method further comprises: if the application program is closed, acquiring current time information for closing the application program; Calculating the real-time information and the current time information to obtain a calculation result; Judging whether the calculation result is larger than a preset threshold value or not; And if yes, deleting the target page cache information.
  8. 8. A page data caching system for application to a client, the system comprising: the acquisition unit is used for acquiring target cache configuration information from a cache interface of a server corresponding to the application program when the application program of the client is started, wherein the target cache configuration information comprises target page parameter information of pages and target page identification information which is matched with the target page parameter information one by one, and the target page identification information comprises an information summarization algorithm MD5; The acquisition unit is further used for acquiring first page parameter information of the first page and first page identification information matched with the first page parameter information when the first page is accessed; A verification unit, configured to verify whether the first page identification information is the same as any page identification information in the target page identification information and whether the client does not store the first page identification information; the sending unit is used for sending a data caching instruction to the caching interface according to the target page parameter information when the first page identification information is the same and not stored, so as to obtain target page caching information; The system further includes a storage unit; the storage unit is used for locally storing the target page cache information according to a preset format; The system also includes a naming unit; The naming unit is used for naming the target page cache information according to the matching relation between the target page parameter information and the target page identification information so as to form naming information of the target page cache information; The storage unit is specifically configured to store the target page cache information to the client according to the format of the naming information; The storage unit is specifically configured to store the target matching relationship between the target page parameter information and the naming information to the client.
  9. 9. A page data caching apparatus, the apparatus comprising: The device comprises a central processing unit, a memory, an input/output interface, a wired or wireless network interface and a power supply; The memory is a short-term memory or a persistent memory; The central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method of any of claims 1 to 7.
  10. 10. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 7.

Description

Page data caching method and related equipment thereof Technical Field The embodiment of the application relates to the technical field of software, in particular to a page data caching method and related equipment thereof. Background With the development of mobile internet technology, application (APP) has become more and more powerful. Meanwhile, the HTML5 (H5 for short) page is more and more popular in APP due to the advantages of high flexibility, low development cost, short manufacturing period and the like. Along with the development of the functions of the APP becoming more and more perfect, the resource data in the APP becomes larger and larger, and at present, the opening of an H5 page in the APP environment is performed by opening and rendering the page through a system webview of a client, and a webview caching mechanism of a browser is utilized to cache static resources. But when the unviewed H5 page in the APP is opened for the first time, the resource file required by the H5 page needs to be requested to be downloaded once, and then the page is rendered. The self-contained webview cache of the browser is limited and uncontrollable, and the cache logic of the page static resource cannot be controlled, so that the loading time of the first screen of the page is greatly increased, the user accessing the page is greatly influenced, and the experience is poor. Disclosure of Invention The embodiment of the application provides a page data caching method which is used for reducing the loading time of pages and improving the user experience. The first aspect of the embodiment of the application provides a page data caching method, which is applied to a client and comprises the following steps: When an application program of the client is started, acquiring target cache configuration information from a cache interface of a server corresponding to the application program, wherein the target cache configuration information comprises target page parameter information of pages and target page identification information which is matched with the target page parameter information one by one; when a first page is accessed, acquiring first page parameter information of the first page and first page identification information matched with the first page parameter information; Checking whether the first page identification information is the same as any page identification information in the target page identification information and whether the client does not store the first page identification information; and if the first page identification information is the same and the first page identification information is not stored, sending a data caching instruction to the caching interface according to the target page parameter information so as to acquire target page caching information. Optionally, after the sending a data caching instruction to the caching interface according to the target page parameter information to obtain target page caching information, the method further includes: And locally storing the target page cache information according to a preset format. Optionally, the locally storing the target page cache information according to a preset format includes: Naming the target page cache information according to the matching relation between the target page parameter information and the target page identification information to form naming information of the target page cache information; storing the target page cache information to the client according to the format of the naming information; And storing the target matching relation between the target page parameter information and the naming information to the client. Optionally, after the target matching relationship between the target page parameter information and the naming information is saved to the client, the method further includes: when a second page is accessed, acquiring second page parameter information of the second page; judging whether to update the target matching relationship according to the second page parameter information; If yes, acquiring first cache configuration information corresponding to the second page from the cache interface to determine whether the first cache configuration information has page identification information identical to the target page identification information; if not, accessing the second page according to the hypertext transfer HTTPS protocol. Optionally, the first cache configuration information includes second page identification information matched with the second page parameter information, and the determining whether the first cache configuration information has the same page identification information as the target page identification information includes: Judging whether the target page identification information contains the second page identification information or not; If yes, updating the target page parameter information into the second page parameter information; and if not, executin