A traffic facility network planning demand calculation method based on long-term traffic flow prediction

CN122551535APending Publication Date: 2026-08-11BEIHANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]鉴于上述的分析,本发明实施例旨在提供一种基于长期车流量预测的交通设施网系规划需求测算方法,用以解决现有技术中部分地区因历史交通数据收集不足导致交通流量预测不准确的问题

Benefits of technology

[0050]1、本发明提出了引入跨域技术,利用数据丰富的源城市(已有成熟交通系统和充足历史数据的城市)的长期车流量数据及道路相关数据,通过深度学习模型进行训练,学习交通流量的时空分布特征和变化规律。通过跨域学习,模型能够跨越单一城市的限制,学习和利用不同城市间的共通特征和模式,从而提高数据不足的目标城市的交通需求预测的准确性和泛化能力;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551535A_ABST
    Figure CN122551535A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of traffic facilities network planning demand measurement method based on long-term traffic flow prediction, belong to traffic planning and traffic flow prediction technical field, solve the problem that part of area in prior art is not accurately predicted due to insufficient historical traffic data collection Traffic flow.The specific steps include: based on the historical traffic flow data and road related data of source city and target city, traffic facilities network planning model is obtained by training, and the spatial characteristics and spatial characteristic similarity weight of each region of source city and target city are obtained;Based on the spatial characteristic similarity weight and the historical traffic flow data of target city, the traffic flow prediction model after training is used, and the traffic flow prediction result and time characteristic of each region of target city are obtained;Based on the traffic flow prediction result, time characteristic and spatial characteristic of each region, the traffic facilities network planning demand of target city is obtained, the accurate measurement of the planning demand of target city with less historical traffic data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic planning and traffic flow forecasting technology, and in particular to a method for calculating the planning demand of traffic facility networks based on long-term traffic flow forecasting. Background Technology

[0002] With the acceleration of urbanization and the continuous advancement of regional economic integration in my country, transportation links between cities are becoming increasingly close, and the role of urban transportation networks in the comprehensive transportation system is becoming more and more prominent. Against this backdrop, the demand for urban transportation infrastructure network planning is also growing to adapt to the increasing traffic flow and complex traffic patterns. However, for many newly established cities with short histories or cities undergoing rapid changes, the lack of historical traffic data makes it difficult to accurately predict traffic flow, which directly affects the scientific nature and foresight of transportation infrastructure planning.

[0003] In these cities, the lagging development of transportation infrastructure, the imperfect traffic data collection systems, and the rapid changes in traffic patterns pose significant challenges to the collection and analysis of traffic flow data. Furthermore, uncertainties in urban development, such as adjustments to urban planning, changes in environmental policies, and social events, can all significantly impact traffic flow, increasing the complexity of traffic forecasting. Summary of the Invention

[0004] Based on the above analysis, the embodiments of the present invention aim to provide a method for calculating the planning demand of traffic facility networks based on long-term traffic flow forecasting, in order to solve the problem that inaccurate traffic flow forecasting in some areas is caused by insufficient collection of historical traffic data in the prior art.

[0005] The objective of this invention is mainly achieved through the following technical solutions:

[0006] This invention provides a method for calculating the planning demand of transportation infrastructure networks based on long-term traffic flow forecasting, comprising the following steps:

[0007] Based on a training set including historical traffic flow data and road-related data from source and target cities, a traffic facility network planning model is trained, and spatial characteristics and spatial similarity weights of each region in the source and target cities are obtained; wherein, the amount of historical data in the source city is greater than that in the target city to be analyzed.

[0008] A traffic flow prediction model was trained based on historical traffic flow data from the source city.

[0009] Based on the spatial feature similarity weights and the historical traffic flow data of the target city, the traffic flow prediction model is used to obtain the traffic flow prediction results and temporal characteristics of each area of ​​the target city.

[0010] Based on the traffic flow forecast results, temporal characteristics, and spatial characteristics of each region, the traffic demand potential index of the corresponding region is obtained. By summing the traffic demand potential indices of each region, the traffic facility network planning demand of the target city is obtained.

[0011] Furthermore, the traffic demand potential index for the corresponding region is calculated based on the following formula:

[0012] TDPI i =w1×Flow i +w2×Time i +w3×Space i ,

[0013] Where w1, w2, and w3 are weighting factors, Flow i Time i Space i These represent the traffic flow prediction results, temporal characteristics, and spatial characteristics of region i, respectively.

[0014] Furthermore, the transportation infrastructure network planning model includes a graph structure, a feature network, and a weighted network; the training of the transportation infrastructure network planning model includes:

[0015] Based on the training set, multiple source city maps and multiple target city maps are obtained using graph structures;

[0016] Based on the multiple source city maps and multiple target city maps, the regions are divided respectively, and the feature network is used to learn the features of each region to obtain the comprehensive node embedding features of each region of the source city and the target city.

[0017] Based on the comprehensive node embedding features of the source city and the target city respectively, the weights of the regions are learned using a weighted network and a weighted network loss function to obtain the similarity weights of each region in the source city and the target city.

[0018] After training, the comprehensive node embedding features and similarity weights obtained from the training set using the transportation infrastructure network planning model are the spatial features and spatial feature similarity weights of each region in the source city and the target city.

[0019] Furthermore, the characteristic is that obtaining multiple source city maps and target city maps includes:

[0020] Construct location adjacency matrices based on the geographical locations of the source city and the target city, respectively;

[0021] Construct road adjacency matrices based on the road relationships between the source city and the target city, respectively;

[0022] A similar adjacency matrix is ​​constructed based on the points of interest in the source city and the target city, respectively; where the points of interest are the location points of typical buildings or transportation facilities.

[0023] Based on traffic flow data from the source city and the destination city, similarity adjacency matrices are constructed for the source nodes and the destination nodes, respectively.

[0024] Based on the above adjacency matrices, multiple source city maps and target city maps are obtained.

[0025] Furthermore, the feature network sequentially utilizes adaptive distillation learning based on KL divergence to learn features for each region, including:

[0026] The source city map and the target city map are processed using a multi-view attention network to obtain the node embedding matrix corresponding to each graph structure;

[0027] The self-attention mechanism of the fusion layer is used to update and fuse the node embedding matrices of the source city and the target city respectively to obtain the updated node embedding features, and the comprehensive node embedding features are output after linear transformation.

[0028] Feature learning for each region is performed sequentially using domain-level adaptive distillation learning, node-level adaptive distillation learning, and edge-level adaptive distillation learning based on KL divergence.

[0029] Furthermore, the domain-level adaptive distillation learning includes:

[0030] Extract the node embedding features of the starting point, destination point and interest point from the updated node embedding features, and calculate the KL divergence of the three types of feature embeddings, wherein the interest point is the location point of a typical building or transportation facility.

[0031] The loss function for the corresponding type of node is calculated based on the KL divergence of the three types of feature embeddings.

[0032] The feature network is trained based on the domain-level global loss function obtained from the loss functions of various nodes.

[0033] Furthermore, the domain-level global loss function is expressed as:

[0034] loss recons =mean(od_adj⊙pre⊙exp(-KL div )),

[0035] loss poi =mean((poi_sim-poi_cos) 2 ⊙exp(-KL div_poi )),

[0036]

[0037] loss δ =loss source +loss target ,

[0038] Where, loss δ For the domain-level global loss function, loss source For the source city, the domain-level loss is... target Domain-level losses in the target city; The reconstruction loss is for the starting point type nodes within the domain. Represents the reconstruction loss of endpoint type nodes within the domain, based on loss recons They were obtained respectively and loss poi The reconstruction loss is for interest point type nodes within the domain. θ and ρ are the weight coefficients, od_adj is the adjacency matrix between the starting point and the destination, pre is the probability distribution of the similarity matrix between the starting point and the destination, poi_sim is the similarity matrix between points of interest, poi_cos is the cosine similarity matrix between points of interest, and KL... div_poi This represents the KL divergence between the interest point feature embeddings obtained from the teacher-student model; KL div This represents the KL divergence from the starting point to the ending point.

[0039] Furthermore, the node-level adaptive distillation learning includes:

[0040] Calculate the KL divergence between the integrated node embedding features output by the teacher-student model and the student model, and take the negative value of the exponential function to weight the input source city and target city samples;

[0041] The similarity between the input source city and target city samples is calculated based on the Gaussian kernel to obtain the composite Gaussian kernel matrix;

[0042] The MMD loss function is obtained based on the kernel matrix derived from the Gaussian kernel matrix and is used to train the feature network.

[0043] Furthermore, the edge-level adaptive distillation learning includes:

[0044] Edge-level features are obtained by connecting node features from a region pair from the source city and the target city;

[0045] Based on the aforementioned edge-level features, the feature network is trained using multi-label binary cross-entropy loss.

[0046] Furthermore, the weighted network loss function is:

[0047] Loss=MSE(pre,truth)+α×(TDPI s -TDPI t ),

[0048] Where MSE is the mean squared error; pre and truth are the traffic flow predicted by the model and the actual observed traffic flow, respectively; α is the weight of the regularization term; TDPI s and TDPI t These are the traffic demand potential indices for the source city and the target city, respectively.

[0049] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0050] 1. This invention proposes introducing cross-domain technology, utilizing long-term traffic flow data and road-related data from data-rich source cities (cities with mature transportation systems and sufficient historical data), and training them through deep learning models to learn the spatiotemporal distribution characteristics and variation patterns of traffic flow. Through cross-domain learning, the model can overcome the limitations of a single city, learning and utilizing common features and patterns between different cities, thereby improving the accuracy and generalization ability of traffic demand prediction for target cities with insufficient data;

[0051] 2. A method for calculating the traffic demand potential index is proposed. By using traffic flow prediction in a specific direction, the traffic demand potential of the tested area relative to other areas within a certain period can be calculated, thereby optimizing the supply and demand matching between vehicles and traffic facilities in the tested area and avoiding waste of traffic resources.

[0052] 3. A multi-granularity domain adaptive technique and knowledge distillation method are proposed, which includes domain-level feature learning, node-level feature learning and edge-level feature learning. By finely adjusting the information flow between the source domain and the target domain, the harmful noise impact when the model migrates from the source city to the target city is effectively reduced.

[0053] 4. Based on the reconstruction loss, it can more effectively distinguish and handle different types of data bias during the learning process. It reconstructs a variety of loss functions, including domain-level loss, node-level loss, and edge-level loss, which improves the ability of knowledge transfer and adaptation from the source city to the target city.

[0054] 5. The method described above can not only improve the scientificity and accuracy of transportation facility planning, but also guide urban planners and transportation management departments to better plan transportation facilities and transportation tasks, which is of great significance for improving urban traffic efficiency and promoting sustainable urban development.

[0055] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0056] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0057] Figure 1 This is a flowchart illustrating the traffic facility network planning requirements calculation according to an embodiment of the present invention. Detailed Implementation

[0058] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0059] A specific embodiment of the present invention discloses a method for calculating the planning demand of transportation infrastructure networks based on long-term traffic flow forecasting, such as... Figure 1 As shown, it includes the following steps:

[0060] Step S1: Based on the training set including historical traffic flow data and road-related data of the source city and the target city, train a traffic facility network planning model, and obtain the spatial characteristics and spatial similarity weights of each region of the source city and the target city; wherein, the amount of historical data of the source city is greater than that of the target city to be analyzed.

[0061] Step S2: Train a traffic flow prediction model based on historical traffic flow data from the source city.

[0062] Step S3: Based on the spatial feature similarity weights and the historical traffic flow data of the target city, the traffic flow prediction model is used to obtain the traffic flow prediction results and time characteristics of each area of ​​the target city.

[0063] Step S4: Based on the traffic flow prediction results, time characteristics, and spatial characteristics of each region, obtain the traffic demand potential index of the corresponding region, summarize the traffic demand potential indices of each region, and obtain the traffic facility network planning demand of the target city.

[0064] By using the above method, based on the rich historical traffic data of the source city and the data of the target city, and using the traffic facility network planning model, the spatial characteristic similarity between the target city and the source city is obtained. Then, combined with the prediction model, traffic flow is predicted for the target city with insufficient data. By calculating the "traffic demand potential index", the future traffic flow trend of the target city is calculated, which improves the accuracy of traffic demand prediction for the target city and solves the problem of low prediction accuracy caused by insufficient data.

[0065] For example, in step S1, traffic flow data including taxis and bicycles within one year in the source city and within one month in the target city are obtained and recorded at hourly intervals; and road-related data including road network data and points of interest (POI) data are obtained in the source city and the target city; wherein, the POI data includes data on the location of typical buildings or transportation facilities such as gas stations, parking lots, parks and schools.

[0066] The acquired data is preprocessed, including:

[0067] 1) Normalize the POI data of the source city and the target city to ensure that the data of the source and target cities are mapped to the same standard range [0, 1];

[0068] 2) Rasterize the area containing the source city and the target city, and obtain the grid size of the source city and the target city, i.e., the longitude lng of the source city. source Source city latitude lat source target city longitude lng target Target city latitude lat target ;

[0069] 3) Perform data cleaning on the traffic flow data, mark whether each location in the traffic flow data of the source city and the target city contains valid traffic flow data (i.e., the sum of the data at that location is greater than zero), and normalize the traffic flow data of the source city and the target city to normalize the traffic flow data to the interval [0, 1].

[0070] 4) Divide the traffic flow data (i.e., spatiotemporal data) of the source city and the target city into time windows according to the given lag value.

[0071] For example, for each time step t, create a window containing data from past lag steps:

[0072] X(t)=[data(t-lag), data(t-lag+1),..., data(t-1)],

[0073] Here, X(t) represents the data within the t-th time window.

[0074] 5) Use the TF-IDFTransformer to standardize the point of interest data, converting it to TF-IDF format. TF-IDF is a commonly used text processing method, mainly used to measure the representativeness of each point of interest to different regions, thereby obtaining the transformed point of interest feature matrix.

[0075] The processed data is divided into training, validation, and test sets. For example, for the source city, the data from the first 8 months is used as the training set, the data from the 9th and 10th months is used as the validation set, and the data from the last 2 months is used as the test set. For the target city, data from one month, one week, or three days are used as the training set, respectively. The validation and test sets are obtained by taking the data from the training set for the next two months and the data from the next two months for the test set.

[0076] The transportation infrastructure network planning model includes a graph structure, a feature network, and a weighted network. The graph structure is used to obtain multiple source city maps and multiple target city maps. The feature network is used to learn the features of each source city map and target city map. The weighted network is used to identify and utilize the regions in the source cities that are useful for traffic prediction in the target cities to learn weights.

[0077] Specifically, the training yields the traffic facility network planning model, including:

[0078] Based on the training set, multiple source city maps and multiple target city maps are obtained using graph structures;

[0079] Based on the multiple source city maps and multiple target city maps, the regions are divided respectively, and the feature network is used to learn the features of each region to obtain the comprehensive node embedding features of each region of the source city and the target city.

[0080] Based on the comprehensive node embedding features of the source city and the target city respectively, the weights of the regions are learned using a weighted network and a weighted network loss function, and the similarity weights of each region in the source city and the target city are obtained.

[0081] Based on the training set, the comprehensive node embedding features and similarity weights of the trained transportation facility network planning model are output as the spatial features and spatial feature similarity weights of each region in the source city and the target city.

[0082] First, multiple source city maps and multiple target city maps are obtained using graph structures. The specific steps are as follows:

[0083] S111: Construct location adjacency matrices based on the geographic location information of the source city and the target city respectively; ensure that the elements in the adjacency matrix correspond one-to-one with the location relationships in the grid area;

[0084] For example, when encoding the adjacency matrix, all diagonal elements in the adjacency matrix are set to 1 to represent the grid region itself; if each region is connected to its neighboring grid regions, the corresponding position in the adjacency matrix is ​​encoded as 1.

[0085] S112: Construct a road adjacency matrix based on the road relationships between the source city and the target city respectively. Similarly, each region is connected to the regions directly connected by roads, and each region is also connected to itself.

[0086] S113: Construct similarity adjacency matrices based on the points of interest in the source city and the target city respectively, specifically including:

[0087] 1) Calculate the inner product of the eigenvectors between each pair of regions using the interest point feature matrix obtained after data processing. This inner product reflects the similarity of the interest point features between the two regions and can be regarded as their dot product in the feature space:

[0088]

[0089] Where F is the interest point feature matrix, i and j are region indices, and M is the feature dimension;

[0090] 2) Calculate the Euclidean norm (i.e., L2 norm) of the feature vector of each region's interest points:

[0091]

[0092] 3) Calculate the cosine similarity between regions using inner product and norm:

[0093]

[0094] 4) For each region, select the 15 regions most similar to it based on cosine similarity and connect them. The regions themselves are also connected, thus constructing the final interest point similarity adjacency matrix. The larger the cosine similarity value, the more similar the two regions are.

[0095] S114: Based on traffic flow data, construct a similarity adjacency matrix for source and destination nodes of source and destination cities;

[0096] For example, taking the source city as an example, firstly, the original adjacency matrix od_adj of the source-destination relationship is constructed based on the traffic flow data (if there is traffic flow from region A to region B, it is marked as the corresponding flow value in the adjacency matrix), and then the similarity between nodes is calculated to obtain the source node similarity adjacency matrix and the destination node similarity adjacency matrix s_adj and d_adj, and each region is also connected to itself;

[0097] Specifically, similarity is calculated using the dot product of matrices: s_sim is obtained by multiplying the transpose of od_adj by itself, representing the similarity between nodes from different sources; d_sim is obtained by multiplying od_adj by its transpose, representing the similarity between nodes destined for different destinations. Both similarity matrices are then normalized.

[0098] Next, to reduce unimportant edges and improve the sparsity of the matrix, the relationships between each node and the top 15 nodes with the highest similarity values ​​are retained, while other similarity values ​​are set to 0. The goal of this process is to focus only on the most significant connections. Finally, s_adj and d_adj represent the sparse similarity relationships between the source and target nodes, respectively. These are high-level graph structures extracted from the original adjacency matrix, which more intuitively describe the important connections between nodes and also reduce the complexity of subsequent calculations.

[0099] S115: Combine all the adjacency matrices obtained through the above steps and convert them into a list of graph objects for the source city and the target city, denoted as the source city graph and the target city graph.

[0100] Furthermore, graph traversal analysis is used to examine the edges of each graph (source city graph and target city graph). This involves traversing any graph object, obtaining the edges connecting the source and target nodes, and for each edge, initializing a zero vector with a length equal to the length of the graph object list if it has not been previously stored; otherwise, setting the edge label to 1 at the corresponding position. All edges and their labels in each graph are collected and stored in an edge array and an edge label array, respectively, for subsequent edge processing.

[0101] Secondly, a feature network for the transportation infrastructure network planning model is established using the average teacher method and Kullback-Leibler divergence, learning node embeddings from multi-view data. These embeddings capture the spatial characteristics of the urban area (such as geographical location); specifically including:

[0102] 1) Use Multi-view Graph Attention Networks to process the source city graph and the target city graph to obtain a set of views of the node embedding matrix corresponding to each graph structure;

[0103] 2) Using the self-attention mechanism and linear transformation of the feature network fusion layer, the source city views and the target city views are updated and fused separately, integrating information from different view structures to obtain the source city view update node embedding (emb). s Comprehensive node embedding representation Embedded in emb and the view update node of the target cityt Comprehensive node embedding representation The update node embedding is obtained by using a self-attention mechanism, and then a comprehensive node embedding is obtained after a linear transformation.

[0104] It should be noted that the feature network built using the average teacher method includes a student model and a teacher model. The two models have completely identical structures, both containing a multi-view attention network and a fusion layer. Training with the teacher-student model can improve the feature extraction capability and reduce the adverse effects of the distribution differences between the source city and the target city.

[0105] Specifically, the feature network is trained sequentially using domain-level feature learning, node-level feature learning, and edge-level feature learning based on KL divergence.

[0106] S121: Feature learning for the domain-level adaptive distillation method based on KL divergence includes:

[0107] 1) EMB output from student and teacher models s emb t Extract the feature embeddings of the starting point, destination point, and interest point (update the node embedding features), and calculate the KL divergence of the three types of feature embeddings. Taking the calculation of the KL divergence between the starting points as an example, the formula is as follows:

[0108]

[0109] in, The node embedding represents the starting point of the student model's output. Node embedding representing the starting point of the teacher model output;

[0110] 2) The reconstruction loss of nodes and the similarity loss of interest points are calculated using the KL divergence between feature embeddings, serving as a consistency measure across the entire data domain. The formula is as follows:

[0111] loss recons =mean(od_adj⊙pre⊙exp(-KL div ))

[0112] loss poi =mean((poi_sim-poi_cos) 2 ⊙exp(-KL di v _poi ))

[0113] Where od_adj represents the adjacency matrix between the starting point and the destination, pre represents the probability distribution of the similarity distribution between the starting point and the destination (i.e., the similarity adjacency matrix s_adj or d_adj), poi_sim represents the similarity matrix between interest points based on the embedding vector calculated by the dot product, poi_cos represents the cosine similarity matrix between interest points based on feature similarity, and KL... div_poi This represents the KL divergence between the interest point feature embeddings output by the teacher-student model; KL div The KL divergence is represented from the starting point to the ending point; mean() represents the average function.

[0114] For each sample with high uncertainty, it is necessary to reduce its contribution to the loss. Therefore, exp(-KL) is used as the confidence weight to incorporate uncertainty-guided optimization into the node reconstruction loss and the interest point similarity loss.

[0115] 3) Obtain the domain-level loss of the source city. source Domain-level loss of the target city target :

[0116]

[0117] in, Represents the reconstruction loss of the starting point type node within the domain; The reconstruction loss represents the reconstructing loss of endpoint type nodes within the domain; poi The similarity loss is calculated for points of interest within the domain. θ and ρ are the weight coefficients, respectively, and their specific values ​​are determined after model training and parameter tuning; loss target The calculation method is the same.

[0118] 4) Thus, the domain-adaptive global loss function is defined. δ for:

[0119] loss δ =loss source +loss target

[0120] S122: Feature learning in the node-level adaptive distillation method based on KL divergence includes:

[0121] 1) A Gaussian kernel is calculated to measure the similarity between samples in two sample sets (i.e., source city map and target city map). It is calculated based on L2 distance and uses a range of Gaussian kernels with different bandwidths.

[0122] 2) Calculate a composite Gaussian kernel matrix using weighted source and target samples. Then, calculate kernel matrices XX, YY, XY, and YX from this composite kernel matrix, representing the similarity within source city sample x, the similarity within target city sample y, and the similarity between source sample x and target sample y, respectively. The weighting is achieved by calculating the KL divergence between the comprehensive node embedding features of the source and target cities output by the teacher-student model, taking the negative of the exponential function for the KL divergence value, and then weighting the node features accordingly.

[0123] 3) Calculate the MMD loss (Maximum Mean Discrimination, MMD) using the kernel matrix, as shown in the following formula:

[0124]

[0125] Where k(x, y) is the Gaussian kernel function, x and y are the source and target samples respectively, and n and m are the sizes of the source and target sample sets respectively;

[0126] S123: Feature learning in the KL divergence-based edge-level adaptive distillation method includes:

[0127] 1) Given a pair of regions a from source city A and target city B respectively. i a j ∈{A, B}, edge-level features are obtained by connecting their combined node features. And assign edge label E ij ∈{0,1} indicates the edge type between pairs of regions:

[0128]

[0129] in, It is an index function; for example, if a i a j Connecting the POI map and the endpoint map, E ij = [0, 0, 1, 0, 1]. Given edge features... In the future, we can use the edge classifier G. edge To predict edge label E ij .

[0130] 2) Learn the edge classifier by minimizing the following loss function:

[0131]

[0132] Where BCE represents the multi-label binary cross-entropy loss, the formula is as follows:

[0133]

[0134] Where, ω kl The KL divergence of the edge-level feature embeddings output by the teacher-student model was calculated.

[0135] Secondly, a weighted network is used to learn how to adjust the weights of source city regions based on the similarity between the source and target cities. This helps the model identify and utilize regions within the source city that are useful for traffic prediction in the target city, learning the corresponding region weights. The learning process includes:

[0136] S131: Scoring weights are calculated using the source city feature embeddings and the target city feature embeddings, and then used for subsequent loss adjustment. Simultaneously, an initial traffic demand potential index is calculated for each region, as shown in the following formula:

[0137] TDPI i =w1×Flow i +w2×Time i +w3×Space i

[0138] Among them, w1, w2, and w3 are weight factors, and their specific values ​​are determined after model training and parameter tuning; Flow i Time i Space i These represent the traffic flow prediction results, temporal characteristics, and spatial characteristics of region i, respectively.

[0139] S132: Perform inner loop training on the source city data while simulating the fine-tuning process of the target city. In each iteration, the loss is calculated through forward propagation, and the weights are updated using gradient descent.

[0140] When calculating the loss of the weighted network, a traffic demand potential index is considered to reflect the region's traffic demand potential. The loss function is as follows:

[0141] Loss=MSE(pre,truth)+α×(TDPI s -TDPI t )

[0142] Where MSE is the mean squared error, pre and truth are the traffic flow predicted by the model and the actual observed traffic flow, respectively, α is the weight of the regularization term, and TDPI is the mean squared error. s and TDPI t These are the traffic demand potential indices for the source city and the target city, respectively.

[0143] S133: Use gradient clipping to prevent gradient explosion and apply the Adam optimizer to update the parameters of the scoring function, which determine how to adjust the region weights according to the Traffic Demand Potential Index (TDPI).

[0144] S134: The overall performance of the model is evaluated by calculating the average query loss across all epochs, which helps to quickly adapt to target cities for new tasks;

[0145] Finally, the transportation infrastructure network planning model is trained based on the following steps:

[0146] S141: Training the Feature Network: Train the feature network using a training set containing data from the source city and the target city. Use domain-level, node-level, and edge-level domain adaptation techniques to adjust the feature network so that the feature distribution of nodes and edges in the source city and the target city is more consistent. Learn regional features that can generalize to the target city.

[0147] S142: Training the Weighted Network: Calculate the Traffic Demand Potential Index (TDPI) for each region of the source city, which may involve a weighted sum of traffic flow, temporal features, and spatial features; based on the TDPI, feature embeddings of the target city and the source city, train the weighted network to learn the region weights. These weights will be used to adjust the loss function of the source city in subsequent steps;

[0148] For example, training a weighted network based on meta-learning includes:

[0149] Inner loop: Simulates the training process of the source city and the fine-tuning process of the target city, quickly adapting to the target city's data through a small number of iterative update steps.

[0150] Outer loop: Update the parameters of the feature network and weighted network on multiple tasks (source-target city pairs) to optimize the model's ability to adapt quickly to new tasks;

[0151] S143: At the end of each epoch, evaluate the model's performance on the validation set, using mean squared error (MSE) and root mean squared error (RMSE) as evaluation metrics.

[0152] S144: Use gradient clipping and the Adam optimizer to update model parameters, ensuring stability and convergence during training; complete model optimization.

[0153] Specifically, the training processes of the traffic facility network planning model and the traffic flow prediction model in steps S1 and S2 are carried out simultaneously. Therefore, before step S143, the traffic flow prediction network is trained simultaneously based on the historical traffic flow data of the source city. The prediction network can capture traffic flow characteristics and time characteristics (such as hours of the day).

[0154] Furthermore, step S2 also involves fine-tuning the prediction model using traffic flow data from the target city, including:

[0155] S21: Initialize the prediction model: Based on the model trained in the source city, initialize the prediction model for the target city;

[0156] S22: Combine the weights calculated by the weighted network and TDPI to adjust the loss function in order to better adapt to the data of the target city;

[0157] S23: Fine-tune the model parameters on the target city data using the adjusted loss function to improve the predictive performance in the target city.

[0158] Specifically, in step S3, a traffic flow prediction model is constructed using cross-domain prediction, which adapts to the feature distribution of different data domains based on spatial feature similarity weights.

[0159] For example, the prediction network uses the STNet network architecture. STNet adapts the feature distribution of different data domains by using spatial feature similarity weights during the forward propagation process. This approach allows the model to share or adapt weights across different domains, thereby improving the model's generalization ability in new domains. By passing a dictionary of spatial feature similarity weights, the model can perform forward propagation using these predefined weights without relying on internal parameter initialization. This is particularly useful for transferring knowledge between the source and target domains, as the weights can be adjusted to adapt to the data features of the target domain.

[0160] The STNet model captures temporal features in time series data through Long Short-Term Memory (LSTM) layers. In the forward propagation method, the model first extracts spatial features from the input data, then organizes these features into sequences and feeds them into the LSTM layer. The LSTM layer processes this sequence data and extracts temporal dependencies, thereby obtaining the temporal features.

[0161] Specifically, in step S4, based on the traffic flow prediction results, time characteristics, and spatial characteristics of each region, the traffic demand potential index of the corresponding region is calculated to quantitatively assess the traffic demand potential of the target city in a specific time period. By summarizing the traffic demand potential indices of each region, the traffic facility network planning demand of the target city can be obtained.

[0162] Compared with existing technologies, this embodiment provides a method for calculating the planning demand of transportation infrastructure networks based on long-term traffic flow forecasting. Based on rich historical traffic data from the source city and relevant data from the target city, it utilizes a transportation infrastructure network planning model to obtain the spatial feature similarity between the target and source cities. Then, combined with a prediction model, it forecasts traffic flow for the target city where data is insufficient. By integrating the predicted data and features, it obtains the planning demand of the target city's transportation infrastructure network, ultimately improving the accuracy of traffic demand forecasting for the target city. On one hand, the method uses a "traffic demand potential index" to quantitatively assess the traffic demand potential of the target city within a specific time period, avoiding the waste of traffic resources. On the other hand, it proposes a multi-granularity domain adaptive technique and knowledge distillation method that includes domain-level feature learning, node-level feature learning, and edge-level feature learning. Combined with reconstruction loss, it more effectively distinguishes and handles different types of data bias during the learning process, effectively reducing the harmful noise impact when the model migrates from the source city to the target city, and improving the ability of knowledge transfer and adaptation.

[0163] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0164] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A traffic facility network planning demand calculation method based on long-term traffic flow prediction, characterized in that, Includes the following steps: Based on a training set including historical traffic flow data and road-related data from source and target cities, a traffic facility network planning model is trained, and spatial characteristics and spatial similarity weights of each region in the source and target cities are obtained; wherein, the amount of historical data in the source city is greater than that in the target city to be analyzed. A traffic flow prediction model was trained based on historical traffic flow data from the source city. Based on the spatial feature similarity weights and the historical traffic flow data of the target city, the traffic flow prediction model is used to obtain the traffic flow prediction results and temporal characteristics of each area of ​​the target city. Based on the traffic flow forecast results, temporal characteristics, and spatial characteristics of each region, the traffic demand potential index of the corresponding region is obtained. By summing the traffic demand potential indices of each region, the traffic facility network planning demand of the target city is obtained.

2. The method according to claim 1, wherein, The traffic demand potential index for the corresponding region is calculated based on the following formula: TDPI i = w1 x Flow i + w2 x Time i + w3 x Space i , where w1, w2, w3 are weight factors, Flow i , Time i , Space i represent the traffic flow prediction result, time feature and space feature of region i, respectively.

3. The method according to claim 2, wherein, The transportation infrastructure network planning model includes a graph structure, a characteristic network, and a weighted network. The training yields the traffic facility network planning model, including: Based on the training set, multiple source city maps and multiple target city maps are obtained using graph structures; Based on the multiple source city maps and multiple target city maps, the regions are divided respectively, and the feature network is used to learn the features of each region to obtain the comprehensive node embedding features of each region of the source city and the target city. Based on the comprehensive node embedding features of the source city and the target city respectively, the weights of the regions are learned using a weighted network and a weighted network loss function to obtain the similarity weights of each region in the source city and the target city. After training, the comprehensive node embedding features and similarity weights obtained from the training set using the transportation infrastructure network planning model are the spatial features and spatial feature similarity weights of each region in the source city and the target city.

4. The method according to claim 3, wherein, The multiple source city maps and target city maps obtained include: Construct location adjacency matrices based on the geographical locations of the source city and the target city, respectively; Construct road adjacency matrices based on the road relationships between the source city and the target city, respectively; A similar adjacency matrix is ​​constructed based on the points of interest in the source city and the target city, respectively; where the points of interest are the location points of typical buildings or transportation facilities. Based on traffic flow data from the source city and the destination city, similarity adjacency matrices are constructed for the source nodes and the destination nodes, respectively. Based on the above adjacency matrices, multiple source city maps and target city maps are obtained.

5. The method for calculating the demand for traffic facility network planning based on long-term traffic flow forecasting as described in claim 4, characterized in that, The feature network sequentially utilizes adaptive distillation learning based on KL divergence to learn features for each region, including: The source city map and the target city map are processed using a multi-view attention network to obtain the node embedding matrix corresponding to each graph structure; The self-attention mechanism of the fusion layer is used to update and fuse the node embedding matrices of the source city and the target city respectively to obtain the updated node embedding features, and the comprehensive node embedding features are output after linear transformation. Feature learning for each region is performed sequentially using domain-level adaptive distillation learning, node-level adaptive distillation learning, and edge-level adaptive distillation learning based on KL divergence.

6. The method according to claim 5, wherein, The domain-level adaptive distillation learning includes: Extract the feature embeddings of the starting point, destination point, and interest point from the embedded features of the updated node, and calculate the KL divergence of the three types of feature embeddings, wherein the interest point is the location of a typical building or transportation facility. The loss function for the corresponding type of node is calculated based on the KL divergence of the three types of feature embeddings. The feature network is trained based on the domain-level global loss function obtained from the loss functions of various nodes.

7. The method according to claim 6, wherein, The domain-level global loss function is expressed as: loss recons = mean(od adj ˙ pre(˙ exp(-KL div )), loss poi =mean((poi_sim-poi_cos) 2 ⊙exp(-KL div_poi )), loss δ =loss source +loss target , Where, loss δ For the domain-level global loss function, loss source For the source city, the domain-level loss is... target Domain-level losses in the target city; The reconstruction loss is for the starting point type nodes within the domain. Represents the reconstruction loss of endpoint type nodes within the domain, based on loss recons They were obtained respectively and loss poi The similarity loss is calculated for points of interest within the domain. θ and ρ are the weight coefficients, od_adj is the adjacency matrix between the starting point and the destination, pre is the probability distribution of the similarity matrix between the starting point and the destination, poi_sim is the similarity matrix between points of interest, poi_cos is the cosine similarity matrix between points of interest, and KL... div_poi This represents the KL divergence between the interest point feature embeddings obtained from the teacher-student model; KL div This represents the KL divergence from the starting point to the ending point. 8.The method of claim 5, wherein, The node-level adaptive distillation learning includes: Calculate the KL divergence between the integrated node embedding features output by the teacher-student model and the student model, and take the negative value of the exponential function to weight the input source city and target city samples; The similarity between the input source city and target city samples is calculated based on the Gaussian kernel to obtain the composite Gaussian kernel matrix; The MMD loss function is obtained based on the kernel matrix derived from the Gaussian kernel matrix and is used to train the feature network. 9.The method of claim 5, wherein, The edge-level adaptive distillation learning includes: Edge-level features are obtained by connecting node features from a region pair from the source city and the target city; Based on the aforementioned edge-level features, the feature network is trained using multi-label binary cross-entropy loss.

10. The method according to any one of claims 3-9, wherein, The weighted network loss function is: Loss = MSE(pre, truth) + a x (TDPI s TDPI t ), where MSE is the mean square error; pre and truth are the model predicted and actual observed traffic flow, respectively; a is the weight of the regularization term; TDPI s and TDPI t are the traffic demand potential indices of the source city and the destination city, respectively.