A page caching method, apparatus, device, and storage medium

By using a caching mechanism between edge servers and terminal devices, the problem of slow access speed under traditional centralized server architecture is solved, achieving fast response and reduced lag under high access volume, thus improving user experience.

CN116861113BActive Publication Date: 2026-05-26SHENZHEN XINDI NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN XINDI NETWORK TECH CO LTD
Filing Date
2023-06-21
Publication Date
2026-05-26

Smart Images

  • Figure CN116861113B_ABST
    Figure CN116861113B_ABST
Patent Text Reader

Abstract

This application provides a page caching method, apparatus, device, and storage medium, applicable to any terminal device communicating with an edge server. The server is communicatively connected to at least one edge server, and the edge server is communicatively connected to at least one terminal device. The method includes: detecting a user's access to a historical page; retrieving cached resources corresponding to the historical page from a local cache; determining whether the cached resources have expired; if expired, requesting updated resources for the historical page from the edge server corresponding to the terminal device; the edge server stores updated resources for the historical page sent by the server, which are generated when the cached resources expire; and receiving and accessing the updated resources. The technical advantage of this application is that it enables servers with high access volumes to quickly respond to access commands, minimizing user-side lag.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of page loading technology, specifically to a page caching method, apparatus, device, and storage medium. Background Technology

[0002] With the continuous development of internet applications, users have increasingly higher requirements for webpage access speed and response speed. However, traditional centralized server architectures may suffer from slow access speeds and high response latency due to network transmission delays and bandwidth bottlenecks.

[0003] In existing technology, when a user needs to access a website, the user terminal sends an access command to the corresponding server of the website. When the website server receives the command, the backend application server retrieves and sends the web page data that matches the access command back to the user terminal.

[0004] For servers with high traffic, the processing time required for each access request is significant due to the massive volume of traffic. Consequently, the data throughput of the server is low when the traffic is high, making it difficult to respond quickly to access commands and causing lag on the user's end. Summary of the Invention

[0005] This application provides a page caching method, apparatus, device, and storage medium, which enables servers with high access volume to quickly respond to access commands and minimize user-end lag.

[0006] In a first aspect, this application provides a page caching method, applied to any terminal device communicating with an edge server, wherein the server is communicating with at least one edge server, and the edge server is communicating with at least one terminal device. The method includes: detecting a user's access operation to a historical page; obtaining cached resources corresponding to the historical page from a local cache; determining whether the cached resources have expired; if the cached resources have expired, requesting updated resources for the historical page from the edge server corresponding to the terminal device; wherein the edge server stores updated resources for the historical page sent by the server, and the updated resources are generated by the server when it detects that the cached resources have expired; receiving the updated resources and accessing the updated resources.

[0007] By adopting the above technical solution, the pressure on the central server is distributed by setting up multiple edge servers. Each user terminal in a different region corresponds to an edge server, so even when the central server has a large number of accesses, it can quickly respond to access commands. Furthermore, when a terminal device accesses a website, the cached resources corresponding to that website will be cached in the local cache in advance. When the access volume of that website is high, the terminal device can call the cached resources from the local cache, minimizing the occurrence of user-end lag.

[0008] Optionally, after detecting a user's access to a historical page and retrieving the cached resource corresponding to the historical page from the local cache, the method further includes: determining whether the cached resource needs to be updated; if the cached resource needs to be updated, requesting the updated resource of the historical page from the edge server corresponding to the terminal device; the edge server stores the updated resource of the historical page sent by the server, and the updated resource is generated by the server when it detects that the cached resource needs to be updated; receiving the updated resource and accessing the updated resource.

[0009] By adopting the above technical solution, when the cached resources cached locally need to be updated, the terminal device will directly request the updated resources from the corresponding edge server. This avoids the situation where local cached resources expire and the terminal device has no local cached resources to call when the user accesses a historical URL due to the high access volume of the current URL, thus causing the user's end to lag.

[0010] Optionally, after receiving and accessing the updated resource, the method further includes: caching the updated resource in the local cache.

[0011] By adopting the above technical solution, the updated resources are cached in the local cache so that users can directly access them on the next visit, avoiding the situation where terminal devices lag when the current URL is accessed too much, thus improving the user experience.

[0012] Optionally, caching the updated resource in the local cache includes: if the updated resource includes the cached resource, then caching the cached resources other than the cached resource in the updated resource in the local cache; if the updated resource does not include the cached resource, then deleting the cached resource and caching the updated resource in the local cache.

[0013] By adopting the above technical solution, when caching updated resources in the local cache, the updated resources and cached resources can be compared to select the amount of updated resources to be stored subsequently, thus avoiding excessive memory occupation of the terminal device and causing the terminal device to lag.

[0014] Optionally, caching the updated resources in the local cache includes: obtaining the historical access volume of the historical page, where the historical access volume is the total number of times the terminal device accessed the historical page within a preset time period before the current time; predicting the access volume of the historical page after the current time period based on the historical access volume, thus obtaining the predicted access volume; obtaining the basic information of the terminal device, where the basic information includes the historical network quality information of the terminal device and the remaining storage information of the terminal device; and combining the predicted access volume and the basic information of the terminal device to determine whether the current terminal device needs to cache some or all of the updated resources, and caching some or all of the updated resources in the local cache.

[0015] By adopting the above technical solution, when considering caching updated resources to the local cache, the amount of resources that the terminal device needs to cache is determined by combining three dimensions: historical access volume, network quality of the terminal device, and remaining storage capacity of the terminal device. This helps to avoid situations where too many or too few updated resources are cached, causing the terminal device to experience lag when accessing the current URL and affecting the user experience.

[0016] Optionally, the step of combining the predicted access volume and the basic information of the terminal device to determine that the current terminal device needs to cache some or all of the updated resources, and caching some or all of the updated resources in the local cache, includes: if the predicted access volume is not less than a first threshold, then it is initially determined that the terminal device needs to cache all of the updated resources; then, based on the remaining storage information of the terminal device in the basic information, the final cache amount is determined; if the remaining storage is greater than all of the updated resources, then the final cache amount is determined to be all of the updated resources; if the predicted access volume does not exceed the first threshold and is not less than a second threshold, and the remaining storage is greater than all of the updated resources, wherein the first threshold is greater than the second threshold; then, based on the historical network quality information in the basic information, a prediction scheme is pushed, the prediction scheme allowing the user to determine the final cache amount themselves.

[0017] By adopting the above technical solutions and combining multiple dimensions and actual conditions, the final cache amount for different terminal devices is determined, so as to avoid situations where too much or too little cached update resources affect the terminal devices' access to the current URL and cause lag, thus impacting the user experience.

[0018] Optionally, the step of determining whether the current terminal device needs to cache some or all of the updated resources by combining the predicted access volume and the basic information of the terminal device, and caching some or all of the updated resources in the local cache, further includes: if the predicted access volume is less than the second threshold and the remaining storage volume is greater than the total amount of resources in the updated resources, then the final cache amount is determined based on the historical network quality information of the terminal device; if the historical network quality of the terminal device does not exceed a preset standard, then the final cache amount is determined to be a portion of the updated resources.

[0019] By adopting the above technical solutions and combining multiple dimensions and actual conditions, the final cache amount for different terminal devices is determined, so as to avoid situations where too much or too little cached update resources affect the terminal devices' access to the current URL and cause lag, thus impacting the user experience.

[0020] In a second aspect, a page caching device is provided, characterized in that the device comprises: a detection module, a judgment module, and a receiving module; wherein, the detection module is used to detect a user's access operation to a historical page and obtain cached resources corresponding to the historical page from a local cache; the judgment module is used to determine whether the cached resources have expired, and if the cached resources have expired, it requests updated resources for the historical page from the edge server corresponding to the terminal device, the edge server storing updated resources for the historical page sent by the server, the updated resources being generated by the server when it detects that the cached resources have expired; the receiving module is used to receive the updated resources and access the updated resources.

[0021] By adopting the above technical solution, the pressure on the central server is distributed by setting up multiple edge servers. Each user terminal in a different region corresponds to an edge server, so even when the central server has a large number of accesses, it can quickly respond to access commands. Furthermore, when a terminal device accesses a website, the cached resources corresponding to that website will be cached in the local cache in advance. When the access volume of that website is high, the terminal device can call the cached resources from the local cache, minimizing the occurrence of user-end lag.

[0022] Thirdly, this application provides an electronic device that adopts the following technical solution: it includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to enable the electronic device to execute a computer program of any of the page caching methods described above.

[0023] Fourthly, this application provides a computer-readable storage medium that employs the following technical solution: storing a computer program capable of being loaded by a processor and executing any of the above-described page caching methods.

[0024] In summary, this application includes at least one of the following beneficial technical effects:

[0025] 1. By setting up multiple edge servers to distribute the pressure on the central server, user terminals in different regions correspond to one edge server. Even when the central server has a large number of accesses, it can quickly respond to access commands. Furthermore, when a terminal device accesses a website, the cached resources corresponding to that website will be cached in the local cache in advance. When the access volume of that website is high, the terminal device can call the cached resources from the local cache, minimizing the occurrence of user-end lag.

[0026] 2. By combining three dimensions—historical access volume, network quality of the terminal device, and remaining storage capacity of the terminal device—the amount of resources that the terminal device needs to cache at present can be determined. This aims to avoid situations where too many or too few cached update resources affect the terminal device's access to the current website, causing lag and impacting user experience. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of an architecture provided in an embodiment of this application;

[0028] Figure 2 This is a flowchart illustrating a page caching method provided in an embodiment of this application;

[0029] Figure 3 This is a schematic diagram of the structure of a page caching device provided in an embodiment of this application;

[0030] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0031] Explanation of reference numerals in the attached diagram: 1. Detection module; 2. Judgment module; 3. Receiving module; 1000. Electronic device; 1001. Processor; 1002. Communication bus; 1003. User interface; 1004. Network interface; 1005. Memory. Detailed Implementation

[0032] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0033] In the description of the embodiments in this application, words such as "illustrative," "for example," or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "illustrative," "for example," or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "illustrative," "for example," or "for example" is intended to present the relevant concepts in a specific manner.

[0034] Figure 1 This is a schematic diagram of an architecture provided in an embodiment of this application. As shown in the figure, it includes a central server, multiple edge servers, and multiple terminal devices; the central server is communicatively connected to the multiple edge servers, and each edge server is communicatively connected to multiple terminal devices. In this application, the server issues task instructions, and the edge servers are used to transmit the instructions issued by the central server to each user terminal. The role of the edge servers can be understood as sharing the burden of the central server and improving the access speed of the terminal devices.

[0035] The application scenario of this application can be understood as follows: to avoid slow access speeds and poor user experience when terminal devices access a website due to excessive number of users accessing the website or poor network quality on the user's end. To solve this problem, the following solution is adopted: the central server stores the website's static resources, such as images and videos, on edge servers. Static resources refer to files that do not require dynamic generation and do not change with different user requests, thus they can be cached, thereby reducing requests to the central server and improving website access speed and performance. When a user visits the website for the first time, these static resources are saved to the terminal device's local cache. On subsequent visits, there is no need to reload them; they can simply be retrieved from the local cache. This not only reduces the pressure on the central server and edge servers but also enables fast access for the user's end.

[0036] Figure 2 This is a flowchart illustrating a page caching method provided in an embodiment of this application. It should be understood that, although... Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows; unless explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be executed in other orders; and Figure 2At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0037] This application discloses a page caching method, such as Figure 2 As shown, the method includes S101-S103.

[0038] S101, a user's access operation to a historical page is detected, and the cached resources corresponding to the historical page are obtained from the local cache.

[0039] In one example, a history page refers to a page that a user has visited at least once, which can be understood as a page that the user has visited multiple times. The cached resources here include, but are not limited to, static resources. The following example uses static resources for illustration. When a user accesses any website for the first time through the corresponding edge server, because the edge server pre-stores some or all of the website's static resources, some static resources (images or videos) from the website are stored in the local cache from the edge server upon the user's first visit. When the user visits the website again, only the static resources stored in the local cache need to be retrieved, without having to retrieve them from the website again, reducing the load on the edge server and improving the user's access speed. The terminal device here can be a computer, mobile phone, tablet, etc., without further restrictions.

[0040] After detecting a user's access to a historical page and retrieving the corresponding cached resource from the local cache, the process further includes: determining whether the cached resource needs to be updated; if the cached resource needs to be updated, requesting the updated resource of the historical page from the edge server corresponding to the terminal device; the edge server stores the updated resource of the historical page sent by the server, and the updated resource is generated by the server when it detects that the cached resource needs to be updated; receiving the updated resource and accessing the updated resource.

[0041] Please refer to the above embodiments for details, which will not be elaborated further here.

[0042] S102, determine whether the cached resource has expired. If the cached resource has expired, request the update resource of the historical page from the edge server corresponding to the terminal device. The edge server stores the update resource of the historical page sent by the server. The update resource is generated by the server when it detects that the cached resource has expired.

[0043] In another example, generally speaking, some static resources (images or videos) on a website are updated as the website is updated. For example, in the case of an e-commerce website, a product image on the website may change over time, so it is necessary to update the image periodically. When some static resources need to be updated, the resources to be updated are the expired resources. In addition, considering the storage capacity of terminal devices, some static resources need to be deleted periodically. For example, when a user visits any website, the terminal device will download some or all of the website's static resources through the corresponding edge server on the first visit. However, there are cases where the user will not visit the website again or will visit the website again after a long period of time. Therefore, it is necessary to delete some static resources periodically to avoid occupying the terminal device's memory space. These static resources can also be understood as expired resources. Here, the time for deleting static resources can be set according to the actual situation.

[0044] When expired static resources are detected, the terminal device requests updated resources for the historical pages from the corresponding edge server. These updated resources are used to add to or delete existing static resources. Generally, the central server monitors the edge servers in real time for expired cached resources. If any are found, the central server sends the updated resources to the edge server, and the terminal device downloads the updated resources from the edge server. Alternatively, the central server can proactively modify static resources and send the modified static resources to the edge servers, allowing the terminal device to directly download the updated static resources from the edge servers.

[0045] S103, Receive updated resources and access updated resources.

[0046] In one example, due to resource updates, this can be considered the user's first visit to a new website. In this case, the above steps need to be repeated to re-download the static resources so that on subsequent visits, there is no need to reload them; they can simply be retrieved from the local cache.

[0047] Cache updated resources in the local cache, including: if the updated resource includes cached resources, then cache the cached resources in the updated resource other than the cached resources in the local cache; if the updated resource does not include cached resources, then delete the cached resources and cache the updated resource in the local cache.

[0048] In one example, after receiving the updated resource, it is necessary to compare the updated resource with the already cached resource to determine the differences between them. For instance, if the updated resource is an addition to the already cached resource, then the updated resource, excluding the already cached resource, is stored in the terminal device's local cache; if some resources in the updated resource are the same as those in the already cached resource, then the parts in the already cached resource that are different from the updated resource are deleted, and the parts in the updated resource that are different from those in the already cached resource are cached in the local cache.

[0049] Cache updated resources in the local cache, including: obtaining the historical access volume of historical pages, where the historical access volume is the total number of times at least one terminal device accesses historical pages within a preset time period before the current time; predicting the access volume of historical pages after the current time within a preset time period based on the historical access volume, thus obtaining the predicted access volume; obtaining the basic information of the terminal device, including the historical network quality information and the remaining storage information of the terminal device; and combining the predicted access volume and the basic information of the terminal device to determine whether the current terminal device needs to cache some or all of the updated resources, and caching some or all of the updated resources in the local cache.

[0050] In one example, the amount of resources to be cached varies depending on the different terminal devices. This example focuses on static resources. An edge server connects to multiple user terminals. When multiple terminals access the same website through the same edge server, it can overload the edge server, causing lag on the terminal devices. Therefore, it's necessary to obtain the historical access volume of each website. Taking a week as an example, we can obtain the total number of times any website was accessed by terminal devices a week ago and predict the website's access volume after a preset time period based on this total number of accesses. This can be understood as follows: if the current website is popular, multiple terminal devices may access it simultaneously after the predicted time period, causing lag for users. To avoid this, terminal devices can cache more static resources for the website. Similarly, if the current website has low access volume, terminal devices can cache less static resources.

[0051] Of course, since different static resource caching amounts need to be set for different terminal devices, it is also necessary to consider the basic information of each terminal device. This basic information includes, but is not limited to, the terminal device's historical network quality information and remaining storage information. Historical network quality information can be understood as obtaining the current network quality of the terminal device by acquiring network quality data over a preset period, such as one week or one month. By acquiring the network quality data of the terminal device over the past week, the current network quality of the terminal device is predicted. Then, combined with historical access volume, the current network quality of the terminal device, and the current storage space of the terminal device, the amount of static resources downloaded by each terminal device from the corresponding edge server is determined. It should be noted that terminal devices may have insufficient storage space, so the amount of static resources downloaded by each terminal device from the corresponding edge server needs to be determined in conjunction with the remaining storage space of the terminal device. Furthermore, the dimensions considered include, but are not limited to, the three dimensions mentioned above. These dimensions can be set, added, or removed according to the actual situation, and will not be elaborated further here.

[0052] Based on the predicted access volume and the basic information of the terminal device, it is determined whether the current terminal device needs to cache some or all of the updated resources, and these resources are cached locally. This includes: if the predicted access volume is not less than a first threshold, it is initially determined that the terminal device needs to cache all of the updated resources; then, based on the remaining storage information of the terminal device in the basic information, the final cache size is determined. If the remaining storage is greater than all of the updated resources, the final cache size is determined to be all of the updated resources; if the predicted access volume does not exceed the first threshold and is not less than a second threshold, and the remaining storage is greater than all of the updated resources (where the first threshold is greater than the second threshold); then, based on the historical network quality information in the basic information, a prediction scheme is pushed, allowing the user to determine the final cache size themselves. If the predicted access volume is less than the second threshold, and the remaining storage is greater than all of the updated resources, the final cache size is determined based on the historical network quality information of the terminal device; if the historical network quality of the terminal device does not exceed a preset standard, the final cache size is determined to be a portion of the updated resources.

[0053] In one example, the amount of static resources cached on each terminal device is calculated by combining the three dimensions mentioned above. Regarding access volume, this can be set according to actual conditions. There are three scenarios for access volume: high access volume, moderate access volume, and low access volume. Generally, if the access volume is high, the website is considered popular. In this case, the terminal device can cache all the website's static resources stored on the edge server locally to prevent lag on subsequent visits. In this case, the network status of the terminal device does not need to be considered; only the terminal device's storage space needs to be considered. Static resources are cached based on the terminal device's storage space. Generally, static resources occupy a small amount of memory and can be cached entirely. If the current static resources occupy too much memory, the amount of static resources to be cached can be appropriately reduced based on the remaining memory. The method of reduction can be chosen by the user or decided by the terminal device.

[0054] For situations with moderate website traffic, where the traffic is unstable and varies significantly across different time periods, the focus should be on the network quality of the terminal device. In such cases, users need to manually select the amount of static resources to cache. The terminal device can push a cache range based on the user's network quality and remaining memory space, allowing the user to choose the amount of static resources to cache according to their own needs.

[0055] For scenarios with low traffic, edge servers generally don't experience lag. Therefore, to prevent users from experiencing lag when accessing the website again, the primary considerations are the network quality and remaining memory space of the terminal device. The terminal device can predict its network quality by obtaining historical network quality data, and then determine whether caching is necessary based on this. If the quality is good, caching is unnecessary; if the quality is poor, the amount of memory needed for caching can be determined by considering the remaining memory. A cache size range can also be provided, allowing users to choose the amount of static resources to cache. It should be noted that when considering the amount of static resources to cache, the dimensions considered are not limited to the three dimensions mentioned above. One or more dimensions can be added or removed depending on the actual situation. No further restrictions are imposed here, but the method for calculating the amount of cached resources for the terminal device can refer to the above embodiment, and will not be elaborated further here.

[0056] Based on the above method, this application also discloses a page caching device, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a page caching device provided in an embodiment of this application.

[0057] A page caching device includes: a detection module 1, a judgment module 2, and a receiving module 3; wherein, the detection module 1 is used to detect user access operations on historical pages and obtain cached resources corresponding to the historical pages from the local cache; the judgment module 2 is used to determine whether the cached resources have expired, and if the cached resources have expired, it requests updated resources for the historical pages from the edge server corresponding to the terminal device, the edge server storing the updated resources for the historical pages sent by the server, and the updated resources are generated by the server when the cached resources are detected to have expired; the receiving module 3 is used to receive and access the updated resources.

[0058] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0059] Please see Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.

[0060] The communication bus 1002 is used to realize the connection and communication between these components.

[0061] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.

[0062] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0063] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1001 and may be implemented as a separate chip.

[0064] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 4 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a page caching method.

[0065] exist Figure 4In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 1001 can be used to call an application program that stores a page caching method in the memory 1005. When executed by one or more processors, the electronic device performs one or more of the methods described in the above embodiments.

[0066] An electronic device readable storage medium stores instructions that, when executed by one or more processors, cause the electronic device to perform one or more of the methods described in the above embodiments.

[0067] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0068] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0069] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.

[0070] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0071] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0072] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0073] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A page caching method, characterized in that, A terminal device applied to any communication connection edge server, wherein the server is communicationally connected to at least one edge server, and the edge server is communicationally connected to at least one of the terminal devices, the method comprising: Upon detecting a user's access to a historical page, the cached resources corresponding to the historical page are retrieved from the local cache. Determine whether the cached resource needs to be updated. If the cached resource needs to be updated, request the update resource of the historical page from the edge server corresponding to the terminal device. The edge server stores the update resource of the historical page sent by the server. The update resource is generated by the server when it detects that the cached resource needs to be updated. Receive the updated resource and access the updated resource; Determine whether the cached resource has expired. If the cached resource has expired, request the update resource of the historical page from the edge server corresponding to the terminal device. The edge server stores the update resource of the historical page sent by the server. The update resource is generated by the server when it detects that the cached resource has expired. Receiving and accessing the updated resource; caching the updated resource in the local cache, including: If the updated resource includes the cached resource, then the cached resources other than the cached resource in the updated resource are cached in the local cache; if the updated resource does not include the cached resource, then the cached resource is deleted and the historical access volume of the historical page is obtained, the historical access volume being the total number of times the terminal device accessed the historical page within a preset time period before the current time; based on the historical access volume, the access volume of the historical page after a preset time period after the current time is predicted to obtain the predicted access volume; the basic information of the terminal device is obtained, the basic information including the historical network quality information of the terminal device and the remaining storage information of the terminal device; Based on the predicted access volume and the basic information of the terminal device, it is determined that the current terminal device needs to cache some or all of the updated resources, and some or all of the updated resources are cached in the local cache, including: If the predicted access volume is not less than a first threshold, it is initially determined that the terminal device needs to cache all resources in the updated resources; then, the final cache size is determined based on the remaining storage information of the terminal device in the basic information. If the remaining storage is greater than all resources in the updated resources, the final cache size is determined to be all resources in the updated resources. If the predicted access volume does not exceed the first threshold and is not less than a second threshold, and the remaining storage is greater than all resources in the updated resources, wherein the first threshold is greater than the second threshold; then, a prediction scheme is pushed based on the historical network quality information in the basic information, so that the user can determine the final cache size themselves. If the predicted access volume is less than the second threshold and the remaining storage volume is greater than the total amount of resources in the updated resources, then the final cache volume is determined based on the historical network quality information of the terminal device; if the historical network quality of the terminal device does not exceed the preset standard, then the final cache volume is determined to be a portion of the resources in the updated resources.

2. A page caching device, characterized in that, The device includes: a detection module (1), a judgment module (2), and a receiving module (3); wherein, The detection module (1) is used to detect user access operations on historical pages, obtain cache resources corresponding to the historical pages from the local cache; determine whether the cache resources need to be updated; if the cache resources need to be updated, request update resources for the historical pages from the edge server corresponding to the terminal device; the edge server stores update resources for the historical pages sent by the server; the update resources are generated by the server when it detects that the cache resources need to be updated; receive the update resources and access the update resources. The judgment module (2) is used to determine whether the cached resource has expired. If the cached resource has expired, it requests the update resource of the historical page from the edge server corresponding to the terminal device. The edge server stores the update resource of the historical page sent by the server. The update resource is generated by the server when it detects that the cached resource has expired. The receiving module (3) is used to receive the updated resource and access the updated resource; cache the updated resource in the local cache, including: if the updated resource includes the cached resource, then cache the cached resources other than the cached resource in the updated resource in the local cache; if the updated resource does not include the cached resource, then delete the cached resource and obtain the historical access volume of the historical page, the historical access volume being the total number of times the terminal device accessed the historical page within a preset time period before the current time; based on the historical access volume, predict the access volume of the historical page after a preset time period after the current time, and obtain the predicted access volume; obtain the basic information of the terminal device, the basic information including the historical network quality information of the terminal device and the remaining storage information of the terminal device; combine the predicted access volume and the basic information of the terminal device to determine that the current terminal device needs to cache some or all of the resources in the updated resource, and cache some or all of the resources in the updated resource in the local cache. The caching process includes: if the predicted access volume is not less than a first threshold, it is initially determined that the terminal device needs to cache all resources in the updated resources; then, based on the remaining storage information of the terminal device in the basic information, the final cache size is determined; if the remaining storage is greater than all resources in the updated resources, the final cache size is determined to be all resources in the updated resources; if the predicted access volume does not exceed the first threshold and is not less than a second threshold, and the remaining storage is greater than all resources in the updated resources, wherein the first threshold is greater than the second threshold; then, based on the historical network quality information in the basic information, a prediction scheme is pushed, the prediction scheme allowing the user to determine the final cache size; if the predicted access volume is less than the second threshold, and the remaining storage is greater than all resources in the updated resources, the final cache size is determined based on the historical network quality information of the terminal device; if the historical network quality of the terminal device does not exceed a preset standard, the final cache size is determined to be a portion of the updated resources.

3. An electronic device, characterized in that, The device includes a processor (1001), a memory (1005), a user interface (1003), and a network interface (1004). The memory (1005) is used to store instructions. The user interface (1003) and the network interface (1004) are used to communicate with other devices. The processor (1001) is used to execute the instructions stored in the memory to cause the electronic device (1000) to perform the method as described in claim 1.

4. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed as described in claim 1.