Internet of vehicles security offloading and cache optimization method based on graph neural network

By constructing a vehicle-to-everything (V2X) system model and combining graph neural networks and reinforcement learning, the problems of task and cache separation and insufficient spatiotemporal correlation in V2X were solved, achieving efficient collaborative utilization of resources and privacy security, and improving task execution efficiency and cache hit rate.

CN121099376BActive Publication Date: 2026-03-20EAST CHINA JIAOTONG UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511639632.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-20
Estimated Expiration
2045-11-11

AI Technical Summary

Technical Problem

In existing vehicle networking technologies, task and cache processing are separated, and spatiotemporal correlation is not captured sufficiently, resulting in low resource utilization, insufficient task execution efficiency, and inability to achieve the optimal state of resource scheduling.

Method used

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. By combining graph neural networks and reinforcement learning, it achieves collaborative optimization of task offloading and caching. It adopts differential privacy protection and asynchronous federated learning to improve the accuracy of task popularity prediction, captures spatiotemporal correlations, and optimizes offloading targets and caching strategies.

Benefits of technology

It achieves a synergistic improvement in privacy and security, low total system latency, high cache hit rate and resource utilization in the Internet of Vehicles, adapts to dynamic topology and complex task requirements, and improves resource scheduling adaptability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121099376B_ABST
    Figure CN121099376B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle networking security offloading and cache optimization method based on a graph neural network, relates to the fields of intelligent transportation and edge computing, and aims to solve the problems of low resource scheduling efficiency, insufficient privacy protection and task and cache processing fragmentation in vehicle networking. The method comprises the following steps: S1, a vehicle networking system model is constructed, including a vehicle-roadside unit-macro base station architecture, a communication model of an orthogonal frequency division multiple access and a dedicated short-range communication protocol, and a calculation model including local processing and partial remote offloading; S2, Gaussian noise is introduced to realize differential privacy protection, and an asynchronous federated learning is combined with a long short-term memory network to predict task popularity; and S3, a dynamic heterogeneous graph is constructed, time and space features are extracted by using a graph neural network, an approximate policy optimization algorithm is input, and offloading targets, proportions and cache strategies are jointly optimized. The application realizes the collaborative improvement of privacy security, low system total time delay, high cache hit rate and resource utilization rate, and is suitable for the dynamic topology and complex task demand of vehicle networking.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent transportation and edge computing, in particular to a vehicle networking security offloading and cache optimization method based on a graph neural network. BACKGROUND

[0002] In the vehicle networking scenario, the effective utilization of resources faces significant challenges, and the core difficulties mainly come from two aspects: first, the network topology structure of vehicle networking has dynamics, and the positions and connection relationships of network nodes (such as vehicles, roadside units, etc.) will continuously change with the movement of vehicles; second, there are complex dependency relationships among various tasks in vehicle networking, and the task execution logic is related to each other, which further increases the difficulty of resource scheduling.

[0003] The existing methods for vehicle networking resource utilization have obvious limitations, which are specifically manifested as follows:

[0004] Task and cache processing are split: existing methods generally treat "task offloading" and "content caching" as two independent modules and process them separately, without forming a collaborative mechanism. This leads to the fact that the task results generated after task offloading cannot be reused immediately - when the same or related task requests occur subsequently, the generated task results cannot be directly called, and the task has to be executed again, resulting in redundant consumption of computing resources and time.

[0005] Insufficient capture of spatio-temporal correlation: there is significant spatio-temporal correlation between network nodes (vehicles, roadside units, base stations, etc.) (such as the aggregation of vehicles in a fixed road section within a certain period, the dynamic connection law of roadside units and surrounding vehicles, etc.), and this correlation is a key basis for making accurate offloading decisions (such as "whether to offload" and "offload to which node") and cache decisions (such as "cache which content" and "how to allocate cache space") in a dynamic vehicle networking environment. However, existing methods cannot effectively capture this spatio-temporal correlation, which ultimately leads to the fact that resource scheduling decisions deviate from the optimal state, and the overall performance of the system is at a suboptimal level.

[0006] The existence of the above problems results in low resource utilization and insufficient task execution efficiency in vehicle networking, and there is an urgent need for an optimization scheme that can integrate task offloading and result caching and accurately adapt to dynamic network characteristics to improve system performance and ensure data security and service efficiency. SUMMARY

[0007] In view of the deficiencies of the prior art, the present application provides a vehicle networking security offloading and cache optimization method based on a graph neural network, which aims to solve the problems in the background art.

[0008] To achieve the above-mentioned purpose, the present application provides the following technical scheme: a vehicle networking security offloading and cache optimization method based on a graph neural network, characterized in that it comprises the following steps:

[0009] Step S1: Constructing a vehicular networking system model; the system model includes a system architecture composed of vehicles, road side units and macro base stations, a communication model based on orthogonal frequency division multiple access and dedicated short range communication protocols, and a computing model covering local processing and partial remote offloading, which defines the processing and transmission delay of tasks on various nodes;

[0010] Step S2: Realizing secure task offloading and federated task popularity prediction; based on the constructed system model, first introduce Gaussian noise disturbance in the task offloading process to realize differential privacy protection; at the same time, use an asynchronous federated learning framework, so that vehicles use local data to cooperatively train a global model based on long short-term memory network to predict the task popularity of future time slots;

[0011] Step S3: Realizing spatio-temporal joint optimization based on graph neural network and reinforcement learning; based on the system model constructed in step S1 and the popularity prediction result obtained in step S2, a dynamic heterogeneous graph is constructed to represent the network spatio-temporal state, and global features are extracted using graph neural network; input this feature and the real-time state of the system into the proximal policy optimization algorithm, which jointly optimizes the offloading target, offloading proportion and caching strategy in the mixed action space, so as to minimize the total delay of the system and improve the cache hit rate.

[0012] Further, the system architecture includes:

[0013] Three types of core entities are defined, respectively:

[0014] Define the vehicle as a mobile node, represented as , denotes the vehicle index, denotes the total number of vehicles, and the vehicle speed follows a uniform distribution , denotes the speed of the th vehicle at time , denotes a uniform distribution, denotes the lower limit value of the vehicle speed, denotes the upper limit value of the vehicle speed, and the vehicle has the ability of task initiation, local calculation and caching;

[0015] Define the road side unit as a fixed node, represented as , denotes the road side unit index, denotes the total number of road side units; the road side unit is used to cover a specific area, coordinate resource allocation and process task requests;

[0016] Define the macro base station as a global resource node, represented as Macro base station is used to handle complex tasks beyond local capacity

[0017] Define time slot The generated task is , Indicates the size of the task data, Indicates the calculation difficulty coefficient, Indicates the size of the result data, Indicates the task category, Indicates the request frequency, Indicates the effective time; Make "partial offloading" strategy, divide the task into local processing part and remote offloading part, the remote offloading priority is: adjacent vehicle → The roadside unit in the coverage range → Macro base station , and after the completion of the offloading, according to the request frequency Decide whether to cache the result, the caching priority is: task execution node → roadside unit in the coverage range → Task initiating vehicle / adjacent vehicle;

[0018] The communication model includes:

[0019] The communication between vehicles is defined as , the communication between vehicle and roadside unit is , the communication between vehicle and macro base station is , the communication between roadside units is , the communication between roadside unit and vehicle is ; The communication between vehicles Adopt dedicated short-range communication protocol; The communication between vehicle and roadside unit , the communication between vehicle and macro base station Adopt orthogonal frequency division multiple access technology; The communication between roadside units Through fiber link;

[0020] Deduce Communication rate, Communication rate, Communication rate and Communication rate;

[0021] The calculation model includes:

[0022] Define the total time delay of the task as the sum of the transmission delay and the calculation delay, wherein the calculation delay includes the waiting time delay of other tasks in the task list and the processing time delay of the current task;

[0023] Combined with the partial offloading proportion, deduce the total time delay of the task generated by the vehicle, which is represented as:

[0024] ;

[0025] 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;

[0026] Derivation of roadside unit The total latency of generating the task is expressed as:

[0027] ;

[0028] In the formula, Indicates roadside unit Total latency of generating tasks represents the transmission latency between the roadside unit and the vehicle within a time slot ; represents the transmission latency between the roadside unit and the adjacent roadside unit within a time slot ; represents the waiting latency of the adjacent roadside unit within a time slot ; represents the processing latency of the adjacent roadside unit within a time slot ; represents the transmission latency between the roadside unit and the macro base station within a time slot ;

[0029] wherein, and ;

[0030] The total latency of the V2X system model is represented as:

[0031] ;

[0032] wherein, represents the total latency of the V2X system model within a time slot ; represents the tasks generated by the vehicle within a time slot ; represents the tasks generated by the roadside unit within a time slot ; represents the total latency of the tasks generated by the i-th vehicle within a time slot ; represents the total latency of the tasks generated by the i-th within a time slot ;

[0033] Further, in step S2, the differential privacy technology is introduced, and a Gaussian mechanism is used to add noise to the offloaded data to generate protected task data:

[0034] ;

[0035] wherein, represents the protected task data within a time slot after differential privacy protection; represents the Gaussian noise with a mean of 0 and a variance of ; ​​

[0036] Let the noise bias be Based on the derived transmission delay, processing delay formula, calculate the vehicle offloading delay increment introduced by noise Roadside unit Offloading delay increment Update the total delay of the vehicle networking system model;

[0037] Define the task completion rate:

[0038] ;

[0039] In the formula, Indicates the task completion rate in time slot ; Indicates the task set in time slot ; Indicates the exponential function; Indicates the actual completion time of the task in time slot , Indicates the basic completion time of the vehicle related task originally in time slot ; Indicates the delay increment of the vehicle offloading task introduced by noise; Indicates the basic completion time of the roadside unit related task originally in time slot ; Indicates the delay increment of the roadside unit offloading task introduced by noise;

[0040] Adopt asynchronous federated learning combined with long short-term memory network, based on vehicle moving characteristics, task request frequency Realize task popularity prediction.

[0041] Further, updating the total delay of the vehicle networking system model includes:

[0042] Vehicle offloading delay increment Indicated as:

[0043] ;

[0044] In the formula, Indicates the communication rate between vehicle And adjacent vehicle ; Indicates the processing capacity of adjacent vehicle ; Indicates the communication rate between vehicle And roadside unit ; Indicates the processing capacity of roadside unit ; Indicates the communication rate between vehicle And macro base station Communication rate between them; Indicates macro base station Processing capacity;

[0045] Roadside Unit Unload delay increment Represented as:

[0046] ;

[0047] 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;

[0048] The total latency for updating the vehicle-to-everything (V2X) system model is expressed as:

[0049] ;

[0050] 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.

[0051] 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:

[0052] 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 travelled in coverage; selection vehicles participating in asynchronous federated training exceed the long-term average training time;

[0053] Model iterative training: by roadside units Initialize global model with long short-term memory network, after participating vehicles download the model, based on local task data and user privacy preferences to update local model; define the first round of vehicle Local experience loss function:

[0054] ;

[0055] In the formula, Local experience loss function of the first round of vehicle ; Local model parameters of the first round of vehicle ; Sample quantity used for local training of the first round of vehicle ; The first sample in local training data; Loss function based on and ;

[0056] Decay coefficient Handle the delayed gradient of "stragglers", calculate the aggregated local gradient:

[0057] ;

[0058] In the formula, Aggregated local gradient of the first round; Delayed gradient of stragglers, i.e. not timely participating in the gradient aggregated before due to delay;

[0059] Update local model:

[0060] ;

[0061] In the formula, Local model parameters of the first round of vehicle ; Local model parameters of the first round; Learning rate of the first round;

[0062] The vehicle uploads the updated local model to the roadside unit The roadside unit Calculates the aggregation weight according to the vehicle driving distance and transmission rate, and updates the global model asynchronously

[0063] The roadside unit Calculates the aggregation weight according to the vehicle driving distance and transmission rate

[0064] The global model is updated asynchronously, represented as:

[0065]

[0066] In the formula, represents the global model parameters of the i-th round; represents the global model parameters of the i-th round; represents the local data volume of the vehicle; represents the total amount of global data, which is the sum of the local data volumes of all vehicles participating in aggregation; represents the aggregated local gradient; The long short-term memory network is used to capture the time sequence dependence of the task request frequency The request frequency of the past 5 time slots and the vehicle privacy preference

[0067] are used as inputs ; through the forget gate , input gate , candidate memory , memory cell , output gate and hidden state , the next time slot task request frequency is predicted , and is taken as the next time slot task popularity

[0068] The cache hit rate in the time slot is defined to evaluate the guidance effect of the prediction on the cache decision, represents the indicator function, represents the relevant task set, represents the cache set, represents the identification corresponding to the task within the time slot

[0069] Further, in step S3, the graph neural network extracts the spatio-temporal features based on the state of the Internet of Vehicles system model, the task completion rate and the cache hit rate ​​​​​A Markov decision process is constructed and optimized using a proximal policy optimization algorithm.

[0070] Furthermore, the specific process of graph neural networks extracting spatiotemporal features is as follows:

[0071] 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;

[0072] 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. ;

[0073] 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.

[0074] 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 side weights ;

[0075] 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;

[0076] Among them, a graph attention network is used, combined with and Attention coefficients, update node features , is represented as:

[0077] ;

[0078] In the formula, denotes a set of nodes associated with the node in the graph; denotes a set of nodes associated with the node in the graph; denotes a history graph weight factor; denotes an activation function; denotes an attention coefficient between the node and the node in the graph; denotes an attention coefficient between the node and the node in the graph; denotes a weight matrix of the layer; denotes a feature representation of the node in the layer; denotes a feature representation of the node in the layer;

[0079] global feature is represented as:

[0080] ;

[0081] wherein, denotes a feature representation of the node in the graph;

[0082] graph reconstruction loss training the graph neural network, updating the parameters, is represented as:

[0083] ;

[0084] ;

[0085] wherein, denotes a weight matrix of the layer of the graph neural network at the iteration; denotes a weight matrix of the layer of the graph neural network at the iteration; denotes a partial derivative symbol; denotes a learning rate; denotes a parameter vector in the attention mechanism at the iteration; denotes the parameter vector in the attention mechanism at the th iteration.

[0086] Further, based on the state of the vehicle networking system model, the task completion rate and the cache hit rate , the specific process of constructing a Markov decision process and optimizing it through a proximal policy optimization algorithm is as follows:

[0087] Define the elements of the Markov decision process:

[0088] The state of the time slot is represented as:

[0089] ;

[0090] In the formula, denotes the node task queue, denotes the vehicle task queue, denotes the roadside unit task queue, denotes the macro base station task queue; denotes the cache state, denotes the vehicle buffer state, denotes the roadside unit cache state, denotes the macro base station cache state; denotes the global feature of the graph neural network;

[0091] The action of the time slot is represented as:

[0092] ;

[0093] In the formula, denotes the unloading target; denotes the cache decision; denotes the partial unloading proportion;

[0094] The reward of the time slot is represented as:

[0095] ;

[0096] In the formula, denotes the weight coefficient of the total delay, used to adjust the influence degree of the total delay in the reward calculation; denotes the weight coefficient of the calculation-related item, used to adjust the influence degree of the calculation-related factor in the reward calculation; denotes the weight coefficient of the cache hit rate, used to adjust the influence degree of the cache hit rate in the reward calculation; ​​​Total latency of the vehicle networking system model after normalization

[0097] Generating hybrid action policy through actor network with the goal of maximizing long-term cumulative reward according to the current state , the hybrid action policy includes discrete action distribution and continuous action distribution ;

[0098] The actor network is optimized with "clipped target function + entropy regularization":

[0099] The clipped target function is expressed as:

[0100] ;

[0101] In the formula, is the probability ratio of the new and old policies; is the generalized advantage estimate value; is the clipping range; is the actor network parameter; is the probability ratio of the new and old policies; is the expected operation; is the clipping operation;

[0102] The entropy regularization is expressed as:

[0103] ;

[0104] In the formula, is the target function after adding entropy regularization; is the clipped target function; is the policy entropy, is the probability of taking action in state ; is the regularization coefficient;

[0105] The state value is evaluated through the Critic network with the goal of minimizing the time difference error:

[0106] ;

[0107] In the formula, is the loss function of the Critic network; is the Critic network parameter; is the target value, is the next state value estimation of the target; denotes the discount factor;

[0108] The proximal policy optimization algorithm interacts with the environment of the Vehicular Networking System model, collecting experience tuples every time slot , which are stored in an experience buffer pool; periodically, a batch of experiences is sampled from the buffer pool, and the network parameters are updated by gradient descent:

[0109] Actor network parameter update: , denotes the learning rate of the Actor network parameter update, denotes the gradient of ;

[0110] Critic network parameter update: , denotes the learning rate of the Critic network parameter update, denotes the gradient of ;

[0111] Iterative optimization: repeat the "experience collection-parameter update" process until the policy converges, and finally achieve the joint optimization of "offloading target-offloading ratio-cache strategy" under the dynamic Vehicular Networking System model environment.

[0112] Further, the historical node features are represented as: , denotes the initial features of node at time slot , including task load, computing power, cache state, location information, and task request frequency, denotes the index of the time slot;

[0113] The edge weight is represented as: , denotes the edge weight between node and node at time slot .

[0114] Further, and the attention coefficient is represented as:

[0115] ;

[0116] ;

[0117] In the formula, denotes the node and node in attention coefficient between the nodes denotes a node in the middle layer attention coefficient between the nodes denotes an activation function denotes a transpose of denotes a parameter vector in the attention mechanism denotes a weight matrix of the first layer denotes a node in the middle layer feature representation in the first layer denotes a node in the middle layer feature representation in the first layer denotes an edge weight between the nodes in the middle layer denotes a node in the middle layer feature representation in the first layer denotes an edge weight between the nodes in the middle layer .

[0118] Compared with the prior art, the present application has the following beneficial effects:

[0119] (1) The present application integrates five innovations of differential privacy protection, asynchronous federated LSTM popularity prediction, GNN spatiotemporal feature extraction, PPO joint optimization and "partial offloading + cache coordination", forming an integrated solution: Gaussian noise is used to realize privacy protection and control the influence of time delay, asynchronous federated LSTM is used to improve the accuracy of popularity prediction to guide the cache; GNN is used to capture the spatiotemporal correlation of nodes, and PPO algorithm is used to optimize the offloading target, proportion and cache strategy in the mixed action space, and the "partial offloading" and cache priority rules are used to break the module fragmentation, so as to finally realize the coordinated improvement of privacy security, low system total time delay, high cache hit rate and resource utilization rate of Internet of Vehicles, and adapt to dynamic topology and complex task requirements.

[0120] (2) The application realizes differential privacy protection by introducing Gaussian noise disturbance in task offloading data, which can effectively prevent attackers from inferring vehicle user privacy information through offloading data, reduce the risk of sensitive data leakage, and at the same time derive the vehicle and roadside unit offloading delay increment introduced by noise, clearly define the influence boundary of the privacy protection mechanism on system performance, avoid excessive protection at the expense of task processing efficiency, and ensure the balance between privacy security and performance.

[0121] (3) The application adopts an asynchronous federated learning framework combined with a long short-term memory network (LSTM) to construct a popularity prediction model, and vehicles can collaboratively train a global model based on local private data without uploading original data, balancing privacy protection and model training efficiency; the LSTM network can accurately capture the time sequence dependence of task request frequency, improve the accuracy of future time slot task popularity prediction, provide reliable basis for cache decision, and thus improve cache hit rate and reduce cache space waste and repeated calculation.

[0122] (4) The application constructs a dynamic heterogeneous graph based on the real-time state of Internet of Vehicles nodes, extracts global spatio-temporal features using a graph neural network, aggregates historical graph features through a time decay factor, effectively captures the spatio-temporal correlation between vehicles, roadside units, and macro base stations, and solves the problem of insufficient spatio-temporal correlation capture in traditional methods; the global features extracted by the GNN are input into a near-end strategy optimization algorithm along with the real-time state of the system, jointly optimizing the task offloading target, offloading ratio, and cache strategy in the hybrid action space, which can significantly reduce the total time delay of the system and improve the adaptability and efficiency of resource scheduling.

[0123] (5) The application innovatively designs an integrated mechanism of "partial offloading + cache collaboration", splits tasks into local processing and remote offloading parts, clearly defines remote offloading priority and cache priority, realizes seamless connection of task offloading and result caching, avoids redundant computing resources caused by the separation of the two in traditional methods; at the same time, the system model integrates communication and computing modules, quantifies the communication rate and task processing delay of each node, realizes multi-node resource collaborative allocation of vehicles, roadside units, and macro base stations, and improves the overall service efficiency and resource utilization rate of Internet of Vehicles. BRIEF DESCRIPTION OF DRAWINGS

[0124] Figure 1 The application provides a step flowchart. DETAILED DESCRIPTION

[0125] As shown in Figure 1 , the application provides a technical solution: a graph neural network-based Internet of Vehicles secure offloading and cache optimization method, including the following steps:

[0126] 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.

[0127] 1. Design the system architecture;

[0128] 1.1 Define three types of core entities, namely:

[0129] 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.

[0130] 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.

[0131] 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.

[0132] 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 Decide whether to cache the results, cache priority: task execution node→ coverage roadside unit → task initiation vehicle / adjacent vehicle; cache content is dynamically updated according to task popularity, low popularity content will be replaced to optimize the utilization efficiency of cache space.

[0133] 2, build communication model;

[0134] 2.1, define the communication between vehicles as , the communication between vehicles and roadside units as , the communication between vehicles and macro base stations as , the communication between roadside units and roadside units as , the communication between roadside units and vehicles as ; the communication between vehicles Adopt dedicated short range communication (DSRC) protocol; the communication between vehicles and roadside units , the communication between vehicles and macro base stations Adopt orthogonal frequency division multiple access (OFDMA) technology; the communication between roadside units and roadside units Through fiber link.

[0135] 2.2, based on Shannon theorem, respectively Communication rate, Communication rate, Communication rate and Communication rate.

[0136] Communication rate:

[0137] ;

[0138] In the formula, Indicates the communication rate between vehicles And adjacent vehicles ; Indicates the available bandwidth of the technology used in communication; Indicates the transmission power of the vehicle; Indicates the channel gain between vehicles And vehicles , Indicates the distance between vehicles And vehicles ; Indicates the noise power in the communication process.

[0139] Can be expressed as:

[0140] ​ ;

[0141] where, denotes the vehicle and the road side unit between the vehicle and the road side unit between the vehicle and the road side unit

[0142] Communication rate:

[0143] ;

[0144] where, denotes the vehicle and the road side unit between the vehicle and the road side unit available bandwidth of the technology used for communication; denotes the channel gain between the vehicle and the road side unit denotes the distance between the vehicle and the road side unit

[0145] Communication rate:

[0146] ;

[0147] where, denotes the vehicle and the macro base station between the vehicle and the macro base station available bandwidth of the technology used for communication; denotes the channel gain between the vehicle and the macro base station denotes the distance between the vehicle and the macro base station

[0148] Communication rate:

[0149] ;

[0150] where, denotes the road side unit communication rate between the vehicle ; available bandwidth of the technology employed for the communication; transmission power of the road side unit; channel gain between the road side unit and the vehicle , distance between the road side unit and the vehicle .

[0151] 3. Deriving the computation model;

[0152] defining the total latency of the task as the sum of the transmission delay and the computation delay, wherein the computation delay includes the waiting latency of other tasks in the task list and the processing latency of the current task;

[0153] 1. Deriving the transmission delay of the vehicle offloading the task to the adjacent vehicle , the road side unit , the macro base station , denoted as:

[0154] ;

[0155] ;

[0156] ;

[0157] wherein, denotes the transmission delay of the vehicle offloading the task to the adjacent vehicle in the time slot ; denotes the transmission delay of the vehicle offloading the task to the road side unit in the time slot ; denotes the transmission delay of the vehicle offloading the task to the macro base station in the time slot ; denotes the data size of the task generated in the time slot .

[0158] deriving the waiting latency and the processing latency of the vehicle , denoted as:

[0159] ;

[0160] ;​

[0161] wherein, denotes a vehicle in time slot ; denotes a vehicle in time slot ; denotes the i-th task in the task list of a vehicle ; denotes the processing capability of a vehicle ; denotes the task list of a vehicle in time slot ; denotes the computational difficulty coefficient of a task in time slot .

[0162] If a task is offloaded to a vehicle , its waiting time and processing time are denoted as:

[0163] ;

[0164] ;

[0165] wherein, denotes the waiting time of a neighboring vehicle in time slot ; denotes the processing time of a vehicle in time slot ; denotes the i-th task in the task list of a vehicle in time slot ; denotes the processing capability of a neighboring vehicle ; denotes the task list of a vehicle in time slot . The waiting time and processing time of a roadside unit

[0166] are denoted as:

[0167] ;

[0168] ;

[0169] wherein, denotes the waiting time of a roadside unit in time slot ; denotes the processing time of a roadside unit​​ the processing latency of the macro base station 1000 at the time slot t; the first task in the task list of the macro base station 1000 at the time slot t; the processing capability of the macro base station 1000; the task list of the macro base station 1000 at the time slot t.

[0170] the waiting latency of the macro base station 1000 and the processing latency of the macro base station 1000 are represented as:

[0171]

[0172]

[0173] wherein, the waiting latency of the macro base station 1000 at the time slot t; the processing latency of the macro base station 1000 at the time slot t; the first task in the task list of the macro base station 1000 at the time slot t; the processing capability of the macro base station 1000;

[0174] the transmission latency of the road side unit 1000 to the vehicle 2000, the adjacent road side unit 1000, the macro base station 1000, is represented as:

[0175]

[0176]

[0177]

[0178] wherein, the transmission latency between the road side unit 1000 and the vehicle 2000 within the time slot t; ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​Intra-vehicle, road-side unit Transmission latency between the vehicle and the road-side unit. Transmission latency between the vehicle and the macro base station. Intra-vehicle, road-side unit Transmission latency between the vehicle and the road-side unit. Intra-vehicle, road-side unit Transmission latency between the vehicle and the macro base station.

[0179] The total latency of the vehicle generating the task is derived in combination with the partial offloading ratio, denoted as:

[0180] ;

[0181] In the formula, denotes the total latency of the vehicle generating the task; denotes the waiting latency of the vehicle in the time slot ; denotes the processing latency of the vehicle in the time slot ; denotes the partial offloading ratio; denotes the transmission latency of the vehicle offloading the task to the adjacent vehicle in the time slot ; denotes the waiting latency of the adjacent vehicle in the time slot ; denotes the processing latency of the vehicle in the time slot ; denotes the transmission latency of the vehicle offloading the task to the road-side unit in the time slot ; denotes the waiting latency of the road-side unit in the time slot ; denotes the processing latency of the road-side unit in the time slot ; denotes the transmission latency of the vehicle offloading the task to the macro base station in the time slot ; denotes the waiting latency of the macro base station in the time slot ; denotes the processing latency of the macro base station in the time slot ; , , Each represents a partial unloading ratio coefficient, corresponding to the task unloading percentage of different unloading objects (vehicles, roadside units, macro base stations, etc.).

[0182] Derivation of roadside unit The total latency of generating the task is expressed as:

[0183] ;

[0184] 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.

[0185] in, and .

[0186] 3. The total latency of the vehicle-to-everything (V2X) system model is expressed as:

[0187] ;

[0188] 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.

[0189] Step S2: Realize secure task offloading and federated task popularity prediction; based on the constructed system model, first introduce Gaussian noise disturbance in the task offloading process to realize differential privacy protection, ensure the safety of sensitive data; at the same time, adopt the asynchronous federated learning framework, make the vehicle use the local data to cooperatively train a global model based on long short-term memory network, to predict the task popularity of future time slots.

[0190] Step S2.1: Perform secure task offloading;

[0191] In view of the sensitive data exposure risk in the task offloading process, the differential privacy technology is introduced, and Gaussian mechanism is adopted to add noise to the offloaded data to generate protected task data:

[0192] ;

[0193] In the formula, denotes the protected task data in the time slot after differential privacy protection; denotes the Gaussian noise with mean 0 and variance .

[0194] Wherein, According to the differential privacy definition calculation, it is denoted as:

[0195] ;

[0196] In the formula, denotes the sensitivity, representing the maximum change of adjacent data; , respectively denote the privacy budget and failure probability, which are used to jointly control the privacy protection strength.

[0197] Wherein, in order to ensure the practicability of the protected task data , it is limited within a reasonable range:

[0198] .

[0199] Let the noise bias be , based on the derived transmission delay and processing delay formula, calculate the vehicle offloading delay increment introduced by noise , roadside unit offloading delay increment , update the total delay of the Internet of Vehicles system model;

[0200] The vehicle offloading delay increment is denoted as:

[0201] .

[0202] Roadside unit offloading delay increment is denoted as:

[0203] ;

[0204] wherein, denotes the communication rate between the road side unit and the adjacent road side unit ; denotes the processing capability of the adjacent road side unit ; denotes the communication rate between the road side unit and the macro base station .

[0205] The total latency of updating the V2X system model is denoted as:

[0206] ;

[0207] wherein, denotes the offloading delay increment introduced by the noise for the th vehicle-generated task in the time slot ; denotes the offloading delay increment introduced by the noise for the th road side unit-generated task in the time slot .

[0208] The task completion rate is defined as:

[0209] ;

[0210] wherein, denotes the task completion rate in the time slot ; denotes the task set in the time slot ; denotes the exponential function; denotes the actual completion time of the task in the time slot , denotes the original base completion time of the vehicle-related task in the time slot ; denotes the offloading delay increment introduced by the noise for the vehicle; denotes the original base completion time of the road side unit-related task in the time slot ; denotes the offloading delay increment introduced by the noise for the road side unit.

[0211] Step S2.2: Implementing the federated task popularity prediction;

[0212] An asynchronous federated learning (AFL) combined with a long short-term memory (LSTM) network is used to predict the popularity of tasks based on the vehicle moving characteristics, task request frequency The popularity of tasks is predicted, and specifically:

[0213] Vehicle selection: according to the uniform distribution characteristics of vehicle speed and the coverage range of roadside units The remaining residence time of the vehicle in the coverage range of the roadside unit is calculated , which represents the distance the vehicle has traveled in the coverage range of the roadside unit; vehicles with a residence time longer than the long-term average training time are selected to participate in asynchronous federated training. Model iterative training: the roadside unit initializes a global model using a long short-term memory (LSTM) network, and after the participating vehicles download the model, they perform local training based on local task data (including task and user privacy preferences) to update the local model; the local experience loss function of the vehicle in the first round is defined as:

[0214] wherein, represents the local experience loss function of the vehicle in the first round; represents the local model parameters of the vehicle in the first round; represents the number of samples used for local training by the vehicle in the first round; represents the i-th sample in the local training data; represents the loss function based on and

[0215]

[0216]

[0217] An attenuation coefficient is introduced to handle the delayed gradient of "laggers", and the aggregated local gradient is calculated as:

[0218]

[0219] ​​​​​​​​​​​​​​​​​​​​​​​​​​local gradient after round t; delay gradient of straggler, i.e., the gradient that is not timely participated in the aggregation of previous rounds due to delay.

[0220] updating local model:

[0221] ;

[0222] wherein, denotes the local model parameter of the t th vehicle; denotes the local model parameter of the t th round; denotes the learning rate of the t th round.

[0223] The vehicle uploads the updated local model to the roadside unit , and the roadside unit calculates the aggregation weight according to the driving distance of the vehicle and the transmission rate, and updates the global model asynchronously;

[0224] The roadside unit calculates the aggregation weight according to the driving distance of the vehicle and the transmission rate, and is expressed as:

[0225] ;

[0226] wherein, denotes the corresponding aggregation weight of the vehicle , which is used to measure the importance of the local model of the vehicle when the roadside unit aggregates the local model; denotes the balance factor; denotes the maximum value of the communication rate of the roadside unit among the vehicles participating in the aggregation of the t th round, denotes the set of vehicles participating in the aggregation of the t th round, denotes the maximum value operation on the variable or function with subscript .

[0227] The global model is updated asynchronously, and is expressed as:

[0228] ;

[0229] wherein, denotes the global model parameter of the t th round; denotes the global model parameter of the t th round; denotes the amount of local data of the vehicle; denotes the total amount of global data, which is the sum of the amount of local data of all vehicles participating in the aggregation.​ This represents the local gradient after aggregation.

[0230] 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);

[0231] 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.

[0232] enter , Indicates a time interval;

[0233] 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;

[0234] 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;

[0235] Candidate Memory , This represents the hyperbolic tangent activation function. representing candidate memories corresponding weight matrix, representing candidate memories corresponding weight matrix, bias term representing candidate memories;

[0236] memory cell , representing previous time step memory cell state, representing element-wise multiplication;

[0237] output gate , representing output gate corresponding weight matrix, representing output gate corresponding weight matrix, bias term representing output gate;

[0238] hidden state .

[0239] Step S3: Implementing spatio-temporal 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, a dynamic heterogeneous graph is constructed to represent the network spatio-temporal state, and a graph neural network (GNN) is used to extract global features; the features are input into the proximal policy optimization algorithm (PPO) together with the real-time state of the system, and the algorithm jointly optimizes the unloading target, unloading proportion and caching strategy in the mixed action space, so as to minimize the total time delay of the system and improve the cache hit rate.

[0240] Step S3.1: Graph neural network (GNN) extracts spatio-temporal features;

[0241] Based on the real-time state of vehicles, roadside units and macro base stations, a time-varying heterogeneous graph is constructed at each time slot , representing a set of nodes, representing a set of fully connected edges, representing edge weights;

[0242] a set of nodes comprising vehicles , roadside units , macro base stations , the total number of nodes being ; the initial node features are set to , including task load, computing power, cache state, location information and task request frequency ;

[0243] Edge weight comprises:

[0244] The weight between roadside units is = 1;

[0245] The weight from roadside unit to macro base station is , denotes the distance from roadside unit to macro base station , denotes the maximum distance threshold;

[0246] The weight from vehicle to vehicle is: , denotes the vehicle related task request frequency, denotes the distance from vehicle to vehicle, denotes the distance decay coefficient;

[0247] The weight from vehicle to roadside unit is: , denotes the roadside unit related task request frequency, denotes the distance from vehicle to roadside unit;

[0248] The weight from vehicle to macro base station is , denotes the distance from vehicle to macro base station.

[0249] The time-varying meta-graph generation history graph of the previous slots , denotes the node set of the history graph, denotes the edge set of the history graph, denotes the edge weight of the history graph, weighted by time decay factor aggregates the history node features and history edge weights ;

[0250] The history node feature is denoted as: , denotes the initial feature of node at slot (including task load, computing capability, cache status, location information and task request frequency, etc.), and denotes the index of the slot;

[0251] The edge weight is denoted as: , denotes the edge weight between node and node at slot ;

[0252] 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.

[0253] in, and The attention coefficient is expressed as:

[0254] ;

[0255] ;

[0256] 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.

[0257] Among them, a graph attention network (GAT) is used, combined with and attention coefficient of the node, updating the node feature is denoted as:

[0258] ;

[0259] wherein, denotes a set of nodes associated with the node in the historical graph; denotes a set of nodes associated with the node in the historical graph; denotes a historical graph loss weight.

[0260] wherein, a global feature is denoted as:

[0261] ;

[0262] wherein, denotes a feature representation of the node in the historical graph;

[0263] wherein, a graph reconstruction loss is denoted as:

[0264] ;

[0265] wherein, denotes a reconstructed edge weight, denotes a transpose of the feature representation of the node , and denotes a feature representation of the node ; denotes a historical graph loss weight.

[0266] wherein, a graph neural network (GNN) is trained with the graph reconstruction loss to update parameters, denoted as:

[0267] ;

[0268] ;

[0269] wherein, denotes a weight matrix of the -th layer of the graph neural network at the -th iteration; denotes a weight matrix of the -th layer of the graph neural network at the -th iteration; denotes a partial derivative symbol; denotes a learning rate; denotes the Parameter vector in attention mechanism at the i-th iteration; Parameter vector in attention mechanism at the i-th iteration. Parameter vector in attention mechanism at the i-th iteration.

[0270] Step S3.2: PPO optimization of offloading and caching strategy;

[0271] Based on the state, task completion rate and cache hit rate of the vehicle networking system model , a Markov decision process (MDP) is constructed and optimized through a near-optimal strategy optimization algorithm, specifically: 1. Define the Markov decision process (MDP) elements:

[0272] State of time slot

[0273] is expressed as:

[0274] ;

[0275] In the formula, represent the current task information, represent the data size of the task, represent the computational difficulty coefficient of the task, represent the data size of the task result, represent the category to which the task belongs, represent the task request frequency, represent the effective time of the task; represent the node task queue, represent the vehicle task queue, represent the roadside unit task queue, represent the macro base station task queue; represent the cache state, represent the vehicle buffer state, represent the roadside unit cache state, represent the macro base station cache state; represent the global features of the graph neural network (GNN).

[0276] Action of time slot is expressed as:

[0277] ;

[0278] In the formula, represent the offloading target (such as vehicle , roadside unit , macro base station ); ​​​represents a cache decision (e.g., whether to cache the task result or not); represents a partial offloading ratio.

[0279] time slot reward represents:

[0280] ;

[0281] wherein, represents a weight coefficient of total latency, used to adjust the influence degree of total latency in reward calculation; represents a weight coefficient of calculation correlation, used to adjust the influence degree of calculation correlation in reward calculation; represents a weight coefficient of cache hit rate, used to adjust the influence degree of cache hit rate in reward calculation; represents the normalized total latency of the vehicle networking system model.

[0282] 2. Dual-network training;

[0283] generate a hybrid action policy through an actor network , which aims to select an optimal action according to the current state to maximize the long-term cumulative reward, including a discrete action distribution and a continuous action distribution ; wherein the discrete action distribution is a joint probability distribution of offloading target and cache decision generated by a Softmax function, and the continuous action distribution is a partial offloading ratio generated by a normal distribution and mapped to [0, 1] through a Sigmoid function.

[0284] The actor network is optimized by a “clipped target function + entropy regularization”:

[0285] The clipped target function is represented as:

[0286] ;

[0287] wherein, represents the probability ratio of new and old policies; represents a generalized advantage estimation (GAE) value; represents a clipping range; represents the actor network parameters; represents the probability ratio of new and old policies; represents an expected operation; represents a clipping operation.

[0288] The entropy regularization is represented as:

[0289] ;

[0290] In the formula, represents the target function after adding the entropy regularization, which is used to consider the optimization of the clipping target function and increase the exploration of the policy through the policy entropy in the policy optimization process, so as to improve the training effect; represents the clipping target function; represents the policy entropy, which is used to measure the uncertainty of the policy. The greater the entropy, the stronger the exploration of the policy. By adding it to the target function, the policy can be encouraged to explore more and avoid converging to a local optimum too early, represents the probability of taking action in state ; represents the regularization coefficient.

[0291] wherein, is represented as:

[0292] ;

[0293] In the formula, represents the time difference (TD) residual, represents the discount factor, represents the value function estimate in state , represents the value function estimate in state , represents the state of time slot ; represents the generalized advantage estimation GAE parameter; represents the total number of time slots.

[0294] The state value is evaluated by the Critic network , and the target is to minimize the time difference (TD) error:

[0295] ;

[0296] In the formula, represents the loss function of the Critic network; represents the Critic network parameter; represents the target value, represents the value estimate of the next state by the Target network (the Critic network with slow parameter update).

[0297] 3. Experience loop optimization;

[0298] Experience collection: Proximal policy optimization algorithm interacts with the environment of the V2X system model, collecting experience tuples every time slot , which are stored in an experience buffer pool.

[0299] Parameter update: periodically sample batch experience (e.g. Mini-batch samples) from the buffer pool, update network parameters by gradient descent:

[0300] Actor network parameter update: , denotes the learning rate of the Actor network parameter update, denotes the gradient of ;

[0301] Critic network parameter update: , denotes the learning rate of the Critic network parameter update, denotes the gradient of .

[0302] Iterative optimization: repeat the process of "experience collection - parameter update" until the policy converges (e.g. reward tends to be stable), finally achieve the joint optimization of "offloading target - offloading ratio - cache policy" under the dynamic V2X system model environment.

[0303] Although embodiments of the present application have been shown and described, it is to be understood that various modifications, substitutions, replacements and variations can be made to these embodiments without departing from the principles and spirit of the present application, the scope of the present application being 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 offloading target, offloading ratio, and caching strategy in the hybrid action space, thereby minimizing the total system latency and improving the cache hit rate. 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: 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. Indicates the first wheeled vehicles The local empirical loss function; 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 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.

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 process of predicting task popularity includes: 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 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.

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 side weights ; 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.

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 . 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

  • Deep reinforcement learning-based cooperative parallel task unloading method and system in vehicle-mounted edge computing environment

    CN120849040A