Edge caching method based on content popularity
Technical Field
The invention relates to the field of mobile edge computing, in particular to an edge content caching method based on content popularity.
Background
Today, the fifth generation of mobile communication is attracting attention worldwide and has been formally commercially used. The core technology of 5G mainly comprises millimeter waves, large-scale multiple input multiple output and the like. In future developments, increasing the communication mode selection of the user and further improving the network experience of the user are important targets for 5G evolution. The advent of 5G has meant that the demand for video streaming services will increase further, which will present a significant challenge to streaming service systems. The collaborative-edge cloud computing architecture combining cloud computing and edge computing can effectively reduce the burden of a streaming media service system. Streaming media content caching under the collaborative edge cloud computing architecture has important significance for improving user service quality. The buffering technology can reduce delay, promote transmission rate and save consumption of backhaul link, is one of important technologies for dealing with exponentially growing mobile data traffic, and will necessarily play a key role in future 5G systems.
In conventional networks, content requested by a mobile user is typically served by a remote Internet content server provided by a content provider. When a user retrieves the same popular content from a remote server, the remote server needs to repeatedly send the same file, which may present a large amount of repeated traffic, and network congestion problems may occur during peak network times. The storage service provided by the mobile edge computing server is utilized in the mobile edge caching network to cache popular content at a position closer to a user, so that repeated content transmission from the content server to an edge caching node can be reduced, the network congestion problem is effectively relieved, and the delay and transmission energy consumption of content retrieval are also effectively reduced. However, in the current edge computation caching method, the considered factors are generally quite limited. The caching method has close relation with factors such as popularity of the content to be cached, mobility of the user and the like. Therefore, research on the selection method of the cache content in the edge calculation is important to reduce the transmission delay and improve the experience of the terminal user. In addition, the global content popularity is different from the content which is interested by the terminal user served by each micro base station, so that the placement method of the cache content needs to be researched, and the most needed content of the cache users of each base station is realized under the limited cache space.
The service provider may deploy the streaming media content on an edge server. The edge server is responsible for responding to the content request of the user, reducing the transmission delay and ensuring the service quality of the user. Meanwhile, the streaming media server can dynamically use the powerful computing resources of the cloud server according to actual demands. Therefore, a corresponding caching method is designed according to the content request frequency of the terminal user, so that the cost of a service provider and the delay of acquiring the content by the user are reduced. But popularity in the content access process varies over time. Therefore, it is required to find a content caching method considering popularity of content so that an edge service provider can cache content at a low cost, and at the same time, improve hit rate of the content, and meet the requirement of users for low delay of acquiring the content.
Although the storage capacity of the edge server is far higher than that of the terminal equipment, the storage capacity of the edge server is limited, so that the content with great benefits of the edge server needs to be cached as much as possible, the popularity is considered firstly, a relevant model is built for the behavior characteristics of the user, and then future behaviors can be predicted according to specific historical data. Meanwhile, considering the influence of the size of the content, for example, larger content may cause other content to be unable to be cached and the acquisition time is longer. And meanwhile, the popularity gain and the time delay gain are set, the duty ratio of the two factors is considered, and the value total income of each content is finally obtained. In the subsequent cache placement scheme, the aim is to select the content with high value and total income for caching, which is a NP difficult problem, the problem is changed into a benefit maximization problem, and a batch of content with the highest value can be cached under the condition that the limiting condition is met, so that the time delay cost of the user for acquiring the content is reduced and the hit rate is improved finally.
The application publication number is CN113965937A, a content popularity prediction method based on clustering federation learning in a fog wireless access network is characterized by comprising the following steps of S1, constructing initial characteristics of each local user and each content by utilizing fog access points according to local user information and content information acquired by a neighborhood set of the local user and the content, S2, taking the initial characteristics of the local user and the content as input, taking the content request probability of the local user as a prediction target, establishing a prediction model based on a dual-channel neural network for each fog access point, setting a binary cross entropy loss as a loss function, optimizing model parameters, S3, utilizing the clustering federation learning method to perform distributed training on the prediction model of each fog access point, and adaptively clustering fog access points with similar area types, realizing the specialization of model parameters for each fog access point, S4, obtaining the activity degree of the local user by utilizing the historical request quantity, obtaining the local user according to the activity degree and the predicted request probability of the local user, then taking the content request probability of the local user as a prediction target, setting a motion preference function according to the motion request probability of the local user, and the motion request probability of the current request, S5, setting the popularity of each fog access point as a motion request, and the popularity request of the current target, and the motion request of the current target, respectively, and comparing the motion request of the current target with the motion target model, and the motion target is set to be the motion target, and the popularity of the current target is optimized, and the popularity target is set according to the motion target, and the motion target is 7, and the motion target is optimized, and obtaining the content popularity of each fog access point.
According to the method, the characteristics are built by collecting the user information and the content information, the popularity of the content is predicted by building a two-channel neural network model, the model parameters are optimized, the long time expenditure is caused by the fact that the neural network is used for prediction without considering data with shorter history length, and if some new content enters the network, only a small amount of history data is needed, and the quantity of input data of the neural network is not reached, so that the prediction accuracy is reduced. Meanwhile, the invention takes the content request probability of the mobile user as a prediction target, and establishes a preference model objective function for each mobile user, however, the influence of the behavior of a single user on the group is very little, the local group behavior is considered during prediction, and the popularity of the content in the current region can be represented by the selection of most people. In the invention, considering the two points, the behaviors of most users of a certain server cluster are selected, the popularity of the content is obtained after collection, the content with different lengths is classified, only the content with less historical data is predicted by using an improved exponential smoothing algorithm, a result with higher accuracy can be obtained in a shorter time, and the content popularity with enough historical data is predicted by using a dynamic optimization LSTM neural network, so that parameters are continuously optimized, and the deviation between the obtained result and a true value is smaller.
Disclosure of Invention
The invention aims to solve the problems of content popularity prediction and an edge server caching method in the existing edge calculation, provides a classification prediction algorithm, so that content popularity prediction errors are smaller, and simultaneously uses a related algorithm to enable an edge server to cache content with the largest income in a limited storage space, so that the cache hit rate of a user for obtaining the content is improved, and the time delay for obtaining the content is reduced. An edge caching method based on content popularity is provided. The technical scheme of the invention is as follows:
an edge caching method based on content popularity, which comprises the following steps:
S1, constructing an end-edge cloud system model according to server clusters, equipment and user request content, obtaining the request times of each content in different time periods, and regarding the request times of the content in unit time by an end user as the historical popularity of the content in the unit time period;
s2, classifying the historical data with different lengths, and predicting popularity at future time by using an improved exponential smoothing prediction algorithm and a dynamic optimization long-short-term memory algorithm after classification;
S3, regarding the popularity predicted in the step S2 as popularity gain, and calculating to obtain the value total income of each content as compared with the time delay obtained from the cloud as time delay spending gain if the content is cached in the edge server cluster because the time delay of the obtained content is related to the size of the content;
S4, for each server cluster, calculating a content sequence with highest benefit under the current capacity by adopting a cache placement algorithm, and caching the content corresponding to the content sequence in the server;
S5, knowing whether each content is cached in the result of the edge server cluster.
Further, in the step S1, a terminal edge cloud system model is constructed, and the method for obtaining the historical popularity concretely includes:
Most of the contents are stored in a cloud, the edge server clusters select part of the contents for storage, a terminal user initiates a request, three environments of the cloud, edges and terminals are divided, a cloud server is a device far away from a user terminal, some terminal devices are served in each edge server cluster, the terminal devices can initiate requests for some contents in different time periods, the edge server acquires the popularity of the contents in different time periods by collecting the historical data of the requested contents, and therefore a historical popularity set of all the contents in the edge server clusters is acquired and used for later popularity prediction.
Further, step S2 is described, where historical data with different lengths are classified, and an improved exponential smoothing prediction algorithm and a dynamic optimization long-short-term memory algorithm are used to predict popularity of popularity prediction at future time after classification, and specifically includes:
setting lp as the length of the content set, and setting a length limit LB;
(1) If lp < LB, dividing into new contents, and predicting by adopting an improved exponential smoothing prediction algorithm;
(2) If lp is larger than or equal to LB, the popularity is predicted by using a dynamic optimization long-short-term memory algorithm.
Further, in the step (1), an improved exponential smoothing prediction algorithm is adopted for prediction. In the traditional exponential smoothing prediction method, the weight factor alpha determines the magnitude of a predicted final value, when alpha is larger, popularity of the current time period is more influenced on a prediction result, otherwise when alpha is smaller, popularity of the content is more influenced more long, and the formula is shown as follows.
Representing content popularity at time t n predicted using an exponential smoothing prediction algorithm, whereThe content popularity of the last moment is represented, the subsequent operation needs to be carried out according to the popularity of the last moment, t n is represented by the current time period, t s is represented by the initial time period, alpha is a variable factor, the value range is [0,1] is fixed, and the influence degree of the popularity of the previous time period on the future time period is determined. Since the weighting factor α in the conventional method is static, so that the smooth prediction is difficult to conform to the variation of the time series itself, the present invention uses an exponential smooth prediction method in which the weighting factor is dynamically changed, the formula of which is as follows.
The content popularity at the time t n is predicted by using the improved exponential smoothing prediction algorithm, and compared with the traditional method, in the improved method, the value of the weight factor alpha is dynamically changed along with the change of t n, is not a fixed value any more, and is dynamically corrected along with time, so that the accuracy of the prediction is more similar to a true value.
Further, in the step (2), the predicting popularity using the dynamic optimization long-short term memory algorithm specifically includes:
For the content with longer historical data, namely the old content, the dynamic optimized LSTM is adopted for prediction, and the time window size, the dense layer number, the LSTM network layer number and the neuron number are used as optimizing objects. Setting m time window to-be-selected values, k dense layer number to-be-selected values, n LSTM layer number to-be-selected values and u neuron number to-be-selected values, and selecting an average percentage error MAPE of LSTM model verification data obtained after training times reach a limit to measure the merits of parameters, wherein the MAPE is defined as follows:
y' n is a value obtained by model prediction, y n is a true value of a sample, N is a sample number, M (M, k, N, u) is set to represent average percentage error obtained after LSTM model prediction of current parameter construction, a group of parameters with the best performance in the test set M (M, k, N, u) are selected through continuous iterative training, then a model used for old content prediction is determined, and meanwhile, the obtained optimal M time window values are the standard LB for dividing new content and old content.
Further, the step S3 is to consider the popularity predicted in the step S2 as popularity gain, and calculate the value total income of each content compared with the time delay obtained from the cloud as delay overhead gain if the content is cached in the edge server cluster because the time delay of obtaining the content has a relation with the size of the content; the specific formula is shown in the formula;
Gi=A*ΔLi+B*Pi
Where a and B are two variable factors a+b=1 for controlling the ratio of the two benefits to the total value benefit, Δl i represents the delay gain for obtaining the content, P i represents the popularity gain for the content, and G i represents the total value benefit for the content.
Further, in the step S4, the cache placement problem is converted into the benefit value maximization problem, the original problem makes a decision for each content, 0 represents non-selection, 1 represents selection, which is a 0-1 variable, and then the 0-1 plan problem is a constraint 0-1 plan problem, which is not only the NP difficult problem, but also the problem is converted into the benefit maximization problem by considering the content of the cache which can bring the maximum benefit to the server cluster, and the problem is converted into the following formula;
The content with the maximum total gain is selected from the collection and cached.
The invention has the advantages and beneficial effects as follows:
1. For popularity prediction related problems, existing related methods consider predicting a user's movement path to obtain potential predictability of user mobility, and thus potentially popular content. There are also block-based video popularity prediction methods, but most of these methods do not consider the impact of historical data of different lengths on the prediction results, and do not consider reducing the prediction error. In the invention, in consideration of the point in the prediction, the terminal edge cloud system is established, the characteristic that the content popularity is defined by the historical information of the collected content is classified according to the historical data with different lengths, and the popularity of the content at the future moment is predicted by using an improved algorithm respectively, so that the errors of the predicted result and the true value are effectively reduced.
2. For the historical data with different lengths, different methods are selected for prediction in the step S2, an improved exponential smoothing prediction algorithm is provided for the historical data with shorter lengths, the weight factors in the traditional exponential smoothing prediction are not changed after the determination, the weight factors which dynamically change along with time are provided, the weight factor values at different moments are different, the real scene is more met, and popularity obtained by predicting the short historical data is more similar to real popularity. For long history data, a model with the lowest average percentage error is obtained by setting a long-short-period memory model and inputting training data, so that a time window with the lowest average percentage error can be selected as input, the time window is also a demarcation point of the long history data, the history data with different lengths can be predicted by a more accurate method, and more ready selection can be made based on the subsequent server cluster.
3. Based on the above problems, a caching method based on content popularity is proposed, the popularity obtained through prediction is regarded as popularity benefits, and the acquisition time delay reduced after certain content is cached in an edge server cluster is regarded as time delay overhead gain. The content cache placement problem is translated into a benefit value maximization problem. And selecting the content which maximizes the total income of the server through an algorithm to cache, and fully using the storage resources of the server. And meanwhile, the hit rate of the content acquired by the user is improved, and the time delay expenditure of acquiring the content is reduced.
Drawings
FIG. 1 is a cloud-side system model constructed in accordance with a preferred embodiment of the present invention;
FIG. 2 is a flow chart of an edge caching method based on content popularity in the present invention;
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and specifically described below with reference to the drawings in the embodiments of the present invention. The described embodiments are only a few embodiments of the present invention.
The technical scheme for solving the technical problems is as follows:
the invention provides an edge caching method based on content popularity, which comprises the following steps:
s1, an end-edge cloud system model is built according to server clusters, equipment and user request content, and ES= {1,2,3, & gt, m } represents an edge server cluster set, CS= { c1, c2, c3, & gt, cn } represents a request content set, and TD= {1,2,3, & gt, q } represents a terminal equipment set as shown in FIG. 1. The number of requests of each content in different time periods is counted and taken as popularity.
S2, classifying historical data with different lengths according to a standard, dividing the historical data into new content and old content, and predicting the classified historical data by using a corresponding algorithm to obtain popularity of the content at a future moment;
s3, according to the popularity predicted in the S2, regarding the popularity as a popularity gain, caching certain content in an edge server cluster, regarding the reduced time delay obtained from the cloud as a time delay overhead gain, and obtaining the value total income of each content according to calculation;
S4, for each server cluster, calculating a content sequence with highest benefit under the current capacity by adopting a cache placement algorithm, obtaining a cache decision of a server on the content, and caching the corresponding content in the server;
s5, according to a final result, the server cluster selects to cache or not cache each content, and when the content cached in the server cluster is requested by a user, the content can be directly obtained from the edge server without sending a request to the cloud;
Further, in the step S1, a terminal edge cloud system model is constructed, and the method for obtaining the historical popularity concretely includes:
(1) According to the related information, three environments of a cloud end, edges and terminals are divided, a cloud end server is a device far away from a user terminal, some terminal devices are served in each edge server cluster, the terminal devices can initiate requests for certain contents in different time periods, and the edge servers collect historical data of the requested contents. Es= {1,2,3,..m } represents an edge server cluster set, cs= {1,2,3,..n } represents a set of requested contents, td= {1,2,3,..q } represents a set of terminal devices, let t j=Tj-Tj-1 represent a unit time period, let Indicating whether the device initiated a request for content c i e CS during time period t j, the popularity of content c i under server S during time period t j may be expressed as:
and obtaining popularity of the content in different time periods through the step, so that a historical popularity set of all the content under the edge server cluster is obtained and is used for predicting the popularity at the later time.
Further, in the step S2, classifying the historical data with different lengths according to the standard, and predicting by using the corresponding algorithm includes:
(1) By using The method comprises the steps of representing all historical data sets of content c epsilon CS in an edge server cluster s epsilon ES in a time period t 1~tn, setting lp as the length of the content set, setting a length limit LB, dividing the content into new content if lp is smaller than LB, predicting by adopting an improved exponential smoothing prediction algorithm IESP, and predicting popularity by adopting a dynamic optimization long-short-term memory algorithm DO-LSTM if lp is larger than LB.
(2) For new content prediction, an improved exponential smoothing prediction algorithm is used for prediction. In the traditional exponential smoothing prediction method, the weight factor alpha determines the magnitude of a predicted final value, when alpha is larger, popularity of the current time period is more influenced on a prediction result, otherwise when alpha is smaller, popularity of the content is more influenced more long, and the formula is shown as follows.
Representing content popularity at time t n predicted using an exponential smoothing prediction algorithm, whereThe content popularity of the last moment is represented, the subsequent operation needs to be carried out according to the popularity of the last moment, t n is represented by the current time period, t s is represented by the initial time period, alpha is a variable factor, the value range is [0,1] is fixed, and the influence degree of the popularity of the previous time period on the future time period is determined. Since the weighting factor α in the conventional method is static, so that the smooth prediction is difficult to conform to the variation of the time series itself, the present invention uses an exponential smooth prediction method in which the weighting factor is dynamically changed, the formula of which is as follows.
The content popularity at time t n is predicted by using the improved exponential smoothing prediction algorithm, and compared with the traditional method, in the improved method, the value of the weight factor alpha is dynamically changed along with the change of t n, and is not a fixed value any more, but is dynamically corrected along with time.
(3) For the content with longer historical data, namely the old content, the dynamic optimized LSTM is adopted for prediction, and the time window size, the dense layer number, the LSTM network layer number and the neuron number are used as optimizing objects. Setting m time window candidate values, k dense layer number candidate values, n LSTM layer number candidate values and u neuron number candidate values, and selecting an average percentage error (MAPE) of LSTM model verification data obtained after the training times reach the limit to measure the quality of the parameters. Wherein MAPE is defined as follows:
y' n is the model predicted value, y n is the true value of the sample, and N is the number of samples. Let M (M, k, n, u) represent the average percentage error obtained after prediction of the LSTM model constructed by the current parameters. Through continuous iterative training, a set of parameters that perform best in the test set M (M, k, n, u) can be selected, and then the model used for old content prediction is determined. Meanwhile, the obtained optimal m time window values are standard LB for dividing new and old contents.
Further, in the step S3, calculating the total gain of the content value includes the following steps:
(1) When the content C i requested by the terminal is already cached in the edge server, the edge server can directly meet the request and start transmitting the content, and the total delay overhead at this time is the delay of uploading the request L u,i plus the delay of downloading the content from the server L d,i, which can be expressed as:
Ledge,i=Lu,i+Ld,i
(2) If the edge server does not cache the content of the request, the request can only be forwarded to the cloud data center, and the delay overhead can be expressed as:
Lcloud,i=Lu,i+Letc+Lc,i
L etc is the latency overhead for the edge server to send the request to the cloud, and L c,i is the latency overhead required to return the content from the cloud to the terminal.
(3) If a content C i originally needs to be obtained from the cloud, the delay overhead is L cloud,i. When it is put into the edge server, the delay cost must be shortened, and the delay cost becomes L edge,i. Thus, the delay gain is defined as follows:
ΔLi=Lcloud,i-Ledge,i
(4) The value total income of the content is determined by combining the content popularity P i obtained by the prediction and the time delay gain, and the specific formula is as follows:
Gi=A*ΔLi+B*Pi
Where a and B are two variable factors a+b=1 for controlling the ratio of the two benefits to the total value benefit, Δl i represents the delay gain for obtaining the content, P i represents the popularity gain for the content, and G i represents the total value benefit for the content.
Further, in the step S4, according to the obtained total benefit of the content value, the cache placement problem is converted into the benefit value maximization problem, and the adopted cache placement algorithm comprises the following steps:
(1) The original problem will make a decision for each content, 0 representing no choice, 1 representing a choice, which is a 0-1 variable, which is then a constrained 0-1 programming problem, which is not the NP-hard problem. By considering the content that the cache can bring the greatest benefit to the server cluster, the problem is turned into a benefit maximization problem, and the problem is turned into the following formula.
G= { G1, G2..gn } is the calculated total value revenue set of the content, where S e is the edge server capacity size, ca i is a 0-1 variable, ca i =1 indicates that the content is selected for caching, and vice versa. s i is the size of the content:
(2) The cache placement algorithm adopted by the invention solves the problem of cache placement of the content in the server, and comprises the following steps:
1) A two-dimensional array Fj is defined. Fi j represents the maximum benefit obtained by selecting a plurality of contents from the first i contents and putting the contents into a server cluster with the residual space j.
2) The selected capacity size is gradually increased from 0, and if the current size j is smaller than the size S i of the content, the bit array F [ i ] [ j ] =f [ i-1] [ j ].
3) If S i is greater than or equal to j, then Fi [ j ] = max { Fi-1 [ j-S [ i ] ] +Gi, fi-1 [ j ] }, execute the decision of put and no put according to the gain of the ith content.
4) And finally obtaining a buffer decision set through reverse derivation.
And the edge server selects the content with the maximum total gain from the calculated set for caching. According to the edge caching method based on the content popularity, not only can the prediction result error be smaller, but also the content with larger total income can be cached in the edge server cluster, so that the hit rate of the content acquired by the user is improved, and the experimental cost of acquiring the content is reduced.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above examples should be understood as illustrative only and not limiting the scope of the invention. Various changes and modifications to the present invention may be made by one skilled in the art after reading the teachings herein, and such equivalent changes and modifications are intended to fall within the scope of the invention as defined in the appended claims.