An event-triggered time-varying federated learning method for vehicular networking

By constructing a time-varying communication network graph model and optimizing communication triggering conditions, the problems of high communication overhead and topology instability in highly dynamic vehicle-to-everything (V2X) environments are solved. Efficient and secure federated learning is achieved, adapting to network topology changes caused by high-speed vehicle movement, and improving the system's energy efficiency and scalability.

CN122072849APending Publication Date: 2026-05-22NANJING UNIV OF INFORMATION SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2026-02-13
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing network federated learning methods suffer from high communication overhead, topological instability, and difficulty in privacy protection in highly dynamic vehicular network environments.

Method used

We adopt an event-triggered time-varying federated learning method for vehicle-to-everything (V2X) networks. By constructing a time-varying communication network graph model, defining local and global loss functions, setting preset step size and threshold convergence conditions, initializing and dynamically updating model parameters, designing weighted model aggregation rules, optimizing communication triggering conditions, and reducing redundant communication.

Benefits of technology

It significantly reduces communication overhead, adapts to changes in network topology, improves the system's energy efficiency and scalability, ensures model convergence accuracy and privacy security, and provides real-time collaborative perception and decision support in intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122072849A_ABST
    Figure CN122072849A_ABST
Patent Text Reader

Abstract

The application provides an event-triggered time-varying vehicle networking network federated learning method, and belongs to the technical field of vehicle networking and distributed machine learning. The method comprises the following steps: based on a decentralized vehicle networking, a time-varying communication network graph model is established, and a global loss function is obtained by defining a local loss function according to a local data set; based on the time-varying communication network graph model, a preset step length and a threshold convergence condition are set, and a preset initialization is performed to obtain an initialized time-varying communication network graph model; a maximum iteration number is set, the initialized time-varying communication network graph model is trained to obtain optimal model parameter of each vehicle node; and a global average model is calculated according to the optimal model parameter of each vehicle node, and an optimal target function value is obtained by using the global loss function. The application solves the problems of large communication overhead, unstable topology and difficult privacy protection of the existing time-varying vehicle networking network federated learning method in a high dynamic network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of vehicle networking and distributed machine learning technology, and particularly relates to a federated learning method for time-varying vehicle networking based on event triggering. Background Technology

[0002] Federated learning, a distributed machine learning technique, enables collaborative modeling among multiple parties while protecting data privacy, and has received widespread attention in the field of connected vehicles in recent years. Traditional centralized federated learning relies on a central server for model aggregation, which poses risks of single points of failure, communication bottlenecks, and privacy breaches. Especially in scenarios where high-speed vehicle movement causes dynamic changes in network topology, long-distance communication between central nodes and edge vehicles is often unstable, severely impacting model training efficiency and system reliability.

[0003] To overcome the aforementioned problems, decentralized federated learning has emerged, which improves system robustness by replacing central server coordination with direct communication between vehicle nodes. However, existing decentralized solutions mostly employ fixed-period communication strategies, requiring frequent exchange of model parameters in time-varying vehicular networks, resulting in significant communication and energy overhead. Although event-triggered mechanisms can suppress redundant communication by setting conditions, existing research is largely based on static network assumptions and fails to effectively address the challenges of ensuring topological consistency and convergence caused by the rapid movement of vehicle nodes. Therefore, a new network federated learning method that is suitable for highly dynamic vehicular networks and can balance communication efficiency and learning performance is urgently needed. Summary of the Invention

[0004] To address the aforementioned shortcomings in existing technologies, this invention provides an event-triggered time-varying vehicular network federated learning method, which solves the problems of high communication overhead, unstable topology, and difficulty in privacy protection in existing network federated learning methods under highly dynamic network environments.

[0005] To achieve the above objectives, the technical solution adopted by this invention is: a federated learning method for time-varying vehicle networks based on event triggering, comprising the following steps: S1. Based on decentralized vehicle network, a time-varying communication network graph model is established by acquiring the set of vehicle nodes, and a global loss function is obtained by defining a local loss function based on the local dataset. S2. Based on the time-varying communication network graph model, by setting the preset step size and threshold convergence condition, the time decay step size sequence and dynamic event triggering threshold function are obtained, and the parameters of the time-varying communication network graph model of each vehicle node are preset and initialized to obtain the initialized time-varying communication network graph model. S3. Set the maximum number of iterations. Based on the local dataset, time decay step sequence, and dynamic event triggering threshold function, train the initialized time-varying communication network graph model by dynamically updating the neighbor set, setting communication triggering conditions, and setting weighted model aggregation rules to obtain the optimal model parameters for each vehicle node. S4. Based on the optimal model parameters of each vehicle node, calculate the global average model and use the global loss function to obtain the optimal objective function value, thus completing the decentralized federated learning of time-varying vehicle networks.

[0006] The beneficial effects of this invention are as follows: By constructing a time-varying communication network graph model and defining local and global loss functions, initializing the model by setting preset step size and threshold convergence conditions, and obtaining optimal model parameters and optimal objective function values ​​by dynamically updating the neighbor set, setting communication trigger conditions, and setting weighted model aggregation rules, this invention significantly reduces the communication overhead in decentralized learning of vehicle networks, effectively adapts to network topology changes caused by high-speed vehicle movement, and improves the energy efficiency and scalability of the system while ensuring model convergence accuracy, providing reliable technical support for real-time collaborative perception and decision-making in intelligent transportation systems.

[0007] Further, S1 includes the following steps: S101. Obtain the set of vehicle nodes and the set of communication links that communicate with each other in the decentralized vehicle network; S102. The set of vehicle nodes is taken as the set of vertices, the set of communication links is taken as the set of edges, and the time-varying communication network is set up based on the preset connectivity assumption to establish a time-varying communication network graph model. S103. Based on the local model parameters shared by each vehicle node in the time-varying communication network graph model, and according to the local dataset, the global loss function is obtained by defining the local loss function.

[0008] Furthermore, the expression for the time-varying communication network graph model is as follows: ; in, Represents a time-varying communication network graph model. Represents the set of vertices. Indicates the number of iterations edge set; The expression for the global loss function is as follows: ; ; in, Represents the global loss function. This indicates that all vehicle nodes share this. dDimensional local model parameters, , Indicates the number of vehicle nodes. Represents the local loss function. Represents vehicle node i The number of local data samples, Indicates the first j indivual, Indicates sample The loss function used is the cross-entropy loss function. Represents local dataset The first in j One data sample.

[0009] The beneficial effects of the above-mentioned further solutions are as follows: This invention constructs a time-varying communication network graph model by obtaining the set of vehicle nodes and communication links that communicate with each other in a decentralized vehicle network, and defines local loss functions and global loss functions, thereby realizing an accurate representation of the dynamic changes in the communication topology between vehicle nodes. At the same time, based on the local dataset, the local loss function is defined and aggregated into a global loss function, establishing a distributed optimization objective, thus providing a theoretical basis and computational foundation for subsequent event triggering and collaborative training.

[0010] Furthermore, S2 includes the following steps: S201. Based on the local model of each vehicle node in the time-varying communication network graph model, by setting a preset step size convergence condition, a time decay step size sequence is constructed according to the basic learning rate and decay coefficient. S202. By setting threshold convergence conditions, a dynamic event triggering threshold function is constructed. S203. Using zero initialization or random initialization based on a specific distribution, initialize the local model parameters of each vehicle node and set the event trigger time record variable to zero to obtain the initialized time-varying communication network graph model.

[0011] Furthermore, the expressions for the preset step size and threshold convergence condition are as follows: ; in, Indicates the number of iterations The preset step size, Indicates the number of iterations. Indicates the number of iterations The time-varying threshold; The expression for the time decay step sequence is as follows: ; in, Indicates the basic learning rate. Indicates the attenuation coefficient; The expression for the dynamic event triggering threshold function is as follows: ; in, It represents the natural logarithm.

[0012] The beneficial effects of the above-mentioned further solutions are as follows: By designing a time decay step sequence and a dynamic event trigger threshold function, and combining it with the preset initialization of model parameters, this invention not only ensures the stable convergence of the training process, but also effectively reduces redundant communication, laying an algorithmic foundation for efficient collaborative learning in time-varying vehicle networking environments.

[0013] Furthermore, step S3 includes the following steps: S301. Set the maximum number of iterations and obtain the initial neighbor set of the vehicle node based on the local dataset; S302. Based on the initialized time-varying communication network graph model, the neighboring nodes within the communication range of the vehicle node are detected by periodic beacon switching, and the initial neighbor set is dynamically updated to obtain the updated neighbor set. S303. Based on the characteristics of the local dataset, set the scaling factor, and based on the dynamic event trigger threshold function and the local model parameters of each vehicle node, obtain the communication trigger conditions by setting the trigger index. S303. In response to the detection of a new neighbor node, the system calculates the trigger index based on the communication trigger conditions to determine whether the communication trigger conditions are met. If yes, proceed to step S304; otherwise, proceed to step S305. S304. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, receive the local model parameters of the new neighbor node, design and obtain a weighted model aggregation rule, update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. S305. Based on the time decay step sequence, use mini-batch stochastic gradient descent to update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. S306. Based on the updated model parameters of each vehicle node, determine whether the current iteration count has reached the maximum iteration count or whether the change in the model parameters of each vehicle node is less than a set threshold. If not, use the updated neighbor set as the initial neighbor set and use the updated model parameters of each vehicle node as the local model parameters of each vehicle node, and return to S302. If yes, use the updated model parameters of each vehicle node as the optimal model parameters of each vehicle node.

[0014] The beneficial effects of the above-mentioned further solutions are as follows: By setting a maximum number of iterations and training the network model based on time decay step size, dynamic event triggering threshold, dynamic update of neighbor set and weighted model aggregation rules, the present invention significantly reduces the redundant communication overhead in decentralized learning, effectively adapts to the topological time-varying characteristics brought about by high-speed vehicle movement, and improves the training efficiency and scalability of the system in dynamic vehicle networking environment while ensuring model convergence accuracy and privacy security.

[0015] Furthermore, step S304 includes the following steps: S3041. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, and receive the local model parameters of the new neighbor node. S3042. Based on the degree of the vehicle node in the time-varying communication network graph model and the updated neighbor set, a weighted model aggregation rule suitable for time-varying topology is designed. S3043. Based on the local model parameters of the new neighboring nodes and the local model parameters of the current vehicle node, the local model parameters of each vehicle node are updated using the weighted model aggregation rule to obtain the updated model parameters of each vehicle node.

[0016] Furthermore, the expression for the communication triggering condition is as follows: ; ; in, Indicates the trigger indicator, Indicates the scaling factor. Represents vehicle node i In the number of iterations The time-varying threshold, Represents vehicle node i In the number of iterations Local model parameters, Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. The p-norm of a vector. Indicates the number of iterations.

[0017] Furthermore, the expression for the weighted model aggregation rule is as follows: ; ; in, Represents vehicle node i In the number of iterations +1 local model parameter, Represents vehicle node i In the number of iterations Local model parameters, Represents the updated set of neighbors. Indicates aggregate weight, Indicates the new neighbor node j The local model parameters at the last time they participated in the aggregation. Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. Represents vehicle node i Degree in time-varying communication network graph models Represents vehicle node j Degree in time-varying communication network graph models Indicates the number of iterations.

[0018] The beneficial effects of the above-mentioned further solutions are as follows: By designing a weighted model aggregation rule based on node degree, this invention comprehensively considers the topological connection state of the node itself and its neighbors in the model update. This invention improves the rationality and adaptability of parameter aggregation, effectively enhances the stability and convergence efficiency of model collaborative training in dynamic network environments, and reduces performance fluctuations caused by topology changes, thereby providing a more robust and efficient federated learning collaborative mechanism for time-varying vehicle networks.

[0019] Furthermore, the expression for the optimal objective function value is as follows: ; ; in, This represents the optimal objective function value. Represents the optimal model parameters. Indicates the number of iterations Global average model parameters The corresponding global loss function value, This represents the global average model. Represents vehicle node i In the number of iterations Local model parameters, Indicates the number of vehicle nodes. Indicates the number of iterations.

[0020] The beneficial effects of the above-mentioned further solutions are as follows: By calculating the global average model and evaluating the optimal objective function value based on the global loss function, this invention achieves reliable convergence verification and final performance quantification of the decentralized federated learning process, ensuring that the models of each node can achieve asymptotic consistency in the time-varying vehicle network environment, and theoretically verifying the convergence and effectiveness of the proposed method, thus providing a verifiable and deployable complete solution for collaborative learning in highly dynamic vehicle networks. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a flowchart of the training process in this embodiment.

[0023] Figure 3 This is a diagram of the time-varying communication topology in this embodiment.

[0024] Figure 4 This is a convergence curve of the training loss for the vehicle node in this embodiment.

[0025] Figure 5 This is a performance comparison chart of different trigger thresholds on the MNIST dataset in this embodiment.

[0026] Figure 6 This is a performance comparison chart of different algorithms on the GTSRB traffic sign dataset in this embodiment. Detailed Implementation

[0027] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0028] Before describing this embodiment, the following terms will be explained: ET-DFL: An event-triggered federated learning method for time-varying vehicular networks; GTSRB: A benchmark dataset for traffic sign recognition; MNIST dataset: A database of handwritten digits used in machine learning and computer vision. FedAvg: Federal Average Algorithm; DSGD: Decentralized Stochastic Gradient Descent Algorithm; GT: A decentralized federated learning algorithm based on fixed threshold event triggering; Algorithm 1: A decentralized federated learning algorithm based on time-varying threshold events; Xavier uniform distribution: A classic probability distribution method for weight initialization in the field of deep learning.

[0029] Example like Figure 1 As shown, this invention provides a federated learning method for time-varying vehicular networks based on event triggering, the implementation of which is as follows: S1. Based on decentralized vehicle-to-everything (V2X) networks, a time-varying communication network graph model is established by acquiring a set of vehicle nodes. Then, based on the local dataset, a global loss function is obtained by defining a local loss function. The specific steps are as follows: S101. Obtain the set of vehicle nodes and the set of communication links that communicate with each other in the decentralized vehicle network; S102. The set of vehicle nodes is taken as the set of vertices, the set of communication links is taken as the set of edges, and the time-varying communication network is set up based on the preset connectivity assumption to establish a time-varying communication network graph model. S103. Based on the local model parameters shared by each vehicle node in the time-varying communication network graph model, and according to the local dataset, the global loss function is obtained by defining the local loss function.

[0030] In this embodiment, as Figure 2 As shown, the federated learning of time-varying vehicle networks specifically refers to decentralized federated learning for time-varying vehicle networks. This involves system initialization, obtaining the set of vehicle nodes communicating with each other in the decentralized vehicle network, and establishing a time-varying communication topology. , where the vertex set Specifically, it refers to the set of vehicle nodes and edge set participating in collaborative learning. Specifically, the number of iterations. The set of communication links, whose dynamic changes reflect the topological evolution caused by vehicle movement; Adjacency matrices can be defined. ,when hour, otherwise ; To ensure the convergence of the algorithm, the network must satisfy the presupposition B-connectivity, that is, there exists a positive integer B such that for any number of iterations... , graph sequence The union of sets remains connected; Based on the local model parameters shared by each vehicle node in the time-varying communication network graph model, and according to the local dataset Define the local loss function as shown below: ; in, Represents the local loss function. This indicates that all vehicle nodes share this. d Dimensional local model parameters, , Represents vehicle node i The number of local data samples, Indicates the first j indivual, Indicates sample loss function, Represents local dataset The first in j One data sample; in, Indicates that given model parameters Below, on the sample The loss value generated during prediction; it is a sample-level loss function that measures the performance of the current model. For the sample Make a prediction; compare the prediction result with the true label of the sample; calculate a non-negative scalar value to represent the magnitude of the prediction error. The common cross-entropy loss function is used; The expression for the global loss function is as follows: ; in, This represents the global loss function.

[0031] S2. Based on the time-varying communication network graph model, by setting preset step size and threshold convergence conditions, the time decay step size sequence and dynamic event triggering threshold function are obtained. The parameters of the time-varying communication network graph model of each vehicle node are then preset and initialized to obtain the initialized time-varying communication network graph model. The specific steps are as follows: S201. Based on the local model of each vehicle node in the time-varying communication network graph model, by setting a preset step size convergence condition, a time decay step size sequence is constructed according to the basic learning rate and decay coefficient. S202. By setting threshold convergence conditions, a dynamic event triggering threshold function is constructed. S203. Using zero initialization or random initialization based on a specific distribution, initialize the local model parameters of each vehicle node and set the event trigger time record variable to zero to obtain the initialized time-varying communication network graph model.

[0032] In this embodiment, parameter settings are performed, specifically setting the algorithm hyperparameters: using a time decay step sequence. ,in, This represents the basic learning rate, which is usually taken as... , This represents the attenuation coefficient, which is usually taken as... To satisfy the step size convergence condition ; Construct a dynamic event trigger threshold function ,in, Indicates the number of iterations The time-varying threshold of the function decreases with time and satisfies the threshold convergence condition. ; And perform local model initialization by initializing all vehicle nodes. Initialize the local model parameters by setting the iteration count to 0, which represents the initial local model parameters. Initial model parameters Zero initialization or random initialization based on a specific distribution (such as the Xavier uniform distribution) can be used, and the event trigger time record variable can be initialized simultaneously. It is used to track the timestamp of the most recent communication triggered by each node, and obtain the initialized time-varying communication network graph model.

[0033] S3. Set the maximum number of iterations. Based on the local dataset, time decay step sequence, and dynamic event triggering threshold function, train the initialized time-varying communication network graph model by dynamically updating the neighbor set, setting communication triggering conditions, and setting weighted model aggregation rules to obtain the optimal model parameters for each vehicle node. The specific steps are as follows: S301. Set the maximum number of iterations and obtain the initial neighbor set of the vehicle node based on the local dataset; S302. Based on the initialized time-varying communication network graph model, the neighboring nodes within the communication range of the vehicle node are detected by periodic beacon switching, and the initial neighbor set is dynamically updated to obtain the updated neighbor set. S303. Based on the characteristics of the local dataset, set the scaling factor, and based on the dynamic event trigger threshold function and the local model parameters of each vehicle node, obtain the communication trigger conditions by setting the trigger index. S303. In response to the detection of a new neighbor node, the system calculates the trigger index based on the communication trigger conditions to determine whether the communication trigger conditions are met. If yes, proceed to step S304; otherwise, proceed to step S305. In this embodiment, iterative training is performed, and a maximum number of iterations T is set. Execute iterations, Indicates the number of iterations: Based on the initialized time-varying communication network graph model, and according to the local dataset, the initial neighbor set of the vehicle node is obtained. iBy periodically exchanging beacons to detect neighboring nodes within the current communication range, the initial neighbor set is dynamically updated, resulting in an updated neighbor set. When a new neighbor is detected, the model synchronization event is immediately triggered, and the event trigger judgment is initiated. Event triggering requires setting communication triggering conditions. Based on the characteristics of the local dataset, a scaling factor is set, and based on the dynamic event triggering threshold function and the local model parameters of each vehicle node, the communication triggering conditions are obtained by setting triggering indicators, as shown in the following expression: ; ; in, Indicates the trigger indicator, Indicates the scaling factor. Represents vehicle node i In the number of iterations The time-varying threshold, Represents vehicle node i In the number of iterations Local model parameters, Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. The p-norm of a vector; The scaling factor r is adaptively adjusted according to the characteristics of the dataset: for the relatively simple MNIST handwritten digit dataset, r=1500 is taken; for the more complex GTSRB traffic sign dataset, since the model parameters have higher dimensionality and more significant changes, r=12000 is taken. By calculating the trigger index, it is determined whether the communication trigger condition is met. If yes, the model aggregation update step is entered; otherwise, the local gradient descent update step is entered.

[0034] S304. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, receive the local model parameters of the new neighbor node, design a weighted model aggregation rule, update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. The specific steps are as follows: S3041. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, and receive the local model parameters of the new neighbor node. S3042. Based on the degree of the vehicle node in the time-varying communication network graph model and the updated neighbor set, a weighted model aggregation rule suitable for time-varying topology is designed. S3043. Based on the local model parameters of the new neighboring nodes and the local model parameters of the current vehicle node, the local model parameters of each vehicle node are updated using the weighted model aggregation rule to obtain the updated model parameters of each vehicle node.

[0035] In this embodiment, model aggregation and updating are performed in response to the communication triggering condition being met, and the current vehicle node... i to new neighbor nodes j Send the local model parameters of the current vehicle node. Vehicle node i The local model parameters of the current vehicle node Specifically, vehicle nodes i The local model parameters from the last time the aggregation occurred, and the local model parameters from the new neighbor nodes are also accepted. New neighbor node j Local model parameters Specifically, the new neighbor vehicle node j The model parameters at the last time they participated in the aggregation ensure that communication is only triggered when the model update is large enough, effectively reducing redundant transmission. By using the degree of vehicle nodes in the time-varying communication network graph model and the updated neighbor set, a weighted model aggregation rule suitable for time-varying topology is designed. The local model parameters of each vehicle node are then updated using the weighted model aggregation rule to obtain the updated model parameters of each vehicle node. The expression for the weighted model aggregation rule applicable to time-varying topologies is shown below: ; ; in, Represents vehicle node i In the number of iterations +1 local model parameter, Represents vehicle node i In the number of iterations Local model parameters, Represents the updated set of neighbors. Indicates aggregate weight, Indicates the new neighbor node j The local model parameters at the last time they participated in the aggregation. Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. Represents vehicle node i Degree in time-varying communication network graph models Represents vehicle node j The degree in the time-varying communication network graph model, i.e., the acquired degree. These are the updated model parameters for each vehicle node.

[0036] In this embodiment, the local model parameters related to the current vehicle node... In algorithm design If in When an event is triggered, i.e., a node participates in aggregation, then... If in If no event is triggered, meaning the node did not participate in the aggregation, then... If in If no event is triggered, meaning the node did not participate in the aggregation, then... If in When an event is triggered, i.e., a node participates in aggregation, then... And so on; That is, when an event is triggered and a node participates in aggregation, Equals the model parameters of the nodes at the time of aggregation. If no event is triggered and the node does not participate in the aggregation, Equals the model parameters of the node at the last time it participated in aggregation. .

[0037] S305. Based on the time decay step sequence, use mini-batch stochastic gradient descent to update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. S306. Based on the updated model parameters of each vehicle node, determine whether the current iteration count has reached the maximum iteration count or whether the change in the model parameters of each vehicle node is less than a set threshold. If not, use the updated neighbor set as the initial neighbor set and use the updated model parameters of each vehicle node as the local model parameters of each vehicle node, and return to S302. If yes, use the updated model parameters of each vehicle node as the optimal model parameters of each vehicle node.

[0038] In this embodiment, local gradient descent updates are performed. Based on the time decay step sequence, mini-batch stochastic gradient descent is used to update the local model parameters of each vehicle node. The expression for local gradient descent updates is as follows: ; in, Represents vehicle node i In the number of iterations +1 local model parameter, Represents vehicle node i In the number of iterations Local model parameters, This represents the gradient descent step size. Represents model parameters The subgradient is used, and mini-batch stochastic gradient descent is employed to improve computational efficiency and introduce moderate noise to promote model generalization. Based on the updated model parameters of each vehicle node, determine whether the current iteration count has reached the maximum iteration count or whether the change in the model parameters of each vehicle node is less than a set threshold. If not, use the updated neighbor set as the initial neighbor set and use the updated model parameters of each vehicle node as the local model parameters of each vehicle node, and return to the step of dynamically updating the initial neighbor set. If yes, use the updated model parameters of each vehicle node as the optimal model parameters of each vehicle node.

[0039] S4. Based on the optimal model parameters of each vehicle node, calculate the global average model and use the global loss function to obtain the optimal objective function value, thus completing the decentralized federated learning of time-varying vehicle networks.

[0040] In this embodiment, a global average model is calculated based on the optimal model parameters of each vehicle node, and asymptotically consistent convergence can be achieved using a global loss function. ; in, The global average model is represented by the following expression: ; The optimal objective function value is obtained, completing the decentralized federated learning of time-varying vehicle networks. The expression for the optimal objective function value is as follows: ; in, This represents the optimal objective function value. Represents the optimal model parameters. Indicates the number of iterations Global average model parameters The corresponding global loss function value.

[0041] In this embodiment, in order to fully verify the effectiveness of the proposed event-triggered time-varying vehicle network federated learning method (ET-DFL), a systematic experimental evaluation was conducted on multiple standard datasets, and a comparative analysis was performed with existing mainstream methods. like Figure 3 As shown, the communication topology between eight vehicle nodes is illustrated. Four communication topologies are cyclically switched to simulate the communication topology that changes over time in reality. Perform consistency convergence verification, such as Figure 4As shown, the training loss convergence curves of the eight vehicle nodes on the MNIST dataset are presented. Experimental results show that despite the different initial states of each node and the differences in local data distribution (non-IID setting), the loss function values ​​of all nodes eventually converge to the same stable value. Specifically, in the first 10 iterations, due to the dynamic changes in the topology and the asynchronous nature of the triggering mechanism, the loss curves of each node show some differences; however, after 50 iterations, all curves tend to be consistent, and the final loss value stabilizes around 0.005. This result proves that the ET-DFL algorithm can still ensure that all participating nodes reach model consensus under time-varying topology conditions, demonstrating the algorithm's good convergence and consistency.

[0042] In this embodiment, the impact of trigger thresholds is analyzed, such as... Figure 5 As shown, the impact of different trigger thresholds on algorithm performance was studied; the experiment was conducted on the MNIST dataset, with three threshold conditions set for r=200, 700, and 2000. from Figure 5 (a) As can be seen from the training loss curve, the convergence speed is similar under different thresholds, and all can reach stability at around 40 rounds; However, from Figure 5 (b) The relationship between test accuracy and number of iterations shows that the highest accuracy achieved at r=700 is significantly better than that at r=200 and r=2000; More importantly, from Figure 5 (c) Analysis of the relationship between test accuracy and communication overhead shows that: insufficient interaction between nodes can reduce communication overhead, but it is difficult to achieve the ideal model accuracy; conversely, sufficient interaction can ensure accuracy, but it is accompanied by a significant communication burden; for example, when r=200, although the accuracy is high, the communication bit value is large and the overhead is huge; when r=2000, the communication overhead is small, but the accuracy drops significantly; while r=700 achieves the highest accuracy with a smaller number of communication bits. Specifically, setting the threshold too small requires high communication costs to maintain accuracy; while setting the threshold too large can reduce communication overhead, but leads to a significant decrease in accuracy. Therefore, choosing an appropriate threshold is the core of achieving the optimal trade-off between algorithm accuracy and communication efficiency.

[0043] In this embodiment, a performance comparison experiment is conducted, such as... Figure 6 As shown, the performance comparison results of different algorithms on the GTSRB dataset are presented. from Figure 6 (a) As can be seen from the training loss curve, the convergence speed of ET-DFL is closest to that of the centralized method FedAvg, and significantly better than the traditional decentralized methods DSGD and GT. In particular, under the same communication bit value conditions, the loss of ET-DFL decreases the fastest, proving the effectiveness of the event triggering mechanism; Figure 6 (b) The comparison of test accuracy further shows that when ET-DFL achieves the same accuracy, the communication overhead is reduced by 65% ​​compared to DSGD, 70% compared to GT, and only 30% more than the centralized method FedAvg, but it completely avoids the risk of single point of failure and privacy leakage. also Figure 6 (c) It shows that the average number of communications required by the ET-DFL algorithm is only 64% of that required by the FedAvg algorithm; Experimental results show that the ET-DFL method proposed in this invention performs well in time-varying vehicle networking environments: First, the algorithm has good convergence and consistency and can adapt to dynamic changes in network topology; second, by reasonably setting the trigger threshold, it can significantly reduce communication overhead while ensuring model accuracy; finally, compared with existing decentralized methods, ET-DFL achieves the best balance between communication efficiency and learning performance.

Claims

1. A federated learning method for event-triggered time-varying vehicular networks, characterized in that, Includes the following steps: S1. Based on decentralized vehicle network, a time-varying communication network graph model is established by acquiring the set of vehicle nodes, and a global loss function is obtained by defining a local loss function based on the local dataset. S2. Based on the time-varying communication network graph model, by setting the preset step size and threshold convergence condition, the time decay step size sequence and dynamic event triggering threshold function are obtained, and the parameters of the time-varying communication network graph model of each vehicle node are preset and initialized to obtain the initialized time-varying communication network graph model. S3. Set the maximum number of iterations. Based on the local dataset, time decay step sequence, and dynamic event triggering threshold function, train the initialized time-varying communication network graph model by dynamically updating the neighbor set, setting communication triggering conditions, and setting weighted model aggregation rules to obtain the optimal model parameters for each vehicle node. S4. Based on the optimal model parameters of each vehicle node, calculate the global average model and use the global loss function to obtain the optimal objective function value, thus completing the decentralized federated learning of time-varying vehicle networks.

2. The event-triggered time-varying vehicular network federated learning method according to claim 1, characterized in that, S1 includes the following steps: S101. Obtain the set of vehicle nodes and the set of communication links that communicate with each other in the decentralized vehicle network; S102. The set of vehicle nodes is taken as the set of vertices, the set of communication links is taken as the set of edges, and the time-varying communication network is set up based on the preset connectivity assumption to establish a time-varying communication network graph model. S103. Based on the local model parameters shared by each vehicle node in the time-varying communication network graph model, and according to the local dataset, the global loss function is obtained by defining the local loss function.

3. The event-triggered time-varying vehicular network federated learning method according to claim 2, characterized in that, The expression for the time-varying communication network graph model is as follows: in, Represents a time-varying communication network graph model. Represents the set of vertices. Indicates the number of iterations edge set; The expression for the global loss function is as follows: in, Represents the global loss function. This indicates that all vehicle nodes share this. d Dimensional local model parameters, , Indicates the number of vehicle nodes. Represents the local loss function. Represents vehicle node i The number of local data samples, Indicates the first j indivual, Indicates sample loss function, Represents local dataset The first in j One data sample.

4. The event-triggered time-varying vehicular network federated learning method according to claim 1, characterized in that, S2 includes the following steps: S201. Based on the local model of each vehicle node in the time-varying communication network graph model, by setting a preset step size convergence condition, a time decay step size sequence is constructed according to the basic learning rate and decay coefficient. S202. By setting threshold convergence conditions, a dynamic event triggering threshold function is constructed. S203. Using zero initialization or random initialization based on a specific distribution, initialize the local model parameters of each vehicle node and set the event trigger time record variable to zero to obtain the initialized time-varying communication network graph model.

5. The event-triggered time-varying vehicular network federated learning method according to claim 4, characterized in that, The expressions for the preset step size and threshold convergence conditions are as follows: in, Indicates the number of iterations The preset step size, Indicates the number of iterations. Indicates the number of iterations The time-varying threshold; The expression for the time decay step sequence is as follows: in, Indicates the basic learning rate. Indicates the attenuation coefficient; The expression for the dynamic event triggering threshold function is as follows: in, It represents the natural logarithm.

6. The event-triggered time-varying vehicular network federated learning method according to claim 1, characterized in that, S3 includes the following steps: S301. Set the maximum number of iterations and obtain the initial neighbor set of the vehicle node based on the local dataset; S302. Based on the initialized time-varying communication network graph model, the neighboring nodes within the communication range of the vehicle node are detected by periodic beacon switching, and the initial neighbor set is dynamically updated to obtain the updated neighbor set. S303. Based on the characteristics of the local dataset, set the scaling factor, and based on the dynamic event trigger threshold function and the local model parameters of each vehicle node, obtain the communication trigger conditions by setting the trigger index. S303. In response to the detection of a new neighbor node, the system calculates the trigger index based on the communication trigger conditions to determine whether the communication trigger conditions are met. If yes, proceed to step S304; otherwise, proceed to step S305. S304. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, receive the local model parameters of the new neighbor node, design and obtain a weighted model aggregation rule, update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. S305. Based on the time decay step sequence, use mini-batch stochastic gradient descent to update the local model parameters of each vehicle node, and obtain the updated model parameters of each vehicle node. S306. Based on the updated model parameters of each vehicle node, determine whether the current iteration count has reached the maximum iteration count or whether the change in the model parameters of each vehicle node is less than a set threshold. If not, use the updated neighbor set as the initial neighbor set and use the updated model parameters of each vehicle node as the local model parameters of each vehicle node, and return to S302. If yes, use the updated model parameters of each vehicle node as the optimal model parameters of each vehicle node.

7. The event-triggered time-varying vehicular network federated learning method according to claim 6, characterized in that, S304 includes the following steps: S3041. Using the current vehicle node, send the local model parameters of the current vehicle node to the new neighbor node, and receive the local model parameters of the new neighbor node. S3042. Based on the degree of the vehicle node in the time-varying communication network graph model and the updated neighbor set, a weighted model aggregation rule suitable for time-varying topology is designed. S3043. Based on the local model parameters of the new neighbor nodes and the local model parameters of the current vehicle node, the local model parameters of each vehicle node are updated using the weighted model aggregation rule to obtain the updated model parameters of each vehicle node.

8. The event-triggered time-varying vehicular network federated learning method according to claim 6, characterized in that, The expression for the communication triggering condition is as follows: in, Indicates the trigger indicator, Indicates the scaling factor. Represents vehicle node i In the number of iterations The time-varying threshold, Represents vehicle node i In the number of iterations Local model parameters, Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. The p-norm of a vector. Indicates the number of iterations.

9. The event-triggered time-varying vehicular network federated learning method according to claim 6, characterized in that, The expression for the weighted model aggregation rule is as follows: in, Represents vehicle node i In the number of iterations +1 local model parameter, Represents vehicle node i In the number of iterations Local model parameters, Represents the updated set of neighbors. Indicates aggregate weight, Indicates the new neighbor node j The local model parameters at the last time they participated in the aggregation. Indicates the current vehicle node i The local model parameters at the last time they participated in the aggregation. Represents vehicle node i Degree in time-varying communication network graph models Represents vehicle node j Degree in time-varying communication network graph models Indicates the number of iterations.

10. The event-triggered time-varying vehicular network federated learning method according to claim 1, characterized in that, The expression for the optimal objective function value is as follows: in, This represents the optimal objective function value. Indicates the optimal model parameters. Indicates the number of iterations Global average model parameters The corresponding global loss function value, This represents the global average model. Represents vehicle node i In the number of iterations Local model parameters, Indicates the number of vehicle nodes. Indicates the number of iterations.