Internet of vehicles secure unloading and caching optimization method based on graph neural network
By using a graph neural network-based method for vehicle-to-everything (V2X) security offloading and caching optimization, this method addresses the issues of task and cache separation and insufficient capture of spatiotemporal correlation in V2X, achieving privacy and security, low total system latency, and high cache hit rate in V2X.
Patent Information
- Application Number
- CN202511639632.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-11-11
AI Technical Summary
In the Internet of Vehicles (IoV), the disconnect between task and cache processing and the lack of spatiotemporal correlation capture lead to low resource utilization and insufficient task execution efficiency.
The method for optimizing task offloading and caching in vehicle-to-everything (V2X) security based on graph neural networks constructs a system model of vehicles, roadside units, and macro base stations, and combines differential privacy protection, asynchronous federated learning, and graph neural networks to achieve collaborative optimization of task offloading and caching.
It improves the privacy and security of vehicle-to-everything (V2X) communication, reduces the total system latency, increases cache hit rate and resource utilization, and adapts to dynamic topologies and complex task requirements.
Smart Images

Figure CN121099376A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent transportation and edge computing technology, specifically to a method for optimizing vehicle network security offloading and caching based on graph neural networks. Background Technology
[0002] In the context of connected vehicles, the effective utilization of resources faces significant challenges, with the core difficulties stemming from two main aspects: First, the network topology of connected vehicles is dynamic, and the location and connection relationships of network nodes (such as vehicles, roadside units, etc.) continuously change as vehicles move; Second, various tasks in connected vehicles have complex dependencies, and the task execution logic is interconnected, further increasing the difficulty of resource scheduling.
[0003] Current methods for utilizing vehicle-to-everything (V2X) resources have significant limitations, specifically: The task and cache processing are separated: Existing methods generally treat "task unloading" and "content caching" as two independent modules, without forming a collaborative mechanism. This results in the task results generated after task unloading not being able to be reused in time—when the same or related task requests occur later, the generated task results cannot be directly called, and the task must be re-executed, resulting in redundant consumption of computing resources and time.
[0004] Insufficient capture of spatiotemporal correlations: Significant spatiotemporal correlations exist between network nodes (vehicles, roadside units, base stations, etc.) (such as the aggregation of vehicles on fixed road segments within a specific time period, and the dynamic connection patterns between roadside units and surrounding vehicles). These correlations are crucial for making accurate offloading decisions (such as "whether to offload" and "to which node to offload") and caching decisions (such as "what content to cache" and "how to allocate cache space") in dynamic vehicular networks. However, existing methods struggle to effectively capture these spatiotemporal correlations, ultimately leading to resource scheduling decisions deviating from the optimal state and resulting in suboptimal overall system performance.
[0005] The aforementioned problems result in low resource utilization and insufficient task execution efficiency in the Internet of Vehicles (IoV). There is an urgent need for an optimization solution that can integrate task offloading and result caching and accurately adapt to dynamic network characteristics in order to improve system performance and ensure data security and service efficiency. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method for optimizing vehicle network security offloading and caching based on graph neural networks, aiming to solve the problems mentioned in the background technology.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for optimizing vehicle network security offloading and caching based on graph neural networks, characterized by comprising the following steps: Step S1: Construct a vehicle-to-everything (V2X) system model; the system model includes a system architecture consisting of vehicles, roadside units and macro base stations, a communication model based on orthogonal frequency division multiple access and dedicated short-range communication protocol, and a computing model covering local processing and partial remote offloading. The computing model defines the processing and transmission latency of tasks on various nodes. Step S2: Implement safe task offloading and federated task popularity prediction; Based on the constructed system model, Gaussian noise perturbation is first introduced during the task offloading process to achieve differential privacy protection; At the same time, an asynchronous federated learning framework is adopted to enable vehicles to use local data to collaboratively train a global model based on a long short-term memory network to predict the task popularity of future time slots. Step S3: Implement spatiotemporal joint optimization based on graph neural network and reinforcement learning; based on the system model constructed in step S1 and the popularity prediction results obtained in step S2, construct a dynamic heterogeneous graph to represent the spatiotemporal state of the network, and use graph neural network to extract global features; input this feature and the real-time state of the system into the proximal policy optimization algorithm, and the algorithm jointly optimizes the unloading target, unloading ratio and caching strategy of the task in the hybrid action space, thereby minimizing the total system latency and improving the cache hit rate.
[0008] Furthermore, the system architecture includes: Define three types of core entities as follows: Define the vehicle as a mobile node, represented as , This indicates a vehicle index. This indicates the total number of vehicles. The speed follows a uniform distribution , Indicates the first One vehicle The speed of time, Indicates uniform distribution. This indicates the lower limit of vehicle speed. This indicates the upper limit of the vehicle's speed. The vehicle has the ability to initiate tasks, perform local calculations, and cache data. Define the roadside unit as a fixed node, represented as , Indicates the roadside unit index. Indicates the total number of roadside units; roadside units are used to cover specific areas, coordinate resource allocation, and process task requests. Define macro base stations as global resource nodes, represented as Macro base stations are used to handle complex tasks that exceed local capabilities. Define time slot Internally generated tasks are , Indicates the size of the task data. This indicates the difficulty level of the calculation. Indicates the size of the result data. Indicates the task category, Indicates the request frequency. Indicate the effective time; formulate a "partial unloading" strategy, dividing the task into a local processing part and a remote unloading part, with the remote unloading priority being: nearby vehicles. →Roadside units within the coverage area → Macro base station And after uninstallation, according to the request frequency The decision on whether to cache the results is based on the following priority: task execution node → roadside units within the coverage area. →Task initiation vehicle / nearby vehicles; Communication models include: Define vehicle-to-vehicle communication as Communication between vehicles and roadside units is Communication between vehicles and macro base stations is Communication between roadside units is Communication between the roadside unit and the vehicle is Vehicle-to-vehicle communication A dedicated short-range communication protocol is used for communication between the vehicle and the roadside unit. Communication between vehicles and macro base stations Orthogonal Frequency Division Multiple Access (OFDMA) technology is used; communication between roadside units. This is achieved via fiber optic link; Derivation Communication rate Communication rate communication rate and Communication rate; The computational model includes: The total task latency is defined as the sum of transmission latency and computation latency, where computation latency includes the waiting latency of other tasks in the task list and the processing latency of the current task. Based on the partial unloading ratio, the total latency of the vehicle generation task is derived and expressed as: ; In the formula, This indicates the total latency of the vehicle generation task; Indicates vehicle In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates the percentage of partial uninstallation; Indicates in time slot Inside, vehicle Unload task to adjacent vehicle Transmission delay; Indicates adjacent vehicles In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to roadside units Transmission delay; Indicates roadside unit In the time slot Waiting delay; Indicates roadside unit In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to macro base stations Transmission delay; Indicates macro base station In the time slot Waiting delay; Indicates macro base station In the time slot Processing latency; , , Each represents a partial offloading ratio coefficient, corresponding to the task offloading ratio of different offloading objects, including vehicles, roadside units, and macro base stations; Derivation of roadside unit The total latency of generating the task is expressed as: ; In the formula, Indicates roadside unit Total latency of task generation; Indicates in time slot Inside, roadside unit With vehicles Transmission delay between; Indicates in time slot Inside, roadside unit With adjacent roadside units Transmission delay between; Indicates adjacent roadside units In the time slot Waiting delay; Indicates adjacent roadside units In the time slot Processing latency; Indicates in time slot Inside, roadside unit With macro base stations Transmission delay between; in, and ; The total latency of the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, This indicates that the vehicle-to-everything (V2X) system model is in time slots. Total latency; Indicates time slot Tasks generated within the vehicle; Indicates time slot Tasks generated by the inner roadside unit; Indicates time slot Inner The total latency of each vehicle generation task; Indicates time slot Inner The total latency of each generated task.
[0009] Furthermore, in step S2, differential privacy technology is introduced, using a Gaussian mechanism to add noise to the unloaded data, generating protected task data: ; In the formula, This indicates that after differential privacy protection, in time slots Protected mission data within; This indicates that the mean is 0 and the variance is . Gaussian noise; Let the noise deviation be Based on the derived formulas for transmission delay and processing delay, the increase in vehicle unloading delay introduced by noise is calculated. Roadside Unit Unload delay increment Update the total latency of the vehicle networking system model; Define task completion rate: ; In the formula, Indicates in time slot Internal task completion rate; Indicates time slot The set of tasks within; Represents an exponential function; Indicates time slot The actual completion time of the internal task. Indicates time slot The original base completion time for vehicle-related tasks; This indicates the delay increment introduced by noise during the vehicle unloading task; Indicates time slot The original base completion time for tasks related to the inner roadside unit; This indicates the delay increment introduced by noise during the roadside unit unloading task; This study employs asynchronous federated learning combined with long short-term memory networks, based on vehicle movement characteristics and task request frequency. Implement task popularity prediction.
[0010] Furthermore, the total latency for updating the vehicle-to-everything (V2X) system model includes: Vehicle unloading delay increment Represented as: ; In the formula, Indicates vehicle With adjacent vehicles Communication rate between them; Indicates adjacent vehicles Processing capacity; Indicates vehicle With roadside units Communication rate between them; Indicates roadside unit Processing capacity; Indicates vehicle With macro base stations Communication rate between them; Indicates macro base station Processing capacity; Roadside Unit Unload delay increment Represented as: ; In the formula, Indicates roadside unit With vehicles Communication rate between them; Indicates vehicle Processing capacity; Indicates roadside unit With adjacent roadside units Communication rate between them; Indicates adjacent roadside units Processing capacity; Indicates roadside unit With macro base stations Communication rate between them; The total latency for updating the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, Indicates time slot Inner The incremental unloading delay introduced by noise for each vehicle generation task; Indicates time slot Inner The incremental unloading delay introduced by noise in the generation task of each roadside unit.
[0011] Furthermore, asynchronous federated learning combined with long short-term memory networks is employed, based on vehicle movement characteristics and task request frequency. The specific process for predicting task popularity is as follows: Vehicle selection: Based on vehicle speed Uniform distribution characteristics and roadside units Coverage Calculate vehicles In roadside units Coverage Remaining stay time , Indicates vehicle Currently in roadside units Distance traveled within the coverage area; Select Vehicles with training times exceeding the long-term average are involved in asynchronous federated training. Model iterative training: from roadside units The global model is initialized using a Long Short-Term Memory (LSTM) network. After the participating vehicles download this model, it is used based on local task data, including task information. Local training is performed to update the local model, taking into account user privacy preferences; the first... wheeled vehicles The local empirical loss function is: ; In the formula, Indicates the first wheeled vehicles The local empirical loss function; Indicates the first wheeled vehicles Local model parameters; Indicates the first wheeled vehicles The number of samples used for local training; Represents the first in the local training data One sample; Indicates based on and The loss function; Introducing attenuation coefficient Handle the delayed gradients of "slackers" and compute aggregated local gradients: ; In the formula, Indicates the first Local gradient after wheel aggregation; This represents the delayed gradient of the lagging component, i.e., the gradient that failed to participate in the previous aggregation due to the delay. Update the local model: ; In the formula, Indicates the first wheeled vehicles Local model parameters; Indicates the first Local model parameters of the wheel; Indicates the first Round learning rate; The vehicle uploads the updated local model to the roadside unit. Roadside unit The aggregate weights are calculated based on vehicle travel distance and transmission rate, and the global model is updated asynchronously. Roadside Unit Aggregation weights are calculated based on vehicle travel distance and transmission rate. ; Asynchronous updates to the global model are represented as: ; In the formula, Indicates the first Global model parameters of the wheel; Indicates the first Global model parameters of the wheel; This indicates the amount of local data for the vehicle. This represents the total global data volume, which is the sum of the local data volume of all vehicles participating in the aggregation. This represents the local gradient after aggregation; Capturing task request frequency using Long Short-Term Memory (LSTM) networks The temporal dependencies, based on the request frequency of the past 5 time slots. and vehicle privacy preferences As input ; through the forgetting gate Input gate Candidate memories Memory unit Output gate and hidden state Predict the frequency of task requests in the next time slot. ,Will As a measure of the popularity of the next time slot task; Defined in time slot cache hit rate To evaluate the effectiveness of predictions in guiding caching decisions. Indicates an indicator function, Represents the set of related tasks. Represents a cache collection. Indicates time slot The identifier corresponding to the task within.
[0012] Furthermore, in step S3, the graph neural network extracts spatiotemporal features based on the state and task completion rate of the vehicle-to-everything (V2X) system model. and cache hit rate A Markov decision process is constructed and optimized using a proximal policy optimization algorithm.
[0013] Furthermore, the specific process of graph neural networks extracting spatiotemporal features is as follows: Based on the real-time status of vehicles, roadside units, and macro base stations, a time-varying map is constructed in each time slot. , Represents a set of nodes. Denotes the set of fully connected edges. Indicates edge weight; Node set Includes vehicles Roadside Unit Macro base stations The total number of nodes is ; Set the initial node characteristics as Includes task load, computing power, cache status, location information, and task request frequency. ; edge weight This includes the weights between roadside units, the weights from roadside units to macro base stations, the weights from vehicles to vehicles, the weights from vehicles to roadside units, and the weights from vehicles to macro base stations. Before storage Time-varying mapping generation history map for each time slot , Represents the set of nodes in a historical graph. Represents the set of edges in a historical graph. The edge weights of the historical graph are represented by the time decay factor. Weighted aggregation of historical node features Historical marginal weight ; Employing graph attention networks, combined with and Attention coefficients, update node features Output global features ; to reconstruct the loss using graphs Train the graph neural network and update its parameters; Among them, a graph attention network is used, combined with and Attention coefficients, update node features , is represented as: ; In the formula, express In and nodes A set of related nodes; express In and nodes A set of related nodes; Indicates the weighting factors of the historical graph; Indicates the activation function; express Middle node and nodes Attention coefficient between them; express Middle node and nodes Attention coefficient between them; Indicates the first Layer weight matrix; express Middle node In the Layer feature representation; express Middle node In the Layer feature representation; Global features Represented as: ; In the formula, express Middle node Feature representation; Reconstructing loss using graphs Training a graph neural network and updating its parameters can be represented as follows: ; ; In the formula, Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the partial derivative sign; Indicates the learning rate; Indicates the first The parameter vector in the attention mechanism during the next iteration; Indicates the first The parameter vector in the attention mechanism during the next iteration.
[0014] Furthermore, based on the state and task completion rate of the vehicle-to-everything (V2X) system model. and cache hit rate The specific process of constructing a Markov decision process and optimizing it using a proximal policy optimization algorithm is as follows: Define the elements of a Markov decision process: Time slot status Represented as: ; In the formula, Represents the node task queue. This indicates the vehicle task queue. This represents the roadside unit task queue. Represents the macro base station task queue; Indicates cache status. Indicates the vehicle's buffer state. Indicates the buffer status of the roadside unit. Indicates the macro base station cache status; Represents the global features of a graph neural network; Time slot action Represented as: ; In the formula, Indicates the target to be uninstalled; Indicates caching decisions; Indicates the percentage of partial uninstallation; Time slot Rewards Represented as: ; In the formula, The weighting coefficient represents the total latency and is used to adjust the degree of influence of total latency in reward calculation; This represents the weighting coefficient of the relevant items, used to adjust the degree of influence of the relevant factors in the reward calculation; This represents the weighting coefficient of cache hit rate, used to adjust the degree of influence of cache hit rate in reward calculation; This represents the total latency after normalization of the vehicle-to-everything (V2X) system model; Generate hybrid action strategies using an Actor network. Its goal is to determine the current state. Select the optimal action To maximize long-term cumulative returns, hybrid action strategies include discrete action distributions. and continuous action distribution ; The Actor network is optimized using "pruning the objective function + entropy regularization": Pruning objective function Represented as: ; In the formula, This represents the probability ratio between the old and new strategies; This represents the estimate of generalized advantage; Indicates the cropping range; Indicates the parameters of the Actor network; This represents the probability ratio between the old and new strategies; This represents the expectation operation; Indicates a cropping operation; Entropy regularization is expressed as: ; In the formula, This represents the objective function after adding entropy regularization; Represent the objective function for pruning; Represents policy entropy. Indicates the state Take action below The probability of; Represents the regularization coefficient; Evaluating state value using Critic network The goal is to minimize the timing difference error. ; In the formula, The loss function of the Critic network is represented by this. Indicates the parameters of the Critic network; Indicates the target value. Indicates the target network's next state Value estimation; Indicates the discount factor; The near-end policy optimization algorithm interacts with the environment of the vehicle-to-everything (V2X) system model, collecting experience tuples in each time slot. The experience is stored in an experience buffer pool; batches of experience are periodically sampled from the buffer pool, and the network parameters are updated using gradient descent. Actor network parameter update: , This represents the learning rate used to update the parameters of the Actor network. Indicates to Find the gradient; Critic network parameter updates: , This represents the learning rate used to update the parameters of the Critic network. Indicates to Find the gradient; Iterative optimization: Repeat the "experience collection-parameter update" process until the strategy converges, and finally achieve joint optimization of "unloading target-unloading ratio-caching strategy" in the dynamic vehicle network system model environment.
[0015] Furthermore, historical node characteristics Represented as: , Indicates in time slot At that time, node The initial characteristics include task load, computing power, cache status, location information, and task request frequency. Indicates the index of the time slot; edge weight Represented as: , Indicates in time slot Time node and nodes The edge weights between them.
[0016] Furthermore, and The attention coefficient is expressed as: ; ; In the formula, express Middle node and nodes Attention coefficient between them; express Middle node and nodes Attention coefficient between them; express Activation function; express transpose, This represents the parameter vector in the attention mechanism; Indicates the first Layer weight matrix; express Middle node In the Layer feature representation; express Middle node In the Layer feature representation; express Middle node and nodes Edge weights between them; express Middle node In the Layer feature representation; express Middle node and nodes The edge weights between them.
[0017] Compared with existing technologies, the present invention has the following advantages: (1) This invention integrates five major innovations: differential privacy protection, asynchronous federated LSTM popularity prediction, GNN spatiotemporal feature extraction, PPO joint optimization, and "partial offloading + cache collaboration" to form an integrated solution: Gaussian noise is used to achieve privacy protection and control the impact of latency, and asynchronous federated LSTM is used to improve the accuracy of popularity prediction to guide caching; GNN captures the spatiotemporal correlation of nodes, and the PPO algorithm is combined to optimize the offloading target, proportion and caching strategy in the hybrid action space. At the same time, "partial offloading" and cache priority rules are relied upon to break the module separation, and finally the privacy security of the Internet of Vehicles, low total system latency, high cache hit rate and resource utilization are synergistically improved, adapting to dynamic topology and complex task requirements.
[0018] (2) This invention achieves differential privacy protection by introducing Gaussian noise perturbation into the task unloading data, which can effectively prevent attackers from inferring vehicle user privacy information through unloading data and reduce the risk of sensitive data leakage. At the same time, it derives the vehicle and roadside unit unloading delay increment introduced by noise, clarifies the impact boundary of the privacy protection mechanism on system performance, avoids sacrificing task processing efficiency due to over-protection, and ensures the balance between privacy security and performance of the system.
[0019] (3) This invention uses an asynchronous federated learning framework combined with a long short-term memory network (LSTM) to build a popularity prediction model. Vehicles can collaboratively train the global model based on local private data without uploading the original data, thus balancing privacy protection and model training efficiency. The LSTM network can accurately capture the temporal dependency of task request frequency, improve the accuracy of future time slot task popularity prediction, provide a reliable basis for caching decisions, thereby improving cache hit rate and reducing cache space waste and redundant calculation.
[0020] (4) This invention constructs a dynamic heterogeneous graph based on the real-time status of vehicle network nodes, extracts global spatiotemporal features using graph neural networks, aggregates historical graph features through time decay factors, effectively captures the spatiotemporal correlation between vehicles, roadside units, and macro base stations, and solves the problem of insufficient spatiotemporal correlation capture in traditional methods; inputs the global features extracted by GNN and the real-time status of the system into the near-end strategy optimization algorithm, and jointly optimizes the task unloading target, unloading ratio and caching strategy in the hybrid action space, which can significantly reduce the total system latency and improve resource scheduling adaptability and efficiency.
[0021] (5) The present invention innovatively designs an integrated mechanism of “partial unloading + cache collaboration”, which splits the task into local processing and remote unloading parts, clarifies the priority of remote unloading and the priority of cache, and realizes the seamless connection between task unloading and result caching, avoiding the redundant computing resources caused by the separation of the two in the traditional method; at the same time, it integrates communication and computing modules through system model, quantifies the communication rate and task processing latency of each node, realizes the collaborative allocation of resources of multiple nodes such as vehicles, roadside units and macro base stations, and improves the overall service efficiency and resource utilization of the Internet of Vehicles. Attached Figure Description
[0022] Figure 1 This is a flowchart of the steps of the present invention. Detailed Implementation
[0023] like Figure 1 As shown, the present invention provides a technical solution: a method for optimizing vehicle network security offloading and caching based on graph neural networks, comprising the following steps: Step S1: Construct a vehicle-to-everything (V2X) system model; the system model includes a system architecture consisting of vehicles, roadside units and macro base stations, a communication model based on orthogonal frequency division multiple access and dedicated short-range communication protocol, and a computing model covering local processing and partial remote offloading. The computing model defines the processing and transmission latency of tasks on various nodes.
[0024] 1. Design the system architecture; 1.1 Define three types of core entities, namely: Define the vehicle as a mobile node, represented as , This indicates a vehicle index. This indicates the total number of vehicles. The speed follows a uniform distribution , Indicates the first One vehicle The speed of time, Indicates uniform distribution. This indicates the lower limit of vehicle speed. This indicates the upper limit of the vehicle's speed. The vehicle has the ability to initiate tasks, perform local calculations, and cache data.
[0025] Define the roadside unit (RSU) as a fixed node, represented as follows: , Indicates the roadside unit index. This indicates the total number of roadside units; roadside units are used to cover specific areas, coordinate resource allocation, and process task requests.
[0026] Define a macro base station (MBS) as a global resource node, represented as Macro base stations are used to handle complex tasks that exceed local capabilities.
[0027] 1.2 Defining Time Slots Internally generated tasks are , Indicates the size of the task data. This indicates the difficulty level of the calculation. Indicates the size of the result data. Indicates the task category, Indicates the request frequency. Indicate the effective time; formulate a "partial unloading" strategy, dividing the task into a local processing part and a remote unloading part, with the remote unloading priority being: nearby vehicles. →Roadside units within the coverage area → Macro base station And after uninstallation, according to the request frequency The decision on whether to cache the results is based on the following priority: task execution node → roadside units within the coverage area. →Task initiating vehicle / nearby vehicles; cached content is dynamically updated based on task popularity, and low-popularity content will be replaced to optimize cache space utilization efficiency.
[0028] 2. Build a communication model; 2.1 Define vehicle-to-vehicle communication as Communication between vehicles and roadside units is Communication between vehicles and macro base stations is Communication between roadside units is Communication between the roadside unit and the vehicle is Vehicle-to-vehicle communication The Dedicated Short Range Communication (DSRC) protocol is used for communication between vehicles and roadside units. Communication between vehicles and macro base stations Orthogonal Frequency Division Multiple Access (OFDMA) technology is used; communication between roadside units. This is achieved via a fiber optic link.
[0029] 2.2. Based on Shannon's theorem, derive the following respectively: Communication rate Communication rate communication rate and Communication rate.
[0030] Communication rate: ; In the formula, Indicates vehicle With adjacent vehicles Communication rate between them; express The available bandwidth of the technology used in the communication; Indicates the vehicle's transmission power; Indicates vehicle With vehicles Channel gain between Indicates vehicle With vehicles The distance between them; This indicates the noise power during communication.
[0031] It can be represented as: ; In the formula, Indicates vehicle With vehicles The large-scale fading coefficient, which is related to the distance between the signals, is used to describe the power attenuation of the signal due to factors such as terrain and buildings during long-distance propagation. Indicates vehicle With vehicles The small-scale fading coefficient is used to describe the rapid power fluctuations of a signal over short distances caused by multipath effects (such as reflection and scattering).
[0032] Communication rate: ; In the formula, Indicates vehicle With roadside units Communication rate between them; express The available bandwidth of the technology used in the communication; Indicates vehicle With roadside units Channel gain between Indicates vehicle With roadside units The distance between them.
[0033] Communication rate: ; In the formula, Indicates vehicle With macro base stations Communication rate between them; express The available bandwidth of the technology used in the communication; Indicates vehicle With macro base stations Channel gain between Indicates vehicle With macro base stations The distance between them.
[0034] Communication rate: ; In the formula, Indicates roadside unit With vehicles Communication rate between them; express The available bandwidth of the technology used in the communication; This indicates the transmission power of the roadside unit; Indicates roadside unit With vehicles Channel gain between Indicates roadside unit With vehicles The distance between them.
[0035] 3. Derive the computational model; The total task latency is defined as the sum of transmission latency and computation latency, where computation latency includes the waiting latency of other tasks in the task list and the processing latency of the current task. 1. Propelling the vehicle Unload task to adjacent vehicle Roadside Unit Macro base stations The transmission delay is expressed as: ; ; ; In the formula, Indicates in time slot Inside, vehicle Unload task to adjacent vehicle Transmission delay; Indicates in time slot Inside, vehicle Unload tasks to roadside units Transmission delay; Indicates in time slot Inside, vehicle Unload tasks to macro base stations Transmission delay; Indicates time slot The size of the data generated by the internal task.
[0036] Propulsion vehicle The waiting delay and processing delay are represented as follows: ; ; In the formula, Indicates vehicle In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates vehicle The first task in the task list One task; Indicates vehicle Processing capacity; Indicates in time slot Vehicle Task list; Indicates time slot The computational difficulty coefficient of the internal task.
[0037] If the task is uninstalled to the vehicle Its waiting delay and processing delay are expressed as follows: ; ; In the formula, Indicates adjacent vehicles In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates time slot Vehicle The first task in the task list One task; Indicates adjacent vehicles Processing capacity; Indicates in time slot Vehicle The task list.
[0038] Roadside Unit The waiting delay and processing delay are expressed as follows: ; ; In the formula, Indicates roadside unit In the time slot Waiting delay; Indicates roadside unit In the time slot Processing latency; Indicates time slot Time-side unit The first task in the task list One task; Indicates roadside unit Processing capacity; Indicates in time slot Time-side unit The task list.
[0039] macro base station The waiting delay and processing delay are expressed as follows: ; ; In the formula, Indicates macro base station In the time slot Waiting delay; Indicates macro base station In the time slot Processing latency; Indicates time slot Time-based base station The first task in the task list One task; Indicates macro base station Processing capacity; Indicates in time slot Time-based base station The task list.
[0040] Roadside Unit Unload task to vehicle Adjacent roadside units Macro base stations The transmission delay is expressed as: ; ; ; In the formula, Indicates in time slot Inside, roadside unit With vehicles Transmission delay between; Indicates in time slot Inside, roadside unit With adjacent roadside units Transmission delay between; Indicates in time slot Inside, roadside unit With macro base stations Transmission delay between them.
[0041] Based on the partial unloading ratio, the total latency of the vehicle generation task is derived and expressed as: ; In the formula, This indicates the total latency of the vehicle generation task; Indicates vehicle In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates the percentage of partial uninstallation; Indicates in time slot Inside, vehicle Unload task to adjacent vehicle Transmission delay; Indicates adjacent vehicles In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to roadside units Transmission delay; Indicates roadside unit In the time slot Waiting delay; Indicates roadside unit In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to macro base stations Transmission delay; Indicates macro base station In the time slot Waiting delay; Indicates macro base station In the time slot Processing latency; , , Each represents a partial unloading ratio coefficient, corresponding to the task unloading percentage of different unloading objects (vehicles, roadside units, macro base stations, etc.).
[0042] Derivation of roadside unit The total latency of generating the task is expressed as: ; In the formula, Indicates roadside unit Total latency of task generation; Indicates in time slot Inside, roadside unit With vehicles Transmission delay between; Indicates in time slot Inside, roadside unit With adjacent roadside units Transmission delay between; Indicates adjacent roadside units In the time slot Waiting delay; Indicates adjacent roadside units In the time slot Processing latency; Indicates in time slot Inside, roadside unit With macro base stations Transmission delay between them.
[0043] in, and .
[0044] 3. The total latency of the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, This indicates that the vehicle-to-everything (V2X) system model is in time slots. Total latency; Indicates time slot Tasks generated within the vehicle; Indicates time slot Tasks generated by the inner roadside unit; Indicates time slot Inner The total latency of each vehicle generation task; Indicates time slot Inner The total latency of generating tasks for each roadside unit.
[0045] Step S2: Implement safe task offloading and federated task popularity prediction; Based on the constructed system model, Gaussian noise perturbation is first introduced during the task offloading process to achieve differential privacy protection and ensure the security of sensitive data; At the same time, an asynchronous federated learning framework is adopted to enable vehicles to use local data to collaboratively train a global model based on a long short-term memory network to predict the task popularity of future time slots.
[0046] Step S2.1: Perform the security task of uninstallation; To address the risk of sensitive data exposure during the task unloading process, differential privacy technology is introduced. A Gaussian mechanism is used to add noise to the unloading data, generating protected task data. ; In the formula, This indicates that after differential privacy protection, in time slots Protected mission data within; This indicates that the mean is 0 and the variance is . Gaussian noise.
[0047] in, Calculated according to the definition of differential privacy, it is expressed as: ; In the formula, Sensitivity represents the maximum change between adjacent data points; , These represent the privacy budget and the probability of failure, respectively, and are used to jointly control the strength of privacy protection.
[0048] Among these measures, to ensure the protection of mission data Its practicality should be limited to a reasonable range: .
[0049] Let the noise deviation be Based on the derived formulas for transmission delay and processing delay, the increase in vehicle unloading delay introduced by noise is calculated. Roadside Unit Unload delay increment Update the total latency of the vehicle networking system model; Vehicle unloading delay increment Represented as: .
[0050] Roadside Unit Unload delay increment Represented as: ; In the formula, Indicates roadside unit With adjacent roadside units Communication rate between them; Indicates adjacent roadside units Processing capacity; Indicates roadside unit With macro base stations The communication rate between them.
[0051] The total latency for updating the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, Indicates time slot Inner The incremental unloading delay introduced by noise for each vehicle generation task; Indicates time slot Inner The incremental unloading delay introduced by noise in the generation task of each roadside unit.
[0052] Define task completion rate: ; In the formula, Indicates in time slot Internal task completion rate; Indicates time slot The set of tasks within; Represents an exponential function; Indicates time slot The actual completion time of the internal task. Indicates time slot The original base completion time for vehicle-related tasks; This indicates the delay increment introduced by noise during the vehicle unloading task; Indicates time slot The original base completion time for tasks related to the inner roadside unit; This indicates the delay increment introduced by noise during the roadside unit unloading task.
[0053] Step S2.2: Implement federated task popularity prediction; Asynchronous Federated Learning (AFL) combined with Long Short-Term Memory (LSTM) networks is employed, taking into account vehicle movement characteristics and task request frequency. To achieve task popularity prediction, specifically: Vehicle selection: Based on vehicle speed Uniform distribution characteristics and roadside units Coverage Calculate vehicles In roadside units Coverage Remaining stay time , Indicates vehicle Currently in roadside units Distance traveled within the coverage area; Select Vehicles that exceed the long-term average training time participate in asynchronous federated training.
[0054] Model iterative training: from roadside units A global model is initialized using a Long Short-Term Memory (LSTM) network. After the participating vehicles download this model, it is used based on local task data (including task data). (and user privacy preferences) are used for local training to update the local model; the first is defined as wheeled vehicles The local empirical loss function is: ; In the formula, Indicates the first wheeled vehicles The local empirical loss function; Indicates the first wheeled vehicles Local model parameters; Indicates the first wheeled vehicles The number of samples used for local training; Represents the first in the local training data One sample; Indicates based on and The loss function.
[0055] Introducing attenuation coefficient Handle the delayed gradients of "slackers" and compute aggregated local gradients: ; In the formula, Indicates the first Local gradient after wheel aggregation; This represents the delayed gradient of the lagging participant, which is the gradient that was not included in the previous aggregation due to the delay.
[0056] Update the local model: ; In the formula, Indicates the first wheeled vehicles Local model parameters; Indicates the first Local model parameters of the wheel; Indicates the first Round learning rate.
[0057] The vehicle uploads the updated local model to the roadside unit. Roadside unit The aggregate weights are calculated based on vehicle travel distance and transmission rate, and the global model is updated asynchronously. Roadside Unit The aggregation weight is calculated based on the vehicle travel distance and transmission rate, and is expressed as follows: ; In the formula, Indicates vehicle The corresponding aggregation weights are used to measure the importance of the local model of the vehicle when aggregating local models of roadside units; Indicates the balance factor; Indicates participation in the Among the vehicles in wheel aggregation, roadside units The maximum communication rate, Indicates participation in the A collection of vehicles that are aggregated by wheels. Indicates that the subscript is The operation of taking the maximum value of a variable or function.
[0058] Asynchronous updates to the global model are represented as: ; In the formula, Indicates the first Global model parameters of the wheel; Indicates the first Global model parameters of the wheel; This indicates the amount of local data for the vehicle. This represents the total global data volume, which is the sum of the local data volume of all vehicles participating in the aggregation. This represents the local gradient after aggregation.
[0059] LSTM Popularity Prediction: Capturing Task Request Frequency Using Long Short-Term Memory (LSTM) Networks The temporal dependencies, based on the request frequency of the past 5 time slots. and vehicle privacy preferences As input ; through the forgetting gate Input gate Candidate memories Memory unit Output gate and hidden state Predict the frequency of task requests in the next time slot. ,Will As the popularity of the next time slot task (task popularity can be reflected by the frequency of task requests); Defined in time slot cache hit rate To evaluate the effectiveness of predictions in guiding caching decisions. Indicates an indicator function, Represents the set of related tasks. Represents a cache collection. Indicates time slot The identifier corresponding to the task within.
[0060] enter , Indicates a time interval; Forgotten Gate , This represents the activation function. Indicates the gate of oblivion The corresponding weight matrix, Indicates the gate of oblivion The corresponding weight matrix, The bias term representing the forget gate. Indicates the hidden state at the previous moment; Input gate , Indicates input gate The corresponding weight matrix, Indicates input gate The corresponding weight matrix, This represents the bias term of the input gate; Candidate Memory , This represents the hyperbolic tangent activation function. Indicating candidate memories The corresponding weight matrix, Indicating candidate memories The corresponding weight matrix, Bias terms representing candidate memories; memory unit , This indicates the state of the memory unit at the previous moment. This indicates element-wise multiplication; Output gate , Indicates the output gate The corresponding weight matrix, Indicates the output gate The corresponding weight matrix, This represents the bias term of the output gate; Hidden state .
[0061] Step S3: Implement spatiotemporal joint optimization based on graph neural networks and reinforcement learning; based on the system model constructed in step S1 and the popularity prediction results obtained in step S2, construct a dynamic heterogeneous graph to represent the spatiotemporal state of the network, and use graph neural networks (GNN) to extract global features; input this feature and the real-time state of the system into the proximal policy optimization algorithm (PPO), which jointly optimizes the unloading target, unloading ratio and caching strategy of the task in the hybrid action space, thereby minimizing the total system latency and improving the cache hit rate.
[0062] Step S3.1: Extract spatiotemporal features using a graph neural network (GNN); Based on the real-time status of vehicles, roadside units, and macro base stations, a time-varying map is constructed in each time slot. , Represents a set of nodes. Denotes the set of fully connected edges. Indicates edge weight; Node set Includes vehicles Roadside Unit Macro base stations The total number of nodes is ; Set the initial node characteristics as Includes task load, computing power, cache status, location information, and task request frequency. ; edge weight include: The weight between roadside units is 1; The weight from the roadside unit to the macro base station is , Indicates roadside unit To macro base station distance, Indicates the maximum distance threshold; The weights for each vehicle are: , This indicates the frequency of vehicle-related task requests. Indicates the distance between vehicles. Indicates the distance attenuation coefficient; The weight of the vehicle to the roadside unit is: , This indicates the frequency of task requests related to roadside units. Indicates the distance from the vehicle to the roadside unit; The weight of the vehicle to the macro base station is , This indicates the distance from the vehicle to the macro base station.
[0063] Before storage Time-varying mapping generation history map for each time slot , Represents the set of nodes in a historical graph. Represents the set of edges in a historical graph. The edge weights of the historical graph are represented by the time decay factor. Weighted aggregation of historical node features Historical marginal weight ; Historical node characteristics Represented as: , Indicates in time slot At that time, node The initial characteristics (including task load, computing power, cache status, location information, and task request frequency, etc.) Indicates the index of the time slot; edge weight Represented as: , Indicates in time slot Time node and nodes Edge weights between them; Using a graph attention network (GAT), combined with and Attention coefficients, update node features Output global features ; to reconstruct the loss using graphs Train a graphical neural network (GNN) and update its parameters.
[0064] in, and The attention coefficient is expressed as: ; ; In the formula, express Middle node and nodes Attention coefficient between them; express Middle node and nodes Attention coefficient between them; express Activation function; express transpose, This represents the parameter vector in the attention mechanism; Indicates the first Layer weight matrix; express Middle node In the Layer feature representation; express Middle node In the Layer feature representation; express Middle node and nodes Edge weights between them; express Middle node In the Layer feature representation; express Middle node and nodes The edge weights between them.
[0065] Among them, a graph attention network (GAT) is used, combined with and Attention coefficients, update node features , is represented as: ; In the formula, express In and nodes A set of related nodes; express In and nodes A set of related nodes; This represents the weighting factor of the historical graph.
[0066] Among them, global features Represented as: ; In the formula, express Middle node The characteristics are represented.
[0067] Among them, graph reconstruction loss Represented as: ; In the formula, This represents the reconstructed edge weights. Represents a node The transpose of the feature representation. Represents a node Feature representation; This represents the weight of the historical graph loss.
[0068] Among them, the graph reconstruction loss Training a graphical neural network (GNN) and updating its parameters is represented as follows: ; ; In the formula, Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the partial derivative sign; Indicates the learning rate; Indicates the first The parameter vector in the attention mechanism during the next iteration; Indicates the first The parameter vector in the attention mechanism during the next iteration.
[0069] Step S3.2: PPO optimizes uninstallation and caching strategies; State and task completion rate based on the vehicle-to-everything (V2X) system model and cache hit rate A Markov Decision Process (MDP) is constructed and optimized using a proximal policy optimization algorithm. Specifically: 1. Define the elements of a Markov Decision Process (MDP): Time slot status Represented as: ; In the formula, Indicates current task information. Indicates the data size of the task. This indicates the computational difficulty coefficient of the task. The size of the data representing the task result. Indicates the category to which the task belongs. Indicates the frequency of task requests. Indicates the effective time of the task; Represents the node task queue. This indicates the vehicle task queue. This represents the roadside unit task queue. Represents the macro base station task queue; Indicates cache status. Indicates the vehicle's buffer state. Indicates the buffer status of the roadside unit. Indicates the macro base station cache status; This represents the global features of a graph neural network (GNN).
[0070] Time slot action Represented as: ; In the formula, Indicates the unloading target (e.g., vehicle). Roadside Unit Macro base stations ); Indicates caching decisions (e.g., whether to cache task results); This indicates the percentage of parts that were uninstalled.
[0071] Time slot Rewards Represented as: ; In the formula, The weighting coefficient represents the total latency and is used to adjust the degree of influence of total latency in reward calculation; This represents the weighting coefficient of the relevant items, used to adjust the degree of influence of the relevant factors in the reward calculation; This represents the weighting coefficient of cache hit rate, used to adjust the degree of influence of cache hit rate in reward calculation; This represents the total latency after normalization of the vehicle-to-everything (V2X) system model.
[0072] 2. Dual-network training; Generate hybrid action strategies using an Actor network. Its goal is to determine the current state. Select the optimal action To maximize long-term cumulative returns, including discrete action distribution. and continuous action distribution Among them, discrete action distribution It generates the joint probability distribution of unloading targets and cache decisions through the Softmax function, and the continuous action distribution. Through normal distribution The partial unloading ratio is generated and mapped to [0,1] using the Sigmoid function.
[0073] The Actor network is optimized using "pruning the objective function + entropy regularization": Pruning objective function Represented as: ; In the formula, This represents the probability ratio between the old and new strategies; This represents the generalized advantage estimate (GAE) value; Indicates the cropping range; Indicates the parameters of the Actor network; This represents the probability ratio between the old and new strategies; This represents the expectation operation; This indicates a cropping operation.
[0074] Entropy regularization is expressed as: ; In the formula, This represents the objective function after adding entropy regularization. It is used in the policy optimization process to both optimize the objective function by pruning it and increase the exploratory nature of the policy through policy entropy, thereby improving the training effect. Represent the objective function for pruning; Policy entropy measures the uncertainty of a policy. Higher entropy indicates a more exploratory policy. Incorporating it into the objective function encourages the policy to explore further and avoids premature convergence to a local optimum. Indicates the state Take action below The probability of; This represents the regularization coefficient.
[0075] in, Represented as: ; In the formula, Represents the time difference (TD) residual. Indicates the discount factor. Representing state Value function estimation under the following conditions Representing state Value function estimation under the following conditions Indicates time slot The state; This represents the parameters of the generalized advantage estimation (GAE). This indicates the total number of time slots.
[0076] Evaluating state value using Critic network The goal is to minimize the timing difference (TD) error. ; In the formula, The loss function of the Critic network is represented by this. Indicates the parameters of the Critic network; Indicates the target value. This indicates the target network (the Critic network with slowly updated parameters)'s response to the next state. Value estimate.
[0077] 3. Experience-based cycle optimization; Experience collection: The near-end policy optimization algorithm interacts with the environment of the vehicle-to-everything (V2X) system model, collecting experience tuples in each time slot. , stored in the experience buffer pool.
[0078] Parameter Update: Periodically sample batch experiences (such as mini-batch samples) from the buffer pool and update the network parameters via gradient descent. Actor network parameter update: , This represents the learning rate used to update the parameters of the Actor network. Indicates to Find the gradient; Critic network parameter updates: , This represents the learning rate used to update the parameters of the Critic network. Indicates to Find the gradient.
[0079] Iterative optimization: Repeat the "experience collection - parameter update" process until the policy converges (e.g., reward). (Tends to stability), ultimately achieving joint optimization of "unloading target-unloading ratio-caching strategy" in the dynamic vehicle networking system model environment.
[0080] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing vehicle network security offloading and caching based on graph neural networks, characterized in that, Includes the following steps: Step S1: Construct a vehicle-to-everything (V2X) system model; the system model includes a system architecture consisting of vehicles, roadside units and macro base stations, a communication model based on orthogonal frequency division multiple access and dedicated short-range communication protocol, and a computing model covering local processing and partial remote offloading. The computing model defines the processing and transmission latency of tasks on various nodes. Step S2: Implement safe task offloading and federated task popularity prediction; Based on the constructed system model, Gaussian noise perturbation is first introduced during the task offloading process to achieve differential privacy protection; At the same time, an asynchronous federated learning framework is adopted to enable vehicles to use local data to collaboratively train a global model based on a long short-term memory network to predict the task popularity of future time slots. Step S3: Implement spatiotemporal joint optimization based on graph neural networks and reinforcement learning; Based on the system model constructed in step S1 and the popularity prediction results obtained in step S2, a dynamic heterogeneous graph is constructed to represent the spatiotemporal state of the network, and global features are extracted using a graph neural network. This feature, along with the real-time system status, is input into the near-end policy optimization algorithm. This algorithm then jointly optimizes the task's unloading target, unloading ratio, and caching strategy in the hybrid action space, thereby minimizing the total system latency and improving the cache hit rate.
2. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 1, characterized in that: The system architecture includes: Define three types of core entities as follows: Define the vehicle as a mobile node, represented as , This indicates a vehicle index. This indicates the total number of vehicles. The speed follows a uniform distribution , Indicates the first One vehicle The speed of time, Indicates uniform distribution. This indicates the lower limit of vehicle speed. This indicates the upper limit of the vehicle's speed. The vehicle has the ability to initiate tasks, perform local calculations, and cache data. Define the roadside unit as a fixed node, represented as , Indicates the roadside unit index. Indicates the total number of roadside units; roadside units are used to cover specific areas, coordinate resource allocation, and process task requests. Define macro base stations as global resource nodes, represented as Macro base stations are used to handle complex tasks that exceed local capabilities. Define time slot Internally generated tasks are , Indicates the size of the task data. This indicates the difficulty level of the calculation. Indicates the size of the result data. Indicates the task category, Indicates the request frequency. Indicate the effective time; formulate a "partial unloading" strategy, dividing the task into a local processing part and a remote unloading part, with the remote unloading priority being: nearby vehicles. →Roadside units within the coverage area → Macro base station And after uninstallation, according to the request frequency The decision on whether to cache the results is based on the following priority: task execution node → roadside units within the coverage area. →Task initiation vehicle / nearby vehicles; Communication models include: Define vehicle-to-vehicle communication as Communication between vehicles and roadside units is Communication between vehicles and macro base stations is Communication between roadside units is Communication between the roadside unit and the vehicle is Vehicle-to-vehicle communication A dedicated short-range communication protocol is used for communication between the vehicle and the roadside unit. Communication between vehicles and macro base stations Orthogonal Frequency Division Multiple Access (OFDMA) technology is used; communication between roadside units. This is achieved via fiber optic link; Derivation Communication rate Communication rate communication rate and Communication rate; The computational model includes: The total task latency is defined as the sum of transmission latency and computation latency, where computation latency includes the waiting latency of other tasks in the task list and the processing latency of the current task. Based on the partial unloading ratio, the total latency of the vehicle generation task is derived and expressed as: ; In the formula, This indicates the total latency of the vehicle generation task; Indicates vehicle In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates the percentage of partial uninstallation; Indicates in time slot Inside, vehicle Unload task to adjacent vehicle Transmission delay; Indicates adjacent vehicles In the time slot Waiting delay; Indicates vehicle In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to roadside units Transmission delay; Indicates roadside unit In the time slot Waiting delay; Indicates roadside unit In the time slot Processing latency; Indicates in time slot Inside, vehicle Unload tasks to macro base stations Transmission delay; Indicates macro base station In the time slot Waiting delay; Indicates macro base station In the time slot Processing latency; , , Each represents a partial offloading ratio coefficient, corresponding to the task offloading ratio of different offloading objects, including vehicles, roadside units, and macro base stations. Derivation of roadside unit The total latency of generating the task is expressed as: ; In the formula, Indicates roadside unit Total latency of task generation; Indicates in time slot Inside, roadside unit With vehicles Transmission delay between; Indicates in time slot Inside, roadside unit With adjacent roadside units Transmission delay between; Indicates adjacent roadside units In the time slot Waiting delay; Indicates adjacent roadside units In the time slot Processing latency; Indicates in time slot Inside, roadside unit With macro base stations Transmission delay between; in, and ; The total latency of the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, This indicates that the vehicle-to-everything (V2X) system model is in time slots. Total latency; Indicates time slot Tasks generated within the vehicle; Indicates time slot Tasks generated by the inner roadside unit; Indicates time slot Inner The total latency of each vehicle generation task; Indicates time slot Inner The total latency of each generated task.
3. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 2, characterized in that: In step S2, differential privacy technology is introduced, and a Gaussian mechanism is used to add noise to the unloaded data to generate protected task data. ; In the formula, This indicates that after differential privacy protection, in time slots Protected mission data within; This indicates that the mean is 0 and the variance is . Gaussian noise; Let the noise deviation be Based on the derived formulas for transmission delay and processing delay, the increase in vehicle unloading delay introduced by noise is calculated. Roadside Unit Unload delay increment Update the total latency of the vehicle networking system model; Define task completion rate: ; In the formula, Indicates in time slot Internal task completion rate; Indicates time slot The set of tasks within; Represents an exponential function; Indicates time slot The actual completion time of the internal task. Indicates time slot The original base completion time for vehicle-related tasks; This indicates the delay increment introduced by noise during the vehicle unloading task; Indicates time slot The original base completion time for tasks related to the inner roadside unit; This indicates the delay increment introduced by noise during the roadside unit unloading task; This study employs asynchronous federated learning combined with long short-term memory networks, based on vehicle movement characteristics and task request frequency. Implement task popularity prediction.
4. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 3, characterized in that: The total latency for updating the vehicle-to-everything (V2X) system model includes: Vehicle unloading delay increment Represented as: ; In the formula, Indicates vehicle Adjacent vehicles Communication rate between them; Indicates adjacent vehicles Processing capacity; Indicates vehicle With roadside units Communication rate between them; Indicates roadside unit Processing capacity; Indicates vehicle With macro base stations Communication rate between them; Indicates macro base station Processing capacity; Roadside Unit Unload delay increment Represented as: ; In the formula, Indicates roadside unit With vehicles Communication rate between them; Indicates vehicle Processing capacity; Indicates roadside unit With adjacent roadside units Communication rate between them; Indicates adjacent roadside units Processing capacity; Indicates roadside unit With macro base stations Communication rate between them; The total latency for updating the vehicle-to-everything (V2X) system model is expressed as: ; In the formula, Indicates time slot Inner The incremental unloading delay introduced by noise for each vehicle generation task; Indicates time slot Inner The incremental unloading delay introduced by noise in the generation task of each roadside unit.
5. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 4, characterized in that: This study employs asynchronous federated learning combined with long short-term memory networks, based on vehicle movement characteristics and task request frequency. The specific process for predicting task popularity is as follows: Vehicle selection: Based on vehicle speed Uniform distribution characteristics and roadside units Coverage Calculate vehicles In roadside units Coverage Remaining stay time , Indicates vehicle Currently in roadside units Distance traveled within the coverage area; Select Vehicles with training times exceeding the long-term average are involved in asynchronous federated training. Model iterative training: from roadside units The global model is initialized using a Long Short-Term Memory (LSTM) network. After the participating vehicles download this model, it is used based on local task data, including task information. Local training is performed to update the local model, taking into account user privacy preferences; the first... wheeled vehicles The local empirical loss function is: ; In the formula, Indicates the first wheeled vehicles The local empirical loss function; Indicates the first wheeled vehicles Local model parameters; Indicates the first wheeled vehicles The number of samples used for local training; Indicates the first in the local training data One sample; Indicates based on and The loss function; Introducing attenuation coefficient Handle the delayed gradients of "slackers" and compute aggregated local gradients: ; In the formula, Indicates the first Local gradient after wheel aggregation; This represents the delayed gradient of the lagging component, i.e., the gradient that failed to participate in the previous aggregation due to the delay. Update the local model: ; In the formula, Indicates the first wheeled vehicles Local model parameters; Indicates the first Local model parameters of the wheel; Indicates the first Round learning rate; The vehicle uploads the updated local model to the roadside unit. Roadside unit The aggregate weights are calculated based on vehicle travel distance and transmission rate, and the global model is updated asynchronously. Roadside Unit Aggregation weights are calculated based on vehicle travel distance and transmission rate. ; Asynchronous updates to the global model are represented as: ; In the formula, Indicates the first Global model parameters of the wheel; Indicates the first Global model parameters of the wheel; This indicates the amount of local data for the vehicle. This represents the total global data volume, which is the sum of the local data volume of all vehicles participating in the aggregation. This represents the local gradient after aggregation; Capturing task request frequency using Long Short-Term Memory (LSTM) networks The temporal dependencies, based on the request frequency of the past 5 time slots. and vehicle privacy preferences As input ; through the forgetting gate Input gate Candidate memories Memory unit Output gate and hidden state Predict the frequency of task requests in the next time slot. ,Will As a measure of the popularity of the next time slot task; Defined in time slot cache hit rate To evaluate the guiding effect of prediction on caching decisions, Indicates an indicator function, Represents the set of related tasks. Represents a cache collection. Indicates time slot The identifier corresponding to the task within.
6. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 5, characterized in that: In step S3, the graph neural network extracts spatiotemporal features based on the state and task completion rate of the vehicle-to-everything (V2X) system model. and cache hit rate A Markov decision process is constructed and optimized using a proximal policy optimization algorithm.
7. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 6, characterized in that: The specific process of extracting spatiotemporal features using a graph neural network is as follows: Based on the real-time status of vehicles, roadside units, and macro base stations, a time-varying map is constructed in each time slot. , Represents a set of nodes. Denotes the set of fully connected edges. Indicates edge weight; Node set Includes vehicles Roadside Unit Macro base stations The total number of nodes is ; Set the initial node characteristics as Includes task load, computing power, cache status, location information, and task request frequency. ; edge weight This includes the weights between roadside units, the weights from roadside units to macro base stations, the weights from vehicles to vehicles, the weights from vehicles to roadside units, and the weights from vehicles to macro base stations. Before storage Time-varying mapping generation history map for each time slot , Represents the set of nodes in a historical graph. Represents the set of edges in a historical graph. The edge weights of the historical graph are represented by the time decay factor. Weighted aggregation of historical node features Historical marginal weight ; Employing graph attention networks, combined with and Attention coefficients, update node features Output global features ; to reconstruct the loss using graphs Train the graph neural network and update its parameters; Among them, a graph attention network is used, combined with and Attention coefficients, update node features , represented as: ; In the formula, express In and nodes A set of related nodes; express In and nodes A set of related nodes; Indicates the weighting factors of the historical graph; Indicates the activation function; express Middle node and nodes Attention coefficient between them; express Middle node and nodes Attention coefficient between them; Indicates the first Layer weight matrix; express Middle node In the Layer feature representation; express Middle node In the Layer feature representation; Global features Represented as: ; In the formula, express Middle node Feature representation; Reconstructing loss using graphs Training a graph neural network and updating its parameters can be represented as follows: ; ; In the formula, Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the first The time-mapped neural network in the nth iteration Layer weight matrix; Indicates the partial derivative sign; Indicates the learning rate; Indicates the first The parameter vector in the attention mechanism during the next iteration; Indicates the first The parameter vector in the attention mechanism during the next iteration.
8. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 7, characterized in that: State and task completion rate based on the vehicle-to-everything (V2X) system model and cache hit rate The specific process of constructing a Markov decision process and optimizing it using a proximal policy optimization algorithm is as follows: Define the elements of a Markov decision process: Time slot status Represented as: ; In the formula, Represents the node task queue. This indicates the vehicle task queue. This represents the roadside unit task queue. Represents the macro base station task queue; Indicates cache status. Indicates the vehicle's buffer state. Indicates the buffer status of the roadside unit. Indicates the macro base station cache status; Represents the global features of a graph neural network; Time slot action Represented as: ; In the formula, Indicates the target to be uninstalled; Indicates caching decisions; Indicates the percentage of partial uninstallation; Time slot Rewards Represented as: ; In the formula, The weighting coefficient represents the total latency and is used to adjust the degree of influence of total latency in reward calculation; This represents the weighting coefficient of the relevant items, used to adjust the degree of influence of the relevant factors in the reward calculation; This represents the weighting coefficient of cache hit rate, used to adjust the degree of influence of cache hit rate in reward calculation; This represents the total latency after normalization of the vehicle-to-everything (V2X) system model; Generate hybrid action strategies using an Actor network. Its goal is to determine the current state. Select the optimal action To maximize long-term cumulative returns, hybrid action strategies include discrete action distributions. and continuous action distribution ; The Actor network is optimized using "pruning the objective function + entropy regularization": Pruning objective function Represented as: ; In the formula, This represents the probability ratio between the old and new strategies; This represents the estimate of generalized advantage; Indicates the cropping range; Indicates the parameters of the Actor network; This represents the probability ratio between the old and new strategies; This represents the expectation operation; Indicates a cropping operation; Entropy regularization is expressed as: ; In the formula, This represents the objective function after adding entropy regularization; Represent the objective function for pruning; Represents policy entropy, Indicates the state Take action below The probability of; Represents the regularization coefficient; Evaluating state value using Critic network The goal is to minimize the timing difference error. ; In the formula, The loss function of the Critic network is represented by this. Indicates the parameters of the Critic network; Indicates the target value. Indicates the target network's next state Value estimation; Indicates the discount factor; The near-end policy optimization algorithm interacts with the environment of the vehicle-to-everything (V2X) system model, collecting experience tuples in each time slot. The experience is stored in an experience buffer pool; batches of experience are periodically sampled from the buffer pool, and the network parameters are updated using gradient descent. Actor network parameter update: , This represents the learning rate used to update the parameters of the Actor network. Indicates to Find the gradient; Critic network parameter updates: , This represents the learning rate used to update the Critic network parameters. Indicates to Find the gradient; Iterative optimization: Repeat the "experience collection-parameter update" process until the strategy converges, and finally achieve joint optimization of "unloading target-unloading ratio-caching strategy" in the dynamic vehicle network system model environment.
9. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 8, characterized in that: Historical node characteristics Represented as: , Indicates in time slot At that time, node The initial characteristics include task load, computing power, cache status, location information, and task request frequency. Indicates the index of the time slot; edge weight Represented as: , Indicates in time slot Time node and nodes The edge weights between them.
10. The method for vehicle network security offloading and cache optimization based on graph neural networks according to claim 9, characterized in that: and The attention coefficient is expressed as: ; ; In the formula, express Middle node and nodes Attention coefficient between them; express Middle node and nodes Attention coefficient between them; express Activation function; express transpose, This represents the parameter vector in the attention mechanism; Indicates the first Layer weight matrix; express Middle node In the Layer feature representation; express Middle node In the Layer feature representation; express Middle node and nodes Edge weights between them; express Middle node In the Layer feature representation; express Middle node and nodes The edge weights between them.
Citation Information
Patent Citations
Joint optimization of caching and calculation based on reinforcement learning caching and calculation
CN111818130A
Task unloading and cache updating method based on federal reinforcement learning in Internet of Vehicles
CN116437481A
Vehicle task unloading method for roadside-unit-free Internet of Vehicles
CN118714614A
End-side cloud collaborative computing unloading method based on resource clustering
CN119071303A
Deep reinforcement learning-based cooperative parallel task unloading method and system in vehicle-mounted edge computing environment
CN120849040A
Cited By
Edge cache content predicting and caching method, device and system for Internet of Vehicles
CN121284638A