Collaborative Caching Method, Apparatus, Electronic Device, and Storage Medium
By performing similar behavior analysis and trajectory clustering on the noise-added trajectory data of multiple vehicles, a cache optimization objective function is constructed, and a cache solution is made using the MADQN algorithm, which solves the problem of inability to take into account both trajectory privacy protection and cache efficiency in the existing technology, and an efficient and adaptable file collaborative cache solution for complex mobile networks is achieved.
Patent Information
- Application Number
- CN202310156893.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2043-02-21
AI Technical Summary
The prior art cannot take into account both trajectory privacy protection and cache efficiency in the cache method, and it is difficult to adapt to complex mobile network application scenarios.
By obtaining the noise-added trajectory data of multiple vehicles, performing similar behavior analysis and trajectory clustering, building cache optimization objective function, and using the MADQN algorithm to make cache scheme decisions, obtaining file collaborative cache scheme in the Internet of Vehicles environment.
It realizes efficient caching on the basis of protecting trajectory privacy, improves caching efficiency, and adapts to complex mobile network application scenarios.
Smart Images

Figure CN116320000B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular, to a collaborative caching method, apparatus, electronic device, and storage medium. Background Art
[0002] With the rapid development of wireless communication technologies and intelligent vehicle platforms, an increasing number of multimedia services are provided in moving vehicles, and mobile traffic has grown exponentially. The growth of large-scale mobile traffic has brought huge pressure to the load and bandwidth transmission of the core network, resulting in a decline in the quality of data caching services. Most of the existing technologies obtain file popularity by analyzing vehicle locations, behaviors, preferences, etc., and cache the files with higher popularity in edge base stations for acquisition. Existing caching technologies consider less about the protection of vehicle trajectory privacy, and the caching efficiency is low, which is not sufficient to adapt to the application scenarios of complex mobile networks. Summary of the Invention
[0003] The present invention provides a collaborative caching method, apparatus, electronic device, and storage medium, which are used to solve the defect that the existing caching method cannot take into account both trajectory privacy protection and caching efficiency, and realize efficient caching of data on the basis of protecting trajectory privacy and adapting to the application scenarios of complex mobile networks.
[0004] The present invention provides a collaborative caching method, including:
[0005] Obtaining the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles;
[0006] Performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain trajectory similarity, and performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result;
[0007] Constructing a cache optimization objective function according to the trajectory clustering result;
[0008] Solving the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle-to-everything (V2X) environment.
[0009] In some embodiments, the performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain trajectory similarity includes:
[0010] Calculating the distance between trajectories and the trajectory continuity based on the noisy trajectory data of the multiple vehicles;
[0011] Obtaining the trajectory similarity based on the distance between trajectories and the trajectory continuity.
[0012] In some embodiments, the trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result includes:
[0013] Using a hierarchical clustering algorithm, continuously merge clusters based on the trajectory similarity to obtain a trajectory clustering result.
[0014] In some embodiments, the construction of the cache optimization objective function according to the trajectory clustering result includes:
[0015] According to the trajectory clustering result, determine the number of vehicles in each cluster after clustering;
[0016] According to the number of vehicles in each cluster after clustering, set a file offloading method and a threshold for each cluster;
[0017] According to the file offloading method and threshold corresponding to each cluster, construct a cache optimization objective function with the minimum total transmission delay as the goal.
[0018] In some embodiments, the file offloading methods include: cloud offloading, collaborative offloading, and nearby offloading.
[0019] The construction of the cache optimization objective function with the minimum total transmission delay as the goal according to the file offloading method and threshold corresponding to each cluster includes:
[0020] Determine the transmission delay of the file offloading method corresponding to each cluster. When the file offloading method is nearby offloading, the corresponding transmission delay is: When the file offloading method is collaborative offloading, the corresponding transmission delay is: When the file offloading method is cloud offloading, the corresponding transmission delay is: And where f s represents the file size, B is the channel bandwidth, N 0 is the noise power spectral density, z is the channel gain, P t is the transmission power, f is the file, k i is the vehicle in the i-th cluster, r represents the nearby roadside unit, x represents the collaborative roadside unit, and c represents the cloud server;
[0021] According to the transmission delay of the file offloading method corresponding to each cluster, determine the average shortest transmission delay of all clusters:
[0022]
[0023] where, |k i | represents the number of vehicles in the i-th cluster;
[0024] According to the average shortest transmission delay, obtain the cache optimization objective function, expressed as:
[0025]
[0026] P: Maximize AL
[0027] C1:
[0028] C2: |k i,c | < |thr c |
[0029] C3: |k i,x | < |thr x |
[0030] Wherein, K represents the total number of clustering clusters, F represents the file set, and C1 represents the total size of the files cached locally which cannot exceed the total cache capacity C r , C2 represents the number of vehicles |k i,c | in each cluster when selecting the cloud offloading method, which must be within the threshold |thr c | corresponding to the cloud offloading method, and C3 represents the number of vehicles |k i,x | in each cluster when selecting the cooperative offloading method, which must be within the threshold |thr x | corresponding to the cooperative offloading method.
[0031] In some embodiments, solving the cache optimization objective function to obtain a file cooperative caching scheme in the vehicle network environment includes:
[0032] Performing Markov modeling on the cache optimization objective function;
[0033] Using the MADQN algorithm to make cache scheme decisions to obtain a file cooperative caching scheme in the vehicle network environment.
[0034] In some embodiments, the cooperative caching method further includes:
[0035] Caching files from the cloud server according to the file cooperative caching scheme.
[0036] The present invention also provides a cooperative caching device, including:
[0037] An acquisition unit, configured to acquire the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles;
[0038] A clustering unit, configured to perform similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity, and perform trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result;
[0039] A construction unit, configured to construct a cache optimization objective function according to the trajectory clustering result;
[0040] A solving unit, configured to solve the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle networking environment.
[0041] The present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the collaborative caching method as described in any one of the above is implemented.
[0042] The present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the collaborative caching method as described in any one of the above is implemented.
[0043] The present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the collaborative caching method as described in any one of the above is implemented.
[0044] A collaborative caching method, device, electronic device, and storage medium provided by the present invention obtain noisy trajectory data of multiple vehicles, perform similar behavior analysis and trajectory clustering on the noisy trajectory data of multiple vehicles to obtain a trajectory clustering result, construct a cache optimization objective function according to the trajectory clustering result, and solve the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle networking environment. It can not only protect the privacy of user trajectories, but also improve the caching efficiency and adapt to the application scenarios of complex mobile networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 It is a schematic diagram of the application scenario of the collaborative caching method provided by the embodiment of the present invention;
[0047] Figure 2 It is a schematic flowchart of the collaborative caching method provided by the embodiment of the present invention;
[0048] Figure 3 It is a schematic flowchart of performing similar behavior analysis on the noisy trajectory data of multiple vehicles and performing trajectory clustering based on the trajectory similarity provided by the embodiment of the present invention;
[0049] Figure 4Schematic flowchart of constructing a cache optimization objective function according to the trajectory clustering result provided by an embodiment of the present invention;
[0050] Figure 5 Schematic flowchart of solving the cache optimization objective function provided by an embodiment of the present invention;
[0051] Figure 6 Schematic structural diagram of a cooperative caching device provided by an embodiment of the present invention;
[0052] Figure 7 Schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] The Internet of Vehicles (IOV) is the Internet of vehicles, which uses sensing technology to sense the state information of vehicles and realizes intelligent traffic management, intelligent decision-making of file services, and intelligent control of vehicles with the help of wireless communication networks and modern intelligent information processing technologies. With the rapid development of wireless communication technologies and intelligent in-vehicle platforms, the multimedia services provided in moving vehicles are becoming increasingly rich, such as entertainment news, immersive media applications, location services, etc. With the increasing user demands and multimedia applications, the mobile traffic in the Internet of Vehicles has grown exponentially, and it is expected that by 2030, its annual growth rate will reach 12%. The growth of large-scale mobile traffic has brought huge pressure to the load and bandwidth transmission of the core network, resulting in a decline in the quality of vehicle network services. Therefore, reducing the network traffic load and providing high-quality Internet of Vehicles file services are very necessary to improve the quality of user service experience.
[0055] Mobile Edge Caching (MEC) alleviates the above problems by providing nearby caching services and shorter latency. This technology sinks communication resources and computing services to the Road Side Unit (RSU) near the mobile vehicle side, such as gas stations, restaurants, passenger service stations, etc. near the vehicle, which can greatly reduce the transmission latency and traffic pressure of multimedia services. However, due to the frequent movement of vehicles and the sensitivity of information, edge caching technology still faces some challenges. This technology may lead to the leakage of user privacy information and it is difficult to guarantee the quality of vehicle network services. Due to the privacy of vehicle trajectory data, during the process of vehicle users requesting services, user sensitive information is easily collected by service providers or stolen by hackers through illegal means. Therefore, in the process of data analysis, protecting data privacy and security is extremely important. In addition, most caching methods lack intelligence and dynamics, and are not sufficient to adapt to the application scenarios of complex mobile networks. When users request services such as videos, entertainment, and navigation, there will be a large delay between the base station and the remote server. When a large number of users request the transmission of the same popular content within a short period of time, it brings huge pressure to the network link, and at the same time causes problems such as waste of bandwidth resources and poor user experience.
[0056] To this end, the present invention provides a collaborative caching method, device, electronic device, and storage medium. By obtaining the noisy trajectory data of multiple vehicles, performing similar behavior analysis and trajectory clustering on the noisy trajectory data of multiple vehicles to obtain a trajectory clustering result, constructing a cache optimization objective function according to the trajectory clustering result, and solving the cache optimization objective function, a file collaborative caching scheme in the vehicle network environment is obtained. The present invention can not only protect user trajectory privacy, but also improve caching efficiency and adapt to the application scenarios of complex mobile networks.
[0057] Figure 1 It is a schematic diagram of the application scenario of the collaborative caching method provided by the embodiment of the present invention. As Figure 1 shown, the collaborative caching framework implemented by the embodiment of the present invention is mainly divided into three layers, namely: cloud service layer, edge computing layer, and vehicle user layer.
[0058] (1) Cloud service layer, which is mainly used to store the total file resources requested by vehicle network users, can transfer files to the edge computing layer, or directly transfer files to vehicles.
[0059] (2) Edge computing layer, which provides an edge computing roadside unit (EC-RSU) to implement vehicle clustering and caching computing services. According to the privacy protection method, the local RSU (i.e., the RSU closest to the vehicle node) adds Laplace noise to the trajectory and uploads it to the edge computing layer. The agglomerative hierarchical clustering method is applied for similarity clustering, and the deep reinforcement learning algorithm is used for the file caching decision of the local RSU.
[0060] (3) Vehicle user layer, which is mainly used for file request services of users in the mobile network environment. Vehicle users can directly obtain files from the cloud. In addition, according to the calculation results of the edge computing layer, the files in the cloud service layer are sunk to each local RSU through the EC-RSU for vehicle users to obtain, or file services can be obtained from the collaborative RSU.
[0061] Figure 2 It is a schematic flow chart of the collaborative caching method provided by the embodiment of the present invention. As Figure 2 shown, a collaborative caching method is provided, including the following steps: Step 210, Step 220, Step 230 and Step 240. The flow steps of this method are only a possible implementation manner of the present invention.
[0062] Step 210: Obtain the noisy trajectory data of multiple vehicles, and the noisy trajectory data of the multiple vehicles is obtained by adding noise to the trajectory data of the multiple vehicles.
[0063] Among them, the trajectory data of each vehicle includes multiple position point data of each vehicle in a preset time series.
[0064] It should be noted that considering the sensitivity of user trajectories, combined with the differential privacy method, the trajectory data of multiple vehicles is generalized according to Laplace noise addition to improve the privacy security of the trajectories.
[0065] Specifically, the adding noise processing of the trajectory data of the multiple vehicles includes:
[0066] Set up a local differential privacy model, including privacy parameter ε, sensitivity Δf, and Laplace function Lap(λ);
[0067] Based on the local differential privacy model, the local RSU adds noise to the trajectory data of multiple vehicles to obtain the noisy trajectory data of multiple vehicles, which is expressed as follows:
[0068]
[0069] Among them, represents the noisy trajectory data of vehicle m, M represents the vehicle set, Denote the noisy location data corresponding to the t location point of vehicle m, where t ∈ T and T represents the set of location points of vehicle m;
[0070] The calculation formula for the noisy location data of vehicle m is expressed as follows:
[0071]
[0072] where loc m represents the location data of vehicle m, is the privacy parameter, Δf is the sensitivity, and Lap(λ) is the Laplace function.
[0073] Step 220: Perform similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain the trajectory similarity, and perform trajectory clustering based on the trajectory similarity to obtain the trajectory clustering result.
[0074] Specifically, the trajectory clustering result includes multiple vehicle clusters and the number of vehicles corresponding to each vehicle cluster.
[0075] It should be noted that the trajectory clustering result reflects the behaviors and preferences among different vehicle trajectories.
[0076] Step 230: Construct a cache optimization objective function according to the trajectory clustering result.
[0077] Among them, the cache optimization objective function refers to a function with the goal of optimizing cache efficiency.
[0078] Step 240: Solve the cache optimization objective function to obtain a file collaborative caching scheme in the vehicle networking environment.
[0079] Specifically, use the deep reinforcement learning algorithm to solve the cache optimization objective function to obtain an optimal file collaborative caching scheme in the vehicle networking environment.
[0080] In the embodiment of the present invention, by obtaining the noisy trajectory data of multiple vehicles, performing similar behavior analysis and trajectory clustering on the noisy trajectory data of multiple vehicles to obtain the trajectory clustering result, constructing a cache optimization objective function according to the trajectory clustering result, and solving the cache optimization objective function to obtain a file collaborative caching scheme in the vehicle networking environment, it can not only protect the privacy of user trajectories, but also improve cache efficiency and adapt to the application scenarios of complex mobile networks.
[0081] Figure 3 This is a schematic flowchart of performing similar behavior analysis on the noisy trajectory data of multiple vehicles and performing trajectory clustering based on the trajectory similarity provided by the embodiment of the present invention. As Figure 3As shown, in some embodiments, in step 220, performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity includes:
[0082] Step 221, calculating a distance between trajectories and a trajectory continuity based on the noisy trajectory data of the multiple vehicles;
[0083] Step 222, obtaining a trajectory similarity based on the distance between trajectories and the trajectory continuity.
[0084] Specifically, the trajectory sequence of vehicle i after adding noise at time T is denoted as Z, and the trajectory of vehicle j after adding noise at time T is denoted as Q. The distance calculation formula for the two trajectories Z and Q is as follows:
[0085]
[0086] where D Z,Q represents the sum of the average distances from all discrete position points on trajectory Z to trajectory Q. Similarly, D Q,Z represents the sum of the average distances from all discrete position points on trajectory Q to trajectory Z, and D Z,Q The specific calculation process is as follows:
[0087]
[0088]
[0089] Similarly, the calculation process of D Q,Z is expressed as:
[0090]
[0091]
[0092] where z represents a certain discrete position point on trajectory Z, q represents a certain discrete position point on trajectory Q, and len(Z) represents the length of trajectory Z.
[0093] Specifically, according to whether the minimum matching numerical value of each position point on one trajectory to the other trajectory increases, the approximation degree of the curve directions of the two trajectories is judged. First, the calculation of the best match number is described as follows: For two trajectory sequences Z = (z 1 , z 2 ,...) and Q = (q 1 , q 2 ,...). If the shortest position from position z 1 to trajectory Q is q 5 , then best(z 1 , Q) = 5.
[0094] Therefore, the calculation formula for the trajectory continuity is expressed as follows:
[0095]
[0096]
[0097] Wherein, |Z| represents the number of discrete positions of the trajectory Z, and |Q| represents the number of discrete positions of the trajectory Q.
[0098] It should be noted that the continuity refers to a measure of the trajectory direction. The more it increases, the greater the continuity value and the more similar the trajectory directions are.
[0099] Exemplarily, for two trajectories, such as the Z trajectory having 3 points and the Q trajectory having 5 trajectory points, the subscripts of the position points of the two trajectories are respectively numbered, and the value of best(z,Q) is calculated. The obtained values are multiple position subscript values that are the closest to each other, such as "1, 2, 3", and "1, 2, 3" is an increasing sequence. Therefore, the count(best(z,Q) value is "1".
[0100] Based on the above calculations, it can be seen that the smaller the distance value between trajectories, the more similar they are, and the greater the trajectory continuity value, the more similar they are. Therefore, the calculation formula for the trajectory similarity is expressed as:
[0101]
[0102] It should be noted that by combining the distance calculation and the continuity calculation, finally, two trajectories with the directions as consistent as possible and the distance as small as possible are obtained, which are the two most similar trajectories.
[0103] It can be understood that in the embodiments of the present invention, based on the noisy trajectory data of multiple vehicles, the distance between trajectories and the trajectory continuity are calculated, and based on the distance between trajectories and the trajectory continuity, the trajectory similarity is obtained, improving the accuracy of the trajectory similarity.
[0104] In some embodiments, in step 220, the performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result includes:
[0105] Step 223: Using the hierarchical clustering algorithm, continuously merge clusters based on the trajectory similarity to obtain a trajectory clustering result.
[0106] Specifically, using the hierarchical clustering algorithm, merge the vehicle user trajectories with the greatest similarity to obtain a clustering set J * , which is expressed as follows:
[0107]
[0108] Among them, i represents vehicle i, and j represents vehicle j. represents the trajectory sequence of vehicle i after adding noise at time T. represents the trajectory sequence of vehicle j after adding noise at time T, and M represents the set of vehicles.
[0109] The hierarchical clustering algorithm is introduced as follows:
[0110] Input: Initialize the trajectory set Trace, privacy budget ε, and vehicle set M.
[0111] Output: Trajectory clustering set J * ,
[0112] 1. For trace ∈ trace 1 ..., trace M do
[0113] 2. trace* = trace + ε
[0114] 3. End
[0115] 4. For m1 = 1, 2, 3,.., M do
[0116] 5. For m2 = 1, 2, 3,...M do
[0117] 6. Calculate the distance between trajectories Dist(Z, Q);
[0118] 7. Calculate the trajectory continuity C(Z, Q);
[0119] 8. Calculate the trajectory similarity Alikeness(Z, Q);
[0120] 9. Use the hierarchical clustering algorithm to obtain J * .
[0121] In the embodiment of the present invention, by using the hierarchical clustering algorithm, clusters are continuously merged based on the trajectory similarity to obtain the trajectory clustering result, improving the accuracy of the clustering result.
[0122] Figure 4 For the flow diagram of constructing the cache optimization objective function according to the trajectory clustering result provided by the embodiment of the present invention, as Figure 4 shown, step 230 includes:
[0123] Step 231: Determine the number of vehicles in each cluster after clustering according to the trajectory clustering result;
[0124] Step 232: Set the file unloading method and threshold for each cluster according to the number of vehicles in each cluster after clustering;
[0125] The present invention measures the efficiency of caching from the perspective of transmission delay. Three ways of requesting files are defined, namely cloud, collaboration, and nearby acquisition. Correspondingly, the file offloading methods include: cloud offloading, collaborative offloading, and nearby offloading. The transmission delay of file f to the vehicle is defined as follows:
[0126]
[0127] where f s represents the file size, B is the channel bandwidth, N 0 is the noise power spectral density, z is the channel gain, P t is the transmission power, P c represents the transmission power for selecting cloud offloading, P x represents the transmission power for selecting collaborative offloading, P r represents the transmission power for selecting nearby offloading.
[0128] Since the number of clusters after clustering is different and the capacity of the RSU is limited, if nearby caching is performed for vehicle clusters with a small number, it will waste space and result in poor caching service performance. Therefore, different thresholds are set for cloud offloading and collaborative offloading. Under the limited caching capacity, the higher the proportion of requesting files from the nearby RSU or collaborative RSU, and the lower the proportion of requesting files from the cloud, the higher the mobile network service performance.
[0129] Step 233: Construct a caching optimization objective function with the minimum total transmission delay as the objective according to the file offloading methods and thresholds corresponding to each cluster.
[0130] Further, step 233 constructs a caching optimization objective function with the minimum total transmission delay as the objective according to the file offloading methods and thresholds corresponding to each cluster, including:
[0131] Step 2331: Determine the transmission delay of the file offloading method corresponding to each cluster;
[0132] When the file offloading method is nearby offloading, the corresponding transmission delay is: When the file offloading method is collaborative offloading, the corresponding transmission delay is: When the file offloading method is cloud offloading, the corresponding transmission delay is: And where f s represents the file size, B is the channel bandwidth, N 0 is the noise power spectral density, z is the channel gain, P t is the transmission power, f is the file, k i is the vehicle within the i-th cluster, r represents the nearby roadside unit, x represents the collaborative roadside unit, and c represents the cloud server.
[0133] Step 2332: Determine the average shortest transmission delay of all clusters according to the transmission delay of the file unloading method corresponding to each cluster. The calculation formula is as follows:
[0134]
[0135] where |k i | represents the number of vehicles in the i-th cluster;
[0136] Step 2333: Obtain the cache optimization objective function according to the average shortest transmission delay of all clusters and the threshold.
[0137] It should be noted that since the number of clusters after noisy clustering is uneven, and the cache capacity inside each RSU base station is limited, if file pre-caching is performed on vehicle clusters with a small number of trajectories, resulting in vehicle clusters with a large number of trajectories being unable to be cached, it will cause unnecessary space waste.
[0138] It can be understood that under the condition of limited RSU cache capacity, when vehicle users with a large number of clusters request file resources, the larger the proportion obtained from nearby or adjacent RSUs and the smaller the proportion obtained from the cloud, the better the vehicle network service performance. Therefore, the cache optimization objective function is expressed as:
[0139]
[0140] P: Maximize AL
[0141] C1:
[0142] C2: |k i,c | < |thr c |
[0143] C3: |k i,x | < |thr x |;
[0144] where K represents the total number of clustering clusters, F represents the file set, C1 represents that the total size of the files cached locally cannot exceed the total cache capacity C r , C2 represents that when selecting the cloud unloading method, the number of vehicles |k i,c | in each cluster must be within the threshold |thr c | corresponding to the cloud unloading method, and C3 represents that when selecting the cooperative unloading method, the number of vehicles |k i,x | in each cluster must be within the threshold |thr x | corresponding to the cooperative unloading method.
[0145] In the embodiments of the present invention, according to the number of vehicles in each cluster after clustering, a file unloading method and a threshold are set for each cluster. On this basis, a cache optimization objective function with the minimum total transmission delay as the goal is constructed, improving the reliability of the cache optimization objective function.
[0146] Figure 5 FIG. is a schematic flowchart of solving the cache optimization objective function provided by the embodiments of the present invention, as Figure 5 shown, step 240 includes:
[0147] Step 241, perform Markov modeling on the cache optimization objective function;
[0148] Step 242, use the multi-agent deep Q network MADQN algorithm to make a cache scheme decision, and obtain a file collaborative cache scheme in the vehicle network environment.
[0149] In order to solve the above cache optimization objective function, the present invention performs Markov modeling on the cache optimization objective function and uses the MADQN algorithm to find the optimal cache scheme decision.
[0150] Among them, the multi-agent deep Q network (MADQN) algorithm allows each agent to learn independently. During training, each agent learns to obtain the optimal Q function.
[0151] The present invention provides a collaborative cache optimization algorithm based on MADQN:
[0152] Input: Clustering result J * , base station set R, file set F, learning rate α, discount factor γ.
[0153] Output: Optimal cache optimization result R * .
[0154] 1. For t = 1, 2, 3,..., T do
[0155] 2. For r = 1, 2, 3....R do
[0156] 3. While step < Γ:
[0157] 4. According to the ξ-strategy, select action a in state s;
[0158] 5. Obtain the reward value r and the next moment state;
[0159] 6. Store the state value, action value, reward value, and the next moment state in the experience pool;
[0160] 7. If step > 200 and step % 5 == 0:
[0161] 8. Select a sample from the experience pool;
[0162] 9. Calculate the Q value and train the neural network parameters;
[0163] 10. Copy the parameters every other time slice;
[0164] 11. Return the optimization result R * .
[0165] Define the Q value of the deep reinforcement learning algorithm as follows:
[0166] Q(s t , a t ) = E[r + γmaxQ(s t+1 , A)]
[0167] where s t , a t represent the cache state and action at time slot t respectively, r is the reward of state s at time slot t, and γ is the revenue discount factor for the next time slot.
[0168] The experience library of the MADQN algorithm is used to update and store the observed state, action, reward, and next state. A part of the sample set extracted from the state equation is used to update the neural network. After one time slice, the parameters of the Q-evaluation network are copied to the Q-target network.
[0169] The calculation formula for the Q value of the MADQN algorithm is expressed as follows:
[0170] Q(s t , a t ) = E[r + γmaxQ(s t+1 , A)]
[0171] where s t represents the cache state at time slot t, s t+1 represents the cache state at time slot t + 1, a t and represents the action at time slot t, A represents the action set, r is the reward of state s at time slot t, γ is the revenue discount factor for the next time slot, and E represents the expectation.
[0172] Furthermore, the loss function is defined using the mean square error as follows:
[0173]
[0174] where θ t represents the neural network parameters at time t.
[0175] The gradient function is further expressed as:
[0176]
[0177] Combined with the Root Mean Square Propagation (RMSProp) algorithm for parameter optimization, it is expressed as:
[0178]
[0179] Where α represents the learning rate, χ represents the weighted average gradient sum, and ω represents the weighted average coefficient.
[0180] Among them, the RMSProp algorithm is one of the gradient descent optimization algorithms. In order to further optimize the problem of excessive swing amplitude in the update of the loss function and further accelerate the convergence speed of the function, the RMSProp algorithm uses the weighted average of the squared differentials for the gradients of the weights and biases.
[0181] In the embodiments of the present invention, by performing Markov modeling on the cache optimization objective function and using the MADQN algorithm for cache scheme decision-making, it is convenient to obtain the optimal file collaborative caching scheme in the vehicle networking environment to ensure high-quality file acquisition services and improve data caching and forwarding efficiency.
[0182] In some embodiments, the collaborative caching method further includes:
[0183] Caching files from the cloud server according to the file collaborative caching scheme.
[0184] Optionally, according to the file collaborative caching scheme, the EC-RSU sinks the cloud service layer files into each local RSU for vehicle users to obtain, or obtains file services from the collaborative RSU.
[0185] The embodiments of the present invention cache files from the cloud server according to the file collaborative caching scheme, improving the file caching efficiency.
[0186] Next, the collaborative caching device provided by the embodiments of the present invention will be described. The device described below can be correspondingly referred to the collaborative caching method described above.
[0187] Figure 6 For the structural schematic diagram of the collaborative caching device provided by the embodiments of the present invention, as Figure 6 shown, the collaborative caching device 600 includes:
[0188] An acquisition unit 610, configured to acquire the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles;
[0189] A clustering unit 620, configured to perform similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity degree, and perform trajectory clustering based on the trajectory similarity degree to obtain a trajectory clustering result;
[0190] A construction unit 630, configured to construct a cache optimization objective function according to the trajectory clustering result;
[0191] A solving unit 640, configured to solve the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle networking environment.
[0192] Optionally, the performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity degree includes:
[0193] Based on the noisy trajectory data of the multiple vehicles, calculating to obtain a distance between trajectories and a trajectory continuity degree;
[0194] Based on the distance between trajectories and the trajectory continuity degree, obtaining a trajectory similarity degree.
[0195] Optionally, the performing trajectory clustering based on the trajectory similarity degree to obtain a trajectory clustering result includes:
[0196] Using a hierarchical clustering algorithm, continuously merging clusters based on the trajectory similarity degree to obtain a trajectory clustering result.
[0197] Optionally, the constructing a cache optimization objective function according to the trajectory clustering result includes:
[0198] According to the trajectory clustering result, determining the number of vehicles in each cluster after clustering;
[0199] According to the number of vehicles in each cluster after clustering, setting a file offloading method and a threshold for each cluster;
[0200] According to the file offloading method and the threshold corresponding to each cluster, constructing a cache optimization objective function with the minimum total transmission delay as the objective.
[0201] Optionally, the file offloading methods include: cloud offloading, collaborative offloading, and nearby offloading.
[0202] The constructing a cache optimization objective function with the minimum total transmission delay as the objective according to the file offloading method and the threshold corresponding to each cluster includes:
[0203] Determining the transmission delay of the file offloading method corresponding to each cluster. When the file offloading method is nearby offloading, the corresponding transmission delay is: When the file offloading method is collaborative offloading, the corresponding transmission delay is: When the file unloading method is cloud unloading, the corresponding transmission delay is: And where f s represents the file size, B is the channel bandwidth, N 0 is the noise power spectral density, z is the channel gain, P t is the transmission power, f is the file, k i is the vehicle in the i-th cluster, r represents the nearby roadside unit, x represents the cooperative roadside unit, and c represents the cloud server;
[0204] Determine the average shortest transmission delay of all clusters according to the transmission delay of the file unloading method corresponding to each cluster:
[0205]
[0206] where, |k i | represents the number of vehicles in the i-th cluster;
[0207] According to the average shortest transmission delay, obtain the cache optimization objective function, expressed as:
[0208]
[0209] P: Maximize ΔL
[0210] C1:
[0211] C2: |k i,c | < thr c |
[0212] C3: |k i,x | < thr x |;
[0213] where, K represents the total number of clustering clusters, F represents the file set, and C1 represents that the total size of the files cached locally cannot exceed the total cache capacity C r , C2 represents that when selecting the cloud unloading method, the number of vehicles |k i,c | in each cluster must be within the threshold |thr c | corresponding to the cloud unloading method, and C3 represents that when selecting the cooperative unloading method, the number of vehicles |k i,x | in each cluster must be within the threshold |thr x | corresponding to the cooperative unloading method.
[0214] Optionally, solving the cache optimization objective function to obtain a file cooperative caching scheme in the vehicle networking environment includes:
[0215] Perform Markov modeling on the cache optimization objective function;
[0216] Use the MADQN algorithm to make cache scheme decisions and obtain a file collaborative caching scheme in the vehicle networking environment.
[0217] Optionally, the collaborative caching device 600 further includes:
[0218] A cache unit 650, configured to cache files from a cloud server according to the file collaborative caching scheme.
[0219] Cache files from a cloud server according to the file collaborative caching scheme.
[0220] It should be noted here that the collaborative caching device provided in the embodiments of the present invention can implement all the method steps implemented in the above-mentioned collaborative caching method embodiments and can achieve the same technical effects. The same parts and beneficial effects as those in the method embodiments will not be specifically described in this embodiment.
[0221] Figure 7 Illustrates a schematic physical structure diagram of an electronic device, as Figure 7 shown. The electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740. Among them, the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call the logical instructions in the memory 730 to execute the collaborative caching method, which includes: obtaining the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles; performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain trajectory similarity, and performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result; constructing a cache optimization objective function according to the trajectory clustering result; solving the cache optimization objective function to obtain a file collaborative caching scheme in the vehicle networking environment.
[0222] In addition, when the logical instructions in the above-mentioned memory 730 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0223] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the collaborative caching method provided by the above-mentioned various methods. The method includes: obtaining the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles; performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity, and performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result; constructing a cache optimization objective function according to the trajectory clustering result; and solving the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle networking environment.
[0224] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the collaborative caching method provided by the above-mentioned various methods. The method includes: obtaining the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles; performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity, and performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result; constructing a cache optimization objective function according to the trajectory clustering result; and solving the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle networking environment.
[0225] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.
[0226] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0227] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A collaborative caching method, characterized in that, applied to an edge computing roadside unit, includes: Obtain the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by adding noise to the trajectory data of the multiple vehicles; Perform similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain trajectory similarity, and perform trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result; the trajectory clustering result includes multiple vehicle clusters and the number of vehicles corresponding to each vehicle cluster; Construct a cache optimization objective function according to the trajectory clustering result; Solve the cache optimization objective function to obtain a file collaborative caching scheme in the vehicle network environment; The adding noise to the trajectory data of the multiple vehicles includes: Set a local differential privacy model, including a privacy parameter ε, a sensitivity Δf, and a Laplace function Lap(λ); Based on the local differential privacy model, use the local RSU to add noise to the trajectory data of the multiple vehicles to obtain the noisy trajectory data of the multiple vehicles, which is expressed as follows: Among them, represents the noisy trajectory data of vehicle m, and M represents the set of vehicles, represents the noisy position data corresponding to the t-th position point of vehicle m, where t ∈ T and T represents the set of position points of vehicle m; The calculation formula for the noisy position data of vehicle m is expressed as follows: where loc m represents the position data of vehicle m, is a privacy parameter, Δf is the sensitivity, and Lap(λ) is the Laplace function; The performing similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain trajectory similarity includes: Based on the noisy trajectory data of the multiple vehicles, calculate the distance between trajectories and the trajectory continuity; Based on the distance between trajectories and the trajectory continuity, obtain the trajectory similarity; The performing trajectory clustering based on the trajectory similarity to obtain a trajectory clustering result includes: Use the hierarchical clustering algorithm to continuously merge clusters based on the trajectory similarity to obtain a trajectory clustering result; The clustering result is expressed as follows: Among them, J * represents the clustering set, i represents vehicle i, j represents vehicle j, represents the trajectory sequence of vehicle i after adding noise at time T, represents the trajectory sequence of vehicle j after adding noise at time T, M represents the vehicle set, represents the maximum trajectory similarity; The constructing a cache optimization objective function according to the trajectory clustering result includes: According to the trajectory clustering result, determine the number of vehicles in each cluster after clustering; According to the number of vehicles in each cluster after clustering, set a file offloading method and a threshold for each cluster; According to the file offloading method and threshold corresponding to each cluster, construct a cache optimization objective function with the minimum total transmission delay as the goal; The file offloading method includes: cloud offloading, collaborative offloading, and nearby offloading. The constructing a cache optimization objective function with the minimum total transmission delay as the goal according to the file offloading method and threshold corresponding to each cluster includes: Determine the transmission delay of the file unloading method corresponding to each cluster. When the file unloading method is local unloading, the corresponding transmission delay is: When the file unloading method is collaborative unloading, the corresponding transmission delay is: When the file unloading method is cloud unloading, the corresponding transmission delay is: Define the transmission delay from file f to the vehicle, which is expressed as follows: Among them, f s represents the file size, B is the channel bandwidth, N 0 is the noise power spectral density, z is the channel gain, P t is the transmission power, f is the file, P c represents the transmission power selected for cloud offloading, P x represents the transmission power selected for cooperative offloading, P r represents the transmission power selected for nearby offloading; k i is the vehicle in the i-th cluster, r represents the nearby roadside unit, x represents the cooperative roadside unit, and c represents the cloud server; Determine the average shortest transmission delay of all clusters according to the transmission delay of the file offloading method corresponding to each cluster; Among them, |k i | represents the number of vehicles in the i-th cluster; According to the average shortest transmission delay, obtain the cache optimization objective function, which is expressed as: P: Maximize ΔL C2:|k i,c |<|thr c | C3: | k i,x | < | thr x |; Among them, K represents the total number of clusters, F represents the file set, and C1 represents the total size of the files cached locally It cannot exceed the total cache capacity C r , C2 represents the number of vehicles |k| in each cluster when the cloud offloading method is selected i,c | must be within the threshold |thr| corresponding to the cloud offloading method c , C3 represents the number of vehicles |k| in each cluster when the collaborative offloading method is selected i,x | must be within the threshold |thr| corresponding to the collaborative offloading method x |; The solving the cache optimization objective function to obtain a file collaborative caching scheme in the vehicle network environment includes: Perform Markov modeling on the cache optimization objective function; Use the multi-agent deep Q-network MADQN algorithm to make cache scheme decisions to obtain a file collaborative caching scheme in the vehicle network environment; The calculation formula for the Q value of the MADQN algorithm is as follows: Q(s t ,a t ) = E[r + γ max Q(s t+1 , A)]; where s t represents the cache state of time slot t, s t+1 represents the cache state of time slot t + 1, a t represents the action at time slot t, A represents the action set, r is the reward of state s at time slot t, γ is the revenue discount factor for the next time slot, and E represents the expectation.
2. The collaborative caching method according to claim 1, characterized in that, The collaborative caching method further includes: Cache files from the cloud server according to the file collaborative caching scheme.
3. A collaborative caching device, characterized in that, the device is used to execute the collaborative caching method according to any one of claims 1-2, and the device includes: an acquisition unit, configured to acquire the noisy trajectory data of multiple vehicles, where the noisy trajectory data of the multiple vehicles is obtained by performing noise addition processing on the trajectory data of the multiple vehicles; a clustering unit, configured to perform similar behavior analysis on the noisy trajectory data of the multiple vehicles to obtain a trajectory similarity degree, and perform trajectory clustering based on the trajectory similarity degree to obtain a trajectory clustering result; a construction unit, configured to construct a cache optimization objective function according to the trajectory clustering result; a solving unit, configured to solve the cache optimization objective function to obtain a file collaborative caching scheme in a vehicle-to-everything environment.
4. An electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the program, it implements the collaborative caching method according to any one of claims 1 to 2.
5. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, it implements the collaborative caching method according to any one of claims 1 to 2.