Cache updating method, system and apparatus
By introducing synchronous cache servers and edge cache servers into the CDN system and optimizing the cache update method, the problem of low update efficiency of the parent cache server was solved, and more efficient cache management and hit rate were achieved.
Patent Information
- Application Number
- CN202411753689.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-02
AI Technical Summary
In the existing multi-level CDN network architecture, the cache update efficiency of the parent layer cache server is low, which cannot effectively improve the cache hit rate.
By introducing synchronous cache servers into the CDN system, edge cache servers periodically obtain cache feature information and generate reporting feature tables and incremental cache hit counts. The parent cache server updates the sorting of the parent LRU linked list based on this information, thereby optimizing cache management.
It improves the cache update efficiency of the parent cache server, reduces cache information loss, and enhances the accuracy and hit rate of cache updates.
Smart Images

Figure CN119520612B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cache updating, and in particular to a cache updating method and device, a computer device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] In a CDN (Content Delivery Network) network, files such as on-demand videos or website pictures need to be cached on a cache server. Cache refers to copying a required static resource file to a CDN cache server. Since the storage capacity of a single cache server is actually limited, the files to be cached can be considered unlimited. In order to improve the quality of CDN service, ensure the cache hit rate, and reduce a large amount of back source caused by cache loss, the general practice in the industry is to set a multi-level CDN network architecture: edge layer cache servers, parent layer cache servers, and multiple edge cache servers sharing the same parent layer server.
[0003] However, the multi-level CDN network architecture currently used has the problem of low cache updating efficiency of the parent layer cache server. SUMMARY
[0004] Therefore, it is necessary to provide a cache updating method and device, a computer device, a computer readable storage medium and a computer program product capable of improving the cache updating efficiency of the parent layer cache server.
[0005] In a first aspect, the present application provides a cache updating method applied to a synchronization cache server in a CDN system of a target area. The CDN system includes a parent layer cache server, a synchronization cache server and multiple edge cache servers. The synchronization cache server is for edge cache servers with ip address information satisfying a set condition, and includes the following steps.
[0006] Receiving hot cache feature information and ip address information of two adjacent periods sent by each edge cache server. The hot cache feature information is obtained by the edge cache server periodically, and the cache hit number and the latest cache hit time of the user request are taken as the cache feature information. Each cache feature information is stored in the edge lru chain table, and the edge lru sorting is determined according to each cache feature information in the edge lru chain table.
[0007] Based on the IP address information and hot cache feature information, a corresponding reporting feature table is generated, and the incremental cache hit count is obtained based on the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are then sent to the parent cache server. The parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list based on the reporting feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU order.
[0008] In one embodiment, a corresponding reporting feature table is generated based on each IP address information and hot cache feature information, including:
[0009] Using the IP address information and hot cache feature information, construct the corresponding initial reporting feature table;
[0010] Multiple cached URLs are obtained from the initial reporting feature table. For each cached URL, the multiple cached URLs are deduplicated based on the most recent access time of the cached URL to obtain the reporting feature table.
[0011] In one embodiment, multiple cached URLs are deduplicated based on their most recent access time, including:
[0012] Identify duplicate cache URLs to be processed from multiple cache URLs;
[0013] Get the most recent access time and the current time of the cached URL to be processed, and get the time distance between the most recent access time and the current time;
[0014] Retain the pending cache URL corresponding to the smallest time distance, and remove other duplicate pending cache URLs.
[0015] Secondly, this application also provides a cache update method, applied to any edge cache server in a CDN system of a target region. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions, including:
[0016] Periodically obtain the cache hit count and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list accordingly;
[0017] Based on the edge LRU sorting of each cache feature information in the edge LRU linked list, the hot cache feature information is determined from multiple cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server; the synchronous cache server is used to receive each hot cache feature information and IP address information, generate the corresponding reporting feature table based on each IP address information and hot cache feature information, and obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server;
[0018] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0019] In one embodiment, hot cache feature information is determined from multiple cache feature information based on the edge LRU sorting of each cache feature information in the edge LRU linked list, including:
[0020] Cache feature information whose edge LRU sorting is greater than a preset sorting threshold is identified as hot cache feature information.
[0021] Thirdly, this application also provides a cache update method applied to a parent cache server in a CDN system for a target region. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions, including:
[0022] The synchronous cache server receives the reported feature table and incremental cache hit count from the synchronous cache server. The reported feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each edge cache server for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically obtaining the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information in the corresponding edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is used to determine the cache feature information.
[0023] Based on the reported feature table and the incremental cache hit count, update the parent LRU sorting of each cache in the parent LRU linked list, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0024] In an exemplary embodiment, updating the parent LRU order of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count includes:
[0025] Iterate through the reported feature table to obtain multiple cached URLs, and get the current time;
[0026] Retrieve the corresponding cache from the parent cache server's cache table based on the cached URL;
[0027] Based on the most recent cache hit time, current time, and incremental cache hit count associated with the cached URL, the decayed cache hit count is obtained;
[0028] Update the cache reference value based on the decayed cache hit count, and update the parent LRU sort of each cache in the parent LRU list based on the updated reference value.
[0029] Fourthly, this application also provides a cache update system, which includes a parent cache server, a synchronous cache server, and multiple edge cache servers of a target area CDN system; the synchronous cache server is an edge cache server whose IP address information meets the set conditions.
[0030] The edge cache server is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list. According to the edge LRU sorting of each cache feature information in the edge LRU linked list, the hot cache feature information is determined from multiple cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server.
[0031] The synchronous cache server is used to generate corresponding reporting feature tables based on each IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server.
[0032] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0033] Fifthly, this application also provides a cache update device applied to a synchronous cache server in a CDN system of a target area. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions, including:
[0034] The information receiving module is used to receive hot cache feature information and IP address information sent by each edge cache server for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically obtaining the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly. The information is determined according to the edge LRU sorting of each cache feature information in the edge LRU linked list.
[0035] The feature sending module is used to generate corresponding reporting feature tables based on each IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; the parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and incremental cache hit count, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0036] Sixthly, this application also provides a cache update device, applied to any edge cache server in a CDN system of a target area. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions, including:
[0037] The information construction module is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list accordingly;
[0038] The information sending module is used to determine the hot cache feature information from multiple cache feature information according to the edge LRU sorting of each cache feature information in the edge LRU linked list, and send the hot cache feature information and IP address information of two adjacent periods to the synchronous cache server; the synchronous cache server is used to receive each hot cache feature information and IP address information, generate the corresponding reporting feature table based on each IP address information and hot cache feature information, and obtain the incremental cache hit count according to the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server;
[0039] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0040] Seventhly, this application also provides a cache update apparatus, applied to a parent cache server in a CDN system of a target region. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions, including:
[0041] The feature receiving module is used to receive the reported feature table and incremental cache hit count sent by the synchronous cache server. The reported feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each edge cache server for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically acquiring the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information into the edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is used to determine the cache feature information.
[0042] The cache update module is used to update the parent LRU sort of each cache in the parent LRU linked list according to the reported feature table and the incremental cache hit count, and update the cache stored in the parent LRU linked list based on the updated parent LRU sort.
[0043] Eighthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0044] It receives hot cache feature information and IP address information for two adjacent periods sent by each edge cache server; the hot cache feature information is obtained by the edge cache server periodically obtaining the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list;
[0045] Based on the IP address information and hot cache feature information, a corresponding reporting feature table is generated, and the incremental cache hit count is obtained based on the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are then sent to the parent cache server. The parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list based on the reporting feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU order.
[0046] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0047] It receives hot cache feature information and IP address information for two adjacent periods sent by each edge cache server; the hot cache feature information is obtained by the edge cache server periodically obtaining the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list;
[0048] Based on the IP address information and hot cache feature information, a corresponding reporting feature table is generated, and the incremental cache hit count is obtained based on the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are then sent to the parent cache server. The parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list based on the reporting feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU order.
[0049] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0050] It receives hot cache feature information and IP address information for two adjacent periods sent by each edge cache server; the hot cache feature information is obtained by the edge cache server periodically obtaining the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list;
[0051] Based on the IP address information and hot cache feature information, a corresponding reporting feature table is generated, and the incremental cache hit count is obtained based on the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are then sent to the parent cache server. The parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list based on the reporting feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU order.
[0052] The aforementioned cache update method, apparatus, computer equipment, computer-readable storage medium, and computer program product involve a synchronous cache server receiving hot cache feature information and IP address information from each edge cache server for two adjacent periods. The hot cache feature information is obtained periodically by the edge cache server from the cache hit count and the most recent cache hit time requested by the user, and each cache feature information is stored in an edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is determined. Then, a corresponding reporting feature table is generated based on each IP address information and the hot cache feature information. The incremental cache hit count is obtained based on the hot cache feature information for two adjacent periods, and the reporting feature table and incremental cache hit count are sent to the parent cache server. The parent cache server updates the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and incremental cache hit count. Finally, the cache stored in the parent LRU linked list is updated based on the updated parent LRU sorting. By forming cache feature information, the loss of cache information is avoided, and the synchronous cache server reporting to the region is added, which reduces the amount of data that the parent cache server needs to process, thereby improving the cache update efficiency. The parent cache server performs hot spot decay based on the number of accesses plus the most recent hit time, and determines the decay of the hit count based on the deviation between the hit time and the current time, thus improving the accuracy of cache updates. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a diagram illustrating the application environment of a cache update method in one embodiment.
[0055] Figure 2 This is a flowchart illustrating a cache update method applied to a synchronous cache server in one embodiment;
[0056] Figure 3 This is a flowchart illustrating a cache update method applied to an edge cache server in another embodiment;
[0057] Figure 4 This is a flowchart illustrating a cache update method applied to a parent cache server in one embodiment;
[0058] Figure 5 This is a schematic diagram of the feature table reporting process in one embodiment;
[0059] Figure 6 This is a schematic diagram of the user request process in another embodiment;
[0060] Figure 7 This is a structural block diagram of a cache update device applied to a synchronous cache server in one embodiment;
[0061] Figure 8 This is a structural block diagram of a cache update device applied to an edge cache server in another embodiment;
[0062] Figure 9 This is a structural block diagram of a cache update device applied to a parent cache server in one embodiment;
[0063] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0065] The cache update method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, a user can initiate a user request to the CDN system in region i through terminal 102. Simultaneously, the CDN system performs a consistent hash election based on the user request and the IP address information of each edge cache server to determine the synchronous cache server to be used. Each region corresponds to a CDN (Content Delivery Network) system, which includes a parent cache server 108, a synchronous cache server 106, and multiple edge cache servers 104. Edge cache server n104 communicates with synchronous cache server 106 through a communication network, and edge cache server n104 can also communicate with parent cache server 108 through a communication network. Synchronous cache server 106 and parent cache server can exchange information.
[0066] Edge cache server n104 periodically obtains the cache hit count and most recent cache hit time of user requests as cache feature information, and stores each cache feature information into an edge LRU linked list. Based on the edge LRU sorting of each cache feature information in the edge LRU linked list, it determines the hot cache feature information from multiple cache feature information, and sends the hot cache feature information and IP address information of two adjacent periods to synchronous cache server 106. Synchronous cache server 106 generates a corresponding reporting feature table based on each IP address information and hot cache feature information, and obtains the incremental cache hit count based on the hot cache feature information of two adjacent periods, and sends the reporting feature table and incremental cache hit count to parent cache server 108. Finally, parent cache server 108 updates the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and incremental cache hit count, and updates the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0067] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The edge cache server n104, synchronous cache server 106, and parent cache server 108 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing cloud computing services.
[0068] In one exemplary embodiment, such as Figure 2 As shown, a cache update method is provided, which is applied to... Figure 1 Taking the synchronous cache server 106 as an example, the explanation includes the following steps S201 and S202. Wherein:
[0069] Step S201: Receive hot cache feature information and IP address information for two adjacent periods sent by each edge cache server; the hot cache feature information is obtained by the edge cache server periodically acquiring the number of cache hits and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list.
[0070] In this context, an edge cache server can be understood as a server that directly interacts with the user, responding to user requests initiated to the CDN via the terminal. A synchronous cache server is a specific edge cache server that, upon receiving a user request, is re-elected using consistent hashing based on the IP address information of all edge cache servers. This single edge cache server acts as an intermediary for the edge cache server to report information to the parent cache server. Consistent hashing election involves calculating the hash value of each IP address and determining its position in the hash ring, as well as the positions of other nodes. Then, the specific data request is directed to the corresponding node clockwise based on its hash value.
[0071] The edge LRU linked list (which includes the LRU algorithm and the Least Recently Used algorithm) can be understood as a doubly linked list that temporarily stores the cache. It stores the cache, the corresponding hit count, and the most recent hit time. The closer to the head of the doubly linked list, the closer the most recent hit time of this cache is to the current time. Conversely, the closer to the tail of the doubly linked list, the further away the most recent hit time of this cache is from the current time. The cache hit time can be understood as the time when this cache was successfully accessed.
[0072] Hot cache characteristics can be simply understood as the cache characteristics at the beginning of the LRU list. Cache characteristics can be understood as the number of cache hits at the request level and the most recent cache hit time. IP (Internet Protocol) address information can be understood as a unique identifier assigned to each device in the network (such as a computer, mobile phone, router, etc.).
[0073] Optionally, edge cache server n104 periodically obtains the cache hit count and most recent cache hit time of user requests as cache feature information, and stores each cache feature information into an edge LRU linked list. Based on the edge LRU sorting of each cache feature information in the edge LRU linked list, hot cache feature information is determined, and two adjacent periods of hot cache feature information and IP address information are sent to synchronous cache server 106. Synchronous cache server 106 receives the two adjacent periods of hot cache feature information and IP address information sent by each edge cache server. This cache feature information is stored on disk, avoiding the loss of cache information due to device restarts. Furthermore, the communication channel only transmits hot cache feature information, reducing information transmission costs and laying the data foundation for subsequent feature table formation and incremental hit count calculations.
[0074] Step S202: Generate a corresponding reporting feature table based on each IP address information and hot cache feature information, and obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU chain based on the reporting feature table and incremental cache hit count, and update the cache stored in the parent LRU chain based on the updated parent LRU sorting.
[0075] The reporting feature table can be understood as a feature information hash table generated by the synchronous cache server after integrating the received hot cache feature information and IP address information. Each edge cache server corresponds to a reporting feature table, and the IP address of each edge cache server is used as the key to distinguish different hash tables. The incremental cache hit count can be understood as the difference between the cache hit counts of the same cache between two adjacent periods. The increment here can be a positive value or a negative value.
[0076] For example, the synchronous cache server 106 generates a corresponding reporting feature table based on each IP address information and hot cache feature information, and calculates the difference between the number of cache hits for the same cache between two adjacent caches as the incremental cache hit count. It then sends the reporting feature table and incremental cache hit count to the parent cache server 108. The parent cache server 108 updates the parent LRU sorting of each cache in the parent LRU linked list based on the received reporting feature table and incremental cache hit count. Finally, based on the updated parent LRU sorting, it deletes the caches stored at the bottom of the parent LRU linked list and deletes the corresponding cache files stored on the disk of the parent cache server 108. The synchronous cache server 106 integrates the received IP address information and hot cache feature information to generate the reporting feature table, and obtains the corresponding incremental cache hit count based on the hot cache feature information of adjacent periods before reporting it to the parent cache server 108. This reduces the data processing workload of the parent cache server 108, lays the data foundation for cache updates in the parent cache server 108, and accelerates the cache update efficiency of the parent cache server 108.
[0077] In the above cache update method, the synchronous cache server receives hot cache feature information and IP address information from each edge cache server for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically acquiring the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information into the edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is determined. Then, a corresponding reporting feature table is generated based on each IP address information and hot cache feature information, and the incremental cache hit count is obtained based on the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are sent to the parent cache server. The parent cache server updates the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and the incremental cache hit count. Finally, the cache stored in the parent LRU linked list is updated based on the updated parent LRU sorting. By forming cache feature information, the loss of cache information is avoided, and the synchronous cache server reporting to the region is added, which reduces the amount of data that the parent cache server needs to process, thereby improving the cache update efficiency. The parent cache server performs hot spot decay based on the number of accesses plus the most recent hit time, and determines the decay of the hit count based on the deviation between the hit time and the current time, thus improving the accuracy of cache updates.
[0078] In one embodiment, generating a corresponding reporting feature table based on each IP address information and hot cache feature information includes: constructing a corresponding initial reporting feature table using each IP address information and hot cache feature information; obtaining multiple cached URLs from the initial reporting feature table; and for each cache, performing deduplication processing on the multiple cached URLs based on the most recent access time of the cached URL to obtain the reporting feature table.
[0079] A cached URL (Uniform Resource Locator) can be understood as a specific address pointing to a resource on the internet, typically used to locate web pages, API interfaces, or files. It contains information such as the protocol (e.g., HTTP / HTTPS), domain name, path, and query parameters. When a URL is requested, the server or client can store the response associated with that URL in the cache. The next time the same URL is requested, the system can directly retrieve the data from the cache without recalculating or accessing the original content. A hash table is built using IP addresses as keys to store the contents of multiple cached URLs associated with that IP address. Access time can be understood as the time when the URL was last accessed, regardless of whether the request was successfully hit.
[0080] Optionally, the synchronous cache server 106 uses the IP address information as the hash key to construct the feature reporting report. Simultaneously, based on the hot cache feature information and the IP address, it constructs multiple cache URLs associated with each IP address. This means that one cache may correspond to multiple cache URLs, thus constructing an initial feature table. Further, it retrieves multiple cache URLs from the initial reporting feature table. For each cache, based on the most recent access time of the cache URL, it performs deduplication on the multiple cache URLs to obtain the reporting feature table. By deduplicating the cache URLs of each cache, the number of reporting feature tables is reduced, thereby reducing the amount of data that the parent cache server 108 needs to process, and thus accelerating the cache update efficiency in the parent cache server.
[0081] In one embodiment, multiple cached URLs are deduplicated based on their most recent access time, including: identifying duplicate cached URLs to be processed from multiple cached URLs; obtaining the most recent access time and the current time of the cached URL to be processed, and obtaining the time distance between the most recent access time and the current time; retaining the cached URL to be processed corresponding to the smallest time distance, and removing other duplicate cached URLs to be processed.
[0082] For example, the synchronous cache server 106 identifies duplicate cache URLs to be processed from the cache URLs included in each cache. It then obtains the most recent access time and the current time of each cache URL, and calculates the time distance between these times. The cache URL with the smallest time distance is retained, while other duplicate cache URLs are removed. Using access time and the current time to remove duplicate cache URLs saves disk storage space and ensures the timeliness of cache URLs, thereby guaranteeing the cache update effect of the parent cache server 108 and improving the cache hit rate.
[0083] In one exemplary embodiment, such as Figure 3 As shown, a cache update method is provided, which is applied to... Figure 1 Taking edge caching server n104 as an example, the explanation includes the following steps S301 and S302. Wherein:
[0084] Step S301: Periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list.
[0085] For example, the edge cache server n104 periodically obtains the number of cache hits and the most recent cache hit time of user requests as cache feature information, and stores each cache feature information into the edge LRU linked list. At the same time, it periodically writes to the disk of the edge cache server n104 to ensure that the relevant cache data will not be lost if the device restarts. The periodic acquisition of cache feature information ensures the timeliness of feature information updates.
[0086] Step S302: Based on the edge LRU sorting of each cache feature information in the edge LRU linked list, hot cache feature information is determined from multiple cache feature information, and hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server; The synchronous cache server is used to receive each hot cache feature information and IP address information, generate corresponding reporting feature tables based on each IP address information and hot cache feature information, obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server;
[0087] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0088] Optionally, edge cache server n104 determines hot cache features from multiple cache features based on the edge LRU sorting of each cache feature in the edge LRU linked list, and sends the hot cache features and IP address information of two adjacent periods to synchronization cache server 106. Synchronization cache server 106 receives each hot cache feature and IP address information, generates a corresponding reporting feature table based on each IP address and hot cache feature, and obtains the incremental cache hit count based on the hot cache feature information of two adjacent periods. It then sends the feature table and incremental cache hit count to parent cache server 108. The parent cache server updates the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and incremental cache hit count, and finally updates the cache stored in the parent LRU linked list based on the updated parent LRU sorting. Using the LRU sorting of cache features to select hot cache features can quickly determine hot cache features from multiple cache features, thereby accelerating the update efficiency of the cache in the parent cache server.
[0089] In one embodiment, hot cache feature information is determined from multiple cache feature information based on the edge LRU sorting of each cache feature information in the edge LRU linked list, including: determining the cache feature information whose edge LRU sorting is greater than a preset sorting threshold as hot cache feature information.
[0090] For example, the edge caching server n104 identifies cache features whose edge LRU ranking is greater than a preset ranking threshold as hot cache features. For instance, cache features ranking in the top X% of the total LRU list can be identified as hot cache features, or cache features greater than a number A can be identified as hot cache features. It's important to note that the "greater than" comparison in the queue is not a conventional "greater than" comparison; rather, a higher ranking indicates higher "hotness," meaning a lower ranking value. Here, "greater than" actually represents a larger "hotness" value, but the actual number may not necessarily be greater than a number A. By setting appropriate filtering conditions, more accurate hot cache features can be determined from multiple cache features, thereby improving cache update efficiency and subsequent cache hit rates.
[0091] In one exemplary embodiment, such as Figure 4 As shown, a cache update method is provided, which is applied to... Figure 1 Taking the parent cache server 108 as an example, the explanation includes the following steps S401 and S402. Wherein:
[0092] Step S401: Receive the reported feature table and incremental cache hit count sent by the synchronous cache server. The reported feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each edge cache server for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically acquiring the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information in the corresponding edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is used to determine the cache feature information.
[0093] Optionally, the parent cache server 108 receives the reported feature table and incremental cache hit count sent by the synchronous cache server 106. The reported feature table contains hot cache feature information and IP address information from two adjacent periods received by the synchronous cache server 106 from each edge cache server. It is generated based on each hot cache feature information and IP address. The incremental cache hit count is obtained by the synchronous cache server 106 based on the hot cache feature information from two adjacent periods. The hot cache feature information is the cache hit count and the most recent cache hit time periodically requested by users on the edge cache server n104. Each cache feature information is stored in the corresponding edge LRU linked list, and the LRU order of each cache feature information in the edge LRU linked list is determined. By receiving the reported feature table and incremental cache hit count reported by the synchronous cache server 106, a data foundation is laid for subsequent updates to the parent LRU order of the cache. At the same time, it avoids directly obtaining cache feature information from the edge cache server n104, reducing the amount of data obtained, thereby improving the security of cache feature information.
[0094] Step S402: Based on the reported feature table and the incremental cache hit count, update the parent LRU sorting of each cache in the parent LRU linked list, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0095] For example, the parent cache server 108 updates the parent LRU sort of each cache in the parent LRU list based on the reported feature table and the incremental cache hit count. Based on the updated parent LRU sort, it deletes caches that are ranked lower in the parent LRU list and deletes the corresponding cache files stored on the disk. It uses the obtained variable information to predict the cache hit in the next cycle and makes corresponding adjustments in the parent cache server 108 in advance to improve the cache hit rate. At the same time, it promptly evicts infrequently used caches to save storage space and avoid system crashes due to storage space overflow.
[0096] In one embodiment, updating the parent LRU order of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count includes: traversing the reported feature table to obtain multiple cache URLs and obtaining the current time; retrieving the corresponding cache from the cache table of the parent cache server based on the cache URL; obtaining the decayed cache hit count based on the most recent cache hit time associated with the cache URL, the current time, and the incremental cache hit count; updating the cache reference value based on the decayed cache hit count, and updating the parent LRU order of each cache in the parent LRU chain based on the updated reference value.
[0097] Optionally, the parent cache server iterates through the reported feature table to obtain multiple cache URLs and the current time. Then, based on the cache URL, it retrieves the corresponding cache from the cache table in the parent cache server. Based on the most recent cache hit time associated with the cache URL, the current time, and the incremental cache hit count, it determines the number of cache hits after decay. The following is a specific example to help understand decay:
[0098] Last hit time (last_hit_time) = 10:00 AM;
[0099] Current time (current_time) = 10:30 AM;
[0100] Incremental cache hit count (increment_hits) = 5;
[0101] Decay factor = 0.1. This factor should be set according to the actual situation.
[0102] Assume the most recent hit count (previous_hits) = 0;
[0103] Calculate the time difference:
[0104] time_since_last_hit = 10:30 - 10:00 = 30 minutes = 30 minutes × 60 seconds / minute = 1800 seconds
[0105] Calculate the decay value:
[0106] decay_value = e - 0.1 × 1800 ≈ e - 180 ≈ 0 (almost zero)
[0107] (Due to the large time difference, the attenuation value will be very small.)
[0108] Calculate the number of hits after decay:
[0109] If we only consider the incremental hit count:
[0110] decayed_hits=5×0≈0decayed_hits=5×0≈0
[0111] If we consider the previous number of hits:
[0112] decayed_hits=(20×0)+5=5decayed_hits=(20×0)+5=5
[0113] As can be seen from the above process, the predicted cache hit count is obtained. After obtaining the decayed cache hit count, the difference between the most recent cache hit count and the decayed cache hit count is calculated. If it increases, the reference value of the cache in the cache table is increased accordingly using the difference; if it decreases, the reference value of the cache in the cache table is decreased accordingly using the difference. The parent LRU order of each cache in the parent LRU list is then updated based on the updated reference values of each cache. By using the incremental cache hit count, the most recent cache hit time, and the current time to decay the cache hit count, obtain the predicted cache reference value, and update the parent LRU order of each cache, the following technical effects are achieved:
[0114] 1. Automatically adjust the reference values of cache entries based on actual usage to ensure that frequently used caches remain in an efficient access position.
[0115] 2. Through the decay mechanism, the priority of cache entries that are no longer used can be effectively reduced, thereby improving the overall cache hit rate.
[0116] 3. Dynamically update the LRU linked list to ensure that frequently accessed data is accessed faster, thus improving the user experience.
[0117] In one embodiment, a cache update system is provided, which includes a parent cache server, a synchronous cache server, and multiple edge cache servers of a target area CDN system; the synchronous cache server is an edge cache server whose IP address information meets the set conditions.
[0118] The edge cache server is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list. According to the edge LRU sorting of each cache feature information in the edge LRU linked list, the hot cache feature information is determined from multiple cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server.
[0119] The synchronous cache server is used to generate corresponding reporting feature tables based on each IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server.
[0120] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0121] For example, a user can initiate a user request to the CDN system in the target area through the terminal. The edge caching server responds to the user request. At the same time as initiating the user request, the CDN system performs a consistent hash election based on the user request and the IP address information of each edge caching server to determine the synchronous caching server to be used in this case from multiple edge caching servers.
[0122] The edge cache server periodically obtains the number of cache hits and the most recent cache hit time of user requests as cache feature information, stores each cache feature information into the edge LRU linked list, and periodically writes it to the disk of the edge cache server n104. The cache feature information that is sorted by edge LRU with a value greater than a set sorting threshold is identified as hot cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server. The synchronous cache server uses each IP address information as the hash key to construct the feature reporting report. At the same time, it constructs multiple cache URLs associated with IP addresses based on the hot cache feature information and IPs. That is, a cache may correspond to multiple cache URLs. It constructs an initial feature table. Further, it obtains multiple cache URLs from the initial reporting feature table. For each cache, it determines the duplicate cache URLs to be processed from the cache URLs included in each cache. Then, it obtains the most recent access time and the current time of the cache URL to be processed, and obtains the time distance between the most recent access time and the current time. It retains the cache URL to be processed corresponding to the smallest time distance, removes other duplicate cache URLs to be processed, and obtains the reporting feature table. It also calculates the difference between the number of cache hits for the same cache between two adjacent caches as the incremental cache hit count, and sends the reporting feature table and the incremental cache hit count to the parent cache server.
[0123] The parent cache server iterates through the reported feature table to obtain multiple cache URLs and the current time. Then, based on the cache URL, it retrieves the corresponding cache from the cache table in the parent cache server. Based on the most recent cache hit time associated with the cache URL, the current time, and the incremental cache hit count, it determines the cache hit count after decay, thus obtaining the predicted cache hit count. After obtaining the cache hit count after decay, it obtains the difference between the most recent cache hit count and the cache hit count after decay. If it increases, it increases the reference value of the cache in the cache table accordingly using the difference; if it decreases, it decreases the reference value of the cache in the cache table accordingly using the difference. Finally, it updates the parent LRU sort of each cache in the parent LRU linked list based on the updated reference values of each cache. The cache hit count decays using incremental cache hit count, the most recent cache hit time, and the current time, resulting in a predicted cache reference value. The parent LRU sorting of each cache is then updated, and the corresponding cache file stored on disk is deleted.
[0124] By operating the aforementioned cache update system, the following technical effects can be achieved:
[0125] 1. Edge caching servers periodically retrieve cache feature information and store it on disk regularly, avoiding the loss of cached data related to device restarts, thereby improving the response speed of requests and the robustness of the entire system.
[0126] 2. By performing hash consistency election based on the IP address information of the edge cache server and the request itself when a request is triggered, a synchronous cache server is determined to serve as the hub for data transfer. At the same time, the data is processed, reducing the amount of data that the parent cache server needs to process, thereby speeding up the update efficiency of the parent cache server's cache.
[0127] 3. By deduplicating cached URLs using access time and current time, duplicate cached URLs are removed, saving disk storage space and ensuring the timeliness of cached URLs. This, in turn, ensures the cache update effect of the parent cache server and helps improve the cache hit rate.
[0128] 4. Through the decay mechanism, the priority of unused cache entries can be effectively reduced, and corresponding adjustments can be made in the parent cache server in advance to improve the cache hit rate. At the same time, infrequently used caches can be eliminated in a timely manner to save storage space and avoid system crashes due to storage space overflow.
[0129] In one exemplary embodiment, such as Figure 5 and Figure 6As shown, a specific implementation method for cache updating is provided (it should be noted that the numbers given below are settings in this example and do not limit this application to cache updating only under these conditions):
[0130] 1. When the edge cache server container starts, it pulls the list of three edge nodes, A, B, and C, from the regional cache machine list through the k8s tag, and elects an edge node A by consistent hashing the IP addresses of A, B, and C.
[0131] 2. The edge cache server counts the number of cache hits at the request granularity level plus the time of the most recent cache hit as feature information, and writes it into the metadata. It periodically writes the metadata to the disk to ensure that the data is not lost when the service is restarted.
[0132] 3. The cache servers of nodes B and C send the feature information of the hot cache (the first 20% of the LRU list) in the disk to the cache server of node A. The cache server of node A then periodically (configurably) sends it to the corresponding parent server D.
[0133] Node A will construct a hash table, where the key of each hash table is the IP address of the edge cache server, and the hash value is an array of feature objects s[2] (size=2) storing the feature information reported by Node B plus the timestamp of the report received from Node B. When Node A reports, it will incrementally report the number of hits of Node B: s[1]-s[0] (the change in the number of hits of the same cache between two adjacent periods), and Node C will operate in the same way. Then, a trait_table hash table will be constructed, where the hash key is the cached URL, and the hotspot feature information of B+C will be deduplicated, such as taking the most recent access time of the two duplicate URLs. The data in the trait_table table will then be reported to the parent layer to avoid excessive computation on the parent server.
[0134] 4. The parent server D will traverse the obtained feature information (trait_table hash table). First, it will retrieve the hash key, which is the cache URL information. Then, it will match the URL in the cache table (store_table, which contains all cache hash tables), obtaining the cache store. This is then transformed into hotspot information, i.e., feature decay. The further the recent hit time in the trait is from the current time, the larger the decay number (this can be understood as the number of hits after decay; the greater the time difference, the lower the probability of the cache being accessed). In other words, the number of hits will decrease (the specific decay ratio can be determined by configuration). The cache store's Reference value will then be increased to influence the parent cache's hotspot status, updating the parent cache's LRU order. Finally, based on the updated parent cache's LRU order, disk space will be reorganized, evicting cold cache entries.
[0135] Compared with the prior art, this application has the following advantages:
[0136] 1. Edge cache servers collect cacheable feature information (cache URL, access count, last hit time) and aggregate it by region. Since the content requests from edge cache servers in the same region are highly correlated, consistent hashing is performed, and a single management cache node reports the information, reducing synchronization requests from the parent server.
[0137] 2. The edge layer caching service can rebuild the LRU table for hot and cold caches by storing the characteristic information on disk and rebuilding it after the service restarts, thus avoiding the loss of hot and cold information.
[0138] 3. The parent layer can update and adjust the hot and cold LRU tables of the cache based on the number of accesses and the most recent hit time, so as to avoid the parent layer being unaware of the hot status of the edge layer cache and treating the hot cache as a cold cache.
[0139] 4. The parent layer performs hotspot decay based on the number of accesses and the most recent hit time. The decay of the hit count is determined based on the deviation between the hit time and the current time, so as to improve the accuracy of hot caching.
[0140] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0141] Based on the same inventive concept, this application also provides a cache update apparatus for implementing the cache update method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more cache update apparatus embodiments provided below can be found in the limitations of the cache update method described above, and will not be repeated here.
[0142] In one exemplary embodiment, such as Figure 7 As shown, a cache update device is provided, applied to a synchronous cache server in a CDN system of a target area. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions. The device includes: an information receiving module 701 and a feature reporting module 702, wherein:
[0143] The information receiving module 701 is used to receive hot cache feature information and IP address information sent by each edge cache server for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically obtaining the number of cache hits requested by the user and the most recent cache hit time as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list.
[0144] The feature sending module 703 is used to generate a corresponding reporting feature table based on each IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; the parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reporting feature table and incremental cache hit count, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0145] In one embodiment, the feature sending module 702 further includes an initial feature construction submodule and a feature generation submodule, wherein:
[0146] The initial feature construction module is used to construct the corresponding initial reporting feature table using each IP address information and hot cache feature information.
[0147] The feature generation submodule is used to obtain multiple cached URLs from the initial reporting feature table. For each cached URL, based on the most recent access time of the cached URL, multiple cached URLs are deduplicated to obtain the reporting feature table.
[0148] In one embodiment, the feature generation submodule is further configured to identify duplicate cache URLs to be processed from multiple cache URLs; obtain the most recent access time and the current time of the cache URL to be processed, and obtain the time distance between the most recent access time and the current time; retain the cache URL to be processed corresponding to the minimum time distance, and remove other duplicate cache URLs to be processed.
[0149] In one exemplary embodiment, such as Figure 8 As shown, a cache update device is provided, which is applied to any edge cache server in a CDN system of a target area. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets the set conditions. The device includes: an information construction module 801 and an information sending module 802, wherein:
[0150] The information construction module 801 is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list accordingly;
[0151] The information sending module 802 is used to determine the hot cache feature information from multiple cache feature information according to the edge LRU sorting of each cache feature information in the edge LRU linked list, and send the hot cache feature information and IP address information of two adjacent periods to the synchronous cache server; the synchronous cache server is used to receive each hot cache feature information and IP address information, generate the corresponding reporting feature table based on each IP address information and hot cache feature information, and obtain the incremental cache hit count according to the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server;
[0152] The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU linked list based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0153] In one embodiment, the information sending module 802 is further configured to identify cached feature information whose edge lru sorting is greater than a preset sorting threshold as hot cached feature information.
[0154] In one exemplary embodiment, such as Figure 9 As shown, a cache update device is provided, applied to a parent cache server in a CDN system for a target region. The CDN system includes a parent cache server, a synchronous cache server, and multiple edge cache servers. The synchronous cache server is an edge cache server whose IP address information meets set conditions. The device includes: a feature receiving module 901 and a cache update module 902, wherein:
[0155] The feature receiving module 901 is used to receive the reported feature table and incremental cache hit count sent by the synchronous cache server. The reported feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each edge cache server for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically obtaining the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information into the edge LRU linked list. The edge LRU sorting of each cache feature information in the edge LRU linked list is used to determine the cache feature information.
[0156] The cache update module 902 is used to update the parent LRU sorting of each cache in the parent LRU linked list according to the reported feature table and the incremental cache hit count, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
[0157] In one exemplary embodiment, the cache update module 902 is further configured to traverse the reporting feature table to obtain multiple cache URLs and obtain the current time; retrieve the corresponding cache from the cache table of the parent cache server according to the cache URL; obtain the decayed cache hit count based on the most recent cache hit time associated with the cache URL, the current time, and the incremental cache hit count; update the cache reference value according to the decayed cache hit count, and update the parent LRU sorting of each cache in the parent LRU linked list based on the updated reference value.
[0158] Each module in the aforementioned cache update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can invoke and execute the operations corresponding to each module.
[0159] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores cache feature information, IP address information, LRU lists, reporting feature tables, and incremental cache hit count data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a cache update method.
[0160] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the cache update means of the above embodiment.
[0162] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the cache update apparatus of the above embodiment.
[0163] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the cache update apparatus of the above embodiments.
[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A cache update method, characterized in that, A synchronous caching server is applied in a CDN system for a target region. The CDN system includes a parent caching server, a synchronous caching server, and multiple edge caching servers. The synchronous caching server is one of the edge caching servers whose IP address information meets set conditions. The method includes: The system receives hot cache feature information and IP address information for two adjacent periods sent by each of the edge cache servers. The hot cache feature information is obtained by the edge cache server periodically acquiring the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly. The system determines the cache feature information based on the edge LRU sorting in the edge LRU linked list. Based on the IP address information and hot cache feature information, a corresponding reporting feature table is generated, and the incremental cache hit count is obtained according to the hot cache feature information of two adjacent periods. The reporting feature table and the incremental cache hit count are then sent to the parent cache server. The parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list according to the reporting feature table and the incremental cache hit count, and to update the cache stored in the parent LRU linked list based on the updated parent LRU order.
2. The method according to claim 1, characterized in that, The process of generating a corresponding reporting feature table based on the IP address information and hot cache feature information includes: Using the IP address information and hot cache feature information, construct the corresponding initial reporting feature table; Multiple cached URLs are obtained from the initial reporting feature table. For each cached URL, the multiple cached URLs are deduplicated based on the most recent access time of the cached URL to obtain the reporting feature table.
3. The method according to claim 2, characterized in that, The process of deduplicating multiple cached URLs based on their most recent access time includes: Identify duplicate cache URLs to be processed from among the multiple cache URLs; Obtain the most recent access time and the current time of the cache URL to be processed, and obtain the time distance between the most recent access time and the current time; Retain the cache URL to be processed corresponding to the smallest time distance, and remove other duplicate cache URLs to be processed.
4. A cache update method, characterized in that, The method applies to any edge caching server in a CDN system for a target region, wherein the CDN system includes a parent caching server, a synchronous caching server, and multiple edge caching servers, and the synchronous caching server is the edge caching server whose IP address information meets set conditions. The cache hit count and the most recent cache hit time of user requests are periodically obtained as cache feature information, and each cache feature information is stored in the edge LRU linked list accordingly; Based on the edge LRU sorting of each cache feature information in the edge LRU linked list, hot cache feature information is determined from multiple cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous cache server; the synchronous cache server is used to receive each hot cache feature information and IP address information, generate a corresponding reporting feature table based on each IP address information and hot cache feature information, and obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU chain based on the updated parent LRU sorting.
5. The method according to claim 4, characterized in that, The step of sorting the edge LRUs in the edge LRU linked list according to the cache feature information and determining the hot cache feature information from the multiple cache feature information includes: The cached feature information whose edge LRU sorting is greater than a preset sorting threshold is identified as the hot cache feature information.
6. A cache update method, characterized in that, A parent caching server applied in a CDN system for a target region, wherein the CDN system includes one parent caching server, one synchronous caching server, and multiple edge caching servers, wherein the synchronous caching server is an edge caching server whose IP address information meets set conditions, and the method includes: The system receives a reported feature table and incremental cache hit count from the synchronous cache server. The reported feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each of the edge cache servers for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically acquiring the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information in the corresponding edge LRU linked list. The cache feature information is then sorted according to the edge LRU order in the edge LRU linked list. Based on the reported feature table and the incremental cache hit count, update the parent LRU sorting of each cache in the parent LRU linked list, and update the cache stored in the parent LRU linked list based on the updated parent LRU sorting.
7. The method according to claim 6, characterized in that, The step of updating the parent LRU order of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count includes: The reported feature table is traversed to obtain multiple cached URLs, and the current time is retrieved. Retrieve the corresponding cache from the cache table of the parent cache server based on the cache URL; Based on the most recent cache hit time associated with the cache URL, the current time, and the incremental cache hit count, the decayed cache hit count is obtained; The reference value of the cache is updated based on the number of cache hits after decay, and the parent LRU sorting of each cache in the parent LRU list is updated based on the updated reference value.
8. A cache update system, characterized in that, The system includes a parent cache server, a synchronous cache server, and multiple edge cache servers in the target area CDN system; the synchronous cache server is the edge cache server whose IP address information meets the set conditions. The edge caching server is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list accordingly; according to the edge LRU sorting of each cache feature information in the edge LRU linked list, hot cache feature information is determined from multiple cache feature information, and the hot cache feature information and IP address information of two adjacent periods are sent to the synchronous caching server. The synchronous cache server is used to generate a corresponding reporting feature table based on each IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server. The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU chain based on the updated parent LRU sorting.
9. A cache update device, characterized in that, A synchronous caching server applied in a CDN system for a target region, wherein the CDN system includes a parent caching server, a synchronous caching server, and multiple edge caching servers, wherein the synchronous caching server is an edge caching server whose IP address information meets set conditions, and the device includes: The information receiving module is used to receive hot cache feature information and IP address information sent by each of the edge cache servers for two adjacent periods; the hot cache feature information is obtained by the edge cache server periodically acquiring the number of cache hits and the most recent cache hit time of the user request as cache feature information, and storing each cache feature information into the edge LRU linked list accordingly, and determining the edge LRU sorting of each cache feature information in the edge LRU linked list; The feature sending module is used to generate a corresponding reporting feature table based on the IP address information and hot cache feature information, and to obtain the incremental cache hit count based on the hot cache feature information of two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; the parent cache server is used to update the parent LRU order of each cache in the parent LRU linked list according to the reporting feature table and incremental cache hit count, and update the cache stored in the parent LRU linked list based on the updated parent LRU order.
10. A cache update device, characterized in that, An edge caching server applied to any edge caching server in a CDN system for a target region, wherein the CDN system includes a parent caching server, a synchronous caching server, and multiple edge caching servers, wherein the synchronous caching server is the edge caching server whose IP address information meets set conditions, and the device includes: The information construction module is used to periodically obtain the number of cache hits and the most recent cache hit time of user requests as cache feature information, and store each cache feature information into the edge LRU linked list accordingly; The information sending module is used to sort the edge LRUs in the edge LRU chain according to the cache feature information, determine the hot cache feature information from the multiple cache feature information, and send the hot cache feature information and IP address information for two adjacent periods to the synchronous cache server; the synchronous cache server is used to receive the hot cache feature information and IP address information, generate a corresponding reporting feature table based on the IP address information and hot cache feature information, obtain the incremental cache hit count according to the hot cache feature information for two adjacent periods, and send the reporting feature table and incremental cache hit count to the parent cache server; The parent cache server is used to update the parent LRU sorting of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count, and to update the cache stored in the parent LRU chain based on the updated parent LRU sorting.
11. A cache update device, characterized in that, A parent caching server applied in a CDN system for a target region, wherein the CDN system includes one parent caching server, one synchronous caching server, and multiple edge caching servers, wherein the synchronous caching server is one of the edge caching servers whose IP address information meets set conditions, and the device includes... The feature receiving module is used to receive the reported feature table and incremental cache hit count sent by the synchronous cache server; The reporting feature table is generated by the synchronous cache server after receiving hot cache feature information and IP address information from each of the edge cache servers for two adjacent periods. The incremental cache hit count is obtained by the synchronous cache server based on the hot cache feature information for two adjacent periods. The hot cache feature information is obtained by the edge cache server periodically acquiring the cache hit count and the most recent cache hit time of user requests as cache feature information, and storing each cache feature information in the corresponding edge LRU linked list. The cache feature information is determined according to the edge LRU sorting of each cache feature information in the edge LRU linked list. The cache update module is used to update the parent LRU sorting of each cache in the parent LRU chain based on the reported feature table and the incremental cache hit count, and update the cache stored in the parent LRU chain based on the updated parent LRU sorting.
Citation Information
Patent Citations
Caching method, system and equipment of edge server and storage medium
CN118264713A
Method and system for improving cache hit rate of edge CDN sink node
CN118353910A