A content caching and replacement method and system based on context awareness
By constructing context feature vectors and using XGBoost model to predict future access popularity, combined with the NSGA-II algorithm to optimize the cache strategy, the problems of low cache hit rate and low resource utilization in the edge cache method are solved, and efficient cache management in complex network environments are achieved.
Patent Information
- Application Number
- CN202510838313.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-23
AI Technical Summary
The existing edge caching methods lack perception and utilization of multi-dimensional context information, resulting in low cache hit rate, low resource utilization rate, and lack of modeling capabilities for balancing relationships between multiple targets, making it difficult to meet the diversified performance requirements of complex network environments.
By constructing context feature vectors, using XGBoost regression model to predict future content access popularity, and combining NSGA-II multi-objective evolution algorithm to optimize the cache strategy, design multi-objective optimization functions and cache scoring functions to achieve global balanced optimization of cache hit rate, transmission delay and bandwidth occupation.
It significantly improves the cache hit rate, reduces system latency and resource consumption, and realizes an efficient, intelligent and sustainable cache management strategy in dynamic and complex network environments.
Smart Images

Figure CN120354972B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of content caching, and in particular to a context-aware content caching and replacement method and system. Background Art
[0002] With the rapid development of mobile Internet, the Internet of Things, and edge computing technologies, end users are increasingly demanding data access latency, service availability, and transmission efficiency. To alleviate transmission pressure on core networks and improve user experience, edge caching technology is widely used to pre-store content in edge nodes close to the user side, thereby achieving rapid response. However, most current mainstream edge caching methods are based on traditional content access statistics, such as access frequency or last access time. These methods rely on historical access patterns of content to make caching decisions and cannot effectively predict future access trends. In practical applications, they are prone to problems such as low hit rate and poor caching efficiency.
[0003] Furthermore, existing methods generally lack the awareness and utilization of multidimensional contextual information when making caching decisions. In real-world edge computing scenarios, user behavior, the operating status of network nodes, and the attributes of requested content all significantly impact the probability of content access. Ignoring these contextual factors, which are closely tied to content requests, results in caching strategies lacking environmental adaptability and predictive accuracy, leading to inefficient allocation and utilization of system resources.
[0004] On the other hand, edge caching systems typically face multiple optimization objectives, while many current strategies only optimize a single metric. They lack the ability to model the balance between these multiple objectives, making it difficult to meet the diverse performance requirements of complex network environments. Furthermore, during content replacement, existing methods often employ fixed or static replacement strategies that fail to consider the content's future accessibility, resource consumption costs, and current system status. These replacement decisions lack intelligence and dynamism, reducing cache space utilization efficiency.
[0005] CN111629217A, entitled: VOD service cache optimization method based on XGBoost algorithm in edge network environment, the method comprises: collecting video data; using average access volume as the prediction target, using XGBoost algorithm to perform regression modeling to obtain a prediction model; using the prediction model to predict the average access volume; establishing a cache optimization model based on the prediction results; using the knapsack algorithm to solve the optimization model and obtain the final cache solution. This method takes into account the need for edge servers to process large amounts of video information and the excellent data analysis capabilities of machine learning in big data processing, thereby enabling edge servers to minimize service access delays and improve the cache efficiency of edge servers. However, this method lacks the ability to perceive and dynamically adjust environmental changes in real time. It only uses the average video access volume as the prediction target and lacks comprehensive modeling of multi-dimensional contextual factors, resulting in the prediction results being unable to dynamically adapt to complex and changing network and user environments. It also lacks fine-grained evaluation and replacement decisions for cached content, which limits cache efficiency in high-frequency update scenarios.
[0006] CN114513514A, entitled: A method for caching and pre-caching edge network content for vehicle users, comprising: based on constraints such as content popularity, vehicle speed, and request initiation location, as well as edge server cache capacity, using content segmentation to complete the caching and pre-caching configuration of vehicle-requested content through vertical collaboration between cloud servers and edge servers, thereby maximizing the resource utilization of edge servers, reducing content download latency for vehicle users, and reducing content update costs for edge servers. This method effectively improves the content acquisition efficiency of vehicle users in high-speed mobile scenarios by combining factors such as content popularity, vehicle speed, and location, and using content segmentation and edge-cloud collaboration. However, it lacks consideration for cached content replacement, and the optimization goal is relatively simple, making it difficult to implement a more efficient and refined caching strategy in a complex network environment. Summary of the Invention
[0007] In response to the above issues, the present invention proposes a context-aware content caching and replacement method and system. This method comprehensively perceives multidimensional contextual information, including user behavior, node status, and content characteristics. It accurately predicts future content access popularity by constructing a contextual feature vector and introducing an XGBoost (Extreme Gradient Boosting) regression model. Furthermore, it uses the NSGA-II (Non-dominated Sorting Genetic Algorithm II) to optimize the caching strategy, achieving a global balance between cache hit rate, transmission latency, and bandwidth usage. This method not only significantly improves cache hit rate but also effectively reduces system latency and resource consumption, thereby implementing an efficient, intelligent, and sustainable cache management strategy in dynamic and complex edge network environments.
[0008] A technical solution of the present invention is:
[0009] A content caching and replacement method based on context awareness, the method comprising:
[0010] Obtain context information at different times and construct context feature vectors;
[0011] Based on the context feature vector, construct a training sample, train the XGBoost regression model, and obtain a trained XGBoost prediction model;
[0012] Constructing a cache decision candidate set, collecting the context feature vectors, and using the trained XGBoost prediction model to perform predictions to obtain future content access popularity;
[0013] Design multi-objective optimization functions and constraints based on cache strategy requirements;
[0014] Based on the multi-objective optimization function and constraints, the NSGA-II multi-objective evolutionary algorithm is used to solve and obtain the Pareto solution set;
[0015] Define a comprehensive scoring function, select the individual with the maximum comprehensive scoring function value from the Pareto solution set as the final caching strategy, use the corresponding content set as the final cache content set, and deploy the cache to the edge node;
[0016] Designing a cache scoring function for a single content, obtaining a cache score based on the cache scoring function, and replacing the cached content using a greedy strategy based on the cache score;
[0017] The content refers to the content that the user requests to access.
[0018] Furthermore, the acquisition of context information at different times and the construction of context feature vectors include:
[0019] performing a preprocessing operation on the context information to obtain preprocessed context information;
[0020] The context feature vector is constructed according to the preprocessed context information.
[0021] Furthermore, the context information includes: user behavior information, node status information, and request content information;
[0022] The user behavior information includes: user access frequency, user location, user speed, and user activity;
[0023] The node status information includes: node bandwidth, node transmission delay, and node load;
[0024] The requested content information includes: the total number of times the content was accessed within the sliding time window and the content size;
[0025] The preprocessing operation includes: outlier elimination, missing value filling and standardization.
[0026] The context feature vector is expressed as follows:
[0027] ;
[0028] in, refers to the context feature vector, It refers to the content, Refers to the user, Refers to the edge node, refers to the current moment, Refers to users Content within a sliding time window User access frequency, The current moment User location, The current moment User speed, The current moment User activity, that is, the total number of user requests, The current moment The node bandwidth, The current moment The node transmission delay, The current moment The node load, Refers to the content The total number of visits within the sliding time window, Refers to the content size, that is, the content size.
[0029] Furthermore, constructing a training sample based on the context feature vector, training the XGBoost regression model, and obtaining a trained XGBoost prediction model includes:
[0030] Based on the context feature vector, actual access popularity within a time span after the corresponding time point is collected as label data;
[0031] The context feature vectors of all historical time points and the corresponding label data constitute a training sample set;
[0032] Setting the input of the XGBoost regression model to the context feature vector and the output to the future content access popularity;
[0033] A loss function is defined, and through iterative training, the parameters of the XGBoost regression model are continuously optimized using a gradient boosting tree to minimize the loss function, and finally the trained XGBoost prediction model is obtained.
[0034] Furthermore, the tag data refers to the content of the content under the condition that all historical time points are known. exist The actual access popularity at a certain moment is expressed as: ;
[0035] The time span is expressed as: ;
[0036] The training sample set is expressed as:
[0037] ;
[0038] in, is the training sample set, refers to the context feature vector, refers to the label data, is the time span, refers to the sample size;
[0039] The future content access popularity is expressed as: ;
[0040] The parameters are expressed as: ;
[0041] The loss function is expressed as:
[0042] ;
[0043] in, is the loss function, refers to the model parameters, is the sample size, refers to the index variable, Refers to the real content access popularity, It refers to the model predicting the popularity of content access. Refers to the model complexity regularization term, which represents the model complexity penalty term, including the number and depth of regression trees, used to prevent overfitting. is the regularization parameter.
[0044] Furthermore, the step of constructing a cache decision candidate set, collecting the context feature vectors, and using the trained XGBoost prediction model to perform predictions to obtain future content access popularity includes:
[0045] At the edge node, count and generate a set of content requested by all users, which is recorded as the candidate content set;
[0046] For each content in the candidate content set, the context feature vector is collected, and prediction is performed using the trained XGBoost prediction model to obtain the predicted future content access popularity;
[0047] The candidate content set is expressed as follows:
[0048] ;
[0049] in, refers to the candidate content set, Refers to each corresponding content.
[0050] Furthermore, the cache strategy requirement refers to maximizing cache hit rate, minimizing transmission delay, and minimizing bandwidth usage;
[0051] The multi-objective optimization function includes a function for maximizing cache hit rate, a function for minimizing transmission delay, and a function for minimizing bandwidth occupancy;
[0052] The objective function of maximizing cache hit rate is expressed as follows:
[0053] ;
[0054] in, It refers to the objective function of maximizing the cache hit rate. Refers to the actual set of cached content selected. refers to the candidate content set, Refers to the future content access popularity, It refers to the time span;
[0055] Minimize the transmission delay objective function, which is expressed as:
[0056] ;
[0057] in, refers to the objective function of minimizing transmission delay, Refers to the actual set of cached content selected. The current moment Node transmission delay;
[0058] Minimize the bandwidth occupancy objective function, its expression is:
[0059] ;
[0060] in, It refers to the objective function of minimizing bandwidth occupancy. Refers to the actual set of cached content selected. Refers to the content The size of Refers to the future content access popularity, is the time span, The current moment Node bandwidth;
[0061] The constraint condition refers to the cache capacity constraint condition, which is expressed as:
[0062] ;
[0063] in, Refers to the actual set of cached content selected. Refers to the content The size of Refers to the total cache capacity of edge nodes.
[0064] Furthermore, based on the multi-objective optimization function and the constraints, the NSGA-II multi-objective evolutionary algorithm is used to solve the problem and obtain a Pareto solution set, including:
[0065] Encode each individual, use a binary vector to represent the cache selection scheme of the content, determine whether to cache the content, and obtain the cache selection vector;
[0066] Randomly generate several legal individuals to form the initial population, set the population size, and initialize the iteration counter;
[0067] Calculate the three objective functions of each individual and obtain the objective function value;
[0068] Perform evolution operations on the current population to generate the next generation population;
[0069] The current population and the next generation population are merged into a joint population, non-dominated sorting and crowding evaluation are re-performed, individuals of the same size as the previous population are selected to form a new population, and an iteration counter is updated until a set maximum number of iterations is reached, the evolution process is stopped, and the Pareto solution set is finally obtained.
[0070] Furthermore, the individual refers to a complete content cache selection scheme, which is represented in the form of a binary vector, where each bit in the vector corresponds to a cache decision of a content in the candidate content set, thereby constituting the cache selection vector;
[0071] The cache selection vector is expressed as follows:
[0072] ;
[0073] in, refers to the cache selection vector, Refers to a binary vector, indicating whether to choose The content in the candidate content cache set is cached on the edge node. Its value is 1 for caching and 0 for not caching. Refers to the total number of candidate content sets;
[0074] The plurality of legal individuals must satisfy the cache capacity constraint;
[0075] The cache capacity constraint condition is expressed as follows:
[0076] ;
[0077] in, Refers to the actual set of cached content selected. Refers to the content The size of It refers to the total cache capacity of edge nodes;
[0078] The initial population is expressed as: ;
[0079] The population size is expressed as: ;
[0080] The initialization iteration counter is expressed as: ;
[0081] The current population is expressed as: ;
[0082] The three objective functions are: maximizing cache hit rate objective function, minimizing transmission delay objective function, and minimizing bandwidth occupancy objective function;
[0083] The evolutionary operations include: non-dominated sorting, congestion calculation, selection operation, crossover operation, and mutation operation;
[0084] The new population is expressed as: ;
[0085] The maximum number of iterations is expressed as: ;
[0086] The Pareto solution set is expressed as: .
[0087] Furthermore, the comprehensive scoring function is defined, and the individual with the largest comprehensive scoring function value is selected from the Pareto solution set as the final caching strategy, and the corresponding content set is used as the final cache content set, and the cache is deployed to the edge node, including:
[0088] For each individual in the Pareto solution set, a comprehensive scoring function is defined;
[0089] Among all solutions in the Pareto solution set, the individual that maximizes the comprehensive scoring function is selected as the optimal solution, and an optimal cache selection vector is obtained;
[0090] Based on the value of each binary bit in the optimal cache selection vector, it is determined whether to cache corresponding content, to obtain the final cache content set, and the content in the final cache content set is cached to the edge node.
[0091] Furthermore, each individual refers to each cache selection vector;
[0092] The comprehensive scoring function is expressed as follows:
[0093] ;
[0094] in, is the comprehensive scoring function, It refers to a cache strategy individual in the Pareto solution set. , Refers to the cache strategy The predicted hit rate value, Refers to the cache strategy The average transmission delay at the current edge node, Refers to the cache strategy The total bandwidth consumption at the current edge node, 、 and Refers to the weight parameter, while satisfying ;
[0095] The optimal solution is expressed as: ;
[0096] The optimal cache selection vector is expressed as: ;
[0097] The final cache content set is expressed as: .
[0098] Furthermore, the design is directed to a cache scoring function for a single content, a cache score is obtained based on the cache scoring function, and a greedy strategy is adopted to replace the cached content based on the cache score, including:
[0099] Designing the cache scoring function to calculate the cache scores of all the content in the candidate content set and the cached content at the current edge node based on the future content access popularity, the content size, and the node load;
[0100] All the contents in the candidate content set and the cached contents are sorted from high to low according to the cache scores, and the cached contents are replaced using a greedy strategy.
[0101] Furthermore, the cache scoring function is expressed as follows:
[0102] ;
[0103] in, refers to the cache scoring function, Refers to the future content access popularity, is the time span, Refers to the content The size of The current moment The node load is used as the load penalty term in the cache scoring function to penalize the cache selection of high-load nodes and reflect the current cache pressure;
[0104] The greedy strategy includes:
[0105] sorting the contents in all the candidate content sets from high to low according to the cache scores;
[0106] Traverse the sorted list and make cache replacement judgments;
[0107] The cache replacement judgment is specifically as follows:
[0108] If the content in the candidate content set is not cached and the cache space is sufficient, directly add it to the cache until the cache space is exhausted;
[0109] If the cache space is insufficient, the cache score of the content in the candidate content set is compared with the content with the lowest cache score in the cached content;
[0110] If the cache score of the content in the candidate content set is higher, the content with the lowest cache score in the cached content is replaced; otherwise, the content in the candidate content set is skipped.
[0111] Based on the above-mentioned context-aware content caching and replacement method, the present invention further provides a context-aware content caching and replacement system, the system comprising:
[0112] A data processing module is used to obtain context information, perform preprocessing operations on the context information, obtain preprocessed data, and construct a context feature vector;
[0113] A popularity prediction module is used to train an XGBoost prediction model based on the context feature vector obtained by the data processing module, and use the XGBoost prediction model to predict future content access popularity;
[0114] The content caching module is used to design a multi-objective optimization function based on the caching strategy requirements and solve it using the NSGA-II algorithm to obtain a Pareto solution set. It then defines a comprehensive scoring function and selects the individual that maximizes the comprehensive scoring function from the Pareto solution set as the final caching strategy. The corresponding content set is used as the final cache content set and is cached to edge nodes.
[0115] The cache replacement module is used to design a cache scoring function for a single content based on the future content access popularity predicted by the popularity prediction module, obtain a cache score based on the cache scoring function, and replace the cached content of the content cache module based on the cache score using a greedy strategy.
[0116] The embodiments of the present invention provide a context-aware content caching and replacement method and system. By collecting and analyzing multi-dimensional context feature information, combined with the XGBoost prediction model, the system accurately predicts the future content access popularity, optimizes the caching strategy using a multi-objective evolutionary algorithm, and finally adopts a greedy replacement mechanism based on cache scoring. This significantly improves the cache hit rate, effectively reduces transmission delay and bandwidth occupancy, and significantly enhances the efficiency and resource utilization of content caching in edge computing environments.
[0117] The above content of the invention is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0118] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0119] Figure 1 A specific flow chart of a content caching and replacement method based on context awareness provided by an embodiment of the present invention is shown.
[0120] Figure 2 A framework diagram of a content caching and replacement system based on context awareness provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0121] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0122] The rapid development of services such as mobile internet, the Internet of Things, and high-definition video has placed higher demands on users for real-time and reliable data access. Edge computing, as an important means of alleviating pressure on central servers and reducing access latency, has been widely used in content distribution systems. However, existing content caching strategies mostly rely on static rules or simple content access statistics, making it difficult to accurately capture dynamic contextual information such as user behavior, node status, and content characteristics. This leads to problems such as low cache hit rates, low resource utilization, and untimely content replacement. Furthermore, traditional strategies lack flexibility and global optimization capabilities when faced with complex multi-objective optimization requirements, making it difficult to achieve optimal distribution efficiency with limited cache resources. How to achieve more intelligent and efficient content caching and replacement at edge nodes has become an urgent issue to be addressed.
[0123] To address these issues, the present invention proposes a context-aware content caching and replacement method and system. This method leverages multi-source contextual information, including user behavior, node status, and content features, to accurately predict future content access popularity using the XGBoost model. This system, combined with a multi-objective optimization algorithm, generates an efficient caching strategy. Furthermore, the system dynamically adjusts cache content through the design of a cache scoring function and a greedy replacement mechanism, improving cache hit rates and optimizing system performance. This method effectively addresses the shortcomings of existing solutions in terms of cache accuracy, dynamics, and resource scheduling, demonstrating its strong practicality and potential for widespread adoption.
[0124] The specific implementation includes the following:
[0125] Example 1:
[0126] refer to Figure 1 This embodiment provides a context-aware content caching and replacement method, the method comprising:
[0127] Step S1: Obtain context information at different times and construct a context feature vector;
[0128] Step S2: Based on the context feature vector, construct a training sample, train the XGBoost regression model, and obtain a trained XGBoost prediction model;
[0129] Step S3: Constructing a cache decision candidate set, collecting the context feature vectors, and using the trained XGBoost prediction model to perform predictions to obtain future content access popularity;
[0130] Step S4: Based on the cache strategy requirements, design a multi-objective optimization function and constraints;
[0131] Step S5: Based on the multi-objective optimization function and the constraints, the NSGA-II multi-objective evolutionary algorithm is used to solve the problem and obtain a Pareto solution set;
[0132] Step S6: Define a comprehensive scoring function, select the individual with the largest comprehensive scoring function value from the Pareto solution set as the final caching strategy, use the corresponding content set as the final cache content set, and deploy the cache to the edge node;
[0133] Step S7: Design a cache scoring function for a single content, obtain a cache score based on the cache scoring function, and replace the cached content using a greedy strategy based on the cache score.
[0134] In step S1, the acquiring of context information at different moments and the constructing of context feature vectors include: performing a preprocessing operation on the context information to obtain preprocessed context information; and constructing the context feature vector according to the preprocessed context information.
[0135] Specifically, preprocessing operations include data alignment and denoising: unifying the time base of all context data (aligning by sliding window sampling points), outlier processing (including negative node load and position jump), and missing value filling (interpolation, mean filling, or deletion); feature normalization: using Min-Max normalization for real-valued features to ensure that all feature values are within a reasonable range, which is conducive to model training.
[0136] The use of contextual information can significantly enhance the intelligence of content caching strategies. By incorporating multi-dimensional information such as user behavior, node status, and content characteristics, the system can more accurately predict the future popularity of content, enabling joint modeling of people, content, and the environment. This not only enhances the model's adaptability to complex network environments and dynamic user behavior, but also makes caching decisions more refined and personalized, thereby improving cache hit rates while effectively reducing transmission latency and bandwidth usage, thereby increasing edge resource utilization efficiency.
[0137] In the above steps, the content refers to the content that the user requests to access.
[0138] The context information includes: user behavior information, node status information, and request content information.
[0139] The user behavior information includes: user access frequency, user location, user speed, and user activity.
[0140] The node status information includes: node bandwidth, node transmission delay, and node load.
[0141] The requested content information includes: the total number of times the content is accessed within the sliding time window and the content size.
[0142] The preprocessing operation includes: outlier elimination processing, missing value filling processing, and standardization processing.
[0143] The context feature vector is expressed as follows:
[0144] ;
[0145] in, refers to the context feature vector, It refers to the content, Refers to the user, Refers to the edge node, refers to the current moment, Refers to users Content within a sliding time window User access frequency, The current moment User location, The current moment User speed, The current moment User activity, that is, the total number of user requests, The current moment The node bandwidth, The current moment The node transmission delay, The current moment The node load, Refers to the content The total number of visits within the sliding time window, Refers to the content size, that is, the content size.
[0146] During the specific implementation, the following scenario is considered: users request to watch short video content in different areas through mobile devices, and the system deploys edge nodes in multiple geographical areas to respond to content requests from surrounding users.
[0147] In step S2, based on the context feature vector, a training sample is constructed, and an XGBoost regression model is trained to obtain a trained XGBoost prediction model, including: based on the context feature vector, actual access popularity within a time span after the corresponding time point is collected as label data; the context feature vectors of all historical time points and their corresponding label data constitute a training sample set; setting the input of the XGBoost regression model as the context feature vector, and the output as the future content access popularity; defining a loss function, and through iterative training, using a gradient boosting tree to continuously optimize the parameters of the XGBoost regression model to minimize the loss function, and finally obtaining the trained XGBoost prediction model.
[0148] The XGBoost prediction model is used to accurately estimate the popularity of content access within a specific time period in the future. By inputting a contextual feature vector, the XGBoost model can comprehensively consider user behavior characteristics, edge node status, and content characteristics, and learn nonlinear relationships in content access patterns from historical data. The prediction result is the access popularity value of each candidate content within a certain time span in the future, providing key support for subsequent caching decisions. Compared with traditional static or rule-driven prediction methods, XGBoost has stronger fitting capabilities and generalization performance, which can improve cache hit rates, reduce unnecessary content replacement and data transmission, and effectively optimize the overall performance of the edge caching system.
[0149] In the above steps, the label data refers to the content under the condition that all historical time points are known. exist The actual access popularity at a certain moment is expressed as: .
[0150] The time span is expressed as: .
[0151] The training sample set is expressed as follows:
[0152] ;
[0153] in, is the training sample set, refers to the context feature vector, refers to the label data, is the time span, is the sample size.
[0154] The future content access popularity is expressed as: .
[0155] The parameters are expressed as: .
[0156] The loss function is expressed as:
[0157] ;
[0158] in, is the loss function, refers to the model parameters, is the sample size, refers to the index variable, Refers to the real content access popularity, It refers to the model predicting the popularity of content access. Refers to the model complexity regularization term, which represents the model complexity penalty term, including the number and depth of regression trees, used to prevent overfitting. is the regularization parameter.
[0159] In step S3, the cache decision candidate set is constructed, the context feature vectors are collected, and the trained XGBoost prediction model is used to perform prediction to obtain future content access popularity, including: at the edge node, counting and generating a content set of all user requests, recorded as a candidate content set; for each content in the candidate content set, its context feature vector is collected, and the trained XGBoost prediction model is used to perform prediction to obtain the predicted future content access popularity.
[0160] In this step, the candidate content set is expressed as:
[0161] ;
[0162] in, refers to the candidate content set, Refers to each corresponding content.
[0163] In step S4, the cache strategy requirement refers to maximizing cache hit rate, minimizing transmission delay, and minimizing bandwidth usage.
[0164] The multi-objective optimization function includes an objective function of maximizing cache hit rate, an objective function of minimizing transmission delay, and an objective function of minimizing bandwidth occupancy.
[0165] The objective function of maximizing cache hit rate is expressed as follows:
[0166] ;
[0167] in, It refers to the objective function of maximizing the cache hit rate. Refers to the actual set of cached content selected. refers to the candidate content set, Refers to the future content access popularity, It refers to the time span.
[0168] Minimize the transmission delay objective function, which is expressed as:
[0169] ;
[0170] in, refers to the objective function of minimizing transmission delay, Refers to the actual set of cached content selected. The current moment Node transmission delay.
[0171] Minimize the bandwidth occupancy objective function, its expression is:
[0172] ;
[0173] in, It refers to the objective function of minimizing bandwidth occupancy. Refers to the actual set of cached content selected. Refers to the content The size of Refers to the future content access popularity, is the time span, The current moment Node bandwidth.
[0174] The constraint condition refers to the cache capacity constraint condition, which is expressed as:
[0175] ;
[0176] in, Refers to the actual set of cached content selected. Refers to the content The size of Refers to the total cache capacity of edge nodes.
[0177] Specifically, the design of the multi-objective optimization function and cache capacity constraint conditions aims to comprehensively balance the key indicators of cache performance under the condition of limited edge node resources. By maximizing the cache hit rate objective function, priority is given to caching content that is predicted to be highly popular, thereby increasing the probability of user requests hitting the local cache and reducing the frequency of back-to-source requests; by minimizing the transmission delay objective function, the cache strategy is encouraged to tend to select content with lower latency at the current node, thereby improving data response efficiency and user experience; and the minimizing bandwidth occupancy objective function guides the system to prioritize caching content with lower unit bandwidth consumption and higher cost-effectiveness, thereby improving network resource utilization. The above three are used as parallel optimization objectives. Under the overall limited cache capacity constraint, they are solved through the NSGA-II multi-objective evolutionary algorithm to obtain a set of Pareto optimal cache strategies, enabling the system to weigh performance indicators from multiple angles and ultimately achieve refined cache content decisions and optimal resource allocation.
[0178] In step S5, the multi-objective optimization function and constraint conditions are solved using the NSGA-II multi-objective evolutionary algorithm to obtain a Pareto solution set, including: encoding each individual, using a binary vector to represent the cache selection scheme of the content, judging whether to cache the content, and obtaining a cache selection vector; randomly generating a number of legal individuals to form an initial population, setting the population size, and initializing an iteration counter; calculating the three objective functions of each individual to obtain the objective function value; performing an evolutionary operation on the current population to generate the next generation population; merging the current population and the next generation population into a joint population, re-performing non-dominated sorting and crowding evaluation, selecting individuals of the previous population size to form a new population, updating the iteration counter until the set maximum number of iterations is reached, stopping the evolutionary process, and finally obtaining the Pareto solution set.
[0179] Specifically, the NSGA-II multi-objective evolutionary algorithm simulates natural selection and evolutionary mechanisms, gradually optimizing content cache selection strategies based on a multi-objective optimization function and cache capacity constraints. In the initial stage, the algorithm randomly generates several individuals that meet the cache capacity constraints. Each individual is encoded using a binary vector, where each bit in the vector corresponds to a candidate content, with 1 indicating that the content is cached and 0 indicating that it is not. Subsequently, the cache hit rate, transmission delay, and bandwidth usage are calculated for each individual in the population. Individuals are ranked according to the non-dominated sorting principle, and the crowding distance is calculated to maintain population diversity. During the iterative process, genetic operations such as selection, crossover, and mutation are used to generate the next generation of populations. These populations are then merged with the current population and re-sorted and filtered, continuously driving the population towards a more optimal Pareto front. By limiting the maximum number of iterations, the algorithm ultimately outputs a set of Pareto-optimal caching strategies covering different trade-offs, providing multiple feasible solutions for subsequent selection of specific caching solutions.
[0180] Furthermore, the population evolution operations include: non-dominated sorting, crowding calculation, selection operation, crossover operation, and mutation operation.
[0181] Furthermore, the non-dominated sorting refers to sorting according to the objective function value, which is divided into different non-dominated levels. The higher the level, the better the solution.
[0182] The crowding calculation refers to maintaining the diversity of solutions by calculating the density of the target space within the same level, and individuals with high crowding are retained preferentially.
[0183] The selection operation refers to selecting a parent generation by combining the non-dominated rank and the congestion degree using a tournament selection method.
[0184] The crossover operation refers to generating new individuals using a single-point crossover or uniform crossover method to ensure that the new individuals meet the cache space constraints, otherwise pruning (deleting the content with the lowest popularity) is performed.
[0185] The mutation operation refers to flipping the bit at a certain position (0↔1) according to probability to generate a mutant individual, which also needs to ensure capacity constraints.
[0186] In the above steps, the individual refers to a complete content cache selection scheme, which is represented in the form of a binary vector. Each bit in the vector corresponds to a cache decision of a content in the candidate content set, thereby forming the cache selection vector.
[0187] The cache selection vector is expressed as follows:
[0188] ;
[0189] in, refers to the cache selection vector, Refers to a binary vector, indicating whether to choose The content in the candidate content cache set is cached on the edge node. Its value is 1 for caching and 0 for not caching. Refers to the total number of candidate content sets.
[0190] The plurality of legal individuals must satisfy the cache capacity constraint.
[0191] The cache capacity constraint condition is expressed as follows:
[0192] ;
[0193] in, Refers to the actual set of cached content selected. Refers to the content The size of Refers to the total cache capacity of edge nodes.
[0194] The initial population is expressed as: .
[0195] The population size is expressed as: .
[0196] The initialization iteration counter is expressed as: .
[0197] The current population is expressed as: .
[0198] The three objective functions are: maximizing cache hit rate objective function, minimizing transmission delay objective function, and minimizing bandwidth occupancy objective function.
[0199] The evolutionary operation includes: non-dominated sorting, congestion calculation, selection operation, crossover operation, and mutation operation.
[0200] The new population is expressed as: .
[0201] The maximum number of iterations is expressed as: .
[0202] The Pareto solution set is expressed as: .
[0203] In step S6, the comprehensive scoring function is defined, and the individual that maximizes the comprehensive scoring function value is selected from the Pareto solution set as the final caching strategy, and the corresponding content set is used as the final cache content set, and the cache is deployed to the edge node, including: defining a comprehensive scoring function for each individual in the Pareto solution set; selecting the individual that maximizes the comprehensive scoring function from all solutions in the Pareto solution set, recording it as the optimal solution, and obtaining an optimal cache selection vector; determining whether to cache the corresponding content based on the value of each binary bit in the optimal cache selection vector, obtaining the final cache content set, and caching the content in the final cache content set to the edge node.
[0204] Specifically, the comprehensive scoring function is used to perform quantitative evaluation and unified comparison among multi-objective solutions with different advantages and disadvantages in the Pareto solution set, so as to assist in selecting the final caching strategy that best meets the overall optimization requirements of the system. The scoring function can assign weights to different objectives according to the actual scenario, so as to dynamically adjust to meet different needs.
[0205] In the above steps, each individual refers to each cache selection vector.
[0206] The comprehensive scoring function is expressed as follows:
[0207] ;
[0208] in, is the comprehensive scoring function, It refers to a cache strategy individual in the Pareto solution set. , Refers to the cache strategy The predicted hit rate value, Refers to the cache strategy The average transmission delay at the current edge node, Refers to the cache strategy The total bandwidth consumption at the current edge node, 、 and Refers to the weight parameter, while satisfying .
[0209] The optimal solution is expressed as: .
[0210] The optimal cache selection vector is expressed as: .
[0211] The final cache content set is expressed as: .
[0212] In step S7, a cache scoring function for a single content is designed, a cache score is obtained based on the cache scoring function, and a greedy strategy is adopted to replace the cached content based on the cache score, including: designing the cache scoring function to calculate the cache scores of all the content in the candidate content set and the cached content at the current edge node according to the future content access popularity, the content size and the node load; sorting all the content in the candidate content set and the cached content from high to low according to the cache score, and adopting a greedy strategy to replace the cached content.
[0213] Specifically, the cache scoring function is defined as an evaluation indicator that comprehensively measures the cache value of content in the current network environment. Its calculation method takes into account the predicted future content access popularity, content size, and the current edge node load level to achieve efficient utilization of cache resources. This method has dynamic adaptability and efficiency, and can quickly replace cached content under constantly changing content popularity and network conditions, thereby improving the overall cache hit rate and reducing access latency and bandwidth usage.
[0214] In the above steps, the cache scoring function is expressed as:
[0215] ;
[0216] in, refers to the cache scoring function, Refers to the future content access popularity, is the time span, Refers to the content The size of The current moment The node load is used as the load penalty term in the cache scoring function to penalize the cache selection of high-load nodes and reflect the current cache pressure.
[0217] Furthermore, the greedy strategy includes: sorting the contents in all the candidate content sets from high to low according to the cache scores; and traversing the sorted list to perform cache replacement judgment.
[0218] Furthermore, the cache replacement judgment is specifically as follows: if the content in the candidate content set is not cached and there is sufficient cache space, it is directly added to the cache until the cache space is exhausted; if the cache space is insufficient, the cache score of the content in the candidate content set is compared with the content with the lowest cache score among the cached contents; if the cache score of the content in the candidate content set is higher, the content with the lowest cache score among the cached contents is replaced; otherwise, the content in the candidate content set is skipped.
[0219] Example 2:
[0220] refer to Figure 2 Based on the context-aware content caching and replacement method of embodiment 1 above, the present invention further provides a context-aware content caching and replacement system, the system comprising:
[0221] A data processing module is used to obtain context information, perform preprocessing operations on the context information, obtain preprocessed data, and construct a context feature vector;
[0222] A popularity prediction module is used to train an XGBoost prediction model based on the context feature vector obtained by the data processing module, and use the XGBoost prediction model to predict future content access popularity;
[0223] The content caching module is used to design a multi-objective optimization function based on the caching strategy requirements and solve it using the NSGA-II algorithm to obtain a Pareto solution set. It then defines a comprehensive scoring function and selects the individual that maximizes the comprehensive scoring function from the Pareto solution set as the final caching strategy. The corresponding content set is used as the final cache content set and is cached to edge nodes.
[0224] The cache replacement module is used to design a cache scoring function for a single content based on the future content access popularity predicted by the popularity prediction module, obtain a cache score based on the cache scoring function, and replace the cached content of the content cache module based on the cache score using a greedy strategy.
[0225] The specific implementation method of this embodiment is the same as that of Example 1, which will not be repeated here. Please refer to the description of Example 1 for details.
[0226] The technical solution of the above embodiment is adopted. In a content caching and replacement method based on context awareness, a context-aware mechanism is introduced to fully utilize multi-dimensional dynamic information such as user behavior, node status, and request content characteristics. The XGBoost regression model is used to accurately predict future content access popularity. In combination with the multi-objective optimization algorithm NSGA-II, cache hit rate, transmission delay, and bandwidth occupancy are simultaneously optimized to achieve intelligent caching decisions for multiple scenarios. At the same time, a comprehensive scoring function is designed to select the optimal caching strategy from the Pareto solution set to further improve decision quality. In the cache replacement phase, a scoring function based on access popularity, content size, and node load is introduced. A greedy strategy is used to dynamically replace cache content, thereby effectively improving cache space utilization efficiency and overall system performance. It is significantly superior to traditional static or single-target caching methods and has stronger environmental adaptability, prediction accuracy, and real-time response capabilities. This method can not only improve cache hit rate and resource utilization efficiency, but also further enhance the service capability and response efficiency of edge nodes in complex environments, thereby achieving a more intelligent and efficient content caching and replacement strategy in dynamic network scenarios.
[0227] Those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is intended to be within the scope of the present invention and to form different embodiments.
[0228] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A content caching and replacement method based on context awareness, characterized in that: The method comprises: Obtain context information at different times and construct context feature vectors; Based on the context feature vector, construct a training sample, train the XGBoost regression model, and obtain a trained XGBoost prediction model; Constructing a cache decision candidate set, collecting the context feature vectors, and using the trained XGBoost prediction model to perform predictions to obtain future content access popularity; Design multi-objective optimization functions and constraints based on cache strategy requirements; Based on the multi-objective optimization function and constraints, the NSGA-II multi-objective evolutionary algorithm is used to solve and obtain the Pareto solution set; Define a comprehensive scoring function, select the individual with the maximum comprehensive scoring function value from the Pareto solution set as the final caching strategy, use the corresponding content set as the final cache content set, and deploy the cache to the edge node; Designing a cache scoring function for a single content, obtaining a cache score based on the cache scoring function, and replacing the cached content using a greedy strategy based on the cache score; The content refers to the content that the user requests to access.
2. The context-aware content caching and replacement method according to claim 1, wherein: The step of obtaining context information at different times and constructing a context feature vector includes: performing a preprocessing operation on the context information to obtain preprocessed context information; The context feature vector is constructed according to the preprocessed context information.
3. The context-aware content caching and replacement method according to claim 2, wherein: The context information includes: user behavior information, node status information, and request content information; The user behavior information includes: user access frequency, user location, user speed, and user activity; The node status information includes: node bandwidth, node transmission delay, and node load; The requested content information includes: the total number of times the content was accessed within the sliding time window and the content size; The preprocessing operation includes: outlier elimination, missing value filling and standardization. The context feature vector is expressed as follows: ; in, refers to the context feature vector, It refers to the content, refers to the user, Refers to the edge node, refers to the current moment, Refers to users Content within a sliding time window User access frequency, The current moment User location, The current moment User speed, The current moment User activity, that is, the total number of user requests, The current moment The node bandwidth, The current moment The node transmission delay, The current moment The node load, Refers to the content The total number of visits within the sliding time window, Refers to the content size, that is, the content size.
4. The context-aware content caching and replacement method according to claim 3, wherein: The method of constructing a training sample based on the context feature vector, training the XGBoost regression model, and obtaining a trained XGBoost prediction model includes: Based on the context feature vector, actual access popularity within a time span after the corresponding time point is collected as label data; The context feature vectors of all historical time points and the corresponding label data constitute a training sample set; Setting the input of the XGBoost regression model to the context feature vector and the output to the future content access popularity; A loss function is defined, and through iterative training, the parameters of the XGBoost regression model are continuously optimized using a gradient boosting tree to minimize the loss function, and finally the trained XGBoost prediction model is obtained.
5. The context-aware content caching and replacement method according to claim 4, characterized in that: The tag data refers to the content under the conditions known at all historical time points. exist The actual access popularity at a certain moment is expressed as: ; The time span is expressed as: ; The training sample set is expressed as: ; in, is the training sample set, refers to the context feature vector, refers to the label data, is the time span, refers to the sample size; The future content access popularity is expressed as: ; The parameters are expressed as: ; The loss function is expressed as: ; in, is the loss function, refers to the model parameters, is the sample size, refers to the index variable, Refers to the real content access popularity, It refers to the model predicting the popularity of content access. Refers to the model complexity regularization term, which represents the model complexity penalty term, including the number and depth of regression trees, used to prevent overfitting. is the regularization parameter.
6. The context-aware content caching and replacement method according to claim 5, characterized in that: The step of constructing a cache decision candidate set, collecting the context feature vectors, and using the trained XGBoost prediction model to perform predictions to obtain future content access popularity includes: At the edge node, count and generate a set of content requested by all users, which is recorded as the candidate content set; For each content in the candidate content set, the context feature vector is collected, and prediction is performed using the trained XGBoost prediction model to obtain the predicted future content access popularity; The candidate content set is expressed as follows: ; in, refers to the candidate content set, Refers to each corresponding content.
7. The context-aware content caching and replacement method according to claim 6, characterized in that: The cache strategy requirement is to maximize the cache hit rate, minimize the transmission delay, and minimize the bandwidth usage; The multi-objective optimization function includes a function for maximizing cache hit rate, a function for minimizing transmission delay, and a function for minimizing bandwidth occupancy; The objective function of maximizing cache hit rate is expressed as follows: ; in, It refers to the objective function of maximizing the cache hit rate. Refers to the actual set of cached content selected. refers to the candidate content set, Refers to the future content access popularity, It refers to the time span; Minimize the transmission delay objective function, which is expressed as: ; in, refers to the objective function of minimizing transmission delay, Refers to the actual set of cached content selected. The current moment Node transmission delay; Minimize the bandwidth occupancy objective function, its expression is: ; in, It refers to the objective function of minimizing bandwidth occupancy. Refers to the actual set of cached content selected. Refers to the content The size of Refers to the future content access popularity, is the time span, The current moment Node bandwidth; The constraint condition refers to the cache capacity constraint condition, which is expressed as: ; in, Refers to the actual set of cached content selected. Refers to the content The size of Refers to the total cache capacity of edge nodes.
8. The context-aware content caching and replacement method according to claim 7, characterized in that: Based on the multi-objective optimization function and the constraints, the NSGA-II multi-objective evolutionary algorithm is used to solve the Pareto solution set, including: Encode each individual, use a binary vector to represent the cache selection scheme of the content, determine whether to cache the content, and obtain the cache selection vector; Randomly generate several legal individuals to form the initial population, set the population size, and initialize the iteration counter; Calculate the three objective functions of each individual and obtain the objective function value; Perform evolution operations on the current population to generate the next generation population; The current population and the next generation population are merged into a joint population, non-dominated sorting and crowding evaluation are re-performed, individuals of the same size as the previous population are selected to form a new population, and an iteration counter is updated until a set maximum number of iterations is reached, the evolution process is stopped, and the Pareto solution set is finally obtained.
9. The context-aware content caching and replacement method according to claim 8, characterized in that: The individual refers to a complete content cache selection scheme, which is represented in the form of a binary vector, where each bit in the vector corresponds to a cache decision of a content in the candidate content set, thereby forming the cache selection vector; The cache selection vector is expressed as follows: ; in, refers to the cache selection vector, Refers to a binary vector, indicating whether to choose The content in the candidate content cache set is cached on the edge node. Its value is 1 for caching and 0 for not caching. Refers to the total number of candidate content sets; The plurality of legal individuals must satisfy the cache capacity constraint; The cache capacity constraint condition is expressed as follows: ; in, Refers to the actual set of cached content selected. Refers to the content The size of It refers to the total cache capacity of edge nodes; The initial population is expressed as: ; The population size is expressed as: ; The initialization iteration counter is expressed as: ; The current population is expressed as: ; The three objective functions are: maximizing cache hit rate objective function, minimizing transmission delay objective function, and minimizing bandwidth occupancy objective function; The evolutionary operations include: non-dominated sorting, congestion calculation, selection operation, crossover operation, and mutation operation; The new population is expressed as: ; The maximum number of iterations is expressed as: ; The Pareto solution set is expressed as: .
10. The context-aware content caching and replacement method according to claim 9, characterized in that: The method of defining a comprehensive scoring function, selecting an individual with the maximum comprehensive scoring function value from the Pareto solution set as the final caching strategy, using the corresponding content set as the final cache content set, and deploying the cache to the edge node includes: For each individual in the Pareto solution set, a comprehensive scoring function is defined; Among all solutions in the Pareto solution set, the individual that maximizes the comprehensive scoring function is selected as the optimal solution, and an optimal cache selection vector is obtained; Based on the value of each binary bit in the optimal cache selection vector, it is determined whether to cache corresponding content, to obtain the final cache content set, and the content in the final cache content set is cached to the edge node.
11. The context-aware content caching and replacement method according to claim 10, characterized in that: Each individual refers to each cache selection vector; The comprehensive scoring function is expressed as follows: ; in, is the comprehensive scoring function, It refers to a cache strategy individual in the Pareto solution set. , Refers to the cache strategy The predicted hit rate value, Refers to the cache strategy The average transmission delay at the current edge node, Refers to the cache strategy The total bandwidth consumption at the current edge node, 、 and Refers to the weight parameter, while satisfying ; The optimal solution is expressed as: ; The optimal cache selection vector is expressed as: ; The final cache content set is expressed as: .
12. The context-aware content caching and replacement method according to claim 11, characterized in that: The design is a cache scoring function for a single content, a cache score is obtained based on the cache scoring function, and a greedy strategy is adopted to replace the cached content based on the cache score, including: Designing the cache scoring function to calculate the cache scores of all the content in the candidate content set and the cached content at the current edge node based on the future content access popularity, the content size, and the node load; All the contents in the candidate content set and the cached contents are sorted from high to low according to the cache scores, and the cached contents are replaced using a greedy strategy.
13. The context-aware content caching and replacement method according to claim 12, characterized in that: The cache scoring function is expressed as follows: ; in, refers to the cache scoring function, Refers to the future content access popularity, is the time span, Refers to the content The size of The current moment The node load is used as the load penalty term in the cache scoring function to penalize the cache selection of high-load nodes and reflect the current cache pressure; The greedy strategy includes: sorting the contents in all the candidate content sets from high to low according to the cache scores; Traverse the sorted list and make cache replacement judgments; The cache replacement judgment is specifically as follows: If the content in the candidate content set is not cached and the cache space is sufficient, directly add it to the cache until the cache space is exhausted; If the cache space is insufficient, comparing the cache score of the content in the candidate content set with the content with the lowest cache score among the cached contents; If the cache score of the content in the candidate content set is higher, the content with the lowest cache score in the cached content is replaced; otherwise, the content in the candidate content set is skipped.
14. A content caching and replacement system based on context awareness, characterized in that: Implementing a context-aware content caching and replacement method according to any one of claims 1 to 13, comprising: A data processing module is used to obtain context information, perform preprocessing operations on the context information, obtain preprocessed data, and construct a context feature vector; A popularity prediction module is used to train an XGBoost prediction model based on the context feature vector obtained by the data processing module, and use the XGBoost prediction model to predict future content access popularity; The content caching module is used to design a multi-objective optimization function based on the caching strategy requirements and solve it using the NSGA-II algorithm to obtain a Pareto solution set. It then defines a comprehensive scoring function and selects the individual that maximizes the comprehensive scoring function from the Pareto solution set as the final caching strategy. The corresponding content set is used as the final cache content set and is cached to edge nodes. The cache replacement module is used to design a cache scoring function for a single content based on the future content access popularity predicted by the popularity prediction module, obtain a cache score based on the cache scoring function, and replace the cached content of the content cache module based on the cache score using a greedy strategy.
Citation Information
Patent Citations
Edge collaborative caching method and system for space-air-ground integrated network
CN117749794A
Pre-fetching self-adaptive intelligent caching method based on machine learning
CN118784720A