Improved popular file prediction method based on vehicle-mounted edge calculation

By introducing adaptive learning rate changes, vehicle screening and V2V delay considerations in vehicle edge computing, popular file prediction is improved, and the problems of unreasonable learning rate and large and timely delay in the existing technology are solved, and the problem of large and timely delay in calculation overhead is realized. Higher cache hit rate and lower file transfer delay.

CN119398107APending Publication Date: 2025-02-07NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411423847.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the existing on-board edge computing, the learning rate of federated learning is unreasonable, the cost of training vehicles is large, and the V2V communication delay is neglected, resulting in low cache hit rate and extended file transfer time.

Method used

An improved popular file prediction method is proposed. Through adaptive changes in the federated learning rate, screening training vehicles participating in federated learning, and considering the V2V communication delay, a popular file prediction method based on on-board edge computing is designed.

Benefits of technology

Improves cache hit rate, reduces file transfer delay, improves Internet of Vehicle file request performance, and reduces the computational overhead of federated learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398107A_ABST
    Figure CN119398107A_ABST
Patent Text Reader

Abstract

The invention provides an improved popular file prediction method based on vehicle-mounted edge calculation, and belongs to the technical field of Internet of Vehicles. The technical problems of prediction misalignment and file outdated existing in a reactive cache mechanism are solved. According to the technical scheme, the method comprises the following steps that S1, in each round, each vehicle obtains data from a test set to construct a file scoring initial matrix; s2, obtaining a file score correction matrix of each vehicle; s3, vehicle clustering; s4, summarizing the score tables of the clusters by the RSU, and accumulating to obtain a total file score table; and S5, the RSU selects Fc files with the highest score from the total file score table in a descending order as popular files, and randomly caches the files from the popular files. The method has the beneficial effects that a learning rate self-adaptive adjustment and vehicle screening algorithm is designed, so that the cache hit rate is remarkably improved, and the file transmission delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Vehicles technology and vehicle-mounted edge computing, and in particular to an improved popular file prediction method based on vehicle-mounted edge computing in a cache mechanism. Background Art

[0002] Through the communication between vehicle to roadside unit (V2R), vehicle to vehicle (V2V) and vehicle to macro base station (V2M) (Vehicle to MBS), the Internet of Vehicles has achieved extensive interconnection. With the needs of vehicle users and society, Internet of Vehicles applications such as traffic safety warnings, traffic management, autonomous driving and vehicle Internet access have been rapidly promoted, attracting great attention from researchers.

[0003] With the development of the Internet of Vehicles and cloud computing, the amount of data in the above-mentioned Internet of Vehicles applications has grown rapidly. However, the Internet of Vehicles is at the edge of the network. If it relies solely on the traditional centralized service network, all user content requests need to be sent to the cloud, which will bring a large task load to the cloud server, leading to network congestion and long transmission delays, thereby affecting the user's communication experience and reducing the operating efficiency of the Internet of Vehicles. Therefore, researchers have proposed vehicle edge computing (VEC) technology, which deploys computing or storage devices on network edge devices (vehicle terminals or roadside units, etc.), reducing the round-trip overhead of request content on the backbone line, and has the advantages of reducing power consumption, saving bandwidth, and reducing system delays. Therefore, vehicle edge computing can better cope with the complex and changeable vehicle environment.

[0004] In order to speed up file transfer and reduce the load on cloud servers, VEC caching technology came into being. Caching technology can effectively reduce the calculation and transmission of repeated content in the Internet of Vehicles by caching some data in edge nodes (base stations, RSUs or vehicle nodes, etc.), thereby shortening latency and reducing network load.

[0005] However, RSU nodes usually have limited storage capacity and cannot cache all the content required by various vehicles. Due to the limitation of cache space, RSU can only selectively save certain files, so popular file prediction has practical significance in VEC research. The traditional reflective caching mechanism is based on user request records, so files will only be cached in RSU nodes after being requested by vehicle users. However, due to the high-speed movement of vehicles, cached files may become outdated quickly based on the file records that vehicle users have requested, so the reflective caching mechanism cannot meet the current needs of the Internet of Vehicles. The active caching mechanism based on machine learning can predict the popularity of files based on user preferences, and cache popular files in advance based on the prediction results. In the Internet of Vehicles scenario, user data involves privacy, and users are usually reluctant to share data directly. Therefore, the researchers introduced federated learning to predict popular files and improve the performance of RSU in responding to vehicle file requests while protecting user privacy.

[0006] Existing researchers have proposed a popular file prediction scheme based on asynchronous federation "Mobility-Aware Cooperative Caching in Vehicular Edge Computing Based on AsynchronousFederated and Deep Reinforcement Learning.2023". Vehicles do not need to upload specific request information, but upload local models to RSU. RSU aggregates the collected vehicle local models into a global model to predict popular documents. However, the above research also has the following problems. First, during the model aggregation process of federated learning, the learning rate gradually increases with the training rounds, affecting the accuracy of the global model. Second, there are some vehicles with small local model gradient changes during the training process, which have limited impact on the performance of the federated learning algorithm, resulting in unnecessary computational overhead for local RSUs. Third, popular content prediction only considers the file preferences of active vehicles and neighboring vehicles, ignoring the V2V communication delay caused by the vehicle distance, resulting in vehicles predicting popular files based on outdated data.

[0007] How to solve the above technical problems is the subject faced by the present invention. Summary of the invention

[0008] The purpose of the present invention is to solve the technical problems of unreasonable learning rate changes, high vehicle training overhead and neglect of vehicle-to-vehicle (V2V) communication delay in existing solutions for file requests from mobile vehicles, and to implement an improved popular file prediction method based on vehicle-mounted edge computing in the Internet of Vehicles, so as to achieve the goal of improving cache hit rate and reducing file transfer delay.

[0009] The inventive idea of ​​the present invention is: the present invention proposes an improved popular file prediction method based on vehicle-mounted edge computing. The present invention designs adaptive changes in the learning rate of federated learning, screens training vehicles participating in federated learning, and additionally considers V2V communication delays, and proposes an improved popular file prediction method based on vehicle-mounted edge computing, based on which RSU randomly caches files.

[0010] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is specifically: an improved popular file prediction method based on vehicle-mounted edge computing, comprising the following steps:

[0011] S1: In each round, each vehicle obtains data from the test set to build an initial matrix of document scores;

[0012] S2: Each vehicle participates in training the Auto Encoder model, and then reconstructs the file score matrix to obtain the file score correction matrix of each vehicle;

[0013] S3: Vehicle clustering: First, determine the cluster head vehicle node, then the cluster head vehicle selects the vehicles in the cluster according to the similarity, collects the file score matrix of all vehicles in the cluster, calculates the file score table of all vehicles in this cluster again and uploads it to the RSU;

[0014] S4: After RSU summarizes the score tables of each cluster, it accumulates and obtains the total file score table;

[0015] S5: RSU selects F from the total file score table in descending order c The top-scoring files are selected as popular files, from which files are randomly cached in preparation for responding to file requests from vehicles.

[0016] S1 specifically includes the following steps:

[0017] In the rth round, first vehicle V i r Extract some data from the test set, obtain the vehicle's rating table for different files, and construct the rating table as vehicle V i r The initial matrix of document scores The rows of this matrix represent vehicle IDs and the columns represent file numbers. Each element in is the rating value of a vehicle user for a certain file. If an element is 0, it means that the vehicle is not interested in this file or has never requested it.

[0018] S2 specifically includes the following steps:

[0019] S201. Select the vehicle to participate in the training:

[0020] Define the coverage area size of RSU as D RSU , V ir represents the i-th vehicle in the r-th round, where r = {1, 2, ..., R}, i = {1, 2, ..., n r}. Assume that each vehicle sends its mobile feature information (including initial position and speed) to the RSU at the beginning of each round. Then the vehicle V i r The residence time at RSU can be written as

[0021]

[0022] Among them, D RSU is the RSU coverage, is the vehicle V i r Distance travelled within the local RSU range, is the vehicle V i r speed.

[0023] S202, download, train and upload local model:

[0024] The RSU uses AE to initialize its own global model and transmits the initialized global model to all selected vehicles within the communication range of the RSU.

[0025] In the rth round, the selected vehicle first downloads the global model θ updated in the r-1th round from the RSU r-1 , and set the downloaded global model as the initial local model. Then the vehicle performs K iterations of training locally. Specifically, in the kth iteration of the rth round, k=1,2,…,K, and the vehicle V r i,k Randomly sample some training data d from the local training set r i,k , which is converted into the initial matrix of document scores Each data item x is input into AE. AE contains Encoder and Decoder. Encoder maps the original data x to the hidden layer, obtains the hidden features of the data, and uses it as the input of Decoder to obtain the reconstructed data x'. Definition For vehicle V r i,k The local model of the kth iteration in the rth round uses the mean squared error (MSE) method. According to relevant research, the data x in the local model The loss function under this condition can be written as

[0026] M(θ i,k r ,x,x')=(x'-x) 2 (2)

[0027] When r i,k After the loss functions of all data items in are calculated, the vehicle V i,k r In local model The total loss function for the next k-th iteration can be written as

[0028]

[0029] where |d r i,k | indicates vehicle V i,k r The size of the training set to use at the kth iteration.

[0030] In order to reduce the error between the local model and the global model and speed up the convergence of the local model, it is necessary to further calculate the regularized loss function, which can be written as

[0031]

[0032] where ξ is the regularization coefficient.

[0033] The loss function after regularization is obtained After that, define For local models The k-th iteration local gradient is used to aggregate the local model with the global model. However, in round r-1, some vehicles may not be able to successfully upload the updated local model due to the long model training time. These vehicles are defined as delayed vehicles. If the local model of the delayed vehicle in round r-1 is uploaded at the same time as the local model of the normal vehicle in round r, it will affect the accuracy and convergence of the global model. Therefore, in order to reduce the negative impact of the above-mentioned delayed vehicles on the local gradient calculation, the delayed local gradient and attenuation coefficient are introduced. In the k-th iteration of the r-th round, the vehicle V i,k r The local gradient formula can be written as

[0034]

[0035] Where β is the attenuation coefficient, For vehicle V i,k r The r-1 round delayed local gradient. If in the r-1 round, the vehicle V i r If the local model is uploaded successfully,

[0036] In order to avoid too high learning rate in the later stage of training, the present invention introduces the weighted average sum of all model gradients in the first k-1 iterations to ensure that the algorithm adaptively adjusts the learning rate in the kth iteration. Its expression can be written as

[0037]

[0038] Where п is the attenuation rate, usually 0.9. θ r is the global model of the rth round, θ i,k+1 r is the local model of the vehicle at the kth iteration of the rth round.

[0039] The learning rate is then adaptively changed according to the weighted average of the round gradients. i,k r The calculation formula for updating the local model parameters can be written as

[0040]

[0041] Among them, ε is a very small number that ensures that the denominator is not zero, η 0 is the initial learning rate.

[0042] The selected vehicle will have its local model updated Upload to the local RSU, so far the vehicle V i r Completed the rth round of local training.

[0043] S203, screening vehicles:

[0044] In the existing asynchronous federated learning framework, once the vehicle is selected, the RSU will not adjust the vehicle. However, during the local training process, the local model gradient of some vehicles changes little, which has limited help in optimizing the global model. Their continued participation in training will add unnecessary computing overhead to the RSU, thereby affecting the training efficiency. Therefore, the present invention designs a "vehicle screening" step, first defining For vehicle V i,k r The gradient difference before and after the rth local training can be expressed as

[0045]

[0046] Where K is the maximum number of iterations.

[0047] Secondly, the local model gradient change values ​​of the vehicles are arranged in descending order, and the first Ω vehicles are selected to participate in the r+1 round of training. Thirdly, the model over-learns the local model with large gradient changes, which may lead to the risk of model overfitting. Diversified training samples help the global model update to be more stable, so consider randomly selecting j vehicles from the screened vehicles to continue to participate in the r+1 round of training, where j is a positive integer between [1,Ω / 3].

[0048] S204, RSU calculates the global model and returns all vehicles:

[0049] In round r, the selected vehicle completes the local model After uploading, RSU considers adding weights to the local model based on the amount of training set data, vehicle location, and content transmission delay. Update the global model θ r , the formula can be written as

[0050]

[0051] Among them, d r i is the vehicle V i r The amount of test set data, d r is the total amount of data in all vehicle training sets. r i Is a local model Weight of asynchronous aggregation.

[0052] Considering the location of the vehicle within the RSU communication range and the file transfer rate, the weight L r i The formula can be written as

[0053]

[0054] Among them, χ 1 and χ 2 are the coefficients of location weight and file transfer rate weight respectively, and χ 1 +χ 2 =1.

[0055] The local RSU aggregates all local models to obtain the updated AE global model θ r+1 , and send the updated global model back to the vehicle. Based on this, each vehicle reconstructs the initial file score matrix to obtain the file score correction matrix Q i r ', then extract vehicle user information from the test set data and construct the user information matrix The columns of the matrix represent the IDs of vehicle users, and the rows represent the personal information of vehicle users (such as gender, age, occupation, etc.).

[0056] S3 specifically includes the following steps:

[0057] S301. Constructing a composite matrix

[0058] Specifically, each vehicle modifies the file score matrix Q i r 'With user information matrix The full connection is a composite matrix O i r The matrix rows represent vehicle IDs, and the columns represent vehicle user information (including gender, age, occupation, and preference scores for files, etc.). Therefore, the composite matrix O i r The vehicle user information and file rating information are associated.

[0059] S302: Select cluster head node

[0060] Calculate the composite matrix O for each vehicle i r The number of non-zero elements in the file score column is sorted in descending order according to the number of non-zero scores, and the first m% (m is a positive integer from 1 to 100) of vehicles are selected and marked as cluster head vehicles.

[0061] S303: Selecting a vehicle in the cluster

[0062] In order to further determine the cluster-head vehicle-related vehicles within the cluster, similarity is considered as the basis for selecting the cluster-head vehicle and the vehicles within the cluster. Existing studies only consider the cosine similarity of the composite matrix between vehicles, and do not consider the transmission delay caused by the distance between vehicles (Vehicle to Vehicle, V2V). The Internet of Vehicles belongs to a high-speed mobile scenario. Ignoring the V2V delay factor will lead to frequent interruption and retransmission of the communication link, affecting the performance of the algorithm. Therefore, the present invention introduces the transmission delay factor between vehicles, and the similarity formula between vehicle a and vehicle b can be written as

[0063]

[0064] in and are the row vectors of the composite matrices of vehicles a and b, respectively. and is the Euclidean norm of the corresponding vector, is the vehicle V a With V b The Euclidean distance between a,b is the vehicle V a With V b The transfer rate between.

[0065] According to the similarity between vehicles, each cluster head vehicle selects l related vehicles in the cluster.

[0066] S304: Calculate and upload vehicle scores within the cluster

[0067] After the cluster head vehicle determines the l vehicles in the cluster to which it belongs, it first extracts the composite matrix O of all vehicles in the cluster. i r , then locally add up the elements of the file score columns of the l+1 composite matrices to calculate the score table of all files in this cluster. Thirdly, all cluster head vehicles upload the file score table to the RSU.

[0068] S4 specifically includes the following steps:

[0069] After RSU summarizes the score tables of each cluster, it accumulates and obtains the total file score table;

[0070] S5 specifically includes the following steps:

[0071] RSU selects F from the total file score table in descending order c The top-scoring files are selected as popular files, from which files are randomly cached in preparation for responding to file requests from vehicles.

[0072] Compared with the prior art, the present invention has the following beneficial effects:

[0073] (1) The learning rate of the federated learning of the present invention changes adaptively to improve training efficiency and accuracy. The learning rate of existing federated learning increases monotonically with the increase of training rounds, and the learning rate will affect the update speed of model parameters. Therefore, if the learning rate is too high in the later stage of training, the gradient value will be too large, resulting in too fast update of model parameters, and ultimately the accuracy of the global model will be lower than expected. Therefore, the present invention designs a learning rate adjustment algorithm based on weighted average and adaptive change to improve the training efficiency and accuracy of the global model, thereby ensuring the cache response performance of high-speed moving vehicles.

[0074] (2) The present invention screens the training vehicles participating in federated learning to reduce computational overhead. During the training process, the model gradient changes of some vehicles are small. Their participation in local model training and global model aggregation has limited improvement in the accuracy of popular file prediction, but will increase unnecessary computational overhead. Therefore, after each round of training, the present invention screens out several vehicles with small gradient changes, reducing the vehicle local model parameters that the local RSU needs to calculate, thereby reducing the computational overhead of federated learning and improving the efficiency of the algorithm.

[0075] (3) The present invention takes into account V2V transmission delay. Popular file prediction requires reasonable clustering of vehicles. Existing studies only consider the file preferences of vehicle users when dividing vehicles, but ignore the transmission delay of V2V communication. Due to the high-speed mobility of vehicles, the quality of vehicle-to-vehicle communication links varies dynamically, and delayed data will cause inaccurate prediction of popular files. To address this problem, the present invention designs a weighted sum of file preference factors and transmission delay factors to assist the cluster head vehicle in selecting a suitable cluster, thereby reducing communication delays and improving cache hit rates. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0077] Figure 1 Schematic diagram of the overall process of the improved popular file prediction solution designed for the present invention.

[0078] Figure 2 This is a schematic diagram of the AE model training process in step S2 provided by the present invention.

[0079] Figure 3 The figure is a schematic diagram showing the comparison results of cache hit rate between the present invention and the existing solution at different cache capacities.

[0080] Figure 4 This is a schematic diagram of the comparison results of file transmission delays between the present invention and the existing solutions at different cache capacities. DETAILED DESCRIPTION

[0081] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0082] Example 1

[0083] See also Figures 1 to 4 , the technical solution provided by this embodiment is: an improved popular file prediction method based on vehicle-mounted edge computing, comprising the following steps:

[0084] S1 specifically includes the following steps:

[0085] In the rth round, first vehicle V i r Extract some data from the test set, obtain the vehicle's rating table for different files, and construct the rating table as vehicle V i r The initial matrix of document scores The rows of this matrix represent vehicle IDs and the columns represent file numbers. Each element in is the rating value of a vehicle user for a certain file. If an element is 0, it means that the vehicle is not interested in this file or has never requested it.

[0086] S2 specifically includes the following steps:

[0087] S201. Select the vehicle to participate in the training:

[0088] Define the coverage area size of RSU as D RSU , V i r represents the i-th vehicle in the r-th round, where r = {1, 2, ..., R}, i = {1, 2, ..., n r}. Assume that each vehicle sends its mobile feature information (including initial position and speed) to the RSU at the beginning of each round. Then the vehicle V i r The residence time at RSU can be written as

[0089]

[0090] Among them, D RSU is the RSU coverage, is the vehicle V i r Distance travelled within the local RSU range, is the vehicle V i r speed.

[0091] S202, download, train and upload local model:

[0092] The RSU uses AE to initialize its own global model and transmits the initialized global model to all selected vehicles within the communication range of the RSU.

[0093] In the rth round, the selected vehicle first downloads the global model θ updated in the r-1th round from the RSU r-1 , and set the downloaded global model as the initial local model. Then the vehicle performs K iterations of training locally. Specifically, in the kth iteration of the rth round (k=1,2,…,K, vehicle V r i,k Randomly sample some training data d from the local training set r i,k , which is converted into the initial matrix of document scores Each data item x is input into AE; AE contains Encoder and Decoder. Encoder then maps the original data x to the hidden layer, obtains the hidden features of the data, and uses it as the input of Decoder to obtain the reconstructed data x'. Definition For vehicle V ri,k The local model of the kth iteration in the rth round uses the mean squared error (MSE) method. According to relevant research, the data x in the local model The loss function under this condition can be written as

[0094] M(θ i,k r ,x,x')=(x'-x) 2 (2)

[0095] When r i,k After the loss functions of all data items in are calculated, the vehicle V i,k r In local model The total loss function for the next k-th iteration can be written as

[0096]

[0097] where |d r i,k | indicates vehicle V i,k r The size of the training set to use at the kth iteration.

[0098] In order to reduce the error between the local model and the global model and speed up the convergence of the local model, it is necessary to further calculate the regularized loss function, which can be written as

[0099]

[0100] where ξ is the regularization coefficient.

[0101] The loss function after regularization is obtained After that, define For local models The k-th iteration local gradient is used to aggregate the local model with the global model. However, in round r-1, some vehicles may not be able to successfully upload the updated local model due to the long model training time. These vehicles are defined as delayed vehicles. If the local model of the delayed vehicle in round r-1 is uploaded at the same time as the local model of the normal vehicle in round r, it will affect the accuracy and convergence of the global model. Therefore, in order to reduce the negative impact of the above-mentioned delayed vehicles on the local gradient calculation, the delayed local gradient and attenuation coefficient are introduced. In the k-th iteration of the r-th round, the vehicle V i,k r The local gradient formula can be written as

[0102]

[0103] Where β is the attenuation coefficient, For vehicle V i,k r The r-1 round delayed local gradient. If in the r-1 round, the vehicle V i r If the local model is uploaded successfully,

[0104] In order to avoid too high learning rate in the later stage of training, the present invention introduces the weighted average sum of all model gradients in the first k-1 iterations to ensure that the algorithm adaptively adjusts the learning rate in the kth iteration. Its expression can be written as

[0105]

[0106] Where п is the attenuation rate, usually 0.9. θ r is the global model of the rth round, θ i,k+1 r is the local model of the vehicle at the kth iteration of the rth round.

[0107] The learning rate is then adaptively changed according to the weighted average of the round gradients. i,k r The calculation formula for updating the local model parameters can be written as

[0108]

[0109] Among them, ε is a very small number that ensures that the denominator is not zero, η 0 is the initial learning rate.

[0110] The selected vehicle will have its local model updated Upload to the local RSU, so far the vehicle V i r Completed the rth round of local training.

[0111] S203, screening vehicles:

[0112] In the existing asynchronous federated learning framework, once the vehicle is selected, the RSU will not adjust the vehicle. However, during the local training process, the local model gradient of some vehicles changes little, which has limited help in optimizing the global model. Their continued participation in training will add unnecessary computing overhead to the RSU, thereby affecting the training efficiency. Therefore, the present invention designs a "vehicle screening" step, first defining For vehicle V i,k r The gradient difference before and after the rth local training can be expressed as

[0113]

[0114] Where K is the maximum number of iterations.

[0115] Secondly, the local model gradient change values ​​of the vehicles are arranged in descending order, and the first Ω vehicles are selected to participate in the r+1 round of training. Thirdly, the model over-learns the local model with large gradient changes, which may lead to the risk of model overfitting. Diversified training samples help the global model update to be more stable, so consider randomly selecting j vehicles from the screened vehicles to continue to participate in the r+1 round of training, where j is a positive integer between [1,Ω / 3].

[0116] S204, RSU calculates the global model and returns all vehicles:

[0117] In round r, the selected vehicle completes the local model After uploading, RSU considers adding weights to the local model based on the amount of training set data, vehicle location, and content transmission delay. Update the global model θ r , the formula can be written as

[0118]

[0119] Among them, d r i is the vehicle V i r The amount of test set data, d r is the total amount of data in all vehicle training sets. r i Is a local model Weight of asynchronous aggregation.

[0120] Considering the location of the vehicle within the RSU communication range and the file transfer rate, the weight L r i The formula can be written as

[0121]

[0122] Among them, χ 1 and χ 2 are the coefficients of location weight and file transfer rate weight respectively, and χ 1 +χ 2 =1.

[0123] The local RSU aggregates all local models to obtain the updated AE global model θ r+1 , and send the updated global model back to the vehicle. Based on this, each vehicle reconstructs the initial file score matrix to obtain the file score correction matrix Q i r ', then extract vehicle user information from the test set data and construct the user information matrix The columns of the matrix represent the IDs of vehicle users, and the rows represent the personal information of vehicle users (such as gender, age, occupation, etc.).

[0124] S3 specifically includes the following steps:

[0125] S301. Constructing a composite matrix

[0126] Specifically, each vehicle modifies the file score matrix Q i r 'With user information matrix The full connection is a composite matrix O i r The matrix rows represent vehicle IDs, and the columns represent vehicle user information (including gender, age, occupation, and preference scores for files, etc.). Therefore, the composite matrix O i r The vehicle user information and file rating information are associated.

[0127] S302: Select cluster head node

[0128] Calculate the composite matrix O for each vehicle i r The number of non-zero elements in the file score column is sorted in descending order according to the number of non-zero scores, and the first m% (m is a positive integer from 1 to 100) of vehicles are selected and marked as cluster head vehicles.

[0129] S303: Selecting a vehicle in the cluster

[0130] In order to further determine the cluster-head vehicle-related vehicles within the cluster, similarity is considered as the basis for selecting the cluster-head vehicle and the vehicles within the cluster. Existing studies only consider the cosine similarity of the composite matrix between vehicles, and do not consider the transmission delay caused by the distance between vehicles (Vehicle to Vehicle, V2V). The Internet of Vehicles belongs to a high-speed mobile scenario. Ignoring the V2V delay factor will lead to frequent interruption and retransmission of the communication link, affecting the performance of the algorithm. Therefore, the present invention introduces the transmission delay factor between vehicles, and the similarity formula between vehicle a and vehicle b can be written as

[0131]

[0132] in and are the row vectors of the composite matrices of vehicles a and b, respectively. and is the Euclidean norm of the corresponding vector, is the vehicle V a With V b The Euclidean distance betweena,b is the vehicle V a With V b The transfer rate between.

[0133] According to the similarity between vehicles, each cluster head vehicle selects l related vehicles in the cluster.

[0134] S304: Calculate and upload vehicle scores within the cluster

[0135] After the cluster head vehicle determines the l vehicles in the cluster to which it belongs, it first extracts the composite matrix O of all vehicles in the cluster. i r , then locally add up the elements of the file score columns of the l+1 composite matrices to calculate the score table of all files in this cluster. Thirdly, all cluster head vehicles upload the file score table to the RSU.

[0136] S4 specifically includes the following steps:

[0137] After RSU summarizes the score tables of each cluster, it accumulates and obtains the total file score table;

[0138] S5 specifically includes the following steps:

[0139] RSU selects F from the total file score table in descending order c The top-scoring files are selected as popular files, from which files are randomly cached in preparation for responding to file requests from vehicles.

[0140] Example 2

[0141] Simulation scenario and parameter settings

[0142] This embodiment is aimed at the Internet of Vehicles environment of urban roads. The experiment uses python3.8 as a simulation tool to compare and simulate the improved popular file prediction scheme of this embodiment with the existing prediction scheme based on asynchronous federated learning.

[0143] Improved popular file prediction scheme: Considering the V2V communication delay, the learning rate adaptive adjustment and vehicle screening algorithm are designed, and the popular file prediction algorithm based on asynchronous federated learning is improved. The RSU then randomly caches files according to the popularity of the predicted files.

[0144] Prediction solution based on asynchronous federated learning: Based on the asynchronous federated learning algorithm, popular content is predicted, and RSU randomly caches files according to the popularity of the predicted files.

[0145] Considering the existence of three communication modes of V2V, V2R and V2M in the experimental scenario, the vehicle network communication adopts the third generation communication protocol (3rd Generation Partnership Project, 3GPP) cellular V2X (C-V2X) architecture. The specific experimental parameter settings are shown in Table 1. The MovieLens LM dataset is randomly assigned to each vehicle and used as the local data of the vehicle. The vehicle randomly selects 90% of the data from the local data as the training set and 10% of the data as the test set. For each round, each vehicle randomly extracts several files from the test set as its requested files.

[0146] Table 1 Experimental parameter values

[0147]

[0148] Performance Indicators

[0149] In order to compare the advantages and disadvantages of the two solutions, this embodiment adopts two indicators: cache hit rate and total file transfer delay. The cache hit rate formula is defined as

[0150]

[0151] Among them, chr r is the number of cache hits in round r, is the number of file requests for all vehicles in round r.

[0152] The file transfer delay is defined as the average delay for all vehicles to obtain files, and its calculation formula is:

[0153]

[0154] Where delay total It is the total delay for all vehicles to obtain the content, which can be obtained by summing the transmission delay of each vehicle to obtain the file.

[0155] Figure 3 The comparison of cache hit rates of two schemes (improved popular file prediction scheme and prediction scheme based on asynchronous federated learning) under different cache capacities of RSU is shown. As can be seen from the figure, with the increase of cache capacity, the cache hit rate of both schemes gradually increases. This is because the increase in cache capacity allows RSU to cache more popular files, and it is easier for vehicle users to obtain requested files from RSU. It should be emphasized that the adaptive change of learning rate makes the prediction of the trained model more accurate, and the cache hit rate of the improved scheme is higher than that of the prediction scheme based on asynchronous federated learning.

[0156] Figure 4The comparison of file transfer delays of the two schemes under different RSU cache capacities is shown. As the cache capacity increases, the transmission delay of the two schemes gradually decreases. This shows that as the accuracy of popular file prediction increases, vehicle users are more likely to obtain requested files from the RSU, reducing the need for vehicle-to-macro base station (MBS) communication, thereby reducing transmission delays. The transmission delay of the improved scheme is also significantly lower than the prediction scheme of asynchronous federated learning. On the one hand, this is because the cache hit rate of the improved algorithm is higher, further reducing the opportunities for V2R and V2M communication. On the other hand, the improved scheme screens out a portion of vehicles with low training value during training, reduces the computational overhead of federated learning, and speeds up file response speed. The above experimental results show that the scheme of this embodiment has advantages in improving cache hit rate and reducing content transmission delay.

[0157] Comprehensive analysis shows that Figure 3 and Figure 4 It can be seen that compared with the prediction scheme based on asynchronous federated learning, this scheme significantly improves the cache hit rate and reduces the file transfer delay, providing a better solution for improving the file request performance of the Internet of Vehicles.

[0158] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An improved popular file prediction method based on vehicle-mounted edge computing, characterized in that: The following steps are involved: S1: In each round, each vehicle obtains data from the test set to build an initial matrix of document scores; S2: Each vehicle participates in training the Auto Encoder model, and then reconstructs the file score matrix to obtain the file score correction matrix of each vehicle; S3: Vehicle clustering: First, the cluster head vehicle node is determined. Then, the cluster head vehicle selects the vehicles in the cluster according to the similarity and collects the file score matrix of all vehicles in the cluster. Then, the file score table of all vehicles in the cluster is calculated and uploaded to the roadside unit RSU. S4: After RSU summarizes the score tables of each cluster, it accumulates and obtains the total file score table; S5: RSU selects F from the total file score table in descending order c The top-scoring files are selected as popular files, from which files are randomly cached in preparation for responding to file requests from vehicles.

2. According to claim 1, an improved popular file prediction method based on vehicle-mounted edge computing is characterized in that: The step S1 is specifically as follows: In the rth round, first vehicle V i r Extract some data from the test set, obtain the vehicle's rating table for different files, and construct the rating table as vehicle V i r The document scoring initial matrix Q i r , the rows of the matrix represent vehicle IDs, the columns represent file numbers, and the matrix Q i r Each element in is the rating value of a vehicle user for a certain file. If an element is 0, it means that the vehicle is not interested in this file or has never requested it.

3. The improved popular file prediction method based on vehicle-mounted edge computing according to claim 2 is characterized in that: The step S2 comprises the following steps: S201. Select the vehicle to participate in the training: Define the coverage area size of RSU as D RSU , V i r represents the i-th vehicle in the r-th round, where r = {1, 2, ..., R}, i = {1, 2, ..., n r }, assuming that each vehicle sends mobile feature information to the RSU at the beginning of each round, including initial position and speed, then the vehicle V i r The duration of stay in RSU is: Among them, D RSU is the RSU coverage, D i r is the vehicle V i r Distance travelled within the local RSU range, U i r is the vehicle V i r speed; S202, download, train and upload local model: The RSU uses AE to initialize its own global model and transmits the initialized global model to all selected vehicles within the communication range of the RSU; In the rth round, the selected vehicle first downloads the global model θ updated in the r-1th round from the RSU r-1 , and set the downloaded global model as the initial local model. Then the vehicle performs K iterations of training locally. In the kth iteration of the rth round, k=1,2,…,K, vehicle V r i,k Randomly sample some training data d from the local training set r i,k , which is converted into the initial document scoring matrix Q i r , each data item x is input into AE, AE contains Encoder and Decoder, Encoder then maps the original data x to the hidden layer, obtains the hidden features of the data, and uses it as the input of Decoder to obtain the reconstructed data x', define θ i,k r For vehicle V r i,k In the local model of the kth iteration in the rth round, using the mean square error method, the data x is in the local model θ i,k r The loss function is written as: M(θ i,k r , x,x')=(x'-x) 2 (2) When r i,k After the loss functions of all data items in are calculated, the vehicle V i,k r In the local model θ i,k r The total loss function for the next k-th iteration is written as: where |d r i,k | indicates vehicle V i,k r Use the size of the training set in the kth iteration; In order to reduce the error between the local model and the global model and speed up the convergence of the local model, the regularized loss function is further calculated, and its formula is written as: Where ξ is the regularization coefficient; The regularized loss function g(θ i,k r ) and then define is the local model θ i,k r The k-th iteration local gradient is used for the aggregation of the local model and the global model. However, in round r-1, some vehicles cannot successfully upload the updated local model due to the long model training time. The above vehicles are defined as delayed vehicles. If the local model trained by the delayed vehicle in round r-1 is uploaded at the same time as the local model of the normal vehicle in round r, it will affect the accuracy and convergence of the global model. The delayed local gradient and attenuation coefficient are introduced. In the k-th iteration of round r, the vehicle V i,k r The local gradient formula is written as: Where β is the attenuation coefficient, For vehicle V i,k r The r-1 round delayed local gradient, if in the r-1 round the vehicle V i r If the local model is uploaded successfully, In order to avoid too high learning rate in the later stage of training, the weighted average sum of all model gradients in the first k iterations is introduced to ensure that the algorithm adaptively adjusts the learning rate in the k+1th iteration. The expression is written as: Where п is the decay rate, θ r is the global model of the rth round, θ i,k+1 r is the local model of the vehicle at the k+1th iteration of the rth round; The learning rate is adaptively changed according to the weighted average of the round gradients. At this time, the vehicle V i,k r The local model parameter update calculation formula is written as: Among them, ε is a very small number that ensures that the denominator is not zero, and η0 is the initial learning rate; The selected vehicle will update the local model θ i r Upload to the local RSU, so far the vehicle V i r Completed the rth round of local training; S203, screening vehicles: In the existing asynchronous federated learning framework, once the vehicle is selected, the RSU will not adjust the above vehicle. However, during the local training process, the local model gradient of some vehicles changes little, which has limited help in optimizing the global model. Their continued participation in training will increase unnecessary computing overhead for the RSU, thus affecting the training efficiency. We design a "vehicle screening" step. First, we define gd i r For vehicle V i,k r The gradient change before and after the rth local training is expressed as: Where K is the maximum number of iterations; Secondly, the local model gradient change values ​​of the vehicles are sorted in descending order, and the first Ω vehicles are selected to participate in the r+1 round of training. Thirdly, the model over-learns the local model with large gradient changes. Consider randomly selecting j vehicles from the screened vehicles to continue to participate in the r+1 round of training, where j is a positive integer between [1, Ω / 3]; S204, RSU calculates the global model and returns all vehicles: In the rth round, when the selected vehicle completes the local model θ i r After uploading, RSU considers adding weights to the local model according to the amount of training set data, vehicle location, and content transmission delay. i r Update the global model θ r , the formula is written as: Among them, d r i is the vehicle V i r The amount of test set data, d r is the total amount of data in all vehicle training sets, L r i is the local model θ i r The weight of asynchronous aggregation; Considering the location of the vehicle within the RSU communication range and the file transfer rate, the weight L r i The formula is written as: Among them, χ1 and χ2 are the coefficients of the position weight and the file transfer rate weight respectively, and χ1+χ2=1, TR r RSU,i For vehicle V i r Communication rate with RSU; The local RSU aggregates all local models to obtain the updated AE global model θ r+1 , and send the updated global model back to the vehicles, based on which each vehicle reconstructs the initial file score matrix to obtain the file score correction matrix Q i r' , and then extract vehicle user information from the test set data to construct the user information matrix P i r , the columns of the matrix represent the vehicle user’s ID, and the rows represent the vehicle user’s personal information.

4. The improved popular file prediction method based on vehicle-mounted edge computing according to claim 3 is characterized in that: The step S3 comprises the following steps: S301. Constructing a composite matrix Each vehicle will modify the file score matrix Q i r' and user information matrix P i r The full connection is a composite matrix O i r , the matrix rows represent vehicle IDs, and the columns represent vehicle user information, including gender, age, occupation, and preference scores for files. The composite matrix O i r The vehicle user information and file rating information are associated; S302: Select cluster head node Calculate the composite matrix O for each vehicle i r The number of non-zero elements in the file score column, in descending order of the number of non-zero scores, select the first m% of vehicles, where m is a positive integer from 1 to 100, and mark them as cluster head vehicles; S303: Selecting a vehicle in the cluster In order to further determine the cluster head vehicle related to the cluster head vehicle, the similarity is considered as the basis for selecting the cluster head vehicle and the cluster vehicles. The transmission delay factor between vehicles is introduced. The similarity formula between vehicle a and vehicle b is written as: Among them, i r (a,:) and O i r (b,:) are the row vectors of the composite matrices of vehicles a and b, respectively. i r (a,:)||2 and ||O i r (b,:)||2 is the Euclidean norm of the corresponding vector, dis(RSU,V i r ) is the vehicle V a With V b The Euclidean distance between a,b is the vehicle V a With V b The transfer rate between According to the similarity between vehicles, each cluster head vehicle selects l related cluster vehicles; S304: Calculate and upload vehicle scores within the cluster After the cluster head vehicle determines the l vehicles in the cluster to which it belongs, it first extracts the composite matrix O of all vehicles in the cluster. i r , then locally accumulate the elements of the file score columns of the l+1 composite matrices to calculate the score table of all files in this cluster, and then, all cluster head vehicles upload the file score table to the RSU.

5. The improved popular file prediction method based on vehicle-mounted edge computing according to claim 4 is characterized in that: The step S4 is specifically as follows: After RSU summarizes the score tables of each cluster, it accumulates and obtains the total file score table.

6. The improved popular file prediction method based on vehicle-mounted edge computing according to claim 5 is characterized in that: The step S5 is specifically as follows: RSU selects F from the total file score table in descending order c The top-scoring files are selected as popular files, from which files are randomly cached in preparation for responding to file requests from vehicles.