A collaborative caching method using roadside parked vehicles in a vehicle network
By selecting the appropriate cache node in the on-board network and using the LSTM neural network to predict the popularity of content, and optimizing the cache strategy with genetic algorithms, the coordinated cache of content in the on-board network is achieved, solving the high delay and success rate of content requests in traditional technology Low issues, lower costs and improve cache hit rate.
Patent Information
- Application Number
- CN202310097782.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2043-02-10
AI Technical Summary
The failure to effectively utilize the cooperation between roadside parked vehicles and mobile vehicles and roadside unit RSU in traditional vehicle networks leads to high latency and cost of content requests, and fails to effectively predict content popularity, resulting in low request success rate.
By selecting cache nodes based on social similarity and centrality, a content acquisition mechanism and cache placement strategy optimization model is built, the content acquisition mechanism and cache placement strategy optimization model is used to predict content popularity using LSTM neural network, and the cache hit rate is optimized using genetic algorithms to realize content in cache nodes, RSUs and Coordinated cache between roadside parking vehicles.
It effectively reduces the latency and cost of content acquisition, improves the success rate of content requests, avoids cache redundancy, and maximizes cache hit rate.
Smart Images

Figure CN116033016B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a collaborative caching method using roadside parked vehicles in a vehicle network. Background Art
[0002] With the rapid development of multimedia and in-vehicle networks, in addition to traditional information, large multimedia content such as pictures, audio, and video also need to be transmitted through in-vehicle networks. These multimedia contents are very important for improving the driver's driving experience. However, the cache capacity of in-vehicle networks is limited, so how to reasonably cache and effectively transmit these contents has become a challenge.
[0003] The traditional caching method in the vehicle network does not consider the collaboration between mobile vehicles, roadside units (RSUs) and roadside parked vehicles, which makes the content request latency and cost of the entire network very high. It also does not consider the prediction of the popularity of the requested content, which leads to a low content request success rate. Therefore, collaborative caching between mobile vehicles, RSUs and roadside parked vehicles should be considered, and the content should be collaboratively distributed among cache nodes, RSUs and roadside parked vehicles to improve the diversity of cached content in the network, reduce redundancy, and reduce the latency and cost of content acquisition. At the same time, the popularity of vehicle-requested content should be predicted so that cache nodes, RSUs and roadside parked vehicles can cache content that is more likely to be requested, thereby improving the content request success rate. Summary of the invention
[0004] Purpose of the invention: In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a collaborative caching method using roadside parked vehicles in an in-vehicle network. Vehicles can obtain requested content from cache nodes, roadside units RSU and roadside parked vehicles. Application of this method can effectively reduce content request latency and cost, and at the same time improve the content delivery success rate in the in-vehicle network.
[0005] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:
[0006] In a first aspect, the present invention provides a collaborative cache using roadside parked vehicles in a vehicle network, comprising:
[0007] Step S1, selecting a suitable vehicle from the mobile vehicles as a cache node according to the social similarity and centrality of the vehicles;
[0008] Step S2: construct a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU;
[0009] Step S3, constructing a cache placement strategy optimization model according to a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU;
[0010] Step S4: According to the historical request information, the LSTM neural network is used to predict the number of content requests, and the content is sorted according to the predicted number of content requests and input into the Zipf distribution to obtain the popularity of the requested content;
[0011] Step S5: construct an optimization problem P1 for maximizing the cache hit rate H based on the cache placement strategy optimization model and the request content popularity;
[0012] Step S6: Use a genetic algorithm to solve the optimization problem P1 to obtain the optimal cache placement strategy.
[0013] In some embodiments, step S1 includes:
[0014] S101, calculating the selective SE of each vehicle according to the social similarity and centrality of the vehicle; SE = α·SS + β·CE, where SS is the social similarity between the vehicle and its neighboring vehicles, CE is the centrality of the vehicle, and α and β are weighting factors;
[0015] S102: If the selectivity of vehicle i is greater than the selectivity of vehicle j, then vehicle i is a cache node. When the cache nodes in the vehicle network reach a threshold, the node selection process ends.
[0016] Further, in some embodiments, calculating the selective SE of each vehicle includes:
[0017] SE=α·SS+β·CE
[0018] Where SS is the social similarity between the vehicle and its neighboring vehicles, CE is the centrality of the vehicle, and α and β are weighting factors;
[0019]
[0020] where w k It is the attribute SA k The importance of k The larger the value, the more nodes and V r,j There are common attributes between them, l is the node V r,j The total number of social attributes possessed;
[0021]
[0022] where c k is the number of the k-th attribute;
[0023] Centrality CE is the sum of degree centrality DC and closeness centrality CC;
[0024] CE=DC+CC
[0025]
[0026]
[0027] in is node V r,j and its neighbor node V r,i Links, is node V r,j and its neighbor node V r,i The reciprocal of the distance between.
[0028] In some embodiments, step S2 includes:
[0029] In the urban road scenario, each intersection is equipped with a roadside unit RSU, with a total of N R RSUs are randomly distributed on a city road of length L. A moving vehicle parked on the roadside When a mobile vehicle requests content, it obtains the content from the roadside unit RSU and the cache node, or sends a request to a roadside parked vehicle. The cache capacity of the RSU is S RSU , the cache capacities of mobile vehicles and roadside parked vehicles are and The moving vehicle is represented by Roadside parked vehicles are represented by The roadside unit RSU is represented by R, and the request content is q (q∈{1,2,3,...,Q});
[0030] When a mobile vehicle needs to obtain content, it first sends a content request to the cache node within a 1-hop range. If the cache node contains the content, it directly returns the content to the requesting vehicle; otherwise, it forwards the content request to a roadside parked vehicle. If the roadside parked vehicle has the content cached, it sends the content to the cache node vehicle, which then forwards the content to the requesting vehicle.
[0031] If neither the cache node nor the roadside parked vehicle has cached the content, the mobile vehicle sends a content request to the roadside unit RSU. If the RSU has cached the content, the content is returned to the requesting vehicle, otherwise the content request fails.
[0032] In some embodiments, step S3 includes:
[0033] Define the cache placement matrix as Indicates that the roadside unit RSU has content q cached. Indicates that the cache node contains content q, Indicates that the vehicle parked on the roadside contains content q. If content q is not cached, then a q,:=0;
[0034] The same content can only be cached once within a road range, and cannot be cached repeatedly in RSUs, cache nodes, and roadside parked vehicles, that is:
[0035]
[0036] Where N R , They are the number of roadside units RSU, cache node mobile vehicles, and roadside parked vehicles respectively.
[0037] In some embodiments, step S4, based on historical request information, using an LSTM neural network to predict the number of content requests, sorting the content according to the predicted number of content requests and inputting the content into a Zipf distribution to obtain the popularity of the requested content;
[0038] The LSTM neural network includes a forget gate, an input gate, and an output gate;
[0039] Forget Gate t The role of C is to determine the cell state t-1 Whether it is forgotten is defined as:
[0040] f t =σ(U f x t +W f h t-1 +b f )
[0041] Among them, h t-1 is the final hidden state of the previous layer, x t is the current input, is the number of requests for each content at the previous moment, recorded as x(t)={x1(t),x2(t),...,x Q (t)}, σ(·) is a nonlinear activation function, b f is the bias matrix, U f and W f is the weight matrix, f t The value of is between [0,1];
[0042] Input Gate i t The role of is to determine the new information Whether to add the current cell state C t In, it is defined as:
[0043] i t =σ(U i x t +W i h t-1 +b i )
[0044]
[0045] Update of cell state and f t and i t The update formula is as follows:
[0046]
[0047] Output gate o t The role of is to output the final hidden state of the current layer, which is defined as:
[0048] o t =σ(U o x t +W o h t-1 +b o )
[0049] h t =o t ×tanh(C t )
[0050] Among them, b i 、b C 、b o is the bias matrix, U i , U C , U o and W i , W C , W o is the weight matrix, tanh(·) is the nonlinear activation function; h t is the final output result, which is the predicted number of requests for each content at this moment, denoted as h(t) = {h1(t),h2(t),...,h Q (t)};
[0051] Sort the predicted content according to the number of requests and use it as the input e of the Zipf distribution q , so as to obtain a more accurate content popularity P = [p1, p2, p3, ..., p Q ];
[0052] The popularity of vehicle request content follows Zipf distribution, so the popularity of content q (q∈{1,2,3,...,Q}) is:
[0053]
[0054] Where s is the parameter of the Zipf distribution, e q It is the ranking of the number of requests for content q.
[0055] In some embodiments, step S5 includes: an optimization problem P1 for maximizing the cache hit rate H:
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062] Among them, P is the request content popularity matrix, is the cache placement matrix, N R , are the number of roadside units RSU, mobile vehicles in cache nodes, and vehicles parked on the roadside; the cache capacity of RSU is S RSU , the cache capacity of mobile cache nodes and roadside parked vehicles are and s q is the size of the content q; a q,x 、a q,y 、a q,z Place a submatrix of the matrix for the cache;
[0063] The first constraint is to ensure that the same content q cannot be cached repeatedly. The second to fourth constraints are cache capacity constraints, which ensure that the total size of the cached content does not exceed the cache capacity of the RSU, cache nodes, and roadside parked vehicles.
[0064] In some embodiments, step S6, using a genetic algorithm to solve the optimization problem P1 to obtain an optimal cache placement strategy, includes:
[0065] S601, initializing cache placement schemes, and calculating cache hit rates of each scheme;
[0066] S602, performing selection, crossover and mutation operations, and saving the best individual in each generation, that is, the best cache placement scheme in each generation;
[0067] The selection operation is to select excellent individuals. In the selection process, the selection probability P is defined s is the ratio of individual fitness value to overall fitness value:
[0068]
[0069] Where N is the population size and Fit is the fitness function, which is defined as:
[0070] Fit=H
[0071] After the selection process is completed, according to the crossover rate P c Perform a crossover operation, select two chromosomes in the current population, and then find a crossover point to cross the genes of the two chromosomes to form new offspring; crossover is to exchange two rows of the cache placement matrix under the condition of satisfying the cache capacity constraint, thereby changing the cache content and obtaining different cache hit rates to avoid falling into the local optimum;
[0072] The mutation operation is based on the mutation rate P v Mutate a gene on a chromosome, that is, invert the current gene, change 1 to 0, and change 0 to 1, so that a new chromosome will appear in each round of inheritance, that is, a new fitness value will appear; suppose there are b 1s in a column of the cache placement matrix, the mutation is to change these b 1s to 0, and then randomly select b rows in the same column and change 0 to 1, thereby changing the cache content to achieve the same purpose as crossover;
[0073] S603: When the iteration reaches the preset maximum number of times, the iteration is stopped, a cache placement scheme with the highest cache hit rate is found, and the cache hit rate at this time is recorded.
[0074] In a second aspect, the present invention provides a collaborative caching device using roadside parked vehicles in a vehicle network, including a processor and a storage medium;
[0075] The storage medium is used to store instructions;
[0076] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.
[0077] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.
[0078] Beneficial effects:
[0079] Compared with the prior art, the present invention has the following significant advantages:
[0080] 1. The present invention takes maximizing the cache hit rate as the optimization goal and adopts the idea of genetic algorithm to optimize the cache placement scheme to obtain the cache placement scheme with the maximum cache hit rate.
[0081] 2. The present invention provides a cache node selection method, which can select a mobile vehicle that is more suitable for caching content and avoid cache redundancy.
[0082] 3. The present invention provides a collaborative caching method, which collaboratively caches content in cache nodes, RSUs and roadside parked vehicles, effectively reducing content acquisition latency and costs, while also improving the success rate of content requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 A schematic diagram of a process of an embodiment of the present invention;
[0084] Figure 2 A schematic diagram of a system model of an embodiment of the present invention;
[0085] Figure 3 LSTM structure diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0086] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0087] In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0088] Example 1
[0089] A cooperative cache using roadside parked vehicles in a vehicle network, comprising:
[0090] Step S1, selecting a suitable vehicle from the mobile vehicles as a cache node according to the social similarity and centrality of the vehicles;
[0091] Step S2: construct a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU;
[0092] Step S3, constructing a cache placement strategy optimization model according to a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU;
[0093] Step S4: According to the historical request information, the LSTM neural network is used to predict the number of content requests, and the content is sorted according to the predicted number of content requests and input into the Zipf distribution to obtain the popularity of the requested content;
[0094] Step S5: construct an optimization problem P1 for maximizing the cache hit rate H based on the cache placement strategy optimization model and the request content popularity;
[0095] Step S6: Use a genetic algorithm to solve the optimization problem P1 to obtain the optimal cache placement strategy.
[0096] In some embodiments, the system model of this embodiment is as follows Figure 2 As shown, in the urban road scenario, each intersection is placed with an RSU, with a total of N R There are N RSUs randomly distributed on a city road of length L. Vr A moving vehicle, the speed of the moving vehicle is 40km / h, parked on the roadside When a mobile vehicle requests content, it can not only obtain content from the RSU and cache nodes, but also send requests to vehicles parked on the roadside. The cache capacity of the RSU is S RSU , the cache capacities of mobile vehicles and roadside parked vehicles are and The moving vehicle is represented by Roadside parked vehicles are represented by RSU is represented by R, and the request content is q (q∈{1,2,3,...,Q}).
[0097] In the vehicle network, a suitable vehicle is first selected from the mobile vehicles as a mobile cache node. When the mobile vehicle needs to obtain content, it first sends a request message to the cache node within the surrounding 1-hop range. If the cache node contains the content, the content is directly returned to the requesting vehicle, otherwise the request will be forwarded to the roadside parked vehicle. If the roadside parked vehicle has the content cached, it will be sent to the cache node vehicle, and the cache node will forward the content to the requesting vehicle. If neither the cache node nor the roadside parked vehicle has the content cached, the mobile vehicle will send a content request to the RSU. If the RSU has the content cached, the content will be returned to the requesting vehicle, otherwise the content request will fail. It should be noted that the communication between the two mobile vehicles and the communication between the mobile vehicle and the RSU use different frequency bands, and there is no mutual interference.
[0098] Vehicles can obtain content from RSUs, cache nodes, and roadside parked vehicles. Different content acquisition methods will result in different content request delays. Assume that the requested content is q and the size is s q .
[0099] When the mobile vehicle obtains the requested content from the RSU, the content request delay is:
[0100]
[0101] in, is a moving vehicle V r,i and the bandwidth between the roadside unit R, is the vehicle V r,i The received power is N0, and N0 is the noise power spectral density.
[0102]
[0103] Among them, P R is the transmit power of the RSU, is a moving vehicle V r,i and the channel gain between the roadside unit R.
[0104] When a mobile vehicle obtains the requested content from a cache node, the request latency is:
[0105]
[0106] in, is a moving vehicle V r,i and V r,j The bandwidth between is the vehicle V r,i The received power, N0 is the noise power spectral density, Interference of other vehicles with the content requesting vehicle.
[0107]
[0108] in, is the cache node V r,j The transmission power, is a moving vehicle V r,i and cache node V r,j The channel gain between .
[0109] When a mobile vehicle obtains content from a parked vehicle on the roadside, the content q is transmitted from the parked vehicle on the roadside to the cache node, and then forwarded by the cache node to the requesting vehicle. The delay at this time is:
[0110]
[0111] in, is the cache node V r,j and roadside parking s,m The bandwidth between is the cache node V r,j The received power is N0, and N0 is the noise power spectral density.
[0112] The process from a mobile vehicle sending a content request to obtaining the content is called a cache hit. The cache hit rate is the ratio between the number of contents obtained by the mobile vehicle and the total number of requested contents. The more content a vehicle obtains, the higher the cache hit rate will be. However, the cache capacity of RSU, cache nodes, and roadside parked vehicles is limited, so the cache placement strategy needs to be optimized to achieve the maximum cache hit rate. The cache placement matrix is defined as Indicates that there is content q cached in the RSU. Indicates that the cache node contains content q, Indicates that the vehicle parked on the roadside contains content q. If content q is not cached, then a q,: = 0. In order to improve the cache hit rate, this embodiment stipulates that the same content can only be cached once within a road range, that is, if the RSU caches content q, then the cache node and the roadside parked vehicles cannot cache it repeatedly, that is:
[0113]
[0114] The request content popularity matrix is P = [p1, p2, p3, ..., p Q ], the cache hit rate can be expressed as:
[0115]
[0116] Cache hit rate is an important factor in evaluating system cache performance. It can directly reflect whether the cache placement strategy is reasonable. Considering the limited cache capacity, the objective function is defined as:
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] Among them, the first constraint is to ensure that the same content q cannot be cached repeatedly, and the second to fourth constraints are cache capacity constraints, which ensure that the total size of the cached content does not exceed the cache capacity of RSU, cache nodes and roadside parked vehicles.
[0124] The present invention selects cache nodes based on the social similarity and centrality of the vehicle. Social similarity is the degree of similarity of social attributes between two nodes. Two nodes with similar social attributes are more likely to have common interests and hobbies. If there is a higher social similarity between the requesting node and the cache node, the cached content in the cache node is more likely to be the content of interest to the requesting node, and the request success rate will also increase accordingly.
[0125] This embodiment uses part of the vehicle user data in the network data set, in which the user includes social attributes such as gender, age, occupation, and residence (specific to a certain district). The social attribute is defined as SA = {s u,1 ,s u,2 ,s u,3 ,...,s u,l}, where s u,l Represents the lth attribute of the uth social attribute, for example, gender includes male and female. Age includes 5 attributes [1,2,3,4,5], where 1 represents age between 0-18, 2 represents 19-25, 3 represents 26-35, 4 represents 36-50, and 5 represents age over 50.
[0126] Social similarity is used to evaluate the common social attributes between two nodes. In this embodiment, the Jaccard similarity coefficient is used to calculate the social similarity SS between two nodes. u ,Different from the traditional Jaccard similarity coefficient calculation method, in this embodiment, each attribute is defined with an importance, and the final social similarity is obtained by calculating the importance. r,i and V r,j The social similarity between is defined as:
[0127]
[0128] where w k It is the attribute SA k The importance of k The larger the value, the more nodes and V r,j There are common attributes between them, l is the node V r,j The total number of social attributes possessed.
[0129] Assume that node V r,i The social attributes of V are {male, 1, student, region 1}, r,j The social attributes of V are {male, 2, student, region 1}, then r,i and V r,j The same social attributes For {male, student, region 1}, some data from the dataset are taken as shown in Table 1
[0130] Table 1 Part of the data in the dataset
[0131] gender Male (7) Female (3) age 1(1) 2(4) 3(2) 4(2) 5(1) Profession Student(4) Teacher (2) Lawyer (2) Writer(1) Artist(1) Place of residence Region 1(3) Region 2(3) Region 3(1) Region 4(2) Region 5(1)
[0132] Importance k Defined as:
[0133]
[0134] where c k is the number of the kth attribute. Taking the table as an example, the number of males is 7. The number of people aged between 19 and 25 is 4. There are 4 nodes with the occupation of student, so There are three people living in Gulou District. in The importance of is {w1,w2,w3}, then V r,i and V r,i The social similarity between them is:
[0135]
[0136] In social networks, centrality is usually used to identify the most influential nodes in the network. In this embodiment, the degree centrality and closeness centrality of the node are considered. The degree centrality represents the node V r,j The number of direct neighbors to the adjacent node is defined as:
[0137]
[0138] in is node V r,j and its neighbor node V r,i The higher the degree centrality, the more popular the node is, that is, it has more neighbors. In the vehicle network, more popular vehicles are selected as cache nodes, which increases the opportunity for information transmission between vehicles.
[0139] Closeness centrality describes the node V r,j The centrality of the network, the selection of central nodes can ensure the wider dissemination of content in the network, defined as:
[0140]
[0141] in It is the inverse of the distance between nodes. The larger the CC is, the closer the node V is. r,j The shorter the distance to other nodes in the network.
[0142] The centrality of this example is the sum of degree centrality and closeness centrality:
[0143] CE=DC+CC
[0144] Taking into account the social similarity and centrality of nodes, the selectivity of nodes is defined as:
[0145] SE=α·SS+β·CE
[0146] Among them, α and β are weighted factors of each influencing factor. The larger the SE is, the more suitable the node is to be selected as a cache node.
[0147] The popularity of vehicle request content follows Zipf distribution, so the request probability of content q (q∈{1,2,3,...,Q}) is
[0148]
[0149] Where s is the parameter of the Zipf distribution, e q It is the ranking of the number of requests for content q. The larger the parameter s is, the higher the probability of popular content appearing, the higher the frequency of corresponding content requests will be, and the probability of these contents being cached will also increase.
[0150] The content popularity calculated directly based on the number of historical requests may be inaccurate, so this embodiment uses an LSTM neural network to predict the number of content requests, which can make full use of historical request information to obtain the number of content requests at the next moment. The structure of the LSTM neural network is as follows: Figure 2 As shown in the figure, it is a time recurrent neural network specially designed to solve the long-term dependency problem of general RNN. The LSTM neural network consists of three neural network units, including a forget gate, an input gate, and an output gate.
[0151] In the LSTM neural network, the forget gate f t The role of C is to determine the cell state t-1 Whether it is forgotten, defined as
[0152] f t =σ(U f x t +W f h t-1 +b f )
[0153] Among them, h t-1 is the final hidden state of the previous layer, x t is the current input. In this embodiment, the input is the number of requests for each content at the previous moment, recorded as x(t)={x1(t),x2(t),...,x Q (t)}, σ(·) is the nonlinear activation function, b is the bias matrix, U and W are weight matrices, and f t The value of is between [0,1].
[0154] Input Gate i t The role of is to determine the new information Whether to add the current cell state C t In, it is defined as
[0155] i t =σ(U i x t +W i h t-1 +b i )
[0156]
[0157] Among them, tanh(·) is a nonlinear activation function, i t With f t Have the same functionality.
[0158] Update of cell state and f t and i t The update formula is as follows:
[0159]
[0160] Output gate o t The role of is to output the final hidden state of the current layer, defined as
[0161] o t =σ(U o x t +W o h t-1 +b o )
[0162] h t =o t ×tanh(C t )
[0163] Among them, h t is the final output result. In this embodiment, the output is the predicted number of requests for each content at this moment, recorded as h(t)={h1(t),h2(t),...,h Q (t)}.
[0164] After completing the content popularity prediction, the predicted content is sorted according to the number of requests and used as the input of the Zipf distribution. q , so as to obtain a more accurate content popularity P = [p1, p2, p3, ..., p Q ].
[0165] Problem P1 is an NP-hard problem. This embodiment uses a genetic algorithm to solve the optimal value of P1 to obtain the optimal cache placement strategy. Genetic algorithm is a process of survival of the fittest. It is a random global search and optimization method developed by imitating the biological evolution mechanism in nature, and draws on Darwin's theory of evolution and Mendel's genetics. Its essence is an efficient, parallel, global search method that can automatically acquire and accumulate knowledge about the search space during the search process, and adaptively control the search process to obtain the best solution. It is through evolution from generation to generation to select the individual that best adapts to the environment, that is, the optimal solution to the problem. In this embodiment, the chromosome in the genetic algorithm represents the cache placement matrix, and the fitness represents the cache hit rate. The maximum value of the fitness, that is, the maximum cache hit rate, is obtained through algorithm iteration, and then the optimal individual, that is, the optimal cache placement solution, is obtained in turn.
[0166] The genetic algorithm mainly includes selection, crossover and mutation processes. The selection operation is to select excellent individuals. In the selection process, this embodiment defines the selection probability as the ratio of the individual fitness value to the overall fitness value.
[0167]
[0168] Where N is the population size and Fit is the fitness function, defined as
[0169] Fit=H
[0170] After the selection process is completed, the algorithm will calculate the crossover rate P. c Perform a crossover operation, select two chromosomes in the current population, and then find a crossover point to cross the genes of the two chromosomes to form new offspring, the purpose of which is to increase the genetic diversity of the population. In this embodiment, crossover is to exchange two rows of the cache placement matrix under the condition of satisfying the cache capacity constraint, thereby changing the cache content, obtaining different cache hit rates, and avoiding falling into local optimality.
[0171] In addition to crossover, the genetic algorithm also includes mutation operations. Mutation is based on the mutation rate P. v Mutate a gene on a chromosome, that is, invert the current gene, change 1 to 0, and change 0 to 1, so that a new chromosome will appear in each round of inheritance, that is, a new fitness value will appear. In this embodiment, assuming that there are b 1s in a column of the cache placement matrix, the mutation is to change these b 1s to 0, and then randomly select b rows in the same column and change 0 to 1, thereby changing the content of the cache to achieve the same purpose as crossover.
[0172] The optimal individual is saved in each round of iteration. When the maximum genetic generation is reached, the algorithm terminates, finds the cache placement scheme with the highest cache hit rate, and records the cache hit rate at this time.
[0173] Finally, if Figure 1 As shown, the process of the invention method based on the above optimization problem is as follows:
[0174] (1) Initialize vehicle position;
[0175] (2) The selectivity SE of each vehicle is calculated according to the selectivity calculation formula. If the selectivity of vehicle i is greater than the selectivity of vehicle j, then vehicle i is a cache node. When the cache nodes in the vehicle network reach the threshold, the node selection process ends.
[0176] (3) In this embodiment, only cache nodes, roadside parked vehicles and RSUs can cache content. The content acquisition delay and content request success rate are analyzed.
[0177] (4) Construct an optimization problem to maximize the cache hit rate.
[0178] (5) Initialize the cache placement scheme and calculate the cache hit rate of each scheme.
[0179] (6) Perform selection, crossover, and mutation operations, and save the best individual in each generation, that is, the best cache placement plan in each generation.
[0180] (7) When the maximum number of iterations is reached, stop the iteration, find the cache placement scheme with the highest cache hit rate, and record the cache hit rate at this time.
[0181] In summary, in order to make full use of the cache resources in the vehicle network, reduce the content request latency and improve the success rate of content requests, the present invention proposes a collaborative cache strategy using roadside parked vehicles. Specifically, first select a suitable cache node, then in the content request process, the vehicle can obtain content from the cache node, RSU and roadside parked vehicles. In order to maximize the request success rate, the popularity of the requested content is first predicted, and then a cache placement method based on genetic algorithm is designed to solve it, and the optimal cache placement solution is obtained.
[0182] Example 2
[0183] In a second aspect, the present embodiment provides a collaborative caching device using roadside parked vehicles in a vehicle network, including a processor and a storage medium;
[0184] The storage medium is used to store instructions;
[0185] The processor is used to operate according to the instructions to execute the steps of the method according to embodiment 1.
[0186] Example 3
[0187] In a third aspect, this embodiment provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in Example 1 are implemented.
[0188] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0189] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0190] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0191] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0192] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0193] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A collaborative caching method using roadside parked vehicles in a vehicle network, comprising: Step S1: Selecting a suitable vehicle from the mobile vehicles as a cache node according to the social similarity and centrality of the vehicles, specifically including: S101, calculating the selective SE of each vehicle according to the social similarity and centrality of the vehicle; SE = α·SS + β·CE, where SS is the social similarity between the vehicle and its neighboring vehicles, CE is the centrality of the vehicle, and α and β are weighting factors; where w k It is the attribute SA k The importance of k The larger the value, the more nodes and V r,j There are common attributes between them, l is the node V r,j The total number of social attributes possessed; where c k is the number of the k-th attribute; Centrality CE is the sum of degree centrality DC and closeness centrality CC; CE=DC+CC in is node V r,j and its neighbor node V r,i Links, is node V r,j and its neighbor node V r,i The reciprocal of the distance between S102, if the selectivity of vehicle i is greater than the selectivity of vehicle j, then vehicle i is a cache node, and when the cache nodes in the vehicle network reach the threshold, the node selection process ends; Step S2: construct a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU, specifically including: In the urban road scenario, each intersection is equipped with a roadside unit RSU, with a total of N R RSUs are randomly distributed on a city road of length L. A moving vehicle parked on the roadside When a mobile vehicle requests content, it obtains the content from the roadside unit RSU and the cache node, or sends a request to a roadside parked vehicle. The cache capacity of the RSU is S RSU , the cache capacities of mobile vehicles and roadside parked vehicles are and The moving vehicle is represented by Roadside parked vehicles are represented by The roadside unit RSU is represented by R, and the request content is q (q∈{1,2,3,...,Q}); When a mobile vehicle needs to obtain content, it first sends a content request to the cache node within a 1-hop range. If the cache node contains the content, it directly returns the content to the requesting vehicle; otherwise, it forwards the content request to a roadside parked vehicle. If the roadside parked vehicle has the content cached, it sends the content to the cache node vehicle, which then forwards the content to the requesting vehicle. If neither the cache node nor the roadside parked vehicle has cached the content, the mobile vehicle sends a content request to the roadside unit RSU. If the RSU has the content cached, the content is returned to the requesting vehicle, otherwise the content request fails; Step S3: construct a cache placement strategy optimization model according to a delivery mechanism for mobile vehicles to obtain content from cache nodes, roadside parked vehicles or roadside units RSU, including: Define the cache placement matrix as Indicates that the roadside unit RSU has content q cached. Indicates that the cache node contains content q, Indicates that the vehicle parked on the roadside contains content q. If content q is not cached, then a q,: = 0; the same content can only be cached once within a road range, and cannot be cached repeatedly in RSU, cache nodes, and roadside parked vehicles, that is: Where N R , are the number of roadside units RSU, cache node mobile vehicles, and roadside parked vehicles respectively; Step S4: According to the historical request information, the LSTM neural network is used to predict the number of content requests, and the content is sorted according to the predicted number of content requests and input into the Zipf distribution to obtain the popularity of the requested content; Step S5: Based on the cache placement strategy optimization model and the request content popularity, an optimization problem P1 for maximizing the cache hit rate H is constructed: Among them, P is the request content popularity matrix, is the cache placement matrix, N R , are the number of roadside units RSU, mobile vehicles in cache nodes, and vehicles parked on the roadside; the cache capacity of RSU is S RSU , the cache capacity of mobile cache nodes and roadside parked vehicles are and s q is the size of the content q; a q,x 、a q,y 、a q,z Place a submatrix of the matrix for the cache; The first constraint is to ensure that the same content q cannot be cached repeatedly. The second to fourth constraints are cache capacity constraints, which ensure that the total size of the cached content does not exceed the cache capacity of the RSU, cache nodes, and roadside parked vehicles; Step S6: Use a genetic algorithm to solve the optimization problem P1 to obtain the optimal cache placement strategy.
2. The method for cooperative caching using roadside parked vehicles in an in-vehicle network according to claim 1, characterized in that: Step S4: According to the historical request information, the LSTM neural network is used to predict the number of content requests, and the content is sorted according to the predicted number of content requests and input into the Zipf distribution to obtain the popularity of the requested content, including: The LSTM neural network includes a forget gate, an input gate, and an output gate; Forget Gate t The role of C is to determine the cell state t-1 Whether it is forgotten is defined as: f t =σ(U f x t +W f h t-1 +b f ) Among them, h t-1 is the final hidden state of the previous layer, x t is the current input, is the number of requests for each content at the previous moment, recorded as x(t)={x1(t),x2(t),...,x Q (t)}, σ(·) is a nonlinear activation function, b f is the bias matrix, U f and W f is the weight matrix, f t The value of is between [0,1]; Input Gate i t The role of is to determine the new information Whether to add the current cell state C t In, it is defined as: i t =σ(U i x t +W i h t-1 +b i ) Update of cell state and f t and i t The update formula is as follows: Output gate o t The role of is to output the final hidden state of the current layer, which is defined as: the t =σ(U o x t +W o h t-1 +b o ) h t =o t ×tanh(C t ) Among them, b i , b C , b o is the bias matrix, U i , U C , U o and W i , W C , W o is the weight matrix, tanh(·) is the nonlinear activation function; h t is the final output result, which is the predicted number of requests for each content at this moment, denoted as h(t) = {h1(t),h2(t),...,h Q (t)}; Sort the predicted content according to the number of requests and use it as the input e of the Zipf distribution q , so as to obtain a more accurate content popularity P = [p1, p2, p3, ..., p Q ]; The popularity of vehicle request content follows Zipf distribution, so the popularity of content q (q∈{1,2,3,...,Q}) is: Where s is the parameter of the Zipf distribution, e q It is the ranking of the number of requests for content q.
3. The method for cooperative caching using roadside parked vehicles in a vehicle network according to claim 1, characterized in that: Step S6: Using a genetic algorithm to solve the optimization problem P1 to obtain the optimal cache placement strategy, including: S601, initializing cache placement schemes, and calculating cache hit rates of each scheme; S602, performing selection, crossover and mutation operations, and saving the best individual in each generation, that is, the best cache placement scheme in each generation; The selection operation is to select excellent individuals. In the selection process, the selection probability P is defined s is the ratio of individual fitness value to overall fitness value: Where N is the population size and Fit is the fitness function, which is defined as: Fit=H After the selection process is completed, according to the crossover rate P c Perform a crossover operation, select two chromosomes in the current population, and then find a crossover point to cross the genes of the two chromosomes to form new offspring; crossover is to exchange two rows of the cache placement matrix under the condition of satisfying the cache capacity constraint, thereby changing the cache content and obtaining different cache hit rates to avoid falling into the local optimum; The mutation operation is based on the mutation rate P v Mutate a gene on a chromosome, that is, invert the current gene, change 1 to 0, and change 0 to 1, so that a new chromosome will appear in each round of inheritance, that is, a new fitness value will appear; suppose there are b 1s in a column of the cache placement matrix, the mutation is to change these b 1s to 0, and then randomly select b rows in the same column and change 0 to 1, thereby changing the cache content to achieve the same purpose as crossover; S603: When the iteration reaches the preset maximum number of times, the iteration is stopped, a cache placement scheme with the highest cache hit rate is found, and the cache hit rate at this time is recorded.
4. A cooperative caching device using roadside parked vehicles in a vehicle network, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 3.
5. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Data forwarding method and device based on social similarity and individual centrality of nodes
CN107801226A
Mobile perception cooperative caching method based on consistent hash under vehicle-mounted content center network
CN110958573A