Federal traffic prediction method oriented to cross-domain space-time diagram data
By adaptively extracting cross-side spatial dependence information in federal traffic prediction and using polynomial transformation functions for safe aggregation, the low-precision problem caused by the unutilization of cross-side spatial dependence relationships in the existing technology is solved, and high-precision traffic prediction is achieved.
Patent Information
- Application Number
- CN202411939364.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-28
AI Technical Summary
The existing federal space-time traffic prediction technology fails to fully utilize the cross-side spatial dependence in multi-party scenarios, resulting in the prediction accuracy being lower than that of traditional data-centralized training models.
A federal traffic prediction method for cross-domain spatio-temporal graph data is designed, deep-level cross-side spatial dependence information is adaptively extracted, traffic state quantity prediction is carried out in the form of a sliding window, and cross-side spatial dependence is achieved using a polynomial-based transformation function.
Without revealing privacy-sensitive information, traffic prediction accuracy is improved, bringing it close to the level of centralized data training.
Smart Images

Figure CN119723885A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of federated computing, and relates to a federated traffic prediction method for cross-domain spatiotemporal graph data, and specifically to a federated traffic prediction method that takes into account the privacy security and prediction accuracy of multi-party spatiotemporal graph data. Background Art
[0002] Traffic forecasting refers to a series of traffic status forecasts including traffic flow, vehicle speed, demand, road occupancy, etc., which plays an important role in improving traffic efficiency, alleviating congestion and enhancing road safety. Since traffic data has both temporal and spatial attributes, existing technologies usually model it in the form of a spatiotemporal graph, where nodes represent geographic locations, such as road sections or intersections, and edges represent spatial dependencies between geographic locations. Each geographic location has its own historical time series data of traffic status, and there are also complex spatial dependencies between geographic locations, such as geographic connectivity or semantic similarity.
[0003] The prediction method based on the spatiotemporal graph neural network model is currently a commonly used method to solve the spatiotemporal traffic prediction task. However, in actual application scenarios, the traffic data of the road network is scattered across multiple platforms in the form of spatiotemporal subgraphs. Due to considerations for sensitive data privacy protection and restrictions on regulatory policies, the platforms cannot directly share spatiotemporal graph data for centralized training.
[0004] In order to avoid the problem of insufficient model prediction accuracy caused by the inability to centrally train the scattered spatiotemporal subgraph data, existing technologies mainly use federated learning to implement joint spatiotemporal graph neural network model training without leaving the local data. Depending on whether they protect spatial dependencies, they can be divided into two categories:
[0005] (1) The first type of technology only uses public and predefined objective geographic structure information to represent spatial dependencies, such as road connectivity information, and only protects the time series data of nodes in the space-time graph from being leaked. However, this type of technology is simple to model and cannot capture deep spatial associations, such as semantic similarity associations, competitive complementary associations, and other complex spatial dependencies, through objective geographic structure information alone. Therefore, it cannot achieve the expected results in terms of prediction accuracy.
[0006] (2) The second type of technology regards the spatial dependencies of the spatiotemporal subgraphs within each platform as part of privacy, because during the construction process, it not only contains objective geographic structure information, but also abstract semantic associations. This type of information contains the associations between the time series data of each node and is therefore also privacy-sensitive. However, this type of technology ignores the importance of cross-party spatial dependencies and does not make full use of them, so there is still a loss in prediction accuracy.
[0007] In summary, existing federated spatiotemporal traffic prediction technologies have not fully utilized the cross-party spatial dependencies in multi-party scenarios, and there is a significant loss in accuracy compared to traditional data-intensive training models. Summary of the invention
[0008] In view of the shortcomings of the existing methods, the present invention designs a federated traffic prediction method for cross-domain spatiotemporal graph data. Under the premise of privacy protection of the spatiotemporal traffic data of all parties within the local area, it adaptively extracts deep cross-party spatial dependency information, so that the traffic prediction accuracy reaches a level close to that of data-centralized training.
[0009] A federated traffic prediction method for cross-domain spatiotemporal graph data, the specific steps are as follows:
[0010] Step 1: Spatiotemporal graph modeling: Each platform uses road sections as nodes and the spatial dependencies between road sections as edge weights to model a spatiotemporal graph. Each node contains the time series data of the historical traffic status of the road section, and uses a sliding window form to train the spatiotemporal graph neural network model and predict the traffic status.
[0011] The traffic state quantity is predicted using a sliding window:
[0012] Each platform uses the historical T in Time series data of time length To predict the future out Traffic state quantity of time length Where t represents the current time, that is:
[0013]
[0014] Among them, θ is the learnable parameter in the spatiotemporal graph neural network model F.
[0015] Step 2: Local spatial dependency extraction: Each platform uses a gated recurrent unit (GRU) to extract temporal features, and an adaptive graph convolutional layer is used in the threshold to extract the local spatial dependency of temporal features.
[0016] Assume that the temporal features extracted by the threshold cycle unit of platform i are H i , local space dependency extraction is denoted as Z i =A ii ·H i ;
[0017] in, represents the adjacency weight matrix of the local spatiotemporal subgraph nodes for adaptive learning, I is the identity matrix, E i is an embedding matrix consisting of the spatially adaptive embedding vectors of each local node, which is transposed with itself The adjacency matrix A composed of the spatial dependency coefficients between local nodes calculated by the inner product of the embedded vector is obtained by multiplying ii ; Adjacency matrix A ii With H i Multiplying them together gives the spatial dependency between the temporal features of each local node and its adjacent nodes.
[0018] E i As part of the learnable parameters, the adaptive mechanism directly extracts spatial dependencies from the dynamic change pattern of the time series data of each node.
[0019] Step 3: Cross-party spatial dependency aggregation: Each platform performs a polynomial-based transformation on the extracted local spatial dependency, uploads the transformed intermediate results to the central server, obtains the cross-party spatial dependency through secure aggregation and broadcasts it to each platform, and each platform calculates the fused cross-party spatial dependency features.
[0020] Lossless transformation formula based on polynomial Platform i calculates the aggregation results locally Then the intermediate result AGG which does not leak privacy i Upload to the central server for summation operation to achieve secure cross-party spatial dependency aggregation. Specifically:
[0021] First, build the global space dependencies of platform i:
[0022]
[0023] Then, the global space dependency required by platform i is rewritten equivalently as:
[0024]
[0025] Where M represents the number of federated platforms.
[0026] Using a separable K-order polynomial To fit the activation function σ(·), where the polynomial coefficients p k As a parameter that can be adaptively learned, we have:
[0027]
[0028] in is the intermediate result uploaded by each party to the central server, P i =[p1,p2,…,p K ] is the parameter vector composed of the polynomial coefficients of platform i, is the k-order transformation function Represents the row-wise Cartesian product of matrices raised to the power of k.
[0029] The central server generates intermediate results for each platform i The sum is calculated to obtain the cross-party spatial dependency aggregation result ∑AGG, which is broadcast to each platform. Each platform realizes cross-party spatial dependency feature fusion through the aggregation result.
[0030] Each platform locally integrates the cross-party spatial dependency information into its own spatiotemporal features to obtain the cross-party spatial dependency features. The calculation formula is:
[0031]
[0032] Step 4: Federated model aggregation: After each platform completes several rounds of model parameter updates locally based on loss gradient descent, the shared part of the model parameters is uploaded to the central server, and the remaining parameters remain personalized. The server performs federated averaging to obtain the global model parameters and returns them to all parties to update the shared part.
[0033] Each platform performs forward inference calculations based on the above steps, constructs a loss function locally, performs local training of the model through gradient back propagation, and then updates the local model weight parameters. The model weight parameters updated by any platform i are expressed as a four-tuple (W i ,b i ,P i ,E i ), which represent the weight pool of linear transformation, the bias pool of linear transformation, the polynomial coefficients, and the spatial adaptive embedding vector in the GRU unit respectively.
[0034] After each platform performs a specified round of local model training, it aggregates the global model parameters:
[0035] The local model weight parameter quaternary is split into two parts, where (Wi, bi, Pi) is the shared weight parameter and E i The spatial adaptive weight parameters are personalized for each platform and are not shared. Each platform uploads the shared part of the weight parameters to the central server, and the central server executes the FedAvg algorithm to aggregate the model. The specific formula is:
[0036]
[0037] The central server aggregates the global model weight parameters (W g ,b g ,P g ) is broadcast to each platform to update its local shared weight parameters.
[0038] Step 5, training completion and prediction: each platform updates the parameter quadruple based on the updated shared weight parameters and determines whether the local loss function converges. If so, the training is completed and returns to step 1 to predict the traffic state quantity of each platform; otherwise, returns to step 4 and enters the next global round of joint model training.
[0039] The advantages of the present invention are as follows:
[0040] (1) In terms of spatiotemporal graph modeling, this method creatively uses road sections of unit length as nodes and the spatial dependencies between road sections as edge weights to establish a spatiotemporal graph. It also proposes to form multiple spatiotemporal subgraphs in a multi-platform federated scenario and use a sliding window to predict traffic state quantities and train models.
[0041] (2) This method introduces adaptive graph convolution into the gated recurrent unit to adaptively learn the local spatial dependencies between local node temporal features.
[0042] (3) This method creatively uses a transformation function based on a k-th order polynomial to achieve the aggregation of cross-party spatial dependency information without leaking privacy-sensitive information.
[0043] (4) This method uses a partial federated averaging algorithm to keep the adaptive weight matrices of each platform unshared, thus achieving spatially dependent personalized learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 The flowchart of the federated traffic prediction method for cross-domain spatiotemporal graph data of the present invention is as follows;
[0045] Figure 2 2 is a comparison chart of experimental results of an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0047] The workflow of the present invention is as follows Figure 1 As shown in the figure, each platform uses historical vehicle flow trajectory data to establish a local space-time subgraph, which is input into the local space-time graph model to extract local spatial dependencies. During this process, the secure aggregation of cross-party spatial dependencies is achieved with the assistance of the central server. After each platform completes the local model training, the central server retains the personalized global model partial federal averaging.
[0048] The implementation platform of the present invention is a plurality of traffic data owners. Here, the implementation method is introduced by taking the online car-hailing platform jointly performing traffic flow prediction as an example, which is specifically divided into the following steps:
[0049] Step 1: Spatiotemporal graph modeling: Each online ride-hailing platform loads its historical trajectory data of online ride-hailing vehicles, samples the trajectory points at a fixed frequency (such as every 5 minutes), and projects them to the corresponding road section positions on the OpenStreetMap road network according to their longitude and latitude. Traffic statistics are performed separately for each unit road section (such as 100 meters), and a graph is built with road sections as nodes and the spatial dependencies between road sections as edge weights to construct a local spatiotemporal subgraph. Model training and prediction are carried out in the form of a sliding window.
[0050] Different from the road network mapping method of most previous technologies that uses intersections as nodes and roads as edges, this invention uses each fixed-length road segment as a node and the spatial dependency between road segments as edge weights to model a spatiotemporal graph. This makes it more suitable for the real scene of road traffic prediction. The historical traffic status of each road section is recorded in the corresponding node in the form of time series data. Since each of the M platforms only has the historical time series data of some sections, each platform has a spatiotemporal subgraph. If it is not for the consideration of sensitive data privacy protection, the spatiotemporal subgraphs of each platform can be spliced into a complete spatiotemporal full graph.
[0051] The prediction form of traffic state quantity adopts sliding window mode, that is, each platform predicts the road sections within its jurisdiction, and each time uses the historical time length T in Time series data To predict the future out Traffic state quantity of time length Where t represents the current time, that is:
[0052]
[0053] Among them, θ is the learnable parameter in the spatiotemporal graph neural network model F.
[0054] Step 2: Local spatial dependency extraction: Each platform uses a gated recurrent unit (GRU) to extract the temporal features of each node in the local spatiotemporal subgraph, and uses an adaptive graph convolutional layer in the threshold to extract the local spatial dependency of each node.
[0055] Like most existing technologies, this step uses a gated recurrent unit (GRU) to extract timing features. This is a relatively common timing modeling method, so it will not be described here. The innovation of the present invention is to introduce an adaptive graph convolution layer into it to extract the local spatial dependencies of timing features.
[0056] Assume that the temporal features extracted by the threshold cycle unit of platform i are H i , the local spatial dependency extraction can be expressed as Z i =A ii ·H i ,in represents the adjacency weight matrix of the local spatiotemporal subgraph nodes for adaptive learning, I represents the identity matrix, which is used to supplement and enhance the spatial dependency coefficient of each node with itself; E i The embedding matrix is composed of the spatial adaptive embedding vectors of each local node. The adjacency matrix A composed of the spatial dependency coefficients between each local node calculated by the inner product of the embedding vector can be obtained by multiplying it with its own transposition. ii ; Adjacency matrix A ii With H i Multiplying them together can obtain the spatial dependence between the temporal features of each local node and its adjacent nodes. i As part of the learnable parameters, the adaptive mechanism can directly extract spatial dependencies from the dynamic change pattern of the time series data of each node.
[0057] Step 3, cross-party spatial dependency aggregation: Each platform performs a polynomial-based transformation on the extracted local spatial dependency, uploads the transformed intermediate results to the central server, obtains the cross-party spatial dependency through secure aggregation and broadcasts it to each platform, and each platform calculates the fused cross-party spatial dependency features.
[0058] Since each platform uses the local spatiotemporal subgraph E i Multiplying by its own transpose can only get the internal spatial dependency coefficient. In order to allow each platform to integrate the spatial dependency information of other parties, it is necessary to obtain the cross-party spatial dependency from other platforms, so as to construct the global spatial dependency and obtain higher prediction accuracy.
[0059] The global space dependencies are:
[0060]
[0061] But the E j cannot be shared directly because The calculated adjacency matrix belongs to the privacy-sensitive information of platform j. To this end, the present invention proposes a lossless transformation formula based on polynomials This allows platform i to only calculate the aggregation results locally By uploading the intermediate results AGG which will not leak privacy i , so that the central server only needs to perform a simple sum operation to achieve secure cross-party spatial dependency aggregation. Specifically, firstly, the global spatial dependency required by platform i is equivalently rewritten as:
[0062]
[0063] Where M represents the number of federated platforms. Since the activation function σ(·) cannot directly perform matrix splitting, a splittable K-order polynomial is used To fit the activation function, where the polynomial coefficients p k As a parameter that can be adaptively learned, we have:
[0064]
[0065] in is the intermediate result uploaded by each party to the central server, P i =[p1,p2,…,p K ] is the parameter vector composed of the polynomial coefficients of platform i, This is the k-order transformation function creatively designed by the present invention. Represents the row-wise Cartesian product of matrices raised to the power of k.
[0066] Each platform i calculates the intermediate result AGG which integrates the temporal and spatial features in parallel in its local plain text form. i Afterwards, it is synchronously uploaded to the central server, which cannot infer the original data from the intermediate result, and only needs to perform a simple summation operation to obtain the cross-party spatial dependency aggregation result ∑AGG, which is uniformly broadcasted by the central server to each platform. After receiving the aggregation result, each platform can integrate the cross-party spatial dependency information between other party data into its own spatiotemporal features, thereby realizing the cross-party spatial dependency feature fusion of multiple parties without leaving the local area.
[0067] The formula for local cross-party spatial dependency feature fusion is:
[0068]
[0069] Step 4, federated model aggregation: After each platform completes several rounds of model parameter updates locally based on loss gradient descent, the shared part of the model parameters is uploaded to the central server, and the remaining parameters are retained as personalized. The server performs federated averaging to obtain the global model parameters and returns them to all parties to update the shared part.
[0070] Each platform performs forward inference calculations based on the above steps, constructs a loss function locally, performs local training of the model through gradient back propagation, and then updates the local model weight parameters. For any platform i, the updated model weight parameters can be expressed as a four-tuple (W i ,b i ,P i ,E i ), which represent the weight pool of linear transformation, the bias pool of linear transformation, the polynomial coefficients, and the spatial adaptive embedding vector in the GRU unit respectively.
[0071] After each platform performs a specified round of local model training, it is necessary to aggregate the global model parameters. In order to retain the personalized characteristics of each platform to a certain extent, the local model quadruple is split into two parts, where (W i ,b i ,P i ) is the shared weight parameter, E i The spatial adaptive weight parameters are personalized for each platform and are not shared. Each platform uploads the shared part of the weight parameters to the central server, and the central server executes the FedAvg algorithm to aggregate the model. The specific formula is:
[0072]
[0073] The central server aggregates the global model weight parameters (W g ,b g ,P g ) is broadcast to each platform to update its local shared layer weight parameters.
[0074] Step 5, training completion and prediction: each platform updates the parameter quadruple based on the updated shared weight parameters and determines whether the local loss function converges. If so, the training is completed and returns to step 1 to predict the traffic state quantity of each platform; otherwise, returns to step 4 and enters the next global round of joint model training.
[0075] The present invention has been experimentally tested on real data from five online ride-hailing companies, and the results are as follows: Figure 2 As shown, it can be seen that after using the method of the present invention, the mean absolute error MAE of the joint prediction of each company is significantly reduced compared to using only its local data.
Claims
1. A federated traffic prediction method for cross-domain spatiotemporal graph data, characterized in that: The specific steps are as follows: Step 1: Spatiotemporal graph modeling: Each platform uses road sections as nodes and the spatial dependencies between road sections as edge weights to model a spatiotemporal graph. Each node contains the time series data of the historical traffic status of the road section, and uses a sliding window form to train the spatiotemporal graph neural network model and predict the traffic status; Step 2: Extract local spatial dependency: Each platform uses a threshold recurrent unit to extract temporal features, and an adaptive graph convolutional layer is used in the threshold to extract the local spatial dependency of temporal features; Assume that the temporal features extracted by the threshold cycle unit of platform i are H i , local space dependency extraction is denoted as Z i =A ii ·H i ; in, represents the adjacency weight matrix of the local spatiotemporal subgraph nodes for adaptive learning, I is the identity matrix, E i is an embedding matrix consisting of the spatially adaptive embedding vectors of each local node, which is transposed with itself The adjacency matrix A composed of the spatial dependency coefficients between local nodes calculated by the inner product of the embedded vector is obtained by multiplying ii ; Adjacency matrix A ii With H i Multiply to get the spatial dependency between the temporal features of each local node and the adjacent nodes; E i As part of the learnable parameters, the adaptive mechanism directly extracts spatial dependencies from the dynamic change pattern of the time series data of each node; Step 3: Cross-party spatial dependency aggregation: Each platform performs a polynomial-based transformation on the extracted local spatial dependency, uploads the transformed intermediate results to the central server, obtains the cross-party spatial dependency through secure aggregation and broadcasts it to each platform, and each platform calculates the fused cross-party spatial dependency features; Lossless transformation formula based on polynomial Platform i calculates the aggregation results locally Then the intermediate result AGG which does not leak privacy i Upload to the central server for summation operation to achieve secure cross-party spatial dependency aggregation; The cross-party spatial dependency aggregation results are broadcast to each platform, and each platform realizes cross-party spatial dependency feature fusion through the aggregation results. The calculation formula is: Among them, P i =[p1,p2,…,p K ] is the parameter vector composed of the polynomial coefficients of platform i, ∑AGG is the aggregation result of cross-party spatial dependency; Step 4: Federated model aggregation: After each platform completes several rounds of model weight parameter updates locally based on loss gradient descent, the shared part of the model weight parameters is uploaded to the central server, and the remaining parameters are kept personalized. The server performs federated averaging to obtain the global model weight parameters and returns them to all parties to update the shared part; Each platform performs forward inference calculations based on the above steps, constructs a loss function locally, performs local training of the model through gradient back propagation, and then updates the local model weight parameters. The model weight parameters updated by any platform i are expressed as a four-tuple (W i ,b i ,P i ,E i ), respectively representing the weight pool of linear transformation, the bias pool of linear transformation, the polynomial coefficient, and the spatial adaptive embedding vector in the GRU unit; After each platform performs a specified round of local model training, it aggregates the global model parameters, and the central server aggregates the global model weight parameters (W g ,b g ,P g ) Broadcast to each platform to update its local shared weight parameters; Step 5, training completion and prediction: each platform updates the parameter quadruple based on the updated shared weight parameters and determines whether the local loss function converges. If so, the training is completed and returns to step 1 to predict the traffic state quantity of each platform; otherwise, returns to step 4 and enters the next global round of joint model training.
2. The method for federated traffic prediction based on cross-domain spatiotemporal graph data according to claim 1, characterized in that: Each platform uses a sliding window to predict the traffic state quantity as follows: Each platform uses the historical T in Time series data of time length To predict the future out Traffic state quantity of time length Where t represents the current time, that is: Among them, θ is the learnable parameter in the spatiotemporal graph neural network model F.
3. The method for federated traffic prediction based on cross-domain spatiotemporal graph data according to claim 1, characterized in that: The calculation process of the cross-party spatial dependency aggregation is: First, build the global space dependencies of platform i: Then, the global space dependency required by platform i is rewritten equivalently as: Where M represents the number of federated platforms; Using a separable K-order polynomial To fit the activation function σ(·), where the polynomial coefficients p k As a parameter that can be adaptively learned, we have: in is the intermediate result uploaded by each party to the central server, P i =[p1,p2,…,p K ] is the parameter vector composed of the polynomial coefficients of platform i, is the k-order transformation function It represents the kth power of the Cartesian product of the matrix rows; The central server generates intermediate results for each platform i The sum is calculated to obtain the cross-party spatial dependency aggregation result ∑AGG, which is broadcast to each platform.
4. The method for federated traffic prediction based on cross-domain spatiotemporal graph data according to claim 1, characterized in that: The processing process of the model weight parameters in step 4 is as follows: The model weight parameter quaternary is split into two parts, where (Wi, bi, Pi) is a shared weight parameter and E i The spatial adaptive weight parameters personalized for each platform are not shared; each platform uploads the shared part of the weight parameters to the central server, and the central server executes the federated average algorithm to aggregate the model. The specific formula is:
Citation Information
Patent Citations
Urban traffic flow space-time prediction method based on federated learning
CN114757389A
Traffic flow prediction method based on federated learning and graph neural network
CN118840860A
Cited By
Security aggregation method for spatial dependence of spatio-temporal data in federated learning
CN121256822A
Federal learning-based dynamic space-time diagram traffic flow prediction method and related device
CN121904994A
Dynamic spatio-temporal graph traffic flow prediction method based on federated learning and related device
CN121904994B
