Traffic flow prediction method and device based on trend similarity, medium and equipment
Patent Information
- Application Number
- CN202410367986.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2044-03-28
AI Technical Summary
在现有的交通流量预测方法中,通常仅仅将历史序列用于特征提取,这种方式不能充分利用序列中信息
[0030](1)本发明通过挖掘路口的交通流量时序特征、经验特征和关联特征共同与交通流量的对应关系,考虑了路口的单独时序以及路口与路口之间的动态关联特性,提高了路口的未来时间段内的交通流量预测的准确性,显著提升了交通流量排名预测的效果。
Smart Images

Figure CN118280127B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic flow prediction, and in particular relates to a traffic flow prediction method, device, medium and equipment based on trend similarity. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Accurate traffic flow forecasting is crucial for optimizing traffic resource allocation, alleviating traffic congestion, improving travel experience, and enhancing traffic safety. Traditional traffic flow forecasting methods primarily rely on historical traffic data and statistical models. These methods are often based on assumptions, such as traffic flow having a linear trend or following a specific probability distribution. These assumptions do not align with real-world traffic systems, rendering the forecasts unapplicable to practical scenarios such as traffic resource allocation.
[0004] The rapid development of machine learning and deep learning technologies has provided new solutions for traffic flow prediction. Existing traffic flow prediction methods typically only use historical sequences for feature extraction, which fails to fully utilize the information within the sequence. Publication number CN 113326449 A presents a method for predicting traffic flow: generating functional relationship maps and flow relationship maps for multiple traffic areas; generating flow characteristics for the target traffic area based on historical flow information from the target traffic area among the multiple traffic areas; generating flow function relationship features for the target traffic area based on the functional relationship maps and flow relationship maps; and predicting the flow of the target traffic area based on the flow characteristics and flow function relationship features. However, the technical problem is that while cosine similarity is used to measure the similarity of flow between intersections, cosine similarity calculates vector distance, ignoring the temporal characteristics of time-series data, thus failing to adequately evaluate time-series similarity and reducing the effectiveness of traffic flow prediction. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a traffic flow prediction method, apparatus, medium, and device based on trend similarity. It combines a trend similarity map with a spatial relationship map to learn associated features, and utilizes sequence features, empirical features, and associated features to jointly predict traffic flow, thereby improving the effectiveness of traffic flow prediction.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] The first aspect of the present invention provides a traffic flow prediction method based on trend similarity.
[0008] In one or more embodiments, a traffic flow prediction method based on trend similarity is provided, including:
[0009] Obtain historical traffic flow data for several intersections within a designated area;
[0010] Extract the temporal characteristics of traffic flow for each intersection from the historical traffic flow data of each intersection;
[0011] Historical windows are traced back on a window-by-window basis. Based on the trend similarity between the historical windows with increasing traffic flow at each intersection and the corresponding windows, the traffic flow empirical features of each intersection are extracted.
[0012] Based on the spatial location of intersections within a defined area and the similarity of traffic flow trends between intersections, spatial relationship diagrams and similarity relationship diagrams are constructed respectively.
[0013] The temporal features of traffic flow at each intersection are used as node features for learning spatial relationship graphs and similarity relationship graphs. The traffic flow association features of each intersection are obtained by weighted summation based on attention weights.
[0014] The traffic flow temporal characteristics, traffic flow empirical characteristics, and traffic flow correlation characteristics of each intersection are fused to obtain fused characteristics;
[0015] Based on the mapping relationship between fusion characteristics and traffic flow, the traffic flow of each intersection within a set area in the future time period is predicted, thereby obtaining the traffic flow ranking of all intersections within the set area.
[0016] A second aspect of the present invention provides a traffic flow prediction device based on trend similarity.
[0017] In one or more embodiments, a traffic flow prediction device based on trend similarity includes:
[0018] The historical traffic flow data acquisition module is used to acquire historical traffic flow data for several intersections within a designated area.
[0019] The traffic flow time-series feature extraction module is used to extract the traffic flow time-series features of each intersection from the historical traffic flow data of each intersection.
[0020] The traffic flow experience feature extraction module is used to backtrack historical windows on a window-by-window basis. Based on the trend similarity between the historical windows with the upward trend of traffic flow at each intersection and the corresponding windows, it extracts the traffic flow experience features of each intersection.
[0021] The spatial and similarity graph construction module is used to construct spatial relationship graphs and similarity relationship graphs based on the spatial location of intersections within a set area and the trend similarity of traffic flow between intersections.
[0022] The traffic flow association feature extraction module is used to use the temporal features of traffic flow at each intersection as node features for learning spatial relationship graphs and similarity relationship graphs, and obtains the traffic flow association features of each intersection by weighted summation based on attention weights.
[0023] The feature fusion generation module is used to fuse the traffic flow temporal features, traffic flow empirical features, and traffic flow correlation features of each intersection to obtain fused features;
[0024] The traffic flow prediction module is used to predict the traffic flow of each intersection within a set area in the future time period based on the mapping relationship between fused features and traffic flow, and thus obtain the traffic flow ranking of all intersections within the set area.
[0025] A third aspect of the present invention provides a computer-readable storage medium.
[0026] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the traffic flow prediction method based on trend similarity as described above.
[0027] A fourth aspect of the present invention provides an electronic device.
[0028] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the traffic flow prediction method based on trend similarity as described above.
[0029] Compared with the prior art, the beneficial effects of the present invention are:
[0030] (1) This invention improves the accuracy of traffic flow prediction in the future time period of intersections by mining the correspondence between the traffic flow temporal features, empirical features and correlation features of intersections and traffic flow, taking into account the individual temporal features of intersections and the dynamic correlation characteristics between intersections, and significantly improves the effect of traffic flow ranking prediction.
[0031] (2) Based on trend similarity, this invention extracts the traffic flow changes of the historical sequence of intersection traffic flow, thereby making full use of the information in the sequence and improving the accuracy of traffic flow prediction in the future time period of the intersection.
[0032] (3) The present invention constructs a similarity graph of intersections based on trend similarity. In the process of identifying similar intersections, the time dependence of traffic flow sequence is preserved, which can more effectively capture the correlation features between intersections, thereby improving the prediction effect of traffic flow.
[0033] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0034] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0035] Figure 1 This is a schematic diagram of an electronic device according to an embodiment of the present invention;
[0036] Figure 2 This is a flowchart illustrating the traffic flow prediction method based on trend similarity according to an embodiment of the present invention.
[0037] Figure 3 This is a schematic diagram illustrating the traffic flow prediction principle based on trend similarity in an embodiment of the present invention.
[0038] Figure 4 This is a flowchart of the association feature learning process according to an embodiment of the present invention;
[0039] Figure 5 This is a flowchart of the experience extraction process according to an embodiment of the present invention;
[0040] Figure 6 This is a schematic diagram illustrating the fusion features of an embodiment of the present invention and their correspondence with traffic flow;
[0041] Figure 7 This is a schematic diagram of the traffic flow prediction device based on trend similarity according to an embodiment of the present invention. Detailed Implementation
[0042] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0043] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0044] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0045] Reference Figure 1A schematic diagram of an electronic device is provided. It should be noted that... Figure 1 The electronic device 100 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0046] like Figure 1 As shown, the electronic device 100 includes a central processing unit (CPU) 101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage section 108 into a random access memory (RAM) 103. The RAM 103 also stores various programs and data required for system operation. The CPU 101, ROM 102, and RAM 103 are interconnected via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0047] The following components are connected to I / O interface 105: an input section 106 including a keyboard, mouse, etc.; an output section 107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 108 including a hard disk, etc.; and a communication section 109 including a network interface card such as a local area network (LAN) card, modem, etc. The communication section 109 performs communication processing via a network such as the Internet. Drive 110 is also connected to I / O interface 105 as needed. Removable media 111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 110 as needed so that computer programs read from them can be installed into storage section 108 as needed.
[0048] When the central processing unit 101 in the electronic device of this embodiment executes the program, it achieves the following: Figure 2 The steps in the traffic flow prediction method based on trend similarity are shown.
[0049] Figure 2 This is a flowchart illustrating a traffic flow prediction method based on trend similarity in an embodiment of the present invention, as shown below. Figure 2 The traffic flow prediction method based on trend similarity in this embodiment may include:
[0050] S201: Obtain historical traffic flow data for several intersections within a designated area.
[0051] It should be noted that historical traffic flow data can be obtained from the transportation department's backend server after approval by the transportation department.
[0052] Let X be the initial feature vector for obtaining historical traffic flow data from several intersections within a designated area. Given intersection i, its data for day t is represented as: in Let X be the traffic flow value at intersection i on day t. M5, M10, M20, and M30 represent the 5-day, 10-day, 20-day, and 30-day average traffic flow values at this intersection, respectively. Data is dynamically acquired using a sliding window. Let the window size be T and the number of intersections be N. Then the data within the window is X = [x...]. 1 ,x 2 ,…,x N ]∈R N×T×5 ,
[0053] S202 extracts the temporal characteristics of traffic flow at each intersection from historical traffic flow data.
[0054] In some alternative embodiments, to extract sequential features of traffic flow, a GRU can be used to extract features from the initial feature vector. GRU is a variant of a recurrent neural network (RNN) that addresses the vanishing and exploding gradient problems in traditional RNNs through reset and update gates, and is better able to learn long-term dependencies of sequences. GRU is widely used in time series modeling due to its simplified structure and efficient learning. For a daily sequence x... t The formula for feature extraction using GRU is as follows:
[0055] r t =σ(W r x t +U r h t-1 +b r (1)
[0056] z t =σ(W z x t +U z h t-1 +b z (2)
[0057]
[0058] y t =σ(W o ·h t (4)
[0059] Formula (1) represents the reset gate, r t∈[0,1], which represents the degree to which past information is reset. When the reset gate outputs a value of 0, past information is completely discarded; when the output value is 1, past information is fully retained. The update gate combines the degree of retention of the hidden layer from the previous time step with the current input to generate a new hidden state. In the above formula, W r U r b r W z U z b z W, U, b, W o These are learnable parameters, ⊙ represents element-wise multiplication of vectors, and σ() and tanh() are activation functions, namely the sigmoid function and the hyperbolic tangent function, respectively, with the following function expressions:
[0060]
[0061]
[0062] Feature extraction is performed using GRU to obtain the sequence feature vectors of traffic flow at all intersections:
[0063] E t =GRU(X) (7)
[0064] Where E t ∈R N×T×H H is the dimension of the GRU hidden layer.
[0065] It is understood here that in other embodiments, temporal convolutional neural networks or other existing neural network structures can also be used to extract the temporal features of traffic flow at each intersection from the historical traffic flow data of each intersection, which will not be described in detail here.
[0066] S203, by window, backtracks on historical windows, and extracts the traffic flow experience features of each intersection based on the trend similarity between the historical windows with the upward trend of traffic flow at each intersection and the corresponding windows.
[0067] The historical traffic flow sequence of each intersection can reflect its characteristics to some extent, and traffic flow changes often follow certain patterns. In the specific implementation process, the steps for extracting the empirical characteristics of traffic flow at each intersection include:
[0068] S2031, perform trend coding on the traffic flow sequences of the current window and historical windows.
[0069] For any intersection i, traffic flow data is obtained using a sliding window approach to obtain the traffic flow sequence for the current window. and traffic flow sequences from historical windows Where τ is the number of time steps for backtracking. Trend coding is performed on all traffic flow sequences to obtain the coded sequences. The encoding method is as follows:
[0070]
[0071] Where δ is the threshold for determining whether traffic flow is trending upward, downward, or unchanged.
[0072] S2032, the present invention predicts the traffic flow of the next day using traffic flow data of length T. By backtracking historical traffic flow sequence data, a historical window with an upward trend in traffic flow on the date to be predicted is selected. The ratio of the number of days with the same traffic flow change trend as the current window in the historical window to the total number of days in the window is calculated to obtain the trend similarity between the historical window and the current window.
[0073] By performing trend encoding on the traffic sequence, the encoded sequence of the current window can be obtained. and the encoding sequence of any history window The trend similarity between two windows is obtained by calculating the proportion of days with the same trend within each window. That is, for... and A bitwise comparison is performed; if the codes are the same, the traffic flow trends for that day are similar. The ratio of the number of days with similar traffic flow trends to the total number of days within the window is used to determine the trend similarity between the two windows.
[0074] The experience extraction starts from the current window and goes back n windows. For historical windows, the trend of the day to be predicted is judged. If the flow trend is upward, the trend similarity between the historical window and the current window is calculated.
[0075] S2033, after the backtracking is completed, the average of the top-ranked trend similarities is taken as the trend-up experience, and the traffic flow experience characteristics of the corresponding intersection are obtained.
[0076] After backtracking, we obtain n. s Trend similarity, for example, when 0 <n s When the value is less than or equal to 3, the average of the obtained trend similarities is taken as the empirical value for an upward trend. When n appears... s When n = 0, it indicates that there is no situation where the daily flow to be predicted is increasing in the backtracking window. At this time, the current window's upward trend experience is set to 0. s When the similarity is greater than 3, the average of the top 3 trends is taken as the empirical value for an upward trend. Using this method, for any intersection i, the empirical value for an upward trend within its window t can be obtained.
[0077] In other embodiments, during the calculation of the upward trend experience, the average of other top-ranking trend similarities can also be selected, such as 4, 5, etc.
[0078] The above method can be used to obtain the empirical features of the current window of all intersections.
[0079] S204. Based on the spatial location of intersections within a set area and the trend similarity of traffic flow between intersections, a spatial relationship diagram and a similarity relationship diagram are constructed respectively.
[0080] In the specific implementation process, in order to capture the mutual influence between relevant intersections, an intersection relationship diagram needs to be constructed. Based on the spatial location of intersections within a defined area, the spatial relationship diagram is constructed by determining the adjacency of each pair of intersections.
[0081] The adjacency matrix of the graph is shown below:
[0082]
[0083] When intersection i to intersection j is reachable in one step, A i,j =1, otherwise A i,j =0. It should be noted that considering the various road conditions, such as one-way and two-way traffic, A... i,j ≠A j,i .
[0084] Traffic conditions at intersections are constantly changing, and therefore the relationships between intersections are also dynamic. This study mines the relationships between intersections based on dynamic trend similarity. The dynamic similarity is calculated using a sliding window approach. At time t, for intersection i, the traffic flow sequence in the current window is... The coding sequence is obtained by using the trend coding introduced in formula (8). For intersections i and j, the sequence trend similarity between their current windows can be calculated. By calculating the similarity between intersections using the above method, we can obtain the traffic flow trend similarity matrix at time t, as shown below:
[0085]
[0086] For intersection i, Sort the i-th row in descending order, select the intersections corresponding to the top K similarity scores as similar intersections of intersection i, and construct a similarity graph G. s That is, if intersection i and intersection j are found to be similar intersections through trend similarity, then nodes i and j in G... s They are associated through edges.
[0087] Specifically, the ratio of the number of days with the same traffic flow trend within the sliding window of each intersection to the total number of days within the window is calculated to obtain the trend similarity of the current window traffic flow between each intersection.
[0088] S205 uses the temporal features of traffic flow at each intersection as node features for learning spatial relationship graphs and similarity relationship graphs, and obtains the traffic flow association features of each intersection by weighted summation based on attention weights.
[0089] In the specific implementation process, graph attention networks (GAT) are used to aggregate features of associated intersections. This aggregation process aggregates node information according to edges; therefore, graph learning requires given edge and node features of the graph. A spatial relationship graph G is obtained based on spatial location relationships and trend similarity. p And similarity graph G s G p and G s The edges of the graph learning are defined. The sequence feature vector E obtained after extracting temporal features is... t As node features in graph learning, GAT's aggregation process consists of two steps: calculating attention weights and weighted summation.
[0090] First, for node i in graph G, calculate its relationship with its neighboring nodes. Attention coefficient between:
[0091]
[0092] W maps node features to a higher dimension. Let represent the sequence feature vector of intersection i at time t. [·||·] concatenates the mapped high-dimensional features, and a(·) maps the concatenated features to a real value. The attention coefficients are normalized using the softmax function.
[0093]
[0094] Based on the above coefficients, the node features are weighted and summed to obtain the association feature representation of the nodes:
[0095]
[0096] Following the graph learning method described above, for G p and G s By performing feature aggregation, any node i can obtain two related features. and The above-mentioned associated features are fused to obtain the final associated feature vector of node i:
[0097]
[0098] Among them W g b are learnable parameters.
[0099] S206 integrates the temporal characteristics, empirical characteristics, and correlation characteristics of traffic flow at each intersection to obtain integrated characteristics.
[0100] In one or more embodiments, the temporal characteristics, empirical characteristics, and correlation characteristics of traffic flow at each intersection are fused using a direct splicing method.
[0101] In other embodiments, the temporal characteristics, empirical characteristics, and correlation characteristics of traffic flow at each intersection can also be fused using an activation function. For example, the following formula can be used:
[0102]
[0103] Among them W j These are learnable parameters, and LeakyReLU is the activation function. For intersection i, its final feature vector at time t is... It incorporates the sequence features, empirical features, and correlation features of that moment, making full use of information from the historical traffic flow sequence and also incorporating the influence of relevant intersections into the model learning.
[0104] S207, based on the mapping relationship between fusion features and traffic flow, predicts the traffic flow of each intersection within a set area in the future time period, and then obtains the traffic flow ranking of all intersections within the set area.
[0105] In the specific implementation process, based on the fusion characteristics, the traffic flow of each intersection in the set area in the future time period is predicted by changing the linear layer and activation function.
[0106] In one or more embodiments, traffic flow ranking information of all intersections within a set area can be sent to the traffic department's backend server to guide traffic lights within the set area and avoid traffic congestion.
[0107] In other embodiments, traffic flow ranking information for all intersections within a set area can also be retrieved by a map server to display the congestion levels of different intersections on the corresponding map.
[0108] On day t, the feature vectors of all intersections are represented as: The predicted traffic flow for all intersections on day t+1 is as follows:
[0109]
[0110] Based on the above traffic flow forecasts, the traffic flow rankings at intersections can be obtained.
[0111] The method in this embodiment combines regression loss and pairwise ranking-aware loss to form a loss function, and optimizes the network by minimizing this loss function, as shown in the following formula:
[0112]
[0113] The first part, regression loss, can reduce the error between predicted traffic and actual traffic. The second part, ranking loss, can make the ranking of predicted traffic relatively accurate, that is, intersections with high traffic volume will be ranked relatively high in the prediction. The α parameter is used to balance the proportion of the two parts of the loss.
[0114] In this embodiment, the mean squared error (MSE), a commonly used metric for evaluating regression tasks, and the mean reciprocal rank (MRR), a commonly used metric for measuring ranking accuracy in recommender systems, are selected to evaluate the model's performance.
[0115] MSE can intuitively express the magnitude of the error between predicted flow and actual flow, as shown in formula (18):
[0116]
[0117] MSE describes the difference between the predicted ranking and the actual ranking, as shown in formula (19):
[0118]
[0119] Where n is the number of intersections used for evaluation. For example, n=1 calculates the ranking accuracy of the intersection that is predicted to be ranked first, n=5 calculates the ranking accuracy of the top five intersections, and n=N calculates the ranking accuracy of all intersections.
[0120] The method in this embodiment was compared with the following three methods: Long Short Term Memory (LSTM), Rank_LSTM, and State-Frequency Memory (SFM) model. The method in this embodiment achieved the highest scores in both metrics, ranking first among the compared methods, thus confirming the effectiveness of the method in this embodiment.
[0121] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including functions for executing... Figure 2 The program code for the method shown. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 109, and / or installed from removable medium 111. When the computer program is executed by central processing unit 101, it performs the various functions defined in the apparatus of this application.
[0122] in, Figure 2 The computer program instructions corresponding to the method shown may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0123] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0124] Figure 7 This is a schematic diagram of a traffic flow prediction device based on trend similarity in an embodiment of the present invention. This embodiment is similar to... Figure 2 Corresponding to traffic flow prediction methods based on trend similarity, such as Figure 7 As shown, the traffic flow prediction device based on trend similarity in this embodiment may include:
[0125] Historical traffic flow data acquisition module 701 is used to acquire historical traffic flow data of several intersections within a set area.
[0126] The traffic flow time-series feature extraction module 702 is used to extract the traffic flow time-series features of each intersection from the historical traffic flow data of each intersection.
[0127] The traffic flow experience feature extraction module 703 is used to backtrack historical windows in units of windows, and extract traffic flow experience features for each intersection based on the trend similarity between the historical windows with the upward trend of traffic flow at each intersection and the corresponding windows.
[0128] The spatial and similarity graph construction module 704 is used to construct a spatial relationship graph and a similarity relationship graph based on the spatial location of intersections within a set area and the trend similarity of traffic flow between intersections.
[0129] The traffic flow association feature extraction module 705 is used to use the traffic flow time series features of each intersection as node features for learning spatial relationship graphs and similarity relationship graphs, and obtain the traffic flow association features of each intersection by weighted summation based on attention weights.
[0130] The fusion feature generation module 706 is used to fuse the traffic flow time-series features, traffic flow empirical features, and traffic flow correlation features of each intersection to obtain fusion features;
[0131] The traffic flow prediction module 707 is used to predict the traffic flow of each intersection in a set area in the future time period based on the mapping relationship between fusion features and traffic flow, and then obtain the traffic flow ranking of all intersections in the set area.
[0132] Figure 7 The specific implementation process of modules 701-707 in the trend similarity-based traffic flow prediction device shown is as follows: Figure 2 The specific implementation process of steps S201 to S207 is the same, and will not be described in detail here.
[0133] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A traffic flow prediction method based on trend similarity, characterized in that, include: Obtain historical traffic flow data for several intersections within a designated area; Extract the temporal characteristics of traffic flow for each intersection from the historical traffic flow data of each intersection; Historical windows are traced back on a window-by-window basis. Based on the trend similarity between the historical windows with increasing traffic flow at each intersection and the corresponding windows, empirical features of traffic flow at each intersection are extracted. Based on the spatial location of intersections within a defined area and the similarity of traffic flow trends between intersections, spatial relationship diagrams and similarity relationship diagrams are constructed respectively. The temporal features of traffic flow at each intersection are used as node features for learning spatial relationship graphs and similarity relationship graphs. The traffic flow association features of each intersection are obtained by weighted summation based on attention weights. The traffic flow temporal characteristics, traffic flow empirical characteristics, and traffic flow correlation characteristics of each intersection are fused to obtain fused characteristics; Based on the mapping relationship between fusion characteristics and traffic flow, the traffic flow of each intersection within a set area in the future time period is predicted, thereby obtaining the traffic flow ranking of all intersections within the set area.
2. The traffic flow prediction method based on trend similarity as described in claim 1, characterized in that, The steps for extracting empirical features of traffic flow at each intersection include: Trend coding is performed on the traffic flow sequences of the current window and historical windows; Select a historical window where traffic flow trends are rising for the time to be predicted, calculate the ratio of the number of days with the same traffic flow trend to the total number of days within the window, and obtain the trend similarity between the historical window and the current window; After the backtracking is completed, the average of the top-ranked trend similarities is taken as the trend-upper experience, and the traffic flow experience characteristics of the corresponding intersection are obtained.
3. The traffic flow prediction method based on trend similarity as described in claim 1, characterized in that, Based on the spatial location of intersections within a defined area, a spatial relationship graph is constructed by determining the adjacency of each pair of intersections.
4. The traffic flow prediction method based on trend similarity as described in claim 1, characterized in that, Calculate the ratio of the number of days with the same traffic flow trend within the sliding window at each intersection to the total number of days within the window to obtain the trend similarity of the current window traffic flow between intersections.
5. The traffic flow prediction method based on trend similarity as described in claim 1, characterized in that, The temporal characteristics, empirical characteristics, and correlation characteristics of traffic flow at each intersection are fused using either direct splicing or activation functions.
6. A traffic flow prediction device based on trend similarity, characterized in that, include: The historical traffic flow data acquisition module is used to acquire historical traffic flow data for several intersections within a designated area. The traffic flow time-series feature extraction module is used to extract the traffic flow time-series features of each intersection from the historical traffic flow data of each intersection. The traffic flow experience feature extraction module is used to backtrack historical windows on a window-by-window basis. Based on the trend similarity between the historical windows with the upward trend of traffic flow at each intersection and the corresponding windows, it extracts the traffic flow experience features of each intersection. The spatial and similarity graph construction module is used to construct spatial relationship graphs and similarity relationship graphs based on the spatial location of intersections within a set area and the trend similarity of traffic flow between intersections. The traffic flow association feature extraction module is used to use the temporal features of traffic flow at each intersection as node features for learning spatial relationship graphs and similarity relationship graphs, and obtains the traffic flow association features of each intersection by weighted summation based on attention weights. The feature fusion generation module is used to fuse the traffic flow temporal features, traffic flow empirical features, and traffic flow correlation features of each intersection to obtain fused features; The traffic flow prediction module is used to predict the traffic flow of each intersection within a set area in the future time period based on the mapping relationship between fused features and traffic flow, and thus obtain the traffic flow ranking of all intersections within the set area.
7. The traffic flow prediction device based on trend similarity as described in claim 6, characterized in that, The step of extracting traffic flow experience features for each intersection in the traffic flow experience feature extraction module includes: Trend coding is performed on the traffic flow sequences of the current window and historical windows; Select a historical window where traffic flow trends are rising for the time to be predicted, calculate the ratio of the number of days with the same traffic flow trend to the total number of days within the window, and obtain the trend similarity between the historical window and the current window; After the backtracking is completed, the average of the top-ranked trend similarities is taken as the trend-upper experience, and the traffic flow experience characteristics of the corresponding intersection are obtained.
8. The traffic flow prediction device based on trend similarity as described in claim 6, characterized in that, In the spatial and similarity graph construction module, based on the spatial location of intersections within a set area, the spatial relationship graph is constructed by determining the adjacency of each intersection; or the ratio of the number of days with the same flow change trend within the sliding window of each intersection to the total number of days within the window is calculated to obtain the trend similarity of the current window flow between each intersection.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the traffic flow prediction method based on trend similarity as described in any one of claims 1-5.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the traffic flow prediction method based on trend similarity as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for predicting traffic flow, electronic equipment and medium
CN113326449A
Traffic anomaly detection method and device, electronic equipment and storage medium
CN111556057A
Traffic flow prediction method and system based on trend space-time diagram convolution, and medium
CN116895157A