CN-116884211-B - Traffic sequence prediction method and device, electronic equipment and storage medium
Abstract
The invention discloses a traffic sequence prediction method, a traffic sequence prediction device, electronic equipment and a storage medium. The method comprises the steps of determining a target area from a source city according to traffic data of the source city and a target city, constructing a virtual city, comparing geographic data of the virtual city and the target city to obtain network weight, training a prediction model based on the network weight, the virtual city and time sequence data of the target city, and finally predicting traffic sequences of the target city. According to the technical scheme, the virtual city is built according to the target area, so that more traffic data which is beneficial to the prediction of the target city in the source city is maintained in the virtual city, the traffic data migration is more stable and reasonable, the negative migration phenomenon is relieved by training the prediction model based on the network weight, the virtual city and the time sequence data of the target city, the accuracy and the efficiency of traffic sequence prediction are improved, and finally the accurate and efficient traffic sequence prediction is realized through the prediction model.
Inventors
- BI XIAOJUN
- LI WUDI
- SUN YIWEN
- QI SIYUAN
Assignees
- 中央民族大学
Dates
- Publication Date
- 20260505
- Application Date
- 20230705
Claims (12)
- 1. A traffic sequence prediction method, comprising: Determining a target area with similarity meeting requirements and communication degree meeting requirements from a source city according to traffic data of the source city and traffic data of a target city, wherein the traffic data comprises time sequence data and geographic data; constructing a virtual city aiming at the target area by taking the maximum available area as a target and generating traffic data of the virtual city; comparing the geographic data of the virtual city with the geographic data of the target city to obtain network weight; training a predictive model based on the network weights, the time series data of the virtual city, and the time series data of the target city; predicting a traffic sequence of the target city through the prediction model; comparing the geographic data of the virtual city with the geographic data of the target city to obtain a network weight, including: forming an adjacency matrix by the geographic data of the virtual city and the geographic data of the target city, and inputting the adjacency matrix to a graph meaning network so as to extract the feature vector of the virtual city and the feature vector of the target city through the graph meaning network; And inputting the feature vector of the virtual city and the feature vector of the target city into a weight network formed by a multi-layer perceptron to obtain network weights.
- 2. The method according to claim 1, wherein determining a target area from a source city that satisfies a requirement for similarity to the target city and a degree of connectivity from the source city based on traffic data of the source city and traffic data of the target city, comprises: for each undetermined area in the source city, calculating the similarity between the undetermined area and the target city according to the traffic data of the undetermined area and the traffic data of the target city; and determining a target area according to the similarity between each undetermined area and the target city.
- 3. The method of claim 2, wherein calculating the similarity of the pending area to the target city based on the traffic data of the pending area and the traffic data of the target city comprises: calculating the similarity between the undetermined area and each area in the target city according to the traffic data of the undetermined area and the traffic data of each area in the target city; And taking the average value of the similarity between the undetermined area and each area in the target city as the similarity between the undetermined area and the target city.
- 4. The method of claim 2, wherein calculating the similarity of the pending area to the target city based on the traffic data of the pending area and the traffic data of the target city comprises: Calculating the time similarity between the undetermined area and the target city according to the time sequence data of the undetermined area and the time sequence data of the target city; calculating the geographic similarity between the undetermined area and the target city according to the geographic data of the undetermined area and the geographic data of the target city; And adding the time similarity and the geographic similarity to obtain the similarity between the undetermined area and the target city.
- 5. The method of claim 2, wherein calculating the similarity of the pending area to the target city based on the traffic data of the pending area and the traffic data of the target city comprises: And calculating the similarity between the undetermined area and the target city by adopting at least one algorithm selected from a dynamic time warping algorithm, an algorithm based on KL divergence, an algorithm based on maximum average error and an algorithm based on JS divergence according to the traffic data of the undetermined area and the traffic data of the target city.
- 6. The method of claim 2, wherein determining a target region based on the similarity of each of the pending regions to the target city comprises: And extracting a pending area with the similarity higher than a set threshold and the connectivity meeting the requirements from the source city by adopting an area extraction algorithm based on depth-first search, and taking the pending area as a target area.
- 7. The method of claim 1, wherein constructing a virtual city for the target area targeting maximizing available area and generating traffic data for the virtual city comprises: Merging the target area with the undetermined area in the surrounding set range to obtain a rectangular area; and constructing a virtual city based on the rectangular area by adopting a two-dimensional stripe packing algorithm and generating traffic data of the virtual city.
- 8. The method of claim 1, wherein training a predictive model based on the network weights, the time series data of the virtual city, and the time series data of the target city comprises: Extracting time sequence data of a first number of virtual cities to selectively learn the extracted time sequence data of the virtual cities based on the network weights through the prediction model; extracting time sequence data of a second number of target cities to learn the extracted time sequence data of the target cities through the prediction model.
- 9. The method of claim 1, wherein training a predictive model based on the network weights, the time series data of the virtual city, and the virtual data of the target city comprises: Extracting time sequence data of a third number of target cities; And determining a loss of the predictive model based on the extracted time series data of the target city; if the loss is greater than a set point, a gradient is calculated based on the loss and the network weight is updated according to the gradient.
- 10. A traffic sequence prediction apparatus, comprising: The determining module is used for determining a target area with similarity meeting requirements and communication degree meeting requirements from a source city according to traffic data of the source city and traffic data of a target city, wherein the traffic data comprises time sequence data and geographic data; The building module is used for building a virtual city aiming at the target area and taking the maximum available area as a target and generating traffic data of the virtual city; The comparison module is used for comparing the geographic data of the virtual city with the geographic data of the target city to obtain network weight; The training module is used for training a prediction model based on the network weight, the time sequence data of the virtual city and the time sequence data of the target city; the prediction module is used for predicting the traffic sequence of the target city through the prediction model; The comparison module comprises a feature vector extraction unit, a graph attention network and a target city extraction unit, wherein the feature vector extraction unit is used for forming an adjacency matrix from the geographic data of the virtual city and the geographic data of the target city and inputting the adjacency matrix into the graph attention network so as to extract feature vectors of the virtual city and feature vectors of the target city through the graph attention network; The network weight acquisition unit is used for inputting the feature vector of the virtual city and the feature vector of the target city into a weight network formed by the multi-layer perceptron to obtain the network weight.
- 11. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the traffic sequence prediction method according to any one of claims 1-9.
- 12. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a traffic sequence prediction method according to any of claims 1-9.
Description
Traffic sequence prediction method and device, electronic equipment and storage medium Technical Field The embodiment of the invention relates to the technical field of intelligent traffic, in particular to a traffic sequence prediction method, a traffic sequence prediction device, electronic equipment and a storage medium. Background With the acceleration of the global urban process, urban population is rapidly increased, traffic demand is also greatly increased, and great challenges are brought to urban traffic systems. The limited road space and traffic infrastructure, as well as the limited investment resources, make traffic management and planning more complex and difficult, and traffic congestion and emission pollution negatively impact the environment, resident health and resident travel experience, thus effective traffic sequence prediction methods are needed to reduce these problems. Most of the existing traffic sequence prediction methods are finished based on a deep learning model, but the problems of knowledge coverage and negative migration during knowledge migration are not solved, and the prediction accuracy is low. Disclosure of Invention The invention provides a traffic sequence prediction method, a traffic sequence prediction device, electronic equipment and a storage medium, so as to realize prediction of traffic sequences. In a first aspect, an embodiment of the present invention provides a traffic sequence prediction method, including: determining a target area with similarity meeting requirements with a target city from the source city according to traffic data of the source city and traffic data of the target city, wherein the traffic data comprises time sequence data and geographic data; Constructing a virtual city aiming at a target area and generating traffic data of the virtual city; Comparing the geographic data of the virtual city with the geographic data of the target city to obtain network weight; training a prediction model based on the network weights, the time sequence data of the virtual city and the time sequence data of the target city; And predicting the traffic sequence of the target city through a prediction model. In a second aspect, an embodiment of the present invention provides a traffic sequence prediction apparatus, including: The determining module is used for determining a target area with the similarity meeting the requirement with the target city from the source city according to the traffic data of the source city and the traffic data of the target city, wherein the traffic data comprises time sequence data and geographic data; The construction module is used for constructing a virtual city aiming at the target area and generating traffic data of the virtual city; the comparison module is used for comparing the geographic data of the virtual city with the geographic data of the target city to obtain network weight; The training module is used for training the prediction model based on the network weight, the time sequence data of the virtual city and the time sequence data of the target city; and the prediction module is used for predicting the traffic sequence of the target city through the prediction model. In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to implement the traffic sequence prediction method as described in the first aspect. In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the traffic sequence prediction method according to the first aspect. The embodiment of the invention provides a traffic sequence prediction method, a device, electronic equipment and a storage medium, wherein a target area meeting the requirement on similarity with a target city is determined from a source city according to traffic data of the source city and traffic data of the target city, the traffic data comprises time sequence data and geographic data, a virtual city is built according to the target area, the traffic data of the virtual city is generated, the geographic data of the virtual city is compared with the geographic data of the target city to obtain network weight, a prediction model is trained based on the network weight, the time sequence data of the virtual city and the time sequence data of the target city, and finally the traffic sequence of the target city is predicted through the prediction model. According to the technical scheme, the similarity of the source city and the target city is calculated according to the time sequence data and the geographic data of the source city, the target area is determined according to the similarity, the virtua