A distributed traffic flow prediction method based on cloud-edge collaborative training
By building a traffic flow hybrid prediction model on the edge server and using the cloud server for model parameter aggregation, the problem of insufficient computing resources of the cloud server is solved, and efficient traffic flow prediction and real-time requirements are achieved.
Patent Information
- Application Number
- CN202411087560.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In the existing centralized traffic flow prediction methods, the computing resources of the cloud server are difficult to meet the needs of real-time processing of large amounts of traffic data, resulting in long prediction model training time and difficulty in meeting the real-time requirements of traffic flow prediction.
A distributed traffic flow prediction method based on cloud-edge collaborative training is used to preprocess and preprocess local data by building a traffic flow hybrid prediction model on the edge server, including a segmented parallel long short-term memory network and a bidirectional time domain convolutional neural network. Training, using the cloud server to perform model parameter aggregation and iterative training until the model minimizes the loss function.
It improves the accuracy and efficiency of traffic flow prediction, relieves the pressure on cloud server computing resources, and meets the real-time demand for traffic flow prediction.
Smart Images

Figure CN118644988B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow prediction, and in particular to a distributed traffic flow prediction method based on cloud-edge collaborative training. Background Art
[0002] Faced with the pressure of traffic management brought by the accelerated urbanization process and the increase in per capita vehicle ownership, traffic flow prediction is of great significance. With the rapid development of computer and Internet of Things technology, intelligent transportation system has become a key component of urban traffic management and smart city construction. Intelligent transportation system relies on accurate traffic flow prediction to achieve real-time decision-making and optimization, thereby improving citizens' travel experience and sustainable development of the city. By predicting traffic flow, urban planners can optimize traffic network design and traffic light settings, thereby improving road utilization efficiency and reducing congestion.
[0003] At present, centralized traffic flow prediction is to complete all data processing and prediction on cloud servers, which means that the computing resources of cloud servers will face huge pressure. With the rapid growth of traffic data, the limited computing resources of cloud servers can hardly meet the needs of real-time processing of large amounts of data, resulting in long training time for prediction models and difficulty in meeting the real-time requirements of traffic flow prediction. Summary of the invention
[0004] The purpose of the present invention is to provide a distributed traffic flow prediction method based on cloud-edge collaborative training to solve the problem in the prior art that the computing resources of cloud servers are facing huge pressure and it is difficult to meet the real-time performance of traffic flow prediction.
[0005] A distributed traffic flow prediction method based on cloud-edge collaborative training includes steps S1 to S3:
[0006] Step S1, constructing a traffic flow hybrid prediction model, preprocessing local traffic flow data through edge servers deployed at each road node to obtain a time series, and then using the time series to perform local training on the traffic flow hybrid prediction model to obtain local model parameters;
[0007] The traffic flow hybrid prediction model includes a segmented parallel long short-term memory network and a bidirectional time-domain convolutional neural network; the segmented parallel long short-term memory network includes an encoder and a decoder. In the encoder, the time series Divide into m segments to obtain segmented time series , and then transform it into Transform to intermediate sequence , the m segments of the intermediate sequence Parallel input is iterated into multi-layer LSTM units to capture the temporal characteristics of traffic flow data ; In the decoder, multiple layers of LSTM units are processed in parallel. Repeat m times and with m positioning blocks Combined to generate m intermediate output vectors , and then the intermediate output vector Input to the Dropout layer and use a learnable linear projection Transform to obtain the output vector of the segmented parallel long short-term memory network The bidirectional time-domain convolutional neural network includes a forward TCN module, a reverse TCN module, a bidirectional fusion layer, an average pooling layer and a fully connected layer. As the input of the forward TCN module, the inverted As the input of the reverse TCN module, the forward TCN module and the reverse TCN module both include 3 layers of residual blocks, the bidirectional fusion layer fuses the output features of the third layer of residual blocks in the forward TCN module and the output features of the third layer of residual blocks in the reverse TCN module, and then inputs the fused features into the average pooling layer for compression, and then inputs the compressed features into the fully connected layer to obtain the final traffic flow prediction value;
[0008] Step S2: Based on the cloud-edge collaborative training strategy, the edge server uploads the local model parameters to the cloud server for aggregation, and then the cloud server sends the aggregated model parameters to each edge server for the next round of local training. The training is iterated until the traffic flow hybrid prediction model of each edge server achieves the minimization of the loss function, thereby completing the training of the traffic flow hybrid prediction model.
[0009] In step S3, each edge server uses the trained traffic flow hybrid prediction model to perform traffic flow prediction.
[0010] The distributed traffic flow prediction method based on cloud-edge collaborative training provided by the present invention has the following beneficial effects:
[0011] (1) The present invention proposes a hybrid traffic flow prediction model, in which a segmented parallel long short-term memory network divides a longer time series into shorter segmented time series through a segmentation strategy, and each segmented time series is processed by an LSTM unit, which allows the model to process these segmented time series in parallel when processing the entire sequence, thereby improving the computational efficiency, and allows the model to consider the predictions of multiple time steps at the same time when predicting future time steps, further improving the accuracy of the prediction, while the bidirectional time-domain convolutional neural network captures local features in the time series through convolution operations, and its bidirectional structure allows the network to extract information from both forward and backward directions, thereby more comprehensively understanding the changes in traffic flow in the short term. By combining the long-term dependency capture capability of the segmented parallel long short-term memory network with the local feature extraction capability of the bidirectional time-domain convolutional neural network, the changing trend and abnormal situation of traffic flow can be predicted more accurately. The high computational efficiency and parallel processing capability enable the hybrid traffic flow prediction model to better cope with the prediction task of large-scale traffic flow data;
[0012] (2) The present invention is based on a cloud-edge collaborative training strategy. The edge server uploads the local model parameters to the cloud server for aggregation, and then the cloud server sends the aggregated model parameters to each edge server for the next round of local training. The training is iterated in this way until the traffic flow hybrid prediction model of each edge server achieves the minimization of the loss function, thereby completing the training of the traffic flow hybrid prediction model. The cloud server collaborates with each edge server to perform training iterations, which improves the traffic flow prediction performance and prediction efficiency, alleviates the huge pressure on the computing resources of the cloud server, and is difficult to meet the real-time performance of traffic flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flow chart of the distributed traffic flow prediction method based on cloud-edge collaborative training of the present invention. DETAILED DESCRIPTION
[0014] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] See also Figure 1 The distributed traffic flow prediction method based on cloud-edge collaborative training provided by an embodiment of the present invention includes steps S1 to S3.
[0016] Step S1, constructing a traffic flow hybrid prediction model, preprocessing local traffic flow data through edge servers deployed at each road node to obtain a time series, and then using the time series to locally train the traffic flow hybrid prediction model to obtain local model parameters.
[0017] The traffic flow hybrid prediction model includes a segmented parallel long short-term memory network and a bidirectional time-domain convolutional neural network. The segmented parallel long short-term memory network includes an encoder and a decoder.
[0018] In the encoder, the time series Divide into m segments to obtain segmented time series , and then transform it into Transform to intermediate sequence ,in, d Represents the transformed dimension, which is used to adapt to the dimension requirements of the LSTM unit, and converts the m segments of the intermediate sequence Parallel input is iterated into multi-layer LSTM units to capture the temporal characteristics of traffic flow data .
[0019] The encoder satisfies the following condition:
[0020] ;
[0021] ;
[0022] ;
[0023] ;
[0024] ;
[0025] ;
[0026] in, f t is the output of the forget gate, I t is the output of the input gate, is the output of the output gate, is the sigmoid activation function, tanh is the tanh activation function, W f and U f is the weight parameter of the forget gate, W I and U I is the weight parameter of the input gate,W c and U c is the weight parameter of the temporary memory unit, W o and U o is the weight parameter of the output gate, x t for t Input at the moment, h t-1 for t -1 The output of the hidden layer at time b f , b I , b c and b o is the bias vector, is the state of the temporary memory unit, C t for t The state of the memory unit is updated at every moment. C t-1 for t -1 The state of the memory unit after updating at time h t for t The output of the hidden layer at time t.
[0027] The output of the last LSTM unit in the encoder is .
[0028] The encoder and decoder share the same chain LSTM network. However, in the decoder, the input of each LSTM unit is no longer the output of the previous LSTM unit, but the output of the last LSTM unit obtained from the encoder, that is, .
[0029] Since the long sequence prediction problem with a prediction span of H is divided into m subsequence prediction problems with a length of w, the sequence order information of the input sequence is also required to prevent the order between the segments from being lost.
[0030] In order to solve the above problem, in this embodiment, in the decoder, multiple layers of LSTM units are processed in parallel. Repeat m times and with m positioning blocks Combined to generate m intermediate output vectors , and then the intermediate output vector Input to the Dropout layer and use a learnable linear projection Transform to obtain the output vector of the segmented parallel long short-term memory network The positioning block is constructed by a relative position code rp and a channel position code cp, wherein the relative position code rp indicates the position of each segment to be predicted in the complete sequence, and the channel position code cp indicates the channel position of the current sequence.
[0031] In this embodiment, the bidirectional time-domain convolutional neural network includes a forward TCN module, a reverse TCN module, a bidirectional fusion layer, an average pooling layer and a fully connected layer. As the input of the forward TCN module, the inverted As the input of the reverse TCN module, both the forward TCN module and the reverse TCN module include 3 layers of residual blocks.
[0032] The bidirectional fusion layer fuses the output features of the third-layer residual block in the forward TCN module and the output features of the third-layer residual block in the reverse TCN module, and then inputs the fused features into the average pooling layer for compression, and then inputs the compressed features into the fully connected layer to obtain the final traffic flow prediction value.
[0033] In this embodiment, the residual block in the forward TCN module and the residual block in the reverse TCN module both include a dilated causal convolution layer, a weight normalization layer, a nonlinear mapping layer, and a regularization layer connected in sequence, and the input is directly connected to the output through the residual connection. The causal convolution in the dilated causal convolution layer belongs to a time-restricted network, that is, there is a cause before there is a result. By introducing causal convolution, the bidirectional time-domain convolutional neural network can efficiently process time series data compared to other models; the dilated convolution in the dilated causal convolution layer is used to ensure that the dimension of the feature map remains unchanged while using fewer layers to achieve a larger receptive field, thereby better capturing the long-term dependencies in the sequence.
[0034] Specifically, the residual block satisfies the following conditional formula:
[0035] ;
[0036] in, For the k The output of the residual block is For the k -1 output of residual block, No. k The input of the residual block is It is a one-dimensional convolution; b =1, indicating the forward TCN module; b =2, it indicates the reverse TCN module.
[0037] Residual connections are used to add the input of a layer of the network directly to a layer after that layer, forming a "short-circuit" path. This connection allows input information to flow more smoothly in the network, avoiding attenuation and loss of information during the layer-by-layer transmission process.
[0038] In this embodiment, the bidirectional fusion layer satisfies the following conditional formula:
[0039] ;
[0040] in, Z is the fusion feature generated after fusion, F is the fusion function, , is the weight coefficient, and + =1, is the output feature of the third-layer residual block in the forward TCN module, It is the output feature of the third layer residual block in the reverse TCN module.
[0041] In step S2, based on the cloud-edge collaborative training strategy, the edge server uploads the local model parameters to the cloud server for aggregation, and then the cloud server sends the aggregated model parameters to each edge server for the next round of local training. The training is iterated until the traffic flow hybrid prediction model of each edge server achieves the minimization of the loss function, thereby completing the training of the traffic flow hybrid prediction model.
[0042] Each edge server will evaluate whether to send its own local model parameters to the cloud server. The evaluation criteria is to compare the performance of the newly trained model with the performance of the previously trained model. Only when the performance of the newly trained model is better than that of the previously trained model, the local model parameters will be sent to the cloud server. In this embodiment, the mean square error is used as the evaluation model performance indicator.
[0043] Specifically, in the cloud-edge collaborative training strategy, the edge server meets the following conditions:
[0044] ;
[0045] ;
[0046] ;
[0047] in, For the z In the iteration n The local model parameters of the edge servers, For the z -1 round of iteration nThe local model parameters of the edge servers, is the learning rate, is the loss function, For the n The current mean square error of the traffic flow hybrid prediction model of the edge servers, For the n The mean square error of the traffic flow hybrid prediction model of edge servers before iteration; is a dynamic adjustment factor. The larger the number of iterations, The smaller it is, the stricter the evaluation criteria; E is the total number of iterations, e is the current iteration number;
[0048] The cloud server meets the following conditions:
[0049] ;
[0050] in, For the z +Model parameters aggregated by the cloud server in 1 round of iteration, N is the total number of edge servers, q n For the n The amount of data on the edge servers, q is the total data quantity of all edge servers.
[0051] In step S3, each edge server uses the trained traffic flow hybrid prediction model to perform traffic flow prediction.
[0052] In summary, the distributed traffic flow prediction method based on cloud-edge collaborative training provided by the present invention has the following beneficial effects:
[0053] (1) The present invention proposes a hybrid traffic flow prediction model, in which a segmented parallel long short-term memory network divides a longer time series into shorter segmented time series through a segmentation strategy, and each segmented time series is processed by an LSTM unit, which allows the model to process these segmented time series in parallel when processing the entire sequence, thereby improving the computational efficiency, and allows the model to consider the predictions of multiple time steps at the same time when predicting future time steps, further improving the accuracy of the prediction, while the bidirectional time-domain convolutional neural network captures local features in the time series through convolution operations, and its bidirectional structure allows the network to extract information from both forward and backward directions, thereby more comprehensively understanding the changes in traffic flow in the short term. By combining the long-term dependency capture capability of the segmented parallel long short-term memory network with the local feature extraction capability of the bidirectional time-domain convolutional neural network, the changing trend and abnormal situation of traffic flow can be predicted more accurately. The high computational efficiency and parallel processing capability enable the hybrid traffic flow prediction model to better cope with the prediction task of large-scale traffic flow data;
[0054] (2) The present invention is based on a cloud-edge collaborative training strategy. The edge server uploads the local model parameters to the cloud server for aggregation, and then the cloud server sends the aggregated model parameters to each edge server for the next round of local training. The training is iterated in this way until the traffic flow hybrid prediction model of each edge server achieves the minimization of the loss function, thereby completing the training of the traffic flow hybrid prediction model. The cloud server collaborates with each edge server to perform training iterations, which improves the traffic flow prediction performance and prediction efficiency, alleviates the huge pressure on the computing resources of the cloud server, and is difficult to meet the real-time performance of traffic flow prediction.
[0055] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0056] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A distributed traffic flow prediction method based on cloud-edge collaborative training, characterized in that: It includes steps S1 to S3: Step S1, constructing a traffic flow hybrid prediction model, preprocessing local traffic flow data through edge servers deployed at each road node to obtain a time series, and then using the time series to perform local training on the traffic flow hybrid prediction model to obtain local model parameters; The traffic flow hybrid prediction model includes a segmented parallel long short-term memory network and a bidirectional time-domain convolutional neural network; the segmented parallel long short-term memory network includes an encoder and a decoder. In the encoder, the time series Divide into m segments to obtain segmented time series , and then transform it into Transform to intermediate sequence , the m segments of the intermediate sequence Parallel input is iterated into multi-layer LSTM units to capture the temporal characteristics of traffic flow data ; In the decoder, multiple layers of LSTM units are processed in parallel. Repeat m times and with m positioning blocks Combined to generate m intermediate output vectors , and then the intermediate output vector Input to the Dropout layer and use a learnable linear projection Transform to obtain the output vector of the segmented parallel long short-term memory network The bidirectional time-domain convolutional neural network includes a forward TCN module, a reverse TCN module, a bidirectional fusion layer, an average pooling layer and a fully connected layer. As the input of the forward TCN module, the inverted As the input of the reverse TCN module, the forward TCN module and the reverse TCN module both include 3 layers of residual blocks, the bidirectional fusion layer fuses the output features of the third layer of residual blocks in the forward TCN module and the output features of the third layer of residual blocks in the reverse TCN module, and then inputs the fused features into the average pooling layer for compression, and then inputs the compressed features into the fully connected layer to obtain the final traffic flow prediction value; Step S2: Based on the cloud-edge collaborative training strategy, the edge server uploads the local model parameters to the cloud server for aggregation, and then the cloud server sends the aggregated model parameters to each edge server for the next round of local training. The training is iterated until the traffic flow hybrid prediction model of each edge server achieves the minimization of the loss function, thereby completing the training of the traffic flow hybrid prediction model. In step S3, each edge server uses the trained traffic flow hybrid prediction model to perform traffic flow prediction.
2. The distributed traffic flow prediction method based on cloud-edge collaborative training according to claim 1 is characterized in that: The encoder satisfies the following condition: ; ; ; ; ; ; in, f t is the output of the forget gate, I t is the output of the input gate, is the output of the output gate, is the sigmoid activation function, tanh is the tanh activation function, W f and U f is the weight parameter of the forget gate, W I and U I is the weight parameter of the input gate, W c and U c is the weight parameter of the temporary memory unit, W o and U o is the weight parameter of the output gate, x t for t Input at the moment, h t-1 for t The output of the hidden layer at time -1, b f , b I , b c and b o is the bias vector, is the state of the temporary memory unit, C t for t The state of the memory unit is updated at every moment. C t-1 for t -1 The state of the memory unit after updating at time h t for t The output of the hidden layer at time t.
3. The distributed traffic flow prediction method based on cloud-edge collaborative training according to claim 1 is characterized in that: The positioning block is constructed by a relative position code rp and a channel position code cp. The relative position code rp indicates the position of each segment to be predicted in the complete sequence, and the channel position code cp indicates the channel position of the current sequence.
4. The distributed traffic flow prediction method based on cloud-edge collaborative training according to claim 1 is characterized in that: The residual block in the forward TCN module and the residual block in the reverse TCN module both include a dilated causal convolution layer, a weight normalization layer, a nonlinear mapping layer and a regularization layer connected in sequence, and the input is directly connected to the output through a residual connection; The residual block satisfies the following condition: ; in, For the k The output of the residual block is For the k -1 output of residual block, No. k The input of the residual block is It is a one-dimensional convolution; b =1, indicating the forward TCN module; b =2, it indicates the reverse TCN module.
5. The distributed traffic flow prediction method based on cloud-edge collaborative training according to claim 1 is characterized in that: The bidirectional fusion layer satisfies the following conditional formula: ; in, Z is the fusion feature generated after fusion, F is the fusion function, , is the weight coefficient, and + =1, is the output feature of the third layer residual block in the forward TCN module, It is the output feature of the third layer residual block in the reverse TCN module.
6. The distributed traffic flow prediction method based on cloud-edge collaborative training according to claim 1 is characterized in that: In the cloud-edge collaborative training strategy, the edge server meets the following conditions: ; ; ; in, For the z In the iteration n The local model parameters of the edge servers, For the z -1 round of iteration n The local model parameters of the edge servers, is the learning rate, is the loss function, For the n The current mean square error of the traffic flow hybrid prediction model of the edge servers, For the n The mean square error of the traffic flow hybrid prediction model of edge servers before iteration, is the dynamic adjustment factor, E is the total number of iterations, e is the current iteration number; The cloud server meets the following conditions: ; in, For the z +Model parameters aggregated by the cloud server in 1 round of iteration, N is the total number of edge servers, q n For the n The amount of data on the edge servers, q is the total data quantity of all edge servers.
Citation Information
Patent Citations
A Novel Deep Learning Approach for Distributed Traffic Flow Forecasting
AU2020101023A4
Intelligent vehicle fault real-time prediction method and system based on end-cloud cooperation
CN113821875A
Short-term traffic flow prediction method based on Conv1D-LSTM model
CN116434531A
Cloud-edge collaborative regional traffic signal dynamic timing system and method
CN116524745A
Traffic flow prediction method and device, medium and equipment
CN117474171A
