Edge collaborative caching method based on user mobility and preference in edge computing
By building a prediction model for user preference and mobile user count and optimizing the cache strategy with the Ant Lion algorithm, the problems of low cache hit rate and resource waste in mobile edge computing are solved, and the balanced utilization of load and energy consumption is achieved, and the cache efficiency is improved.
Patent Information
- Application Number
- CN202211431410.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-11-15
AI Technical Summary
In existing mobile edge computing, users' mobility and preferences are not effectively considered, resulting in low cache hit rate and waste of resources. Caching strategies are prone to data skew and cannot fully utilize the resources of edge servers.
Through user historical behavior data and location information, a user preference model and mobile user number prediction model are built, combined with cosine similarity and ant lion algorithm, the cache strategy is optimized to balance load and energy consumption and determine the cache target resources.
It improves the cache hit rate, is more in line with mobile edge scenarios, optimizes the utilization of edge server resources, and reduces energy consumption and latency.
Smart Images

Figure CN115767596B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of mobile edge computing, and in particular relates to an edge caching method oriented to user mobility and preference in mobile edge computing. Background Art
[0002] Mobile Edge Computing (MEC), as an emerging computing paradigm, further extends network capabilities to the edge of the user network. It is a computing model that provides reliable and stable services to users nearby. Since edge servers are deployed close to user terminal devices, they can directly provide services to users nearby to meet the service requirements of high reliability and low latency, reduce the load on the core network, and reduce the transmission energy consumption of the backhaul link to a certain extent. Using the storage resources of mobile edge computing to cache the resources requested by users in advance has been recognized as an effective solution to solve the network backhaul bandwidth limitation, reduce user service latency, and save energy.
[0003] However, although the application of mobile edge computing has achieved good results, it also faces some severe challenges. For example, compared with cloud servers, edge servers have limited resources and can only cache part of the resources to meet the needs of some users. Predicting and caching the files that users want to request can effectively improve the cache hit rate and reduce resource waste. Therefore, predicting the cache content is a very important and worthy issue. In existing research, many researchers predict the popularity of content based on the frequency of file access, but do not consider the impact of user mobility and preferences on content popularity. This will greatly affect the cache hit rate. Resources that are cached but not requested by users will cause precious edge server resources to be wasted. When the cache target resources are determined, due to the singleness of the cache indicator, it is easy to cause data skew between edge servers, so that resources cannot be well allocated and utilized. Therefore, it is crucial to use the limited cache resources of edge servers to meet the needs of as many users as possible and reduce latency and energy consumption.
[0004] After searching, the application publication number is CN113115362A, a method for collaborative edge caching using reinforcement learning, the specific method includes: first, obtaining the content requests triggered by each user terminal in the corresponding edge device within the coverage of the edge cache system, and then taking the minimum system energy consumption as the optimization goal, establishing a cache optimization model, and taking the cache capacity limit of each edge device and the request delay limit allowed by the user terminal as constraints. Finally, a reinforcement learning algorithm is used to determine the optimal collaborative edge caching strategy corresponding to the content request; this method can obtain an edge collaborative caching strategy with less energy consumption; this method uses the idea of reinforcement learning for target optimization, and can give a better solution in a shorter time, with strong real-time performance; at the same time, it reduces the system energy consumption to a lower level. In this patent, the collaborative caching problem in mobile edge computing is solved by using a reinforcement learning algorithm, but users in mobile edge computing are constantly moving, and different categories of users have different preferences. This patent uses the historical location information of each category of users to build a mobile user quantity prediction model to predict the number of users of each category at the next moment, and then combines the preferences of users of different categories to predict the cache content, thereby solving the edge collaborative caching problem that is more in line with the actual scenario; at the same time, this patent also establishes a target optimization model for the system load and energy consumption balance to solve a better system load and energy consumption collaborative caching strategy. Summary of the invention
[0005] The present invention aims to solve the above problems of the prior art. An edge collaborative caching method for user mobility and preference in edge computing is proposed. The technical solution of the present invention is as follows:
[0006] An edge collaborative caching method for user mobility and preference in edge computing comprises the following steps:
[0007] S1, based on the user's historical behavior data, i.e., the user-item rating matrix R, uses the Embedding vector generated by the alternating least squares method to represent the user's preference, and clusters the users according to their preferences. At the same time, a user trust model is built based on the user's social data to infer the category to which the cold start user belongs;
[0008] S2, based on the user's historical location information data, uses ARIMA to establish a mobile user quantity prediction model;
[0009] S3, using cosine similarity to calculate the user's preferred resources, combined with the predicted number of users of each category in the area at the next moment and the preference files of users of each category, to determine the corresponding cache target resources;
[0010] S4, based on the load of each server and the cache energy consumption, a collaborative cache placement optimization model with load and energy consumption balance is established;
[0011] S5, uses the ant lion algorithm based on improved spiral search to solve the cache placement optimization model and obtain the cache placement strategy.
[0012] Furthermore, the step S1 establishes a user preference model based on user historical behaviors and clusters users according to user preferences, specifically including:
[0013] The user-item rating matrix is constructed based on the historical rating data of users on items. The larger the rating value, the greater the user's preference for this type of resource. The rating matrix R of N users on M items can be expressed as follows:
[0014]
[0015] Among them, r (N,M) Represents the rating of the Nth user on the Mth item. The matrix R is a sparse matrix. Based on the matrix decomposition theory, the matrix R with N rows and M columns can be approximately expressed as the product of a matrix U with N rows and k columns and a matrix V with M rows and k columns.
[0016] After decomposing the matrix R into matrices U and V, the u in matrix U N It is the k-dimensional embedding vector of user N, v in matrix V M It is the k-dimensional Embedding vector of user M;
[0017] Cluster users based on their preferences, including:
[0018] The similarity is calculated based on the Embedding vector of this type of user and the Embedding vector of the data content. The more similar the data content is to the Embedding vector of the corresponding category of users, the greater the preference of this category of users for the content; thus, the TOP K preferred contents of this category of users can be obtained.
[0019] Furthermore, the step S2 establishes a mobile user quantity prediction model based on the mobile user historical location information, specifically including:
[0020] The number of users in the collaboration domain from time period t1 to time period tn can be expressed as:
[0021] NOU={NOU(t1),NOU(t2),…,NOU(tn)+
[0022] And use NOU as the input of the ARIMA model to predict the number of users in each category at time tn+1;
[0023] The basic idea of the ARIMA model is to regard the data sequence formed by the change of variables over time as a time series data, and use a given mathematical model to approximately describe the sequence and calculate the future value of the variable; the ARIMA (p, d, q) model is expressed as:
[0024]
[0025] Where μ is a constant, p, d, q represent the autoregressive order, the difference order required to make the time series stable, the moving average order, γ i is the autoregressive coefficient, θ i is the moving average coefficient, ε t represents the error term.
[0026] Furthermore, the step S3 uses cosine similarity to calculate the user's preferred resources, and combines the predicted number of users of each category in the area at the next moment and the user preference files of each category to determine the corresponding cache target resources, including the steps of:
[0027] (1) Obtain the embedding vectors of each category of users and resource files and the category to which the corresponding cold start user belongs through step S1;
[0028] (2) Through step S2, the number of users of each category in the region at the next moment, NOU, can be obtained. Combined with the embedding vectors of each category of users and resource files, the similarity between each category of users and resource files is calculated by cosine similarity to obtain the preference files of each category of users. The cosine similarity calculation formula is as follows:
[0029]
[0030] where u i 、v i Respectively represent vector u N and v M The various quantities.
[0031] Furthermore, step S4 is based on the load factor of each server. Cache Energy Factor A collaborative cache placement optimization model for load and energy consumption balance is established, including the following steps:
[0032] (1) Let the set of files to be cached be f = {f1, f2, ..., f j}, there are k edge servers in the collaboration domain, the set is S = {S1, S2, …, S k}, the total capacity of each edge server that can be used for caching C = {C1,C1,…,C k}, the remaining cache capacity of each edge server Q = {Q1, Q2, ..., Q k}; The power of the core network to transmit files to each edge server is P e , the read speed of each server disk Write speed
[0033] (2) When caching content files on the MEC server, the cache energy consumption overhead generated by the system is calculated by the following formula:
[0034]
[0035] Among them, N c 、N e represents the number of routers passing through the core network and the edge network, E c 、E e 、E gat 、E sw represents the energy consumed by core network routers, edge network routers, gateways, and switches for each bit of data transmitted, L fj Indicates the amount of data in the file;
[0036] When content files are cached on the MEC server, additional storage energy consumption will be incurred by the cache system. The storage energy consumption is calculated by the following formula:
[0037]
[0038] Where P k represents the energy consumed by edge server k for storing one bit of data; therefore, the total cache energy consumption can be expressed as the sum of transmission energy consumption and storage energy consumption;
[0039]
[0040] (3) Server S k Load factor It can be expressed by the following formula.
[0041]
[0042] Where Q k , They represent edge servers S k The remaining available capacity, the speed of writing files, the speed of reading files, Q max , They represent the maximum remaining capacity, maximum write rate, and maximum read rate in the edge server collaboration domain, respectively. min , They represent the minimum remaining capacity, minimum write rate, and minimum read rate in the edge server cooperation domain, SC k For server S k The proportion of remaining cache capacity can be expressed as;
[0043]
[0044] Among them C k For server S k Total capacity, SC max , SC min They represent the maximum remaining capacity ratio and the minimum remaining capacity ratio in the edge server cooperation domain respectively. The above weights satisfy α1+α2+α3+α4=1;
[0045] The smaller it is, the smaller the relative load of resources used by server k in the collaborative domain is. From the perspective of load balancing, it is more suitable for storing more files;
[0046] (4) The storage energy consumption factor is used to measure the relative amount of energy consumed by a MEC server to cache a file in a collaborative domain. The storage energy consumption factor is expressed by the following formula:
[0047]
[0048] in, Respectively represent files f j The maximum and minimum values of energy consumption of edge servers stored in the collaboration domain, The smaller the size, the smaller the file f j Stored on server S k The energy consumption is relatively smaller in the cooperative domain;
[0049] (5) The fitness function is composed of the load factor Storage energy factor Decide;
[0050] File j For edge server S k The fitness is obtained by the following formula:
[0051]
[0052] Where β1 and β2 represent the non-negative weights of resource usage load and energy consumption of each server under the cache strategy, satisfying is the average value of the load factor of each edge server.
[0053] The problem of solving the collaborative cache strategy is transformed into the minimum value of the sum of the corresponding cache fitness of each target cache file, that is, the objective function of the collaborative cache strategy solution can be expressed by the following formula;
[0054]
[0055] in Represents file f i Whether to cache on edge server S m If yes, then otherwise
[0056] Constraint: The sum of the file sizes stored on the edge server cannot exceed the total cache capacity of the edge server.
[0057]
[0058] Furthermore, the step S5 uses the ant lion algorithm to solve the objective function, specifically including:
[0059] Step 1: Set N ant , N antlion is the number of ants and antlions, and the ants and antlions are initialized, that is, the cache placement strategy is randomly generated in the solution space as the solution corresponding to the ants and antlions; the objective function in the cache model is used as the fitness function, and the fitness value is calculated for each ant and antlion through the fitness function. The antlion with the best fitness value is selected as the elite antlion Ant elit ;
[0060] Step 2: Each ant selects a target ant lion and walks between the target ant lion and the elite ant lion to search for a solution. Finally, a random walk with a corresponding step length is performed towards the target ant lion and the elite ant lion. The random walk formula can be expressed as follows:
[0061] RW=D e,i ×e bt ×cos(2πt)
[0062] Where D e,i is the distance between the ant and the antlion, b is the spiral walk parameter, usually 1, and t is a uniform random number between (0,1);
[0063] Step 3: Recalculate the fitness values of the ants, and sort all the ants and ant lions according to the fitness values. After sorting, select the first N ant lions with the best fitness values as new ant lions, starve the ants at the bottom of the fitness value ranking, and regenerate new ants to join the population;
[0064] Step 4: Determine whether the convergence criteria or termination conditions are met. If not, return to step 2 and continue the calculation. Otherwise, output the elite ant lion. The solution corresponding to the elite ant lion is the final solution of the algorithm.
[0065] The advantages and beneficial effects of the present invention are as follows:
[0066] 1. The present invention comprehensively considers the mobility and preferences of users in a mobile edge environment, constructs a user preference model and classifies users based on their preferences, and at the same time constructs a user trust model, analyzes user social relationships to infer the category to which cold start users belong, and solves the problem of predicting the preferred content of cold start users; constructs a mobile user quantity prediction model to predict the number of users of each category in the area at future times, and selects cache target resources preferred by users of each category in a targeted manner, thereby improving the cache hit rate and being more in line with real mobile edge scenarios.
[0067] 2. After confirming the user preference resources to be cached in the mobile edge environment, the present invention comprehensively considers the resource load conditions in the collaborative domain of each edge server and the energy consumption of the cache, constructs an edge cache model with energy consumption and load balance, and uses an improved ant lion algorithm to optimize and solve the model. The final edge collaborative caching strategy with better energy consumption and load is obtained, which fully and efficiently utilizes system resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 The present invention provides a flowchart of edge collaborative caching for user mobility and preference in edge computing in a preferred embodiment;
[0069] Figure 2 A flow chart for generating user preferences for the present invention;
[0070] Figure 3 The collaborative caching strategy solution flow chart of the present invention. DETAILED DESCRIPTION
[0071] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0072] The technical solution of the present invention to solve the above technical problems is:
[0073] The edge collaborative caching strategy method oriented to user mobility and preference includes the following steps:
[0074] S1, based on the user's historical behavior data, i.e., the user-item rating matrix R, uses the alternating least squares (ALS) method to generate an embedding vector to represent the user's preference, and clusters the users according to their preferences. At the same time, a user trust model is built based on the user's social data to infer the category to which the cold start user belongs;
[0075] S2, based on the user's historical location information data, the set of user numbers in the collaboration domain from time period t1 to time period tn can be expressed as NOU = {NOU(t1), NOU(t2), ..., NOU(tn)}, and an ARIMA model is used to establish a mobile user number prediction model;
[0076] S3, using cosine similarity to calculate the user's preferred resources, combined with the predicted number of users of each category in the area at the next moment and the preference files of users of each category, to determine the corresponding cache target resources;
[0077] S4, based on the load factor of each server Cache Energy Factor Establish a collaborative cache placement optimization model that balances load and energy consumption;
[0078] S5, adopts the antlion algorithm based on improved spiral search to solve the cache placement optimization model and obtain the cache placement strategy with energy consumption and load balance.
[0079] In this embodiment, in step S1, based on the user historical behavior data and the user-item rating matrix R, an Embedding vector is generated to represent the user preference, and the users are clustered according to their preferences. At the same time, a user trust model is built based on the user social data to infer the category to which the cold start user belongs, such as Figure 2 As shown, the steps include:
[0080] (1) Based on the user-item rating matrix R:
[0081]
[0082] Among them, r (N,M) Represents the rating of the Nth user on the Mth item. The matrix R is a sparse matrix. Based on the matrix decomposition theory, the matrix R with N rows and M columns can be approximately expressed as the multiplication of a matrix U with N rows and k columns and a matrix V with M rows and k columns.
[0083]
[0084] (2) The loss function of the matrix decomposition model can be expressed as:
[0085]
[0086] The alternating least squares (ALS) method is used to optimize the loss function. The core idea is to randomly generate a value in the matrix U and then fix it to solve the value in another matrix V, and then use V to solve the value in U in reverse, and repeat the calculation alternately until the optimal solution minC is obtained.
[0087] After decomposing the matrix R into matrices U and V, the u in matrix U N It is the k-dimensional embedding vector of user N, v in matrix V M It is the k-dimensional Embedding vector of user M.
[0088] (3) For cold-start users without historical data information, since it is impossible to generate an embedding vector, the user trust model is used to infer the preferences of the cold-start user from the user's social relationships. From the user's local social network, the user's directly trusted users can be obtained, and from the global social network, the user's indirectly trusted users can be obtained.
[0089] If user u directly trusts user v, then Lt (u,v) =1, otherwise Lt (u,v) = 0, when there is a direct trust relationship between user u and user v, the probability that user u directly trusts user v. It is expressed as Lp (u,v) , the calculation formula is as follows.
[0090]
[0091] Among them, F u represents the number of directly trusted friends of user u, F v represents the number of directly trusted friends of user v, F u ∩F v Represents the number of common friends of users u and v.
[0092] (4) If there is at least one reachable path between user u and user v, such as: path = (u, m1, m2, ..., m n ,v), where m1,m2,…,m n represents the intermediate user of the reachable path. Then user u trusts user v, and the trust strength between users will decay as the propagation path grows, that is, the indirect trust between users is inversely proportional to the length of the reachable path. The indirect trust between user u and user v is expressed as Gt (u,v) , the calculation formula is as follows:
[0093]
[0094] in, d represents the path length. When there are multiple paths between users,
[0095]
[0096] The probability that global social networking can be trusted:
[0097] In a social group, the more times a person is trusted, the greater the probability that he is trusted by others. That is, the greater the trust in-degree of a user, the greater the probability that he can be trusted. (v) It represents the probability that user v can be trusted in the global social network. The calculation formula is as follows:
[0098]
[0099] Among them I v represents the trust in-degree of user v, and avg represents the average trust in-degree of each user in the local social network. v When ≥avg, it means that the user is trusted more times and has a good social reputation. At this time, the user's global trust probability is 1.
[0100] (5) User trust is composed of direct trust and indirect trust. Therefore, the trust degree T of user u to user v is (u,v) By direct trust Lt (u,v) , indirect trust Gt (u,v) And the trust probability Lp of both (u,v) , Gp (v) It can be calculated by the following formula:
[0101] T (u,v) =Lt (u,v) ×Lp (u,v) +Gt (u,v) ×Gp (v)
[0102] The first k trusted users of the cold start user are calculated according to the user trust model, and the categories to which these trusted users belong are analyzed. The larger the number of users belonging to a certain category, the greater the probability that the cold start user is a preferred user of this category.
[0103] In this embodiment, the step S2 uses ARIMA to establish a mobile user quantity prediction model based on the user historical location information data NOU, including the following steps:
[0104] (1)BS={BS1,BS2,…,BS n} represents the set of base stations in the cooperation domain, UD={UD1,UD2,…,UD m} represents the user's mobile terminal set. When the user's mobile terminal UD m Enter the base station BS in the area n Within the service range of the base station BS n The base station will record the time T when the user enters the base station in ,When the user leaves the base station service range, the base station BS n The time T when the user leaves the base station will be recordedout .
[0105] At time t, the number of users in the collaboration domain can be calculated as follows:
[0106]
[0107] Indicates that at time t, user UD m Is it at the base station BS n Service scope:
[0108]
[0109] Therefore, the number of users in the collaboration domain from time period t1 to time period tn can be expressed as:
[0110] NOU={NOU(t1),NOU(t2),…,NOU(tn)}
[0111] (2) Use NOU as the input of the ARIMA model to predict the number of users with different preferences in the collaborative domain. The basic idea of the ARIMA model is to regard the data sequence formed by the change of variables over time as a time series data, and use a given mathematical model to approximate the sequence and calculate the future value of the variable. The ARIMA (p, d, q) model is expressed as:
[0112]
[0113] Where μ is a constant, p, d, q represent the autoregressive order, the difference order required to make the time series stable, the moving average order, γ i is the autoregressive coefficient, θ i is the moving average coefficient, ε t represents the error term.
[0114] The model is constructed in three main steps as follows.
[0115] Step 1: NOU = {NOU(t1), NOU(t2), ..., NOU(tn)} is the time series of the number of users in the time period from t1 to tn. If the time series is non-stationary, it needs to be processed by d-order difference to make it a stationary time series.
[0116] Step 2: Calculate the statistics describing the characteristics of the sequence through the autocorrelation function and partial autocorrelation function, and determine the parameter autoregressive order p and moving average order q based on the calculated sequence characteristics.
[0117] Step 3: Parameters μ, γ i ,θ i , ε tThe value of is adjusted, and then the fitting effect of the model ARIMA(p,d,q) is tested.
[0118] After constructing ARIMA through the above steps, the number of users NOU(tn+1) of each category in the area at time tn+1 can be predicted.
[0119] In this embodiment, the step S3 uses cosine similarity to calculate the user's preferred resources, and combines the predicted number of users of each category in the area at the next moment and the user preference files of each category to determine the corresponding cache target resources, including the steps of:
[0120] (1) Through step S1, the embedding vectors of each category of users and resource files and the category to which the corresponding cold start user belongs are obtained.
[0121] (2) Through step S2, the number of users of each category in the region at the next moment, NOU, can be obtained. By combining the embedding vectors of each category of users and resource files, the similarity between each category of users and resource files is calculated through cosine similarity to obtain the preference files of each category of users. The formula for calculating cosine similarity is as follows:
[0122]
[0123] where u i 、v i Respectively represent vector u N and v M of each quantity.
[0124] In this embodiment, step S4 is based on the load factor of each server. Cache Energy Factor A collaborative cache placement optimization model for load and energy consumption balance is established, including the following steps:
[0125] (1) Let the set of files to be cached be f = {f1, f2, ..., f j}, there are k edge servers in the collaboration domain, the set is S = {S1, S2, …, S k}, the total capacity of each edge server that can be used for caching C = {C1,C1,…,C k}, the remaining cache capacity of each edge server Q = {Q1, Q2, ..., Q k The power of the core network to transmit files to each edge server is P e , the read speed of each server disk Write speed
[0126] (2) When caching content files on the MEC server, the cache energy consumption generated by the system is mainly composed of the transmission energy consumption of the content files and the storage energy consumption on the MEC server. The transmission energy consumption mainly comes from the transmission overhead of the content files from the remote data center to the MEC server in the collaboration domain, which can be calculated by the following formula:
[0127]
[0128] Among them, N c 、N e represents the number of routers passing through the core network and the edge network, E c 、E e 、E gat 、E sw It represents the energy consumed by core network routers, edge network routers, gateways, and switches for each bit of data transmitted. Indicates the amount of data in the file.
[0129] When content files are cached on the MEC server, additional storage energy consumption will be incurred by the cache system. The storage energy consumption can be calculated by the following formula:
[0130]
[0131] Where P k represents the energy consumed by edge server k for storing one bit of data. Therefore, the total cache energy consumption can be expressed as the sum of transmission energy consumption and storage energy consumption.
[0132]
[0133] (3) The server load factor is used to evaluate the relative load of resource usage of a MEC server in the collaborative domain, which mainly includes the cache capacity of each edge server, the remaining cache capacity, and the read and write efficiency of the server. k Load factor It can be expressed by the following formula.
[0134]
[0135] Where Q k , They represent edge servers S k The remaining available capacity, the speed of writing files, the speed of reading files, Q max , They represent the maximum remaining capacity, maximum write rate, and maximum read rate in the edge server collaboration domain, respectively. min , They represent the minimum remaining capacity, minimum write rate, and minimum read rate in the edge server cooperation domain, SCk For server S k The proportion of remaining cache capacity can be expressed as;
[0136]
[0137] Among them C k For server S k Total capacity, SC max , SC min They represent the maximum remaining capacity ratio and the minimum remaining capacity ratio in the edge server cooperation domain respectively. The above weights satisfy α1+α2+α3+α4=1;
[0138] The smaller it is, the smaller the relative load of resource usage of server k in the collaborative domain is. From the perspective of load balancing, it is more suitable for storing more files.
[0139] (4) The storage energy consumption factor is used to measure the relative amount of energy consumed by a MEC server to cache a file in a collaborative domain. The storage energy consumption factor can be expressed by the following formula.
[0140]
[0141] in, Respectively represent files f j The maximum and minimum values of energy consumption of edge servers stored in the collaboration domain, The smaller the size, the smaller the file f j Stored on server S k The energy consumption is relatively smaller in the cooperative domain.
[0142] (5) The fitness function is mainly used to comprehensively evaluate the adaptability of the storage relationship between the file and the edge server. It comprehensively considers the resource usage load of each edge server and the storage energy consumption of the file. It is mainly composed of the load factor Storage energy factor Decide.
[0143] File j For edge server S k The fitness can be obtained by the following formula:
[0144]
[0145] Where β1 and β2 represent the non-negative weights of resource usage load and energy consumption of each server under the cache strategy, satisfying β1+β2=1. is the average value of the load factor of each edge server.
[0146] The problem of solving the collaborative cache strategy is transformed into the minimum value of the sum of the corresponding cache fitness of each target cache file, that is, the objective function of solving the collaborative cache strategy can be expressed by the following formula.
[0147]
[0148] in Represents file f i Whether to cache on edge server S m If yes, then otherwise
[0149] Constraint: The sum of the file sizes stored on the edge server cannot exceed the total cache capacity of the edge server.
[0150]
[0151] In this embodiment, the step S5 uses an improved meta-heuristic algorithm, the ant lion algorithm, to solve the objective function of S4, such as Figure 3 As shown, the main steps include the following:
[0152] The improved ant lion algorithm is based on the traditional ant lion algorithm. In the local search phase, the ant's wandering mechanism is optimized, and the ant's wandering mechanism is improved from random wandering to spiral search within the corresponding range of the target ant lion and the elite ant lion. The calculation of the improved ant's random wandering is as follows:
[0153] RW=D e,i ×e bt ×cos(2πt)
[0154] Where D e,i is the distance between the ant and the antlion, b is the spiral walk parameter, usually 1, and t is a uniform random number between (0,1).
[0155] In the global search phase, ants with poor fitness are starved to death in each iteration and new ants are regenerated, which enhances the global search capability and further avoids falling into the local optimum. The overall process of the improved algorithm can be summarized as follows:
[0156] Step 1: Set N ant , N antlion is the number of ants and antlions, and the ants and antlions are initialized, that is, the cache placement strategy is randomly generated in the solution space as the solution corresponding to the ants and antlions. The objective function in the cache model is used as the fitness function, and the fitness value is calculated for each ant and antlion through the fitness function. The antlion with the best fitness value is selected as the elite antlion Ant elit .
[0157] Step 2: Each ant selects a target ant lion and walks between the target ant lion and the elite ant lion to search for a solution. Finally, it randomly walks towards the target ant lion and the elite ant lion with the corresponding step length.
[0158] Step 3: Recalculate the fitness values of the ants, and sort all the ants and ant lions according to the fitness values. After sorting, select the first N ants with better fitness values as new ant lions, starve the ants at the bottom of the fitness value ranking, and regenerate new ants to join the population.
[0159] Step 4: Determine whether the convergence standard or the end condition is met. If not, return to step 2 and continue the calculation. Otherwise, output the elite ant lion. The solution corresponding to the elite ant lion is the final solution of the algorithm. That is, the collaborative caching strategy.
[0160] The present invention comprehensively considers the influence of user preference and user mobility on cache content prediction, and comprehensively considers cache energy consumption and the load between edge servers when solving the cache strategy. Compared with the existing edge collaborative caching method, the present invention has the following main advantages: (1) Comprehensively consider user preference and user mobility, establish a user preference model and a mobile user quantity prediction model, and more accurately predict the user request content in the area, which is more in line with the actual scenario; (2) Comprehensively consider the load balancing between edge servers and the energy consumption of the cache, and establish a cache model, and use the improved ant lion algorithm to solve the cache strategy.
[0161] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, 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.
[0162] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0163] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. An edge collaborative caching method for user mobility and preference in edge computing, characterized in that: The following steps are involved: S1, based on the user's historical behavior data, i.e., the user-item rating matrix R, uses the Embedding vector generated by the alternating least squares method to represent the user's preference, and clusters the users according to their preferences. At the same time, a user trust model is built based on the user's social data to infer the category to which the cold start user belongs; S2, based on the user's historical location information data, uses ARIMA to establish a mobile user quantity prediction model; S3, using cosine similarity to calculate the user's preferred resources, combined with the predicted number of users of each category in the area at the next moment and the preference files of users of each category, to determine the corresponding cache target resources; S4, based on the load of each server and the cache energy consumption, a collaborative cache placement optimization model with load and energy consumption balance is established; S5, using the ant lion algorithm based on improved spiral search to solve the cache placement optimization model and obtain the cache placement strategy; The step S1 establishes a user preference model based on user historical behaviors and clusters users according to user preferences, specifically including: The user-item rating matrix is constructed based on the historical rating data of users on items. The larger the rating value, the greater the user's preference for this type of resource. The rating matrix R of N users on M items can be expressed as follows: Among them, r (N,M) Represents the rating of the Nth user on the Mth item. The matrix R is a sparse matrix. Based on the matrix decomposition theory, the matrix R with N rows and M columns can be approximately expressed as the product of a matrix U with N rows and k columns and a matrix V with M rows and k columns. After decomposing the matrix R into matrices U and V, the u in matrix U N It is the k-dimensional embedding vector of user N, v in matrix V M It is the k-dimensional Embedding vector of user M; Cluster users based on their preferences, including: The similarity is calculated based on the embedding vector of the user of this category and the embedding vector of the data content. The more similar the data content is to the embedding vector of the corresponding category of users, the greater the preference of the users of this category for the content. Thus, the TOP K preferred contents of the users of this category can be obtained. The step S2 establishes a mobile user quantity prediction model based on the mobile user historical location information, specifically including: The number of users in the collaboration domain from time period t1 to time period tn can be expressed as: NOU={NOU(t1),NOU(t2),…,NOU(tn)} And use NOU as the input of the ARIMA model to predict the number of users in each category at time tn+1; The basic idea of the ARIMA model is to regard the data sequence formed by the change of variables over time as a time series data, and use a given mathematical model to approximately describe the sequence and calculate the future value of the variable; the ARIMA (p, d, q) model is expressed as: Where μ is a constant, p, d, q represent the autoregressive order, the difference order required to make the time series stable, the moving average order, γ i is the autoregressive coefficient, θ i is the moving average coefficient, ε t represents the error term; The step S3 uses cosine similarity to calculate the user's preferred resources, and combines the predicted number of users of each category in the area at the next moment and the user preference files of each category to determine the corresponding cache target resources, including the steps of: (1) Obtain the embedding vectors of each category of users and resource files and the category to which the corresponding cold start user belongs through step S1; (2) Through step S2, the number of users of each category in the region at the next moment, NOU, can be obtained. Combined with the embedding vectors of each category of users and resource files, the similarity between each category of users and resource files is calculated by cosine similarity to obtain the preference files of each category of users. The cosine similarity calculation formula is as follows: where u i 、v i Respectively represent vector u N and v M The various components of Step S4 is based on the load factor of each server Cache Energy Factor A collaborative cache placement optimization model for load and energy consumption balance is established, including the following steps: (1) Let the set of files to be cached be f = {f1, f2, ..., f j }, there are k edge servers in the collaboration domain, the set is S = {S1, S2, ..., S k }, the total capacity of each edge server that can be used for caching C = {C1,C1,…,C k }, the remaining cache capacity of each edge server Q = {Q1, Q2, ..., Q k }; The power of the core network to transmit files to each edge server is P e , the read speed of each server disk Write speed (2) When caching content files on the MEC server, the cache energy consumption overhead generated by the system is calculated by the following formula: Among them, N c 、N e represents the number of routers passing through the core network and the edge network, E c 、E e 、E gat 、E sw It represents the energy consumed by core network routers, edge network routers, gateways, and switches for each bit of data transmitted. Indicates the amount of data in the file; When content files are cached on the MEC server, additional storage energy consumption will be incurred by the cache system. The storage energy consumption is calculated by the following formula: Where P k represents the energy consumed by edge server k for storing one bit of data; therefore, the total cache energy consumption can be expressed as the sum of transmission energy consumption and storage energy consumption; (3) Server S k Load factor It can be expressed by the following formula; Where Q k , They represent edge servers S k The remaining available capacity, the speed of writing files, the speed of reading files, Q max , They represent the maximum remaining capacity, maximum write rate, and maximum read rate in the edge server collaboration domain, respectively. min , They represent the minimum remaining capacity, minimum write rate, and minimum read rate in the edge server cooperation domain, SC k For server S k The proportion of remaining cache capacity can be expressed as; Among them C k For server S k Total capacity, SC max , SC min They respectively represent the maximum remaining capacity ratio and the minimum remaining capacity ratio in the edge server cooperation domain; the above weights satisfy α1+α2+α3+α4=1; The smaller it is, the smaller the relative load of resources used by server k in the collaborative domain is. From the perspective of load balancing, it is more suitable for storing more files; (4) The storage energy consumption factor is used to measure the relative amount of energy consumed by a MEC server to cache a file in a collaborative domain. The storage energy consumption factor is expressed by the following formula: in, Respectively represent files f j The maximum and minimum values of energy consumption of edge servers stored in the collaboration domain, The smaller the size, the smaller the file f j Stored on server S k The energy consumption is relatively smaller in the cooperative domain; (5) The fitness function is composed of the load factor Storage energy factor Decide; File j For edge server S k The fitness is obtained by the following formula: Where β1 and β2 represent the non-negative weights of resource usage load and energy consumption of each server under the cache strategy, satisfying β1+β2=1. is the average value of the load factor of each edge server; The problem of solving the collaborative cache strategy is transformed into the minimum value of the sum of the corresponding cache fitness of each target cache file, that is, the objective function of the collaborative cache strategy solution can be expressed by the following formula; in Represents file f i Whether to cache on edge server S m If yes, then otherwise Constraint: The sum of the file sizes stored on the edge server cannot exceed the total cache capacity of the edge server.
2. According to claim 1, the edge collaborative caching method for user mobility and preference in edge computing is characterized in that: The step S5 uses the ant lion algorithm to solve the objective function, specifically including: Step 1: Set N ant , N antlion is the number of ants and antlions, and the ants and antlions are initialized, that is, a cache placement strategy is randomly generated in the solution space as the solution corresponding to the ants and antlions; the objective function in the cache model is used as the fitness function, and the fitness value of each ant and antlion is calculated through the fitness function; the antlion with the best fitness value is selected as the elite antlion Ant elit ; Step 2: Each ant selects a target ant lion and walks between the target ant lion and the elite ant lion to search for a solution; finally, it performs a random walk of corresponding step lengths toward the target ant lion and the elite ant lion; the random walk formula can be expressed as follows: RW=D e,i ×e bt ×cos(2πt) Where D e,i is the distance between the ant and the antlion, b is the spiral walk parameter, usually 1, and t is a uniform random number between (0,1); Step 3: Recalculate the fitness values of the ants, and sort all the ants and ant lions according to the fitness values. After sorting, select the first N ant lions with the best fitness values as new ant lions, starve the ants at the bottom of the fitness value ranking, and regenerate new ants to join the population; Step 4: Determine whether the convergence criteria or termination conditions are met. If not, return to step 2 and continue the calculation. Otherwise, output the elite ant lion. The solution corresponding to the elite ant lion is the final solution of the algorithm.
