Cache optimization method and device, equipment, storage medium and computer program product

By updating caching strategies and dynamic path selection, and optimizing the multi-level caching structure, the problems of low cache hit rate and high content transmission cost were solved, achieving efficient cache management and resource utilization.

CN119484641BActive Publication Date: 2025-11-28CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411606632.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-11-28
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

Existing cache management methods suffer from low cache hit rates, high content transmission costs, and low collaboration efficiency in multi-level cache structures when facing large-scale, dynamically changing network environments, resulting in a poor user experience.

Method used

By acquiring data information from different caching levels, updating caching strategies, optimizing cached content, and performing dynamic path selection in a multi-level structure, efficient cache management is achieved through the collaborative mechanism of local cache, regional cache, and global cache levels.

Benefits of technology

It improves cache hit rate, reduces content transfer costs, optimizes storage resource utilization and access performance, and adapts to data requests of different sizes and types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484641B_ABST
    Figure CN119484641B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cache optimization, and discloses a cache optimization method, device, equipment, storage medium and computer program product.The method comprises the following steps: acquiring data information of cache nodes in different cache levels, updating a cache strategy based on the data information, and obtaining an updated cache strategy, wherein the different cache levels comprise a local cache level, a regional cache level and a global cache level; optimizing the cache levels based on the updated cache strategy, and obtaining optimized cache content; in response to a content request of a user, performing dynamic path selection in different cache levels, and obtaining a target request path; and acquiring target cache content from the optimized cache content based on the target request path.The application can effectively adapt to different sizes and types of data requests, realize efficient utilization of storage resources and optimization of access performance, effectively improve cache hit rate, and reduce content transmission cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cache optimization, in particular to a cache optimization method and device, equipment, storage medium and computer program product. BACKGROUND

[0002] As an important part of edge computing, distributed cache technology can significantly reduce the request volume to the origin server by storing popular content on the network edge server, and can alleviate network congestion. However, due to the uneven time and spatial distribution of content requests and the dynamic changes of network environment, how to achieve efficient cache management in edge cloud has become an important research topic. Although the existing cache management methods perform well in some specific scenarios, there is still much room for improvement when facing large-scale and dynamically changing network environments. First, the content placement and update strategy of the cache often lacks dynamic adjustment capability and cannot adapt to the changes of network traffic in real time, resulting in low cache hit rate and affecting user experience. Second, in a multi-level cache structure, the cooperation between levels and the content transmission efficiency need to be improved. The existing methods often have bottlenecks in cross-level content transmission, increasing the transmission delay. In addition, the cache eviction strategy is difficult to balance the utilization of cache space and the frequency of content update, resulting in waste of cache resources or frequent cache replacement overhead.

[0003] Therefore, how to effectively improve the cache hit rate and reduce the content transmission cost is a problem that needs to be solved at present.

[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0005] The main purpose of the present application is to provide a cache optimization method, device, equipment and storage medium, aiming at solving the technical problem of how to effectively improve the cache hit rate and reduce the content transmission cost.

[0006] To achieve the above purpose, the present application provides a cache optimization method, which comprises:

[0007] Obtain data information of each cache node in different cache levels, and update the cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level and a global cache level;

[0008] Optimize each cache level based on the updated cache strategy to obtain optimized cache content;

[0009] In response to a user's content request, dynamically select a path in different cache levels to obtain a target request path;

[0010] obtain target cache content from the optimized cache content based on the target request path.

[0011] In an embodiment, the step of obtaining data information of each cache node in different cache levels and updating the cache strategy based on the data information to obtain an updated cache strategy comprises:

[0012] obtaining data information of each cache node in different cache levels;

[0013] determining data characteristics and performance indicators of cache content in each cache node based on the data information;

[0014] updating the data characteristics and the performance indicators to obtain updated data characteristics and updated performance indicators;

[0015] updating the cache strategy of each cache node in different cache levels according to the updated data characteristics and the updated performance indicators to obtain an updated cache strategy.

[0016] In an embodiment, the step of updating the cache strategy of each cache node in different cache levels according to the updated data characteristics and the updated performance indicators to obtain an updated cache strategy comprises:

[0017] collecting user request data within a preset length of time window;

[0018] constructing a data set based on the user request data and determining an average gradient based on the data set;

[0019] updating model parameters of local models corresponding to each cache node in the different cache levels according to the average gradient to obtain updated local models;

[0020] updating the cache strategy of each cache node in different cache levels based on the updated data characteristics, the updated performance indicators, and the updated local models to obtain an updated cache strategy.

[0021] In an embodiment, the step of optimizing each cache level based on the updated cache strategy to obtain optimized cache content comprises:

[0022] obtaining cache capacity, a current cache content set, and a new cache content set of each cache node in each cache level;

[0023] determining a first content popularity of each cache content in the current cache content set and a second content popularity of each cache content in the new cache content set according to the updated cache strategy;

[0024] optimizing each of the cache levels according to the cache capacity, the first content popularity and the second content popularity, to obtain an optimized cache content.

[0025] In an embodiment, the step of dynamically selecting a path in different cache levels according to the content request of the user to obtain a target request path comprises:

[0026] In response to the content request of the user, a query priority of each cache level is obtained, and a target cache level is determined according to the query priority by dynamically selecting a path in different cache levels.

[0027] According to the content request, cache content of a cache node in the target cache level is queried to obtain a target cache node.

[0028] According to the target cache node, a target request path is generated.

[0029] In an embodiment, the step of querying cache content of a cache node in the target cache level according to the content request to obtain a target cache node comprises:

[0030] According to the content request, cache content of an initial cache node in the target cache level is queried to obtain a first query result.

[0031] When the first query result is cache content with a hit, the initial cache node is taken as the target cache node.

[0032] When the first query result is cache content without a hit, a transition probability of the initial cache node is obtained, and a neighbor node is determined based on the transition probability.

[0033] According to the content request, cache content of the neighbor node is queried to obtain a second query result.

[0034] When the second query result is cache content with a hit, the neighbor cache node is taken as the target cache node.

[0035] When the second query result is cache content without a hit, and a current query depth reaches a preset depth threshold or a current query time reaches a preset time threshold, a cache level with a next query priority is taken as the target cache level, and the step of querying cache content of an initial cache node in the target cache level according to the content request to obtain a first query result is executed.

[0036] In addition, to achieve the above-mentioned purpose, the application further provides a cache optimization device, which comprises:

[0037] an updating module configured to acquire data information of each cache node in different cache levels, and update a cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level, and a global cache level;

[0038] an optimizing module configured to optimize each cache level based on the updated cache strategy to obtain optimized cache content;

[0039] a selecting module configured to perform dynamic path selection in the different cache levels in response to a content request of a user to obtain a target request path;

[0040] an acquiring module configured to acquire target cache content from the optimized cache content based on the target request path.

[0041] In addition, to achieve the above object, the present application further provides a cache optimization device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the cache optimization method.

[0042] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the cache optimization method.

[0043] In addition, to achieve the above object, the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the cache optimization method.

[0044] The present application provides a cache optimization method, which first acquires data information of each cache node in different cache levels, and updates a cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level, and a global cache level; optimizes each cache level based on the updated cache strategy to obtain optimized cache content; performs dynamic path selection in the different cache levels in response to a content request of a user to obtain a target request path; and acquires target cache content from the optimized cache content based on the target request path, which can effectively adapt to different sizes and types of data requests, realize efficient utilization of storage resources and optimization of access performance, effectively improve cache hit rate, and reduce content transmission cost.

[0045] In summary, this application updates the caching strategy by updating the data information of each cache node in the caching layers, including local cache layer, regional cache layer, and global cache layer. Through a multi-level structure and cooperation mechanism, it can effectively adapt to data requests of different scales and types, achieving efficient utilization of storage resources and optimization of access performance. Optimizing each cache layer based on the updated caching strategy can effectively improve the cache hit rate, thereby responding to user content requests. Dynamic path selection is performed at different cache layers, and the target cache content is retrieved from the optimized cache content based on the target request path, effectively reducing content transmission costs. This overcomes the technical shortcomings of existing cache management methods, such as low cache hit rate and high content transmission cost, and can effectively adapt to data requests of different scales and types, achieving efficient utilization of storage resources and optimization of access performance, effectively improving cache hit rate and reducing content transmission costs. Attached Figure Description

[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating an embodiment of the cache optimization method of this application.

[0049] Figure 2 This is a flowchart illustrating Embodiment 2 of the cache optimization method of this application;

[0050] Figure 3 This is a flowchart illustrating Embodiment 3 of the caching optimization method of this application;

[0051] Figure 4 This is a schematic diagram illustrating the video pathfinding process between multiple cache layers, provided in Embodiment 3 of the cache optimization method of this application.

[0052] Figure 5 This is a schematic diagram of the module structure of the cache optimization device according to an embodiment of this application;

[0053] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the cache optimization method of this application embodiment.

[0054] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0055] It should be understood that the specific embodiments described herein are merely intended to explain the technical solutions of the present application, and are not intended to limit the present application.

[0056] In order to better understand the technical solutions of the present application, the following will be described in detail in combination with the accompanying drawings and specific embodiments.

[0057] The main solution of the embodiment of the present application is: obtaining data information of each cache node in different cache levels, and updating the cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level and a global cache level; based on the updated cache strategy, each cache level is optimized to obtain optimized cache content; in response to a content request of a user, a dynamic path selection is performed in different cache levels to obtain a target request path; and based on the target request path, target cache content is obtained from the optimized cache content.

[0058] As an important part of edge computing, distributed cache technology can significantly reduce the request amount of the source server by storing popular content on the network edge server, and can alleviate network congestion. However, due to the uneven time and space distribution of content requests and the dynamic changes of network environment, how to achieve efficient cache management in edge cloud has become an important research topic. Although the existing cache management methods perform well in some specific scenarios, there is still a lot of room for improvement when facing large-scale and dynamically changing network environments. First, the content placement and update strategy of the cache often lacks dynamic adjustment ability and cannot adapt to the changes of network traffic in real time, resulting in low cache hit rate and affecting user experience. Secondly, in the multi-level cache structure, the cooperation and content transmission efficiency between each level need to be improved, and the existing methods often have bottlenecks in cross-level content transmission, increasing the transmission delay. In addition, the cache eviction strategy is difficult to balance the utilization of cache space and the frequency of content update, resulting in waste of cache resources or frequent cache replacement overhead. Therefore, how to effectively improve the cache hit rate and reduce the content transmission cost is a problem that needs to be solved at present.

[0059] The application updates the cache strategy of the data information of each cache node in the cache levels such as the local cache level, the regional cache level and the global cache level, and can effectively adapt to different sizes and types of data requests through the multi-level structure and the cooperation mechanism, realizes efficient use of storage resources and optimization of access performance, optimizes each cache level based on the updated cache strategy, can effectively improve the cache hit rate, and then responds to user content requests, dynamically selects a path in different cache levels and obtains target cache content from the optimized cache content based on the target request path, effectively reduces the content transmission cost, overcomes the technical defects of low cache hit rate and high content transmission cost of the existing cache management method, can effectively adapt to different sizes and types of data requests, realizes efficient use of storage resources and optimization of access performance, effectively improves the cache hit rate and reduces the content transmission cost.

[0060] It should be noted that the execution subject of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a cache optimization device, etc. that can realize the above functions. Hereinafter, the cache optimization device is taken as an example to describe the embodiment and the following embodiments.

[0061] Based on this, the embodiment of the application provides a cache optimization method, referring to Figure 1 , Figure 1 The flowchart of the first embodiment of the cache optimization method of the application is shown.

[0062] In the embodiment, the cache optimization method includes steps S10-S40:

[0063] Step S10, obtain the data information of each cache node in different cache levels, and update the cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level and a global cache level.

[0064] It should be noted that in the present embodiment, a multi-level distributed cache architecture is adopted, which specifically includes a three-layer cache structure, i.e. a local cache level, a regional cache level and a global cache level, each layer being composed of a plurality of distributed cache nodes, and each level of cache nodes being equipped with a corresponding cache space for storing part of the content to meet the user requests of different levels.

[0065] It can be understood that the local cache is located on each edge server, directly serving user requests, providing the lowest access delay; the regional cache is located in the central position between multiple edge servers, serving as an intermediate layer, balancing storage capacity and access speed; the global cache is located near the core data center or the main server, providing the most comprehensive content coverage. This multi-level structure can effectively adapt to different sizes and types of data requests, while through the cooperation mechanism between levels, it realizes the efficient use of storage resources and the optimization of access performance.

[0066] It is worth noting that the data information of each cache node can include but is not limited to user request patterns, content popularity, and network conditions. Using a distributed online learning method to analyze user request patterns, content popularity, and network conditions in real time can dynamically adjust the cache strategy to adapt to changes in network traffic and fluctuations in user requests.

[0067] It is worth noting that due to the use of a distributed architecture, each cache node can independently learn and optimize, while sharing learning results through a collaborative mechanism to achieve global optimization.

[0068] Step S20, based on the updated cache strategy, optimizing each cache level to obtain optimized cache content.

[0069] It should be noted that optimizing each cache level includes optimizing cache content and optimizing cache space, where optimizing cache content mainly refers to how to select appropriate content for storage according to the updated cache strategy to improve cache hit rate, while optimizing cache space focuses on how to reasonably allocate and manage cache space to avoid resource waste and frequent cache replacement. Through this optimization, dynamically adjusting the cache content and size of each node can ensure that the cache content is consistent with user demand to adapt to different data access patterns, while improving the utilization of cache space.

[0070] It can be understood that in the multi-level distributed cache optimization, a small batch learning method is used to balance real-time performance and system overhead. The small batch learning method can be used to dynamically adjust the selection and update of cache content, optimize cache content on a larger time scale, reduce the overhead caused by frequent cache replacement, and ensure the stability and long-term optimization effect of the system.

[0071] In an implementable embodiment, in order to reduce the calculation and network overhead caused by frequent cache replacement, balance response speed and resource efficiency, step S20 can comprise: obtaining the cache capacity of each cache node in each cache level, the current cache content set and the new cache content set; determining the first content popularity of each cache content in the current cache content set and the second content popularity of each cache content in the new cache content set according to the updated cache strategy; optimizing each cache level according to the cache capacity, the first content popularity and the second content popularity to obtain the optimized cache content.

[0072] It should be noted that the cache capacity refers to the maximum space that the cache node can store content, the current cache content set refers to the content set that has been stored in the cache node at present, and the new cache content set refers to the content set that is newly recommended to be stored. The content popularity refers to the popularity of a certain cache content on the cache node within a certain time period, and the content popularity can be measured according to the access times or request frequency of the content within a period of time. Generally, the higher the content popularity is, the more popular the content is, and thus the content is more likely to be requested by users. By comparing the popularity of each content in the current cache content set and the new cache content set, it can be determined which content should be retained and which content should be replaced, thereby realizing the optimization of the cache content.

[0073] It can be understood that in the cache optimization, the mini-batch learning method can be used to dynamically adjust the selection and update strategy of the cache content, let C be the cache capacity, for the current cache content set, by analyzing the mini-batch data set B t , the popularity of each content can be calculated, and the cache content is adjusted based on the popularity, let H i represent the popularity of content i within a time window t, as follows:

[0074]

[0075] wherein, represents an indicator function, when x j equals content i, otherwise

[0076] It should be noted that by calculating the popularity of each content in the current cache content set and the new cache content set, the content with the highest popularity can be selected for cache update. In order to optimize the cache strategy, a dynamic elimination strategy based on mini-batch learning can be used, let be the new cache content set, and the update is performed by the following steps: 1. Calculate the popularity H i(t); 2. According to the popularity ranking, the highest popularity content is selected to update the cache; 3. The LRU (Least Recently Used) or LFU (Least Frequently Used) strategy is adopted to eliminate low popularity content and release cache space. In this way, the cache hit rate can be guaranteed while optimizing the utilization of cache space.

[0077] Step S30, in response to the user's content request, dynamic path selection is performed in different cache levels to obtain a target request path.

[0078] It should be noted that the dynamic path selection is based on the current network conditions, load conditions and content popularity, etc. to intelligently select the most suitable cache level for content retrieval, thereby reducing response time and improving user experience. For example, if the content requested by the user exists in the local cache level and is the latest, the content is provided directly from the local cache level; if it does not exist in the local cache level, the regional cache level and the global cache level are checked in turn until the required content is found.

[0079] It can be understood that in the present embodiment, the dynamic path selection adopts a random walk-based dynamic path selection algorithm, which combines content popularity, server load and network topology to intelligently select the optimal request path between different levels of cache nodes through random walk, achieving efficient content distribution and access.

[0080] It is worth noting that the random walk algorithm uses random walk theory to achieve dynamic path selection through node cooperation and information sharing. In each layer of cache, when a node receives a content request, it first checks whether the target content exists in the local cache. If not found, the algorithm will intelligently select adjacent nodes for query according to historical data and current network status. This selection not only considers the probability characteristics of random walk, but also combines the content popularity and load conditions of the nodes to improve the probability of request hit.

[0081] Step S40, based on the target request path, the target cache content is obtained from the optimized cache content.

[0082] It should be noted that according to the target request path, the target cache node in the cache level where the target cache content is located can be quickly found, and then the required target cache content can be retrieved from the cache node to ensure fast retrieval and transmission of content and reduce content transmission cost.

[0083] It can be understood that after obtaining the target cache content, the target cache content is displayed to the user who initiates the request, thereby reducing the waiting time and improving the user experience.

[0084] The embodiment provides a cache optimization method. The embodiment updates a cache strategy based on data information of cache nodes in different cache levels, obtains an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level and a global cache level, optimizes the cache levels based on the updated cache strategy, obtains optimized cache content, performs dynamic path selection in the different cache levels in response to a content request of a user, obtains a target request path, and obtains target cache content from the optimized cache content based on the target request path. The method can effectively adapt to data requests of different scales and types, realizes efficient use of storage resources and optimization of access performance, effectively improves cache hit rate, and reduces content transmission cost.

[0085] In conclusion, the embodiment updates a cache strategy based on data information of cache nodes in cache levels such as a local cache level, a regional cache level and a global cache level, can effectively adapt to data requests of different scales and types through a multi-level structure and a cooperation mechanism, realizes efficient use of storage resources and optimization of access performance, optimizes the cache levels based on the updated cache strategy, can effectively improve cache hit rate, and in response to a content request of a user, performs dynamic path selection in different cache levels and obtains target cache content from optimized cache content based on a target request path, thereby effectively reducing content transmission cost. The embodiment overcomes the technical defects of low cache hit rate and high content transmission cost of the prior cache management method, can effectively adapt to data requests of different scales and types, realizes efficient use of storage resources and optimization of access performance, effectively improves cache hit rate, and reduces content transmission cost.

[0086] Based on the first embodiment, in the second embodiment, the same or similar contents as the above-mentioned first embodiment can be referred to the above description, and will not be repeated hereinafter. On this basis, please refer to Figure 2 , the step S10 further includes steps S101-S104:

[0087] In step S101, data information of cache nodes in different cache levels is obtained.

[0088] It should be noted that the data information of cache nodes in different cache levels can be obtained in various ways, for example, through a network management system, a monitoring tool or directly collecting data from cache nodes. The data information includes but is not limited to user request mode, content popularity and network condition and the like.

[0089] In step S102, data characteristics and performance indexes of cache content in each cache node are determined based on the data information.

[0090] It should be noted that the data characteristics of the cached content include the content popularity, user viewing patterns, network load, etc., and the performance indicators include cache hit rate, video loading time, playback stutter rate, etc.

[0091] It can be understood that in the embodiment, a distributed adaptive multi-objective cache optimization algorithm (DAMCO) is adopted. The DAMCO algorithm combines distributed learning, online optimization and multi-objective decision-making techniques, and can realize real-time optimization of cache space and timely updating of cache allocation strategies in a large-scale edge computing environment, thereby realizing efficient utilization of cache resources, reducing data access delay, and adapting to dynamically changing network environments and user demands.

[0092] It should be noted that by analyzing the usage of the cache nodes and the content popularity, the DAMCO algorithm can intelligently adjust the cache strategy to ensure that the most popular and frequently accessed content is stored in the cache first. In addition, the algorithm also considers network load and server status to avoid storing too much content on nodes with high load or poor performance, thereby optimizing the overall cache performance.

[0093] Considering the characteristics of the multi-layer cache architecture, DAMCO adopts different learning strategies at different levels. For example, the local cache layer focuses more on the fast response of short-term hot videos, the regional cache layer focuses on the medium-term content popularity trend, and the global cache layer focuses more on the efficient storage of long-tail content. Through the global coordinator, learning parameter sharing and strategy coordination across levels are realized to optimize the overall cache efficiency. In addition, the DAMCO algorithm introduces an adaptive learning rate mechanism to cope with the dynamic changes of video traffic, as follows:

[0094] η(t+1)=η(t)·exp(γ·(R target -R(t)))

[0095] where R(t) can be the current cache hit rate or average video loading time, R target target performance value, this mechanism can quickly adjust the cache strategy when facing sudden hot events (such as major live events).

[0096] In step S103, the data characteristics and the performance indicators are updated to obtain updated data characteristics and updated performance indicators.

[0097] It should be noted that each cache node continuously collects and updates local data. For example, for video streaming content, the cache node records the request frequency, viewing duration, user geographic distribution, etc. of different videos, and uses exponential moving average to update the data characteristics and performance indicators, as follows:

[0098] X i(t) = a x X i (t) + (1-a) x X i (t-1)

[0099] Y i (t) = b x Y i (t) + (1-b) Y i (t-1)

[0100] where X i (t) is the data feature, Y i (t) is the performance indicator, and a and b are weight indices.

[0101] At step S104, the cache strategy of each cache node in different cache levels is updated according to the updated data feature and the updated performance indicator, to obtain an updated cache strategy.

[0102] It should be noted that the multi-level structure balances the storage capacity and access speed. The local cache has a small capacity but the fastest access speed, the regional cache has a larger capacity but a slightly slower access speed, and the global cache has the largest capacity but a relatively slow access speed. This design not only effectively responds to the dynamic changes in data hotness, but also reasonably allocates data according to their importance and access frequency. Each layer of cache nodes is closely linked through a complex coordination mechanism. The core cache controller is responsible for coordinating the distributed system. It dynamically adjusts the content and size of each cache node by analyzing network conditions, user behavior, and data access patterns in real time. For example, when the access frequency of a certain content exceeds the preset threshold within a certain time, the cache controller will instruct the relevant local cache node to increase the priority of this content, or even pre-fetch the content from the upper cache. This cache strategy greatly reduces the probability of cache miss and improves the response speed of the overall system.

[0103] It can be understood that both the distributed online learning technology and the mini-batch learning method are used in the cache space optimization and cache strategy updating process. The distributed online learning ensures the system's quick response to short-term changes, while the mini-batch learning ensures the stability and efficiency of long-term optimization. For example, the distributed online learning may adjust the cache location of a popular video in real time, while the mini-batch learning may adjust the cache proportion of different types of content based on a week's data. This combination can quickly adapt to short-term changes and maintain long-term optimization effects.

[0104] It is worth noting that the small batch learning method is a technology for optimizing cache content and updating cache strategy, aiming to balance real-time performance and system overhead. Unlike traditional real-time updating strategies, the small batch learning method optimizes cache content on a larger time scale. By collecting access data over a certain period of time and then learning and updating in batches, rather than responding immediately to each request, this method can reduce the computational and network overhead caused by frequent cache replacement, while still maintaining sensitivity to changes in user behavior and content popularity. By reasonably setting the batch size and update frequency, the best balance between response speed and resource efficiency can be achieved.

[0105] In a feasible implementation, in order to ensure the efficiency of model updating and reduce the computational overhead, step S104 can include: collecting user request data within a preset length of time window; constructing a data set based on the user request data, and determining an average gradient based on the data set; updating model parameters of a local model corresponding to each cache node in the different cache levels according to the average gradient, to obtain an updated local model; and updating the cache strategy of each cache node in the different cache levels based on the updated data feature, the updated performance indicator, and the updated local model, to obtain an updated cache strategy.

[0106] It should be noted that in the multi-layer distributed cache architecture, the DAMCO algorithm works collaboratively on three levels: local cache level, regional cache level, and global cache level. Each cache node v i maintains a local model M i (e.g., a neural network-based model) that predicts the optimal cache strategy S i (t+1) based on the current observed data feature X i (t) and historical performance indicator Y i (t):

[0107] S i (t+1) = f(M i , X i (t), Y i (t))

[0108] where M i is the local model, X i (t) includes the popularity of video content, user viewing patterns, network load, etc.; Y i (t) includes cache hit rate, video loading time, playback stutter rate, and other performance indicators.

[0109] Each cache node updates its local model based on the collected data. Considering the computational resource limitations of edge nodes, DAMCO uses a lightweight online gradient descent algorithm:

[0110]

[0111] Here, η represents the learning rate, which controls the step size of each update. A smaller learning rate can make the model more stable but converge more slowly, while a larger learning rate may lead to faster convergence but may also cause instability. Let L denote the gradient operator, representing the gradient of the loss function L with respect to the model parameters M. i The partial derivative of (t), L(M) i (t),X i (t),Y i (t) represents the loss function, used to measure the current model M. i (t) In the input data X i The predicted and actually observed performance index Y on (t) i The difference between (t).

[0112] In the specific implementation, let T be the length of the time window. Within each time window, user request data is collected, and a mini-batch dataset B = {x1, x2, ..., x...} is constructed. m}, where x i This indicates that the i-th user requests data within the time window, where m is the size of the mini-batch data, and x represents each data point. i It contains multiple features, such as request time, request content, and user geolocation. By performing feature extraction and normalization on this data, a feature vector x∈R can be obtained. d , where d is the feature dimension. Constructing feature vectors helps with subsequent model training and optimization.

[0113] In mini-batch learning, the model update uses the mini-batch gradient descent algorithm. Let θ be the model parameters and J(θ) be the loss function. The model parameters are optimized by minimizing the loss function. Within each time window, the update formula for the mini-batch gradient descent algorithm is:

[0114]

[0115] Where η is the learning rate, B t For a mini-batch dataset within a time window t, J(θ, B) t ) indicates that in a mini-batch dataset B t The gradient on.

[0116] In mini-batch dataset B t The average gradient is calculated as follows:

[0117]

[0118] Where θ is the model parameter, Bt For small batch data set B t , m is the size of small batch, x i represents the i-th user request data in the time window.

[0119] The model parameters are updated using the average gradient, which can reduce the computational overhead while ensuring the efficiency of model updating. Techniques such as stochastic gradient descent (SGD) can quickly adapt to environmental changes and achieve efficient learning under limited computational resources. By using this method, the cache content and size can be dynamically adjusted, popular content can be predicted, and cache hit rate can be improved, thereby significantly improving overall performance.

[0120] The algorithm complexity of the small batch learning method mainly depends on the processing of small batch data and model updating. Let m be the size of the small batch data and d be the feature dimension. The complexity of updating the model parameters is O(md). Since the amount of data in each time window is limited, the small batch learning method can reduce computational overhead while ensuring real-time performance. The small batch learning method not only dynamically adjusts the cache content and cache strategy to improve cache hit rate, but also finds the global optimal solution in multi-objective optimization to improve the overall performance of the system. By reasonably setting the size of the small batch data and the length of the time window, the best balance between response speed and resource efficiency can be achieved.

[0121] Further, in order to capture regional content trends, limited information exchange is performed between adjacent cache nodes. For example, edge nodes in adjacent cities may share information about popular local videos. Node v i exchanges model parameters with its neighbor nodes N(v i ), and then aggregates the model by weighted average:

[0122]

[0123] where M i '(t) is the aggregated model, v i is the cache node, N(v i ) is the neighbor node, and ω j is the weight.

[0124] Considering multiple performance objectives of video streaming services (such as cache hit rate, video startup time, playback quality, etc.), DAMCO adopts a multi-objective optimization method. Define the objective function set: F(S) = {f1(S), f2(S),..., f k (S)}. Use the Pareto optimization method to find the optimal strategy, as follows:

[0125]

[0126] where S represents a specific cache strategy, and fi (S) represents an evaluation function of the i-th performance target, for example, f1(S) represents the cache hit rate, which is calculated in the following manner: the number of hit requests / the total number of requests; f2(S) represents the average video startup time, which is calculated in the following manner: the total startup time / the number of video requests, and the like, S * is a set of solutions, for each solution S in it, there is no other solution S' that is not worse than S on all targets and strictly better than S on at least one target.

[0127] Each solution in the set of Pareto optimal solutions is "not completely outperformed". For any solution in the set, it is impossible to find another solution that improves at least one target without sacrificing any other target. The finally selected strategy is where P(S, X(t)) is a preference function based on the current system state, which can be dynamically adjusted according to the service focus of different time periods (such as peak vs. valley). The selected strategy S opt is applied to the cache system, for example, to decide to pre-fetch some popular videos to the local cache, or to migrate long-tail content from the local cache to the regional cache, and to continuously monitor the effect of the cache strategy execution, such as the change of user experience indicators, and to transmit the results back to the learning algorithm as feedback signals.

[0128] In this embodiment, by determining and updating the data characteristics and performance indicators of each cache node in different cache levels, and then using the updated cache strategy updated by the small batch learning algorithm based on the updated data characteristics and updated performance indicators, the cache hit rate can be improved, and the best balance between response speed and resource efficiency can be achieved.

[0129] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the cache optimization method of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.

[0130] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as the above embodiment one can be referred to the above introduction, and will not be described in detail. On this basis, please refer to Figure 3 The step S30 further includes steps S301-S303.

[0131] Step S301, in response to a user's content request, acquiring the query priority of each cache level, and dynamically selecting a path in different cache levels according to the query priority to determine the target cache level.

[0132] It should be noted that the content request refers to a request sent by a user to the system to obtain specific video content. In the embodiment, the content request can include user identification, requested video content identification, request time, and the like, and the embodiment does not make a specific limitation thereto.

[0133] It can be understood that in the present embodiment, a multi-level cache structure is adopted, including three levels of cache structures of a local cache level, a regional cache level, and a global cache level. The query priority of the local cache level is the highest, the query priority of the regional cache level is the second, and the query priority of the global cache level is the lowest. This indicates that the local cache level is queried first. When the required content exists in the local cache level, the global cache level is queried. When the required content does not exist in the global cache level, the global cache level is queried. If the required content does not exist in the global cache level, a request is finally sent to the master server.

[0134] It should be noted that the dynamic path selection based on random walk is a request processing strategy for improving the request processing efficiency and load balancing capability of the system. When receiving a content request of a user, an improved random walk algorithm is used to select a suitable node in the same level for query in combination with content popularity and server load information. If the content is not found in the current level, the algorithm determines whether to ascend the request to a higher level. Not only can the request pressure be effectively dispersed to avoid single point failure, but also the path can be dynamically adjusted according to real-time network conditions to improve the overall response speed and reliability of the system.

[0135] In step S302, the cache content of the cache node in the target cache level is queried according to the content request, and a target cache node is obtained.

[0136] It should be noted that when processing a user request, a multi-level path selection strategy is adopted, that is, when a user request arrives, a search is performed in the target cache, and if the required content is not found, a neighbor node query mechanism based on random walk is started. The neighbor node query mechanism is not a simple broadcast query, but intelligently selects the neighbor node that is most likely to store the target content according to historical data and current network status. In order to prevent unlimited query diffusion, a query termination condition is set, that is, a query depth or a query time specific threshold. If the content is still not found under these conditions, the request is raised to the cache level corresponding to the next query priority.

[0137] In a feasible embodiment, in order to improve the probability of request hit, step S302 can include: querying the cache content of an initial cache node in the target cache level according to the content request to obtain a first query result; when the first query result is a hit cache content, the initial cache node is taken as a target cache node.

[0138] When the first query result is no cache content, the transition probability of the initial cache node is obtained, and neighbor nodes are determined based on the transition probability; cache content of the neighbor nodes is queried according to the content request, and a second query result is obtained; when the second query result is cache content, the neighbor cache node is taken as a target cache node; when the second query result is no cache content, and the current query depth reaches a preset depth threshold or the current query time reaches a preset time threshold, a cache level of a next query priority is taken as a target cache level, and the step of querying cache content of an initial cache node in the target cache level according to the content request to obtain the first query result is performed.

[0139] It should be noted that according to the query priority, the initial target cache level is the local cache level, and when the user request arrives, the local cache level is first searched. If the required content is not found, the neighbor node query mechanism based on random walk is started, and the neighbor node most likely to store the target content is intelligently selected according to historical data and the current network state. If the content is still not found under the termination condition, the request will be upgraded to the cache level of the next query priority, that is, the regional cache level.

[0140] It can be understood that in the regional cache level, a similar but more relaxed query strategy is adopted. Since the regional cache node covers a wider range, a greater query depth and a longer query time are allowed. At the same time, the nodes in the regional cache level are interconnected through a high-speed network, and information can be exchanged faster. If the required content is still not found in the regional cache level, the request will eventually be upgraded to the global cache level. The global cache level serves as the last barrier and stores the most comprehensive content. If the content is still not found in the global cache level, the system will initiate a request to the source server.

[0141] It should be noted that the transition probability P i,j (t) represents the probability of content routing from node v i to neighbor node v j at time t. Let G = (V, E) be the graph structure of the cache network, where V represents the node set, and E represents the edge set between nodes. Each node v i ∈ V maintains a cache content list C i and a load value L i , and each content request is represented by r. The transition probability depends on the content popularity H j and the load L j of the node, as follows:

[0142]

[0143] where N(i) represents the node v ia set of neighbor nodes of v j (t) represents the content popularity of node v j at time t j (t) represents the content popularity of node v j at time t

[0144] Content popularity represents the popularity of a certain content on a certain node within a certain time period. Content popularity can be measured according to the number of accesses or request frequency of the content within a certain period of time. The higher the popularity, the higher the popularity of the content on the node, and the greater the probability of user requests for the content. Load value represents the resource usage of a node within a certain period of time, including CPU usage, memory usage, network bandwidth, etc. The higher the load value, the more resource usage of the node, and the lower the ability to process requests. When a node v i receives a content request r, it first searches in the local cache C i , if not hit, according to the transfer probability P i,j (t) selects a neighbor node v j for the next query, this process will continue until the target content is found or the preset termination condition is reached. Content popularity H j (t) and load L j (t) are dynamically changing, real-time updating content popularity H j (t) and load L j (t), as follows:

[0145] H j (t+1) = a x H j (t) + (1-a) R j (t)

[0146] L j (t+1) = b L j (t) + (1-b) U j (t)

[0147] Where R j (t) represents the request frequency of node v j at time t, U j (t) represents the load change of node v j at time t, a and b are smoothing coefficients, the value range is between 0 and 1, reflecting the degree of dependence of the system on historical data.

[0148] In specific implementation, when user requests arrive at the local cache node v i , first check the local cache C i . If not hit, according to the transfer probability P i,j (t) randomly selects a neighbor node vj A query is performed. If the content is not found within a preset query depth d local and a time threshold T local , the request is raised to the regional cache layer. At the regional cache layer, the node v i receives the request and selects a neighbor node v i,j with higher content popularity and lower load according to a transfer probability P j (t) to perform a query. If the content is not found within a preset query depth d regional and a time threshold T regional , the request is raised to the global cache layer. As the last query level, the node v i receives the request and selects a neighbor node v i,j to perform a query according to a transfer probability P j (t). If the content is still not found at the global cache layer, a request is finally initiated to the source server. The preset query depth d local may be 3 hops, and the time threshold T local may be 100 milliseconds, which are not limited in the embodiment.

[0149] To further optimize the query process, an adaptive back propagation mechanism is introduced. When a node successfully finds the target content, success information is back propagated along the query path, and the content popularity and load information of all nodes on the path are updated. This mechanism helps to improve the hit rate and query efficiency of future requests. To prove the effectiveness of the algorithm in the multi-layer cache, consider the transfer probability and termination condition of each layer of cache. Let the transfer probability matrix of each layer be P (l) , where l represents the cache level (local, regional, global). The transfer matrix of each layer satisfies the following conditions:

[0150]

[0151] where N(i) represents a set of nodes that can be connected to node i. In addition, let T (l) be the query time threshold of each layer of cache, and D (l) be the query depth threshold.

[0152] For the query process in each layer of cache, it can be represented as:

[0153]

[0154] where Pr(F|1) represents the probability of finding the content in level l, and represents the probability of finding the content within a query depth of D (l) from the node v iThe probability of finding the target content in the initial query path is represented by the product term in the formula, which indicates the probability of not finding the content in the first k-1 nodes of the query path, and the last term indicates the probability of finding the content in the k-th node.

[0155] If no content is found at level l, the query request will escalate to level l+1 and continue the above process. Through recursive calculation, the query success probability of the entire multi-level caching architecture can be obtained. The overall query success probability Pr(F) in the multi-level caching architecture can be expressed as a combination of the success probabilities of each level:

[0156]

[0157] Where L represents the total number of cache levels. This formula represents the complement of the probability that no content is found at any level, that is, the probability that content is found at at least one level.

[0158] like Figure 4 As shown, Figure 4 This diagram illustrates the pathfinding process of video across multiple cache layers. User A requests to watch video V1 in city X. The pathfinding process for video V1 across these cache layers includes: 1. Local cache check: User A's request first reaches the nearest edge server S1. S1 checks its local cache layer; if found, it returns; otherwise, it continues to step 2. 2. Request from neighboring nodes within the same layer: S1 searches for its neighboring cache nodes S2. S2 checks its cache; if found, it returns; otherwise, it continues to step 3. 3. Request from regional cache: Since video V1 is not found in the local cache or among neighboring nodes within the same layer, S1 escalates the request to the regional cache layer (based on geographical location, sent to the nearest neighboring node). The most recent parent node), i.e., the regional cache node R1, sends a request. R1 checks its cache. If found, it returns; otherwise, it continues to step 4. 4. Global cache request: S1 continues to request the global cache hierarchy, sending a request to the global cache node G1. G1 checks its cache. If found, it returns; otherwise, it continues to step 5. 5. Request back to the origin server: If video V1 is still not found after searching through multiple levels of cache, S1 finally sends a request to the master server. The master server transmits video V1 to S1, and S1 then transmits the video to user A. 6. Cache update: In order to improve the hit rate of subsequent requests, S1 caches video V1 in the local cache so that it can be directly hit in the next request.

[0159] Step S303: Generate a target request path based on the target cache node.

[0160] It should be noted that the target cache node refers to a cache node storing cache content meeting the user content request. According to the location of the target cache node and the network topology, an optimal path from the local cache node to the target cache node is constructed, and in the construction of the path, network delay, bandwidth, load balancing and other factors need to be considered to ensure that the request can efficiently reach the target cache node.

[0161] It can be understood that in the embodiment, an adaptive back propagation mechanism is introduced, when a node successfully finds the target content, the success information is back propagated along the query path, and the content popularity and load information of all nodes on the path are updated, so as to improve the hit rate and query efficiency of future requests.

[0162] In the embodiment, the query priority of each cache level is used for dynamic path selection to accurately locate the target cache level, and then the cache content of the cache node in the target cache level is determined according to the content request to determine the target cache node and generate the target request path, thereby effectively improving the query efficiency and the probability of request hit.

[0163] It should be noted that the above examples are only used for understanding the present application and do not constitute a limitation on the cache optimization method of the present application, and more forms of simple transformation based on the technical concept are within the protection scope of the present application.

[0164] The present application also provides a cache optimization device, please refer to Figure 5 , the cache optimization device comprises:

[0165] The updating module 10 is configured to obtain data information of each cache node in different cache levels, and update the cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level and a global cache level.

[0166] The optimization module 20 is configured to optimize each cache level based on the updated cache strategy to obtain optimized cache content.

[0167] The selection module 30 is configured to respond to a content request of a user, and perform dynamic path selection in the different cache levels to obtain a target request path.

[0168] The acquisition module 40 is configured to acquire target cache content from the optimized cache content based on the target request path.

[0169] The embodiment provides a cache optimization device. The embodiment obtains data information of cache nodes in different cache levels, updates a cache strategy based on the data information, and obtains an updated cache strategy. The different cache levels include a local cache level, a regional cache level, and a global cache level. The cache strategy is optimized based on the updated cache strategy, and optimized cache content is obtained. In response to a content request of a user, a target request path is obtained through dynamic path selection in different cache levels. Target cache content is obtained from the optimized cache content based on the target request path. The method can effectively adapt to data requests of different sizes and types, realize efficient use of storage resources and optimization of access performance, effectively improve cache hit rate, and reduce content transmission cost.

[0170] In conclusion, the embodiment updates the cache strategy based on the data information of the cache nodes in the local cache level, the regional cache level, and the global cache level. Through the multi-level structure and the cooperation mechanism, the method can effectively adapt to data requests of different sizes and types, realize efficient use of storage resources and optimization of access performance, optimize the cache strategy, effectively improve the cache hit rate, and then respond to the content request of the user, perform dynamic path selection in different cache levels, and obtain target cache content from the optimized cache content based on the target request path. The method effectively reduces the content transmission cost, overcomes the technical defects of the existing cache management method, such as low cache hit rate and high content transmission cost, can effectively adapt to data requests of different sizes and types, realize efficient use of storage resources and optimization of access performance, effectively improve the cache hit rate, and reduce the content transmission cost.

[0171] Optionally, the updating module 10 is further configured to obtain data information of cache nodes in different cache levels, determine data features and performance indexes of cache content in the cache nodes based on the data information, update the data features and the performance indexes to obtain updated data features and updated performance indexes, and update cache strategies of the cache nodes in the different cache levels based on the updated data features and the updated performance indexes to obtain updated cache strategies.

[0172] Optionally, the updating module 10 is further configured to collect user request data in a preset length of a time window, construct a data set based on the user request data, determine an average gradient based on the data set, update model parameters of local models corresponding to the cache nodes in the different cache levels based on the average gradient to obtain updated local models, and update cache strategies of the cache nodes in the different cache levels based on the updated data features, the updated performance indexes, and the updated local models to obtain updated cache strategies.

[0173] Optionally, the optimization module 20 is further configured to acquire the cache capacity of each cache node in each cache level, a current cache content set and a new cache content set, determine a first content popularity of each cache content in the current cache content set and a second content popularity of each cache content in the new cache content set according to the updated cache strategy, and optimize each cache level according to the cache capacity, the first content popularity and the second content popularity to obtain an optimized cache content.

[0174] Optionally, the selection module 30 is further configured to acquire a query priority of each cache level in response to a content request of a user, and perform dynamic path selection in different cache levels according to the query priority to determine a target cache level, query cache content of a cache node in the target cache level according to the content request to obtain a target cache node, and generate a target request path according to the target cache node.

[0175] Optionally, the selection module 30 is further configured to query cache content of an initial cache node in a target cache level according to the content request to obtain a first query result, take the initial cache node as the target cache node when the first query result is cache content with a hit, acquire a transition probability of the initial cache node when the first query result is cache content without a hit, and determine a neighbor node based on the transition probability, query cache content of the neighbor node according to the content request to obtain a second query result, take the neighbor cache node as the target cache node when the second query result is cache content with a hit, and take a cache level with a next query priority as the target cache level and perform the step of querying cache content of an initial cache node in a target cache level according to the content request to obtain a first query result when the second query result is cache content without a hit and a current query depth reaches a preset depth threshold or a current query time reaches a preset time threshold.

[0176] The cache optimization device provided in the application adopts the cache optimization method in the above embodiments, and can solve the technical problem of how to effectively improve cache hit rate and reduce content transmission cost. Compared with the prior art, the cache optimization device provided in the application has the same beneficial effects as the cache optimization method provided in the above embodiments, and other technical features in the cache optimization device are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0177] The application provides a cache optimization device, comprising: at least one processor; and a memory connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the cache optimization method in the above embodiment one.

[0178] Reference is made below Figure 6 , which shows a structural diagram of a cache optimization device suitable for implementing the embodiments of the application. The cache optimization device in the embodiments of the application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 6 The illustrated cache optimization device is only an example and should not bring any limitation to the functions and use range of the embodiments of the application.

[0179] As Figure 6 shown, the cache optimization device can include a processing apparatus 1001 (such as a central processor, a graphics processor, or the like) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or loaded from a storage apparatus 1003 into a random access memory (RAM) 1004. In the RAM 1004, various programs and data required for the operation of the cache optimization device are also stored. The processing apparatus 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: input apparatuses 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, and the like; output apparatuses 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; the storage apparatus 1003 including, for example, a magnetic tape, a hard disk, and the like; and a communication apparatus 1009. The communication apparatus 1009 can allow the cache optimization device to communicate with other devices wirelessly or by wire to exchange data. Although the cache optimization device with various systems is shown in the figure, it should be understood that all the illustrated systems are not required to be implemented or provided. More or fewer systems can be alternatively implemented or provided.

[0180] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiments disclosed in the present application are executed.

[0181] The cache optimization device provided by the present application adopts the cache optimization method in the above-mentioned embodiments, and can solve the technical problem of how to effectively improve the cache hit rate and reduce the content transmission cost. Compared with the prior art, the cache optimization device provided by the present application has the same beneficial effects as the cache optimization method provided by the above-mentioned embodiments, and other technical features in the cache optimization device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0182] It should be understood that parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0183] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0184] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for executing the cache optimization method in the above-mentioned embodiments.

[0185] The computer readable storage medium provided in the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to an electrical wire, an optical cable, an RF (Radio Frequency), and the like, or any suitable combination of the above.

[0186] The above computer readable storage medium can be included in a cache optimization device, or can exist separately without being assembled into the cache optimization device.

[0187] The above computer readable storage medium carries one or more programs, which, when executed by the cache optimization device, cause the cache optimization device to: obtain data information of cache nodes in different cache levels, and update a cache strategy based on the data information to obtain an updated cache strategy, wherein the different cache levels include a local cache level, a regional cache level, and a global cache level; optimize each of the cache levels based on the updated cache strategy to obtain optimized cache content; in response to a content request of a user, perform dynamic path selection in the different cache levels to obtain a target request path; and obtain target cache content from the optimized cache content based on the target request path.

[0188] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0189] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0190] The modules involved in the embodiments of the present application can be implemented in software or hardware. In some cases, the names of the modules do not constitute a limitation on the modules themselves.

[0191] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer programs) for executing the above-mentioned cache optimization method, and can solve the technical problem of how to effectively improve cache hit rate and reduce content transmission cost. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the cache optimization method provided by the above-mentioned embodiments, and will not be described here.

[0192] The application further provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the cache optimization method as described above.

[0193] The computer program product provided by the application can solve the technical problem of how to effectively improve the cache hit rate and reduce the content transmission cost. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the cache optimization method provided by the above-mentioned embodiments, and are not described here.

[0194] The above only describes some embodiments of the application, and does not limit the patent scope of the application. Any equivalent structural transformation made by using the content of the specification and drawings, or direct / indirect application in other related technical fields under the technical concept of the application is included in the patent protection scope of the application.

Claims

1. A cache optimization method, characterized in that, The method includes: Data information of each cache node in different cache levels is obtained, and the cache strategy is updated based on the data information to obtain the updated cache strategy. The different cache levels include local cache level, regional cache level and global cache level. Based on the updated caching strategy, each of the caching levels is optimized to obtain the optimized cached content; In response to a user's content request, dynamic path selection is performed at different cache levels to obtain a target request path. Specifically, this includes: in response to a user's content request, obtaining the query priority of each cache level, and performing dynamic path selection at different cache levels based on the query priority to determine a target cache level; querying the cached content of the initial cache node in the target cache level according to the content request to obtain a first query result; when the first query result indicates no matched cached content, obtaining the transition probability of the initial cache node, and determining neighboring nodes based on the transition probability, wherein the transition probability is determined based on content popularity and load; querying the cached content of the neighboring nodes according to the content request to obtain a second query result; when the second query result indicates matched cached content, designating the neighboring cache node as the target cache node; and generating a target request path based on the target cache node. The target cache content is obtained from the optimized cache content based on the target request path.

2. The method as described in claim 1, characterized in that, The steps of obtaining data information of each cache node in different cache levels and updating the cache strategy based on the data information to obtain the updated cache strategy include: Retrieve data information of each cache node at different cache levels; Based on the data information, determine the data characteristics and performance indicators of the cached content in each cache node; The data features and performance indicators are updated to obtain updated data features and updated performance indicators; The caching strategies of each cache node in different caching levels are updated based on the updated data characteristics and the updated performance indicators to obtain the updated caching strategies.

3. The method as described in claim 2, characterized in that, The step of updating the caching strategy of each cache node in different caching levels according to the updated data characteristics and the updated performance indicators to obtain the updated caching strategy includes: Collect user request data within a preset time window; A dataset is constructed based on the user request data, and the average gradient is determined based on the dataset; The model parameters of the local model corresponding to each cache node in the different cache levels are updated according to the average gradient to obtain the updated local model. Based on the updated data characteristics, the updated performance metrics, and the updated local model, the caching strategies of each cache node in different caching levels are updated to obtain the updated caching strategy.

4. The method as described in claim 1, characterized in that, The step of optimizing each cache level based on the updated caching strategy to obtain optimized cache content includes: Obtain the cache capacity, current cache content set, and new cache content set of each cache node in each cache level; The first content popularity of each cached content in the current cached content set and the second content popularity of each cached content in the new cached content set are determined according to the updated caching strategy. The cache levels are optimized based on the cache capacity, the popularity of the first content, and the popularity of the second content to obtain optimized cache content.

5. A cache optimization device, characterized in that, The cache optimization device includes: The update module is used to obtain data information of each cache node in different cache levels, and update the cache strategy based on the data information to obtain the updated cache strategy. The different cache levels include local cache level, regional cache level and global cache level. The optimization module is used to optimize each cache level based on the updated caching strategy to obtain optimized cache content; The selection module is used to dynamically select the target request path in response to the user's content request at different cache levels. The acquisition module is used to acquire target cached content from the optimized cached content based on the target request path; The selection module is also used to respond to the user's content request, obtain the query priority of each cache level, and perform dynamic path selection in different cache levels according to the query priority to determine the target cache level; Based on the content, a query is made to retrieve the cached content of the initial cache node in the target cache level, and the first query result is obtained; When the first query result indicates that there is no matched cached content, the transition probability of the initial cache node is obtained, and neighboring nodes are determined based on the transition probability, wherein the transition probability is determined based on content popularity and load. Based on the content, a query is made to retrieve the cached content of the neighboring node, and a second query result is obtained; If the second query result indicates that there is a matched cached content, the neighboring cache node will be used as the target cache node. Generate the target request path based on the target cache node.

6. A cache optimization device, characterized in that, The cache optimization device includes: a memory, a processor, and a cache optimization program stored on the memory and executable on the processor, the cache optimization program being configured to implement the cache optimization method as described in any one of claims 1 to 4.

7. A storage medium, characterized in that, The storage medium stores a cache optimization program, which, when executed by the processor, implements the cache optimization method as described in any one of claims 1 to 4.

8. A computer program product, characterized in that, The computer program product includes a cache optimization program, which, when executed by a processor, implements the steps of the cache optimization method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data caching method and device, electronic equipment and readable storage medium

    CN117009389A

  • Data processing method and related device

    CN117539915A