Traffic flow prediction method and system based on graph neural network

Through the traffic flow prediction method based on graph neural network, combined with historical traffic data and traffic light information, the prediction model is dynamically selected, which solves the problem of inaccurate prediction results in the existing technology and achieves more accurate traffic flow prediction and real-time status judgment. .

CN118629202AInactive Publication Date: 2024-09-10JILIN UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410685367.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing traffic flow prediction models have inaccurate prediction results when regular changes occur and cannot effectively respond to dynamic changes in traffic flow.

Method used

A traffic flow prediction method based on graph neural network is adopted. By obtaining historical traffic flow data and traffic light switching time, the first and second prediction models are established. Combined with vehicle residual volume and entry/exit data, the prediction model is dynamically selected to improve predictions. Accuracy, and determine the number of vehicles and time span through traffic light switching time and driving demand time, and establish a relationship curve for prediction.

Benefits of technology

It improves the accuracy of traffic flow prediction, can accurately predict the number and flow of vehicles under different traffic conditions, enhances the ability to judge real-time status, and reduces reliance on fixed data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629202A
    Figure CN118629202A
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method and system based on a graph neural network, and relates to the technical field of traffic prediction, and the method comprises the steps: obtaining the historical traffic flow data of a to-be-predicted road segment, and obtaining the historical actual traffic flow data; carrying out statistics on the vehicle residual quantity at the intersection of the to-be-predicted road section to obtain residual quantity data; establishing a first prediction model based on the residual volume data and the historical actual traffic flow data; acquiring the driving-in vehicle data and the driving-out vehicle data of the road section to be predicted, and establishing a second prediction model; obtaining residual quantity data of vehicles at the intersection of the road section to be predicted at the current moment, comparing the residual quantity data with built-in residual quantity standard data, and if the residual quantity data is smaller than the built-in residual quantity standard data, performing prediction based on a first prediction model to obtain a prediction result; and if the residual volume data is greater than the built-in residual volume standard data, predicting the to-be-predicted road section based on a second prediction model to obtain a prediction result. The method has the effect of improving the accuracy of the prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of traffic prediction, and in particular to a method and system for predicting traffic flow based on graph neural networks. Background Art

[0002] With the acceleration of urbanization, urban traffic problems have become increasingly prominent. Traffic congestion not only affects people's travel efficiency, but also has a negative impact on the environment. Accurately predicting traffic flow is of great significance for traffic management and planning, and alleviating traffic pressure.

[0003] In the related technology, historical data is analyzed to extract the date characteristics, holiday characteristics and periodic characteristics of the traffic flow at the intersection, and the traffic flow of the corresponding intersection in different time periods is predicted based on the extracted characteristic data to ensure the accuracy of the prediction.

[0004] Regarding the above-mentioned related technologies, the prediction model is obtained by summarizing the regularity of long-term historical data. When the regularity changes, the prediction results of the prediction model will no longer be accurate, so there is room for improvement. Summary of the invention

[0005] In order to improve the accuracy of the prediction results, the present application provides a traffic flow prediction method and system based on graph neural network.

[0006] In the first aspect, the present application provides a traffic flow prediction method based on graph neural network, which adopts the following technical solutions:

[0007] Traffic flow prediction methods based on graph neural networks include:

[0008] Obtain historical traffic flow data of the road section to be predicted, and perform traffic volume statistics based on the historical traffic flow data to obtain historical actual traffic flow data;

[0009] Based on the traffic light switching time of the road section to be predicted, the residual quantity of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic flow data is counted to obtain the residual quantity data;

[0010] The residual volume data and historical actual traffic flow data are analyzed based on the graph neural network to establish the first prediction model;

[0011] Obtaining the number of entrance intersections of the road section to be predicted, and obtaining the data of vehicles entering and leaving the road section to be predicted based on the number of entrance intersections, and processing the data of vehicles entering and leaving based on the graph neural network to establish a second prediction model;

[0012] Obtain the residual volume data of the vehicle at the intersection of the road section to be predicted at the current moment, and compare the residual volume data with the built-in residual volume standard data. If the residual volume data is less than the built-in residual volume standard data, perform a first prediction on the road section to be predicted based on the first prediction model to obtain a first prediction result;

[0013] If the residual amount data is greater than the built-in residual amount standard data, the current time point is output to the second prediction model to perform a second prediction on the road section to be predicted, and obtain a second prediction result.

[0014] Preferably, the distance data between each intersection in the road section to be predicted and the exit of the road section to be predicted is obtained, and the travel demand time data from each intersection to the exit of the road section to be predicted is determined based on the built-in average speed data;

[0015] Obtain the traffic light switching time of each intersection, and determine the least common multiple of the time between each intersection based on the traffic light switching time and the travel demand time data;

[0016] Obtain the vehicle entry data of each intersection and the lowest common multiple of the time between each intersection in the historical data, and determine the time span data required when the number of vehicles leaving the road section to be predicted is the same as the vehicle entry data of each intersection;

[0017] Vehicles are counted based on time span data to obtain historical actual traffic data.

[0018] Preferably, the residual quantity data is collected and read at a time to obtain residual quantity time data;

[0019] The historical actual traffic flow data is read based on the residual time data to obtain the historical actual traffic flow data at the same time point;

[0020] The historical actual traffic flow data and residual time data with the same time point are matched to obtain a relationship scatter plot;

[0021] Perform mathematical induction on the relationship scatter plot to obtain the relationship curve and predicted fluctuation range;

[0022] A prediction model is established based on the relationship curve.

[0023] Preferably, the intersection traffic information of each intersection is obtained, and the vehicle ratio data of each lane is determined according to the intersection traffic information;

[0024] Based on the vehicle ratio data, the traffic flow of the road section is divided proportionally to obtain the vehicle data of the corresponding lane;

[0025] Obtaining the positional relationship between the road section to be predicted and each intersection to determine the lane data of each intersection entering the road section to be predicted;

[0026] Selecting vehicle data based on lane data to obtain data of vehicles to be driven into the corresponding lane;

[0027] Obtain the traffic light switching time at each intersection, and input the incoming vehicle data and traffic light switching time into the graph neural network for data processing to obtain the incoming vehicle data;

[0028] Carry out vehicle exit statistics at the exit of the predicted road section to obtain exit vehicle data;

[0029] The difference calculation is performed based on the incoming vehicle data and the outgoing vehicle data to obtain the remaining vehicle data of the road section to be predicted, and a second prediction model is established.

[0030] Preferably, the green light duration, red light duration and exit traffic volume under the green light state of the traffic light of the road section to be predicted are determined based on historical traffic flow data;

[0031] Obtain the traffic light status data of each intersection at the current moment and the traffic light status data of the road section to be predicted; wherein the traffic light status data is whether the traffic light is in a red light state or a green light state at the current moment, and the switching time under the corresponding state;

[0032] If the traffic light state of the intersection to be predicted at the current moment is red, the end time of the previous green light state is used as the green light end timestamp;

[0033] Based on the traffic light status data of each intersection, determine the green light start timestamp of each intersection;

[0034] The time offset difference between the green light end timestamp of the road section to be predicted and the green light start timestamp of each intersection is calculated to obtain the offset time data;

[0035] Obtain the travel demand time data from each intersection to the exit of the road section to be predicted;

[0036] The dislocation time data is compared with the travel demand time data to screen out the intersections where the dislocation time data is greater than the travel demand time data, and the incoming vehicle data of the intersection is recorded as the outgoing vehicle data of the section to be predicted.

[0037] Preferably, if the traffic light status data of the intersection at the current moment is a green light state, the green light start time at the current moment is used as the green light start timestamp of the intersection;

[0038] If the traffic light state data of the intersection at the current moment is a red light state, then the time point when the next traffic light state is a green light state is determined based on the state switching time of the traffic light at the intersection, and recorded as the first time point;

[0039] Compare the first time point with the green light end timestamp, if the first time point is before the green light end timestamp, use the first green light start timestamp as the green light start timestamp of the intersection;

[0040] If the first time point is not before the green light end timestamp, the time point when the last traffic light state was in the green light state is determined based on the state switching time of the traffic light at the intersection, and this time point is recorded as the green light start timestamp of the intersection.

[0041] Preferably, the maximum traffic volume of the road section under the green light state in the historical traffic volume is calculated based on the historical traffic volume data of the road section to be predicted;

[0042] The maximum vehicle flow volume is compared with the predicted outgoing vehicle data of the road section to be predicted. If the maximum vehicle flow volume is greater than the predicted outgoing vehicle data of the road section to be predicted, the predicted outgoing vehicle data is used as the outgoing vehicle data of the road section to be predicted.

[0043] If the maximum vehicle flow volume is less than the predicted outgoing vehicle data of the road section to be predicted, the maximum vehicle flow volume is used as the outgoing vehicle data of the road section to be predicted.

[0044] In the second aspect, the present application provides a traffic flow prediction system based on graph neural network, which adopts the following technical solutions:

[0045] A traffic flow prediction system based on a graph neural network, comprising: a first prediction model building module, a second prediction model building module and a prediction analysis module;

[0046] The first prediction model establishment module obtains historical traffic flow data of the road section to be predicted, and counts the traffic volume based on the historical traffic flow data to obtain historical actual traffic flow data; counts the residual volume of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic flow data based on the traffic light switching time of the road section to be predicted, to obtain residual volume data; analyzes the residual volume data and the historical actual traffic flow data based on the graph neural network to establish the first prediction model;

[0047] The second prediction model building module obtains the number of entry intersections of the road section to be predicted, and obtains the entry vehicle data and the exit vehicle data of the road section to be predicted based on the number of entry intersections, and processes the entry vehicle data and the exit vehicle data based on the graph neural network to establish the second prediction model;

[0048] The prediction and analysis module obtains the residual quantity data of the vehicle at the intersection of the to-be-predicted road section at the current moment, and compares the residual quantity data with the built-in residual quantity standard data. If the residual quantity data is smaller than the built-in residual quantity standard data, a first prediction is performed on the to-be-predicted road section based on the first prediction model to obtain a first prediction result; if the residual quantity data is larger than the built-in residual quantity standard data, the current time point is output to the second prediction model to perform a second prediction on the to-be-predicted road section to obtain a second prediction result.

[0049] In summary, the present application includes at least one of the following beneficial technical effects:

[0050] 1. The first prediction model is established by jointly analyzing the historical actual traffic flow data and the vehicle residual volume, and the second prediction model is established by judging the vehicle entering and leaving the predicted section. The actual collected vehicle residual volume data is compared with the built-in residual volume standard data to determine the prediction model under different conditions to improve the accuracy of the prediction results of the prediction model;

[0051] 2. By determining the distance data between each intersection and the exit of the road section to be predicted, the time data required for entering and exiting the road section to be predicted at each intersection is determined. Then, based on the switching time of the traffic lights at each intersection, the lowest common multiple of the switching time of the traffic lights at each intersection is determined, thereby limiting the time span of vehicle collection, so that the number of vehicles obtained by statistics is valid, and then the prediction model obtained by modeling based on historical actual traffic flow data is more accurate;

[0052] 3. By determining the time data of the traffic lights at the exit of the road section to be predicted and the time data of the traffic lights at each intersection, the data relationship between the green light end time of the road section to be predicted and the green light start time of each intersection is determined, so as to determine the driving status of each intersection entering the road section to be predicted, and then judge the vehicle data leaving the road section to be predicted. When judging the vehicle data leaving, the fixed data obtained based on the historical data analysis is removed, so that the accuracy of the vehicle exit judgment in real time is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flowchart of the steps of the traffic flow prediction method based on graph neural network in this embodiment;

[0054] Figure 2 This is a module block diagram of the traffic flow prediction system based on graph neural network in this embodiment.

[0055] Figure numerals: 1. First prediction model building module; 2. Second prediction model building module; 3. Prediction analysis module. DETAILED DESCRIPTION

[0056] The following is combined with Figure 1-Figure 2 This application is described in further detail.

[0057] The embodiments of the present application disclose a traffic flow prediction method and system based on a graph neural network.

[0058] Example: Figure 1 As shown, the traffic flow prediction method based on graph neural network of the present invention includes:

[0059] S100, obtaining historical traffic flow data of the road section to be predicted, and performing traffic flow statistics based on the historical traffic flow data to obtain historical actual traffic flow data;

[0060] S200, based on the traffic light switching time of the road section to be predicted, the remaining number of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic data is counted to obtain the remaining number data; wherein the remaining number data is the vehicle data that is still at the traffic intersection when the traffic light changes from red to green and then to red.

[0061] S300, analyzing the residual volume data and the historical actual traffic flow data based on a graph neural network to establish a first prediction model;

[0062] S400, obtaining the number of entry intersections of the road section to be predicted, and obtaining the entry vehicle data and the exit vehicle data of the road section to be predicted based on the number of entry intersections, and processing the entry vehicle data and the exit vehicle data based on a graph neural network to establish a second prediction model;

[0063] S500, obtaining residual volume data of vehicles at the intersection of the road section to be predicted at the current moment, and comparing the residual volume data with the built-in residual volume standard data, if the residual volume data is less than the built-in residual volume standard data, performing a first prediction on the road section to be predicted based on the first prediction model to obtain a first prediction result;

[0064] S600: If the residual volume data is greater than the built-in residual volume standard data, the current time point is output to the second prediction model to perform a second prediction on the road section to be predicted, and obtain a second prediction result.

[0065] In this embodiment, the historical actual traffic flow data and the vehicle residual volume are jointly analyzed to establish a first prediction model, and the entering and exiting vehicle data of the predicted section are judged to establish a second prediction model. The actually collected vehicle residual volume data is compared with the built-in residual volume standard data to determine the prediction model for different conditions to improve the accuracy of the prediction results of the prediction model.

[0066] For example, through the analysis of historical data, it is found that the relationship between the residual volume data x of the traffic intersection and the traffic flow of the road section is y=kx, where k is the coefficient of variation, x is the residual volume data of the current traffic intersection, and y is the traffic flow of the road section. Assuming that the built-in residual volume standard data is 8, when the road section is heavily congested, there will still be a large amount of residuals when the intersection switches from green to red, resulting in ineffective prediction. Therefore, when the residual volume data of the current traffic intersection is detected to be 10, the detected residual volume data 10 is greater than the built-in residual volume standard data 8, and the second prediction model is selected for prediction. For example, there are 10 intersections merging into the road section. Through prediction, there will be 10 vehicles merging into the road section to be predicted at each intersection. Therefore, it is judged that there will be 100 vehicles merging into the road section to be predicted at the same time, and then the traffic flow of the road section is judged to be 100, which is the second prediction result. The actual detected residual volume data is 5, and the first prediction model is selected for prediction, and the traffic flow obtained is 5k.

[0067] In step S100, historical traffic flow data of the road section to be predicted is obtained, and traffic volume is counted based on the historical traffic flow data to obtain historical actual traffic flow data, including the following steps:

[0068] S110, obtaining distance data between each intersection in the road section to be predicted and the exit of the road section to be predicted, and determining travel demand time data from each intersection to the exit of the road section to be predicted based on built-in average speed data;

[0069] S120, obtaining the traffic light switching time of each intersection, and determining the least common multiple of the time between each intersection based on the traffic light switching time and the travel demand time data;

[0070] S130, obtaining the vehicle entry data of each intersection and the least common multiple of the time between each intersection in the historical data, and determining the time span data required when the number of vehicles exiting the road section to be predicted is the same as the vehicle entry data of each intersection;

[0071] S140, counting vehicles based on the time span data to obtain historical actual traffic flow data.

[0072] In this embodiment, when statistics are taken on the actual traffic volume in the historical traffic data, the distance data between each intersection and the exit of the section to be predicted is determined to determine the time data required for entering and exiting the section to be predicted at each intersection, and then based on the switching time of the traffic lights at each intersection, the lowest common multiple of the switching time of the traffic lights at each intersection is determined, thereby limiting the time span of vehicle collection, so that the number of vehicles obtained by statistics is valid, and the prediction model obtained by establishing the model based on the historical actual traffic data is more accurate.

[0073] For example, there are 10 traffic intersections, and the time required for driving from each traffic intersection to the exit of the road section to be predicted increases by 10 seconds. For example, it takes 10 seconds for traffic intersection a to reach the exit of the road section to be predicted, and it takes 20 seconds for traffic intersection b to reach the exit of the road section to be predicted. Assuming that the signal switching of the traffic lights at each traffic intersection is 10 seconds green light and 10 seconds red light, and the number of vehicles entering each traffic intersection is 10, then at the 0th second (green light), 10 cars from a, b, c, d, e, f, g, h, i, and j all enter the road section to be predicted, totaling 100 cars; at the 11th second (red light), a arrives at the exit And wait for the red light, b drives half the distance, c drives one-third of the distance, and so on. At the 21st second (green light), a drives in 10 cars again, and the 10 cars that originally arrived at the exit drive out, b drives in 10 cars again, and the 10 cars that originally drove in drive out of the exit, and so on. During the green light at the 61st second, a total of 100 cars can drive out, and the earliest outgoing vehicle at the farthest intersection has only driven seven-tenths of the distance. Therefore, the outgoing vehicle flow rate of the section to be analyzed is counted for 70 seconds to determine the number of vehicles on the section to be predicted at the 0th second, which makes the judgment simpler and improves work efficiency.

[0074] In step S300, the residual volume data and the historical actual traffic flow data are analyzed based on the graph neural network to establish a first prediction model, including the following steps:

[0075] S310, reading the collection time of the residual quantity data to obtain the residual quantity time data;

[0076] S320, reading historical actual traffic flow data based on the residual time data to obtain historical actual traffic flow data at the same time point;

[0077] S330, matching the historical actual traffic flow data and the residual volume time data at the same time point to obtain a relationship scatter plot;

[0078] S340, mathematically summarize the relationship scatter plot to obtain a relationship curve and a predicted fluctuation range;

[0079] S350, establishing a prediction model based on the relationship curve.

[0080] In this embodiment, the traffic volume in the historical traffic volume video data is counted to determine the corresponding traffic volume data, and then the number of vehicles that have not exited the predicted section at the traffic intersection when the traffic light switches from green to red is determined according to the traffic light switching time, thereby establishing a relationship scatter plot between the residual volume data and the traffic volume, and analyzing the relationship scatter plot through mathematical induction to determine a relationship curve between the residual volume data and the traffic volume, so that the data predicted according to the relationship curve is more accurate.

[0081] For example, through statistics, it is found that when the residual volume data is 5, the corresponding vehicle flow data is 50, and when the residual volume data is 10, the corresponding vehicle flow data is 100, thereby determining the relationship between the vehicle flow data and the residual volume data, y=10x, where y is the vehicle flow data and x is the residual volume data.

[0082] In step S400, the number of entrance intersections of the road section to be predicted is obtained, and the data of vehicles entering and leaving the road section to be predicted is obtained based on the number of entrance intersections. The data of vehicles entering and leaving the road section to be predicted is processed based on the graph neural network to establish a second prediction model, including the following steps:

[0083] S410, obtaining intersection traffic information of each intersection, and determining vehicle ratio data of each lane according to the intersection traffic information; wherein the intersection traffic information is vehicle image data of the intersection, and the vehicles at the intersection can be counted through the intersection traffic information.

[0084] S420, dividing the traffic flow of the road section into proportions based on the vehicle proportion data to obtain vehicle data of corresponding lanes;

[0085] S430, obtaining the positional relationship between the road section to be predicted and each intersection to determine the lane data of each intersection entering the road section to be predicted;

[0086] S440, selecting vehicle data based on lane data to obtain data of vehicles to be driven into the corresponding lane;

[0087] S450, obtaining the traffic light switching time of each intersection, and inputting the data of vehicles to be driven into and the traffic light switching time into the graph neural network for data processing to obtain the data of vehicles to be driven into;

[0088] S460, counting vehicles exiting the exit of the predicted road section to obtain exit vehicle data;

[0089] S470, performing difference calculation based on the incoming vehicle data and the outgoing vehicle data to obtain the remaining vehicle data of the road section to be predicted, and establishing a second prediction model.

[0090] In this embodiment, by determining the vehicle data on the lanes corresponding to each intersection, and then determining the lane data of each intersection entering the road section to be predicted based on the positional relationship between the road section to be predicted and each intersection, the vehicle data of each intersection is screened for the first time, and then according to the traffic light switching time of the corresponding intersection, the vehicle data that can pass through each intersection during the time period when the traffic light changes from red to green and then to red is determined, so as to perform a second screening on the number of vehicles entering, thereby making the determined number of vehicles more accurate, thereby improving the accuracy of the prediction of the road to be predicted.

[0091] For example, there are three intersections at the entrance of the road section to be analyzed, and each intersection has three lanes for left turn, straight ahead, and right turn. The number of vehicles at each intersection is 30, 40, and 20 respectively. Through the averaging algorithm, the number of vehicles in each lane of each intersection is calculated to be 10, 13, and 7. Therefore, through the position relationship, it is judged that they correspond to left turn, straight ahead, and right turn respectively. Assuming that the switching time of the traffic lights is 10s, and for the vehicles in the intersection, one vehicle passes through 1s, so the number of vehicles passing through each intersection may be 10, 10, and 7. Therefore, the total number of vehicle data imported into the road section to be predicted is 27, and the data is recorded as the traffic flow data of the road section to be predicted, that is, the second prediction result.

[0092] In step S460, the exit of the predicted road section is counted to obtain the exit vehicle data, which includes the following steps:

[0093] S461, determining the green light duration, red light duration and exit traffic volume under the green light state of the traffic light of the road section to be predicted based on the historical traffic flow data;

[0094] S462, obtaining the traffic light status data of each intersection at the current moment and the traffic light status data of the road section to be predicted; wherein the traffic light status data is whether the traffic light is in a red light state or a green light state at the current moment, and the switching time under the corresponding state;

[0095] S463, if the traffic light state of the intersection to be predicted at the current moment is a red light state, the end time of the last green light state is used as the green light end timestamp;

[0096] S464, determining a green light start timestamp for each intersection based on the traffic light status data for each intersection;

[0097] S465, calculating the time offset difference between the green light end timestamp of the road section to be predicted and the green light start timestamp of each intersection to obtain offset time data;

[0098] S466, obtaining the travel demand time data from each intersection to the exit of the road section to be predicted;

[0099] S467, comparing the dislocation time data with the travel demand time data to select intersections where the dislocation time data is greater than the travel demand time data, and recording the incoming vehicle data of the intersection as the outgoing vehicle data of the road section to be predicted.

[0100] In this embodiment, in the process of predicting the traffic flow for the predicted section, not only the incoming traffic flow data but also the outgoing traffic flow data are included. In the judgment of the outgoing traffic flow data, by determining the time data of the traffic lights at the exit of the predicted section and determining the time data of the traffic lights at each intersection, the data relationship between the green light end time of the predicted section and the green light start time of each intersection is determined, thereby determining the driving status of each intersection entering the predicted section, and then judging the outgoing vehicle data of the predicted section. When judging the outgoing vehicle data, the fixed data obtained by analyzing the historical data is removed, so that the accuracy of the vehicle exit judgment in the real-time state is improved.

[0101] For example, if the green light start timestamp at intersection 1 is 00:00:00 (0 hour, 0 minute, 0 second), and the current state of the intersection to be predicted is a red light state, then by reading historical data, it is determined that the last green light end timestamp is 00:00:10 (0 hour, 0 minute, 10 seconds). If the time requirement for intersection 1 is 8s, it can be determined that the vehicles at the intersection can exit the section before the last green light ends. If the time requirement for intersection 1 is 13s, it is determined that the vehicles at the intersection were unable to exit the section before the last green light ended, that is, the vehicles entering the intersection are still on the section, and the vehicles entering the intersection are recorded as the traffic flow data of the section.

[0102] In step S464, based on the traffic light status data of each intersection, the green light start timestamp of each intersection is determined, including the following steps:

[0103] S4641, if the traffic light state data of the intersection at the current moment is a green light state, the green light start time at the current moment is used as the green light start timestamp of the intersection;

[0104] S4642, if the traffic light state data of the intersection at the current moment is a red light state, then based on the state switching time of the traffic light at the intersection, determine the time point when the next traffic light state is a green light state, and record it as the first time point;

[0105] S4643, compare the first time point with the green light end timestamp, if the first time point is before the green light end timestamp, use the first green light start timestamp as the green light start timestamp of the intersection;

[0106] S4644, if the first time point is not before the green light end timestamp, determine the time point when the last traffic light state was in the green light state based on the state switching time of the traffic light at the intersection, and record this time point as the green light start timestamp of the intersection.

[0107] In this embodiment, the traffic light status data at each intersection is analyzed to further determine the green light start timestamp at each intersection, so that the judgment result of the outgoing vehicle data based on the staggered time data of the green light before the predicted section and each intersection is more accurate, thereby improving the accuracy of the second prediction model in data prediction.

[0108] In step S467, the misalignment time data is compared with the travel demand time data to select the intersection whose misalignment time data is greater than the travel demand time data, and the vehicle entering the intersection is recorded as the vehicle leaving the section to be predicted, and the following steps are also included:

[0109] S4671, based on the historical traffic flow data of the road section to be predicted, the maximum traffic flow volume of the road section under the green light state in the historical traffic flow;

[0110] S4672, comparing the maximum vehicle flow volume with the predicted outgoing vehicle data of the road section to be predicted, if the maximum vehicle flow volume is greater than the predicted outgoing vehicle data of the road section to be predicted, using the predicted outgoing vehicle data as the outgoing vehicle data of the road section to be predicted;

[0111] S4673: If the maximum vehicle flow volume is less than the predicted outgoing vehicle data of the road section to be predicted, the maximum vehicle flow volume is used as the outgoing vehicle data of the road section to be predicted.

[0112] In this embodiment, the predicted outgoing vehicle data is judged against the maximum vehicle flow volume of the road section in history to determine whether the predicted outgoing vehicle data is reasonable. If the maximum vehicle flow volume is greater than the predicted outgoing vehicle data, the prediction result is determined to be reasonable and a corresponding output is given. If the maximum vehicle flow volume is less than the predicted outgoing vehicle data of the road section to be predicted, it indicates that the traffic speed of the road section to be predicted cannot clear the predicted outgoing vehicle data, so the predicted outgoing vehicle result is unreasonable, and the maximum vehicle flow volume is recorded as the outgoing vehicle data, thereby making the prediction of the traffic flow of the road section to be predicted more accurate.

[0113] For example, the maximum traffic volume of the predicted section is 50. When it exceeds 50, congestion and waiting will occur. The predicted exit data is 60, so 10 vehicles will not be able to pass through the predicted section smoothly. On the contrary, when the predicted exit data is 40, it indicates that the section can be passed completely and normally.

[0114] Based on the description of the above-mentioned traffic flow prediction method embodiment based on graph neural network, the embodiment of the present invention also discloses a traffic flow prediction system based on graph neural network:

[0115] like Figure 2 As shown, the traffic flow prediction system based on graph neural network, by applying the above-mentioned traffic flow prediction method based on graph neural network, includes: a first prediction model establishment module 1, a second prediction model establishment module 2 and a prediction analysis module 3;

[0116] The first prediction model establishment module 1 obtains historical traffic flow data of the road section to be predicted, and counts the traffic volume based on the historical traffic flow data to obtain historical actual traffic flow data; based on the traffic light switching time of the road section to be predicted, the residual volume of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic flow data is counted to obtain residual volume data; the residual volume data and the historical actual traffic flow data are analyzed based on the graph neural network to establish the first prediction model;

[0117] The second prediction model building module 2 obtains the number of entry intersections of the road section to be predicted, and obtains the entry vehicle data and the exit vehicle data of the road section to be predicted based on the number of entry intersections, and processes the entry vehicle data and the exit vehicle data based on the graph neural network to establish a second prediction model;

[0118] Prediction and analysis module 3 obtains the residual quantity data of the vehicle at the intersection of the to-be-predicted road section at the current moment, and compares the residual quantity data with the built-in residual quantity standard data. If the residual quantity data is smaller than the built-in residual quantity standard data, a first prediction is performed on the to-be-predicted road section based on the first prediction model to obtain a first prediction result; if the residual quantity data is larger than the built-in residual quantity standard data, the current time point is output to the second prediction model to perform a second prediction on the to-be-predicted road section to obtain a second prediction result.

[0119] Compared with the existing traffic flow prediction method and system based on graph neural network, the present invention improves the accuracy of the prediction results.

[0120] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A traffic flow prediction method based on graph neural network, characterized in that: include: Obtain historical traffic flow data of the road section to be predicted, and perform traffic volume statistics based on the historical traffic flow data to obtain historical actual traffic flow data; Based on the traffic light switching time of the road section to be predicted, the residual quantity of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic flow data is counted to obtain the residual quantity data; The residual volume data and historical actual traffic flow data are analyzed based on the graph neural network to establish the first prediction model; Obtaining the number of entrance intersections of the road section to be predicted, and obtaining the data of vehicles entering and leaving the road section to be predicted based on the number of entrance intersections, and processing the data of vehicles entering and leaving based on the graph neural network to establish a second prediction model; Obtain the residual volume data of the vehicle at the intersection of the road section to be predicted at the current moment, and compare the residual volume data with the built-in residual volume standard data. If the residual volume data is less than the built-in residual volume standard data, perform a first prediction on the road section to be predicted based on the first prediction model to obtain a first prediction result; If the residual amount data is greater than the built-in residual amount standard data, the current time point is output to the second prediction model to perform a second prediction on the road section to be predicted, and obtain a second prediction result.

2. The traffic flow prediction method based on graph neural network according to claim 1 is characterized in that: The historical traffic flow data of the road section to be predicted is obtained, and the traffic volume is counted based on the historical traffic flow data to obtain the historical actual traffic flow data, specifically: Obtain the distance data between each intersection in the road section to be predicted and the exit of the road section to be predicted, and determine the travel demand time data from each intersection to the exit of the road section to be predicted based on the built-in average speed data; Obtain the traffic light switching time of each intersection, and determine the least common multiple of the time between each intersection based on the traffic light switching time and the travel demand time data; Obtain the vehicle entry data of each intersection and the lowest common multiple of the time between each intersection in the historical data, and determine the time span data required when the number of vehicles leaving the road section to be predicted is the same as the vehicle entry data of each intersection; Vehicles are counted based on time span data to obtain historical actual traffic data.

3. The traffic flow prediction method based on graph neural network according to claim 1 is characterized in that: The residual volume data and historical actual traffic flow data are analyzed based on the graph neural network to establish a first prediction model, specifically: The residual quantity data is collected and read at a time to obtain residual quantity time data; The historical actual traffic flow data is read based on the residual time data to obtain the historical actual traffic flow data at the same time point; The historical actual traffic flow data and residual time data with the same time point are matched to obtain a relationship scatter plot; Perform mathematical induction on the relationship scatter plot to obtain the relationship curve and predicted fluctuation range; A prediction model is established based on the relationship curve.

4. The traffic flow prediction method based on graph neural network according to claim 1 is characterized in that: The method of obtaining the number of entrance intersections of the road section to be predicted, and obtaining the data of vehicles entering and leaving the road section to be predicted based on the number of entrance intersections, and processing the data of vehicles entering and leaving the road section based on the graph neural network to establish a second prediction model is specifically as follows: Obtaining intersection traffic information for each intersection, and determining vehicle ratio data for each lane based on the intersection traffic information; Based on the vehicle ratio data, the traffic flow of the road section is divided proportionally to obtain the vehicle data of the corresponding lane; Obtaining the positional relationship between the road section to be predicted and each intersection to determine the lane data of each intersection entering the road section to be predicted; Selecting vehicle data based on lane data to obtain data of vehicles to be driven into the corresponding lane; Obtain the traffic light switching time at each intersection, and input the incoming vehicle data and traffic light switching time into the graph neural network for data processing to obtain the incoming vehicle data; Carry out vehicle exit statistics at the exit of the predicted road section to obtain exit vehicle data; The difference calculation is performed based on the incoming vehicle data and the outgoing vehicle data to obtain the remaining vehicle data of the road section to be predicted, and a second prediction model is established.

5. The method for traffic flow prediction based on graph neural network according to claim 4 is characterized in that: The vehicle exit statistics are performed on the exit of the predicted road section to obtain the exit vehicle data, specifically: Determine the green light duration, red light duration and exit traffic volume under the green light state of the traffic light of the road section to be predicted based on historical traffic flow data; Obtain the traffic light status data of each intersection at the current moment and the traffic light status data of the road section to be predicted; wherein the traffic light status data is whether the traffic light is in a red light state or a green light state at the current moment, and the switching time under the corresponding state; If the traffic light state of the intersection to be predicted at the current moment is red, the end time of the previous green light state is used as the green light end timestamp; Based on the traffic light status data of each intersection, determine the green light start timestamp of each intersection; The time offset difference between the green light end timestamp of the road section to be predicted and the green light start timestamp of each intersection is calculated to obtain the offset time data; Obtain the travel demand time data from each intersection to the exit of the road section to be predicted; The dislocation time data is compared with the travel demand time data to screen out the intersections where the dislocation time data is greater than the travel demand time data, and the incoming vehicle data of the intersection is recorded as the outgoing vehicle data of the section to be predicted.

6. The traffic flow prediction method based on graph neural network according to claim 5 is characterized in that: The method of determining the green light start timestamp of each intersection based on the traffic light status data of each intersection also includes: If the traffic light status data of the intersection at the current moment is green light state, the green light start time at the current moment is used as the green light start timestamp of the intersection; If the traffic light state data of the intersection at the current moment is a red light state, then the time point when the next traffic light state is a green light state is determined based on the state switching time of the traffic light at the intersection, and recorded as the first time point; Compare the first time point with the green light end timestamp, if the first time point is before the green light end timestamp, use the first green light start timestamp as the green light start timestamp of the intersection; If the first time point is not before the green light end timestamp, the time point when the last traffic light state was in the green light state is determined based on the state switching time of the traffic light at the intersection, and this time point is recorded as the green light start timestamp of the intersection.

7. The traffic flow prediction method based on graph neural network according to claim 6 is characterized in that: The step of comparing the misalignment time data with the travel demand time data to select an intersection where the misalignment time data is greater than the travel demand time data, and recording the vehicle entry data of the intersection as the vehicle exit data of the road section to be predicted, further includes: Based on the historical traffic flow data of the road section to be predicted, the maximum traffic flow volume of the road section under the green light state in the historical traffic flow; The maximum vehicle flow volume is compared with the predicted outgoing vehicle data of the road section to be predicted. If the maximum vehicle flow volume is greater than the predicted outgoing vehicle data of the road section to be predicted, the predicted outgoing vehicle data is used as the outgoing vehicle data of the road section to be predicted. If the maximum vehicle flow volume is less than the predicted outgoing vehicle data of the road section to be predicted, the maximum vehicle flow volume is used as the outgoing vehicle data of the road section to be predicted.

8. The traffic flow prediction system based on graph neural network is characterized by: The system is used to implement the traffic flow prediction method based on graph neural network as described in any one of claims 1 to 7: comprising: a first prediction model establishment module, a second prediction model establishment module and a prediction analysis module; The first prediction model establishment module obtains historical traffic flow data of the road section to be predicted, and counts the traffic volume based on the historical traffic flow data to obtain historical actual traffic flow data; counts the residual volume of vehicles at the intersection of the road section to be predicted when the traffic light is switched in the historical traffic flow data based on the traffic light switching time of the road section to be predicted, to obtain residual volume data; analyzes the residual volume data and the historical actual traffic flow data based on the graph neural network to establish the first prediction model; The second prediction model building module obtains the number of entry intersections of the road section to be predicted, and obtains the entry vehicle data and the exit vehicle data of the road section to be predicted based on the number of entry intersections, and processes the entry vehicle data and the exit vehicle data based on the graph neural network to establish the second prediction model; The prediction and analysis module obtains the residual quantity data of the vehicle at the intersection of the to-be-predicted road section at the current moment, and compares the residual quantity data with the built-in residual quantity standard data. If the residual quantity data is smaller than the built-in residual quantity standard data, a first prediction is performed on the to-be-predicted road section based on the first prediction model to obtain a first prediction result; if the residual quantity data is larger than the built-in residual quantity standard data, the current time point is output to the second prediction model to perform a second prediction on the to-be-predicted road section to obtain a second prediction result.

Citation Information

Cited By

  • Intelligent analysis method, system and equipment for highway security and protection and medium

    CN120564420A