Intelligent traffic road network traffic flow prediction method based on Bayesian algorithm
By preprocessing and feature extraction of traffic flow data, the traffic related index is obtained, and combined with the preset traffic flow range, a traffic flow prediction model is constructed, which solves the problem of low accuracy of traffic flow prediction in the traffic road network in the existing technology, and realizes Provides higher forecast accuracy and data reliability.
Patent Information
- Application Number
- CN202410961988.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, prediction based on the regularity and trend of historical data is difficult to capture the nonlinear and complex characteristics of traffic flow, resulting in low accuracy of traffic flow prediction results in traffic network.
By preprocessing and feature extraction of the collected initial traffic flow data, the speed correlation index, occupancy index and flow correlation index are obtained, combined with the preset traffic flow range for comparison, the traffic flow level is obtained, and a traffic flow prediction model is constructed, dynamically Adjust forecast results to improve accuracy.
The accuracy of the traffic flow prediction results of the traffic road network is improved, the problem of low accuracy of the traffic flow prediction results of the traffic road network in the existing technology is effectively solved, and the data reliability and accuracy are enhanced.
Smart Images

Figure CN118865705A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transportation, and in particular to a method for predicting traffic flow in an intelligent transportation network based on a Bayesian algorithm. Background Art
[0002] With the acceleration of urbanization and the continuous growth of the number of cars, problems such as traffic congestion and frequent traffic accidents have become increasingly prominent. As one of the effective means to solve these problems, the intelligent transportation system integrates advanced information technology, communication technology, control technology and traffic engineering to achieve comprehensive perception, intelligent analysis and active management of traffic. As an important part of the intelligent transportation system, traffic flow prediction is of great significance to improving traffic efficiency, alleviating traffic congestion and ensuring traffic safety. As a reasoning method based on probability statistics, the Bayesian algorithm has the ability to handle uncertainty and complex data relationships. In the traffic flow prediction of intelligent transportation road networks, the Bayesian algorithm can play its advantages in the following ways: the Bayesian algorithm can make full use of historical traffic flow data (prior knowledge) and real-time observation data, and calculate the probability distribution of future traffic flow through the Bayesian theorem. This method takes into account both historical laws and real-time changes, and improves the accuracy and robustness of the prediction. The intelligent transportation system needs to monitor traffic flow changes in real time and dynamically adjust the prediction model according to actual conditions. The Bayesian algorithm has the ability to update in real time, and can dynamically adjust the prior probability distribution and prediction results according to new observation data, so that the prediction is closer to the actual situation.
[0003] Existing methods can predict the traffic flow distribution in a certain period of time in the future by collecting historical traffic data and constructing a Bayesian network model. This helps traffic management departments to formulate traffic diversion plans in advance, optimize traffic signal control strategies, etc., thereby effectively alleviating traffic congestion problems.
[0004] For example, the invention patent with announcement number: CN115482664B announces a method for spatiotemporal prediction of road network traffic flow for intelligent transportation, including: step S1, dividing the urban road network into a number of road network sub-areas, and adjacent road network sub-areas are connected by at least one road; performing all-weather photography and monitoring on each road network sub-area and the roads between each adjacent road network sub-area to obtain corresponding road network sub-area images and road images, and performing image preprocessing on the road network sub-area images and the road images; step S2, according to the time nodes of the all-weather photography, extracting road network sub-area picture frame sequences corresponding to different time periods and road picture frame sequences corresponding to different time periods from the road network sub-area images; performing image preprocessing on the road network sub-area picture frame sequences and road picture frame sequences. The sequence is identified and processed to obtain the traffic characteristic parameters of the road network sub-areas and the roads in different time periods; step S3, based on the traffic characteristic parameters of the road network sub-areas and the roads, predict the vehicle driving flow information within the road network sub-areas corresponding to different time periods in the next all-weather shooting and monitoring process and the vehicle flow transportation information between different road network sub-areas; based on the vehicle driving flow information and the vehicle flow transportation information, predict the congestion related parameters corresponding to each road network sub-area and each road; step S4, based on the congestion related parameters corresponding to the road network sub-areas and the roads, determine the location and time corresponding to the traffic congestion event in each road network sub-area and each road, so as to adjust the working state of the traffic lights in each road network sub-area and each road.
[0005] For example, the invention patent with announcement number CN117437786B announces a method for predicting short-term traffic flow in a real-time traffic network based on artificial intelligence, including: S1: obtaining a traffic network and traffic flow data set in a fixed area; S2: performing data preprocessing on the traffic flow data set to be processed in step S1 to obtain a traffic flow data set that meets the standards; S3: using a hierarchical clustering method to analyze the correlation between various factors affecting traffic and the factors affecting traffic flow, and determining multiple key factors affecting traffic flow; S4: using the traffic flow data set in step S2 to construct training samples; S5: using a CNN-LSTM model to train the model; S6: obtaining the traffic flow prediction value of any road section at a certain moment; S7: obtaining the prediction value of all road sections; S8: using a mapping relationship and a compressed prediction matrix to obtain a road network prediction value.
[0006] However, in the process of implementing the technical solution of the invention in the embodiments of the present application, the present application found that the above technology has at least the following technical problems:
[0007] In the prior art, since predictions are made based on the regularity and trend of historical data, it is difficult to capture the nonlinear and complex characteristics of traffic flow, resulting in low accuracy of traffic flow prediction results in the traffic network. Summary of the invention
[0008] The embodiment of the present application solves the problem of low accuracy of traffic flow prediction results of traffic networks in the prior art by providing an intelligent traffic network traffic flow prediction method based on a Bayesian algorithm, thereby improving the accuracy of traffic flow prediction results of traffic networks.
[0009] The embodiment of the present application provides a method for predicting traffic flow in an intelligent traffic network based on a Bayesian algorithm, comprising the following steps: S1, preprocessing the collected initial traffic flow data to obtain preprocessed traffic flow data, wherein the preprocessing is used to integrate the initial traffic flow data to ensure that the data format is consistent; S2, extracting features from the preprocessed traffic flow data according to preset features to obtain characteristic traffic flow data, wherein the preset features include preset time features, preset spatial features, and preset dynamic features, and the feature extraction is used to obtain characterized preprocessed traffic flow data; S3, obtaining a traffic-related index according to the characteristic traffic flow data, wherein the traffic-related index includes a speed-related index, an occupancy index, and a flow-related index, wherein the speed-related index is used to evaluate the speed change of a vehicle during driving, the occupancy index is used to evaluate the distribution density of vehicles on a preset road, and the flow-related index is used to evaluate the change in traffic flow; S4, comparing the traffic-related index with the preset traffic flow range to obtain a traffic flow level corresponding to the characteristic traffic flow data, wherein the traffic flow level is used to describe the degree of traffic road congestion; S5, obtaining a traffic flow prediction model according to the characteristic traffic flow data, the traffic-related index, and the corresponding traffic flow level.
[0010] Furthermore, the specific acquisition process of the pre-processed traffic flow data is as follows: the sample data is screened according to a preset traffic flow range to obtain initial traffic flow data, and the initial traffic flow data represents the screened sample data; the initial traffic flow data is processed for missing values to obtain first pre-processed data; the first pre-processed data is standardized to obtain pre-processed traffic flow data.
[0011] Furthermore, the specific acquisition process of the characteristic traffic flow data is as follows: according to the preset time feature, the pre-processed traffic flow data is subjected to time feature extraction to obtain the first characteristic data, and the time feature extraction is used to reflect the periodic changes of the traffic flow; according to the preset spatial feature, the first characteristic data is subjected to spatial feature extraction to obtain the second characteristic data, and the spatial feature extraction is used to describe the geographical location and spatial relationship of the first characteristic data; according to the preset dynamic feature, the second characteristic data is subjected to dynamic feature extraction to obtain the third characteristic data, and the dynamic feature extraction is used to reflect the real-time changes of the second characteristic data; the characteristic traffic flow data includes the first characteristic data, the second characteristic data and the third characteristic data.
[0012] Furthermore, the specific process of obtaining the speed-related index is as follows: measuring the first-location speed of the vehicle by an instantaneous speed tester during a preset time period; measuring the first passing time of the vehicle by a timer during a preset time period; measuring the first road section length of the vehicle by a laser rangefinder during a preset time period, obtaining a preset time speed threshold, a preset interval speed threshold, a preset speed first weight and a preset speed second weight, and obtaining the speed-related index in combination with the first-location speed, the first passing time and the first road section length.
[0013] Furthermore, the speed-related index is calculated using the following formula:
[0014]
[0015] Where X1 represents the speed-related index, v mi represents the first location speed of the i-th vehicle in the m-th preset time period, m=1,2,...,n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1,2,...,r, i represents the number of the vehicle, r represents the total number of vehicles, t mi represents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, V1 represents the preset time speed threshold, V2 represents the preset interval speed threshold, σ1 represents the preset speed first weight, σ2 represents the preset speed second weight, and e represents a natural constant.
[0016] Furthermore, the specific process of obtaining the occupancy degree index is as follows: measuring the first occupancy length of the vehicle by a total station in a preset time period; measuring the first occupancy time of the vehicle by a wireless geomagnetic detector in a preset time period; obtaining a preset spatial occupancy threshold, a preset time occupancy threshold, a preset occupancy first weight and a preset occupancy second weight from a database, and obtaining the occupancy degree index in combination with the first road section length, the first passing time, the first occupancy length and the first occupancy time.
[0017] Furthermore, the occupancy index is calculated using the following formula:
[0018]
[0019] In the formula, X2 represents the occupancy index, L mi represents the first occupancy length of the i-th vehicle in the m-th preset time period, m=1, 2, ..., n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1, 2, ..., r, i represents the number of the vehicle, r represents the total number of vehicles, T mi represents the first occupancy time of the i-th vehicle in the m-th preset time period, t mirepresents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, R1 represents the preset space occupancy threshold, R2 represents the preset time occupancy threshold, τ1 represents the preset occupancy first weight, and τ2 represents the preset occupancy second weight.
[0020] Furthermore, the specific process of obtaining the traffic-related index is as follows: measuring the first number of vehicles on a preset road section through a radar detector and a counter during a preset time period; measuring the total length of the first time through a wireless geomagnetic detector during a preset time period; obtaining a preset traffic threshold from a database and combining the first number of vehicles and the first total length of time to obtain the traffic-related index.
[0021] Furthermore, the flow correlation index is calculated using the following formula:
[0022]
[0023] In the formula, X3 represents the flow correlation index, Q m represents the number of the first vehicle in the mth preset time period, m=1, 2, ..., n, m represents the number of the preset time period, n represents the total number of preset time periods, T m represents the first total time length of the mth preset time period, f represents the preset flow threshold, and e represents the natural constant.
[0024] Furthermore, the specific acquisition process of the traffic flow prediction model is as follows: dividing the traffic data set into a training set and a validation set according to a preset ratio, the traffic data set being a sequence of characteristic traffic flow data, traffic-related indexes and corresponding traffic flow levels; inputting the training set into the initial model for training to obtain the first model, and inputting the validation set into the first model to obtain the corresponding validation traffic flow level, and at the same time comparing the validation traffic flow level with the preset level to obtain the level allocation accuracy, the level allocation accuracy being used to evaluate the accuracy of the verification; screening the first model according to the level allocation accuracy to obtain the traffic flow prediction model.
[0025] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0026] 1. Preprocessed traffic flow data is obtained by preprocessing the collected initial traffic flow data, and a traffic-related index is obtained based on the characteristic traffic flow data obtained by feature extraction. Then, the traffic flow level corresponding to the characteristic traffic flow data is obtained by comparison with a preset traffic flow range. Finally, a traffic flow prediction model is obtained based on the characteristic traffic flow data, the traffic-related index and the corresponding traffic flow level, thereby improving the reliability of the obtained data, and further improving the accuracy of the traffic flow prediction results of the traffic road network, effectively solving the problem of low accuracy of the traffic flow prediction results of the traffic road network in the prior art.
[0027] 2. The sample data is screened within a preset traffic flow range to obtain initial traffic flow data, and then the initial traffic flow data is processed for missing values to obtain first preprocessed data. Finally, the first preprocessed data is standardized to obtain preprocessed traffic flow data, thereby reducing data complexity and improving data accuracy.
[0028] 3. By measuring the first-location speed, the first passing time and the first section length of the vehicle in a preset time period, and obtaining the preset time speed threshold, the preset interval speed threshold, the preset speed first weight and the preset speed second weight from the database to obtain the speed-related index, a numerical evaluation of the speed change of the vehicle during driving is achieved, thereby providing a guarantee for traffic flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flow chart of a method for predicting traffic flow in an intelligent transportation network based on a Bayesian algorithm provided in an embodiment of the present application;
[0030] Figure 2 A statistical chart of changes in the flow-related index provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiment of the present application solves the problem of low accuracy of traffic flow prediction results of traffic networks in the prior art by providing a method for predicting traffic flow of intelligent traffic networks based on a Bayesian algorithm. Preprocessed traffic flow data is obtained by preprocessing the collected initial traffic flow data, and then feature extraction is performed on the preprocessed traffic flow data according to preset features to obtain feature traffic flow data. Then, a traffic-related index is obtained based on the feature traffic flow data, and the traffic-related index is compared with a preset traffic flow range to obtain a traffic flow level corresponding to the feature traffic flow data. Finally, a traffic flow prediction model is obtained based on the feature traffic flow data, the traffic-related index and the corresponding traffic flow level, thereby improving the accuracy of traffic flow prediction results of traffic networks.
[0032] The technical solution in the embodiment of the present application is to solve the problem that the accuracy of the traffic flow prediction results of the above-mentioned traffic network is not high. The overall idea is as follows:
[0033] The characteristic traffic flow data is obtained by preprocessing and feature extraction of the initial traffic flow data, and then the traffic-related index and the corresponding traffic flow level are obtained based on the characteristic traffic flow data. Finally, the traffic flow prediction model is obtained based on the characteristic traffic flow data, thereby achieving the effect of improving the accuracy of traffic flow prediction results of the traffic road network.
[0034] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0035] like Figure 1 As shown, it is a flow chart of a method for predicting traffic flow of an intelligent traffic network based on a Bayesian algorithm provided by an embodiment of the present application, the method comprising the following steps: S1, preprocessing the collected initial traffic flow data to obtain preprocessed traffic flow data, the preprocessing is used to integrate the initial traffic flow data to ensure the consistency of the data format, and the preprocessed traffic flow data represents the preprocessed initial traffic flow data; S2, extracting features from the preprocessed traffic flow data according to preset features to obtain feature traffic flow data, the preset features include preset time features, preset spatial features and preset dynamic features, the feature extraction is used to obtain characterized preprocessed traffic flow data, and the feature traffic flow data represents the feature extracted pre-processed traffic flow data; S3, obtaining traffic-related indexes according to the characteristic traffic flow data, the traffic-related indexes include speed-related index, occupancy index and flow-related index, the speed-related index is used to evaluate the speed change of vehicles during driving, the occupancy index is used to evaluate the distribution density of vehicles on preset roads, and the flow-related index is used to evaluate the change of traffic flow; S4, comparing the traffic-related index with the preset traffic flow range to obtain the traffic flow level corresponding to the characteristic traffic flow data, the traffic flow level is used to describe the degree of traffic road congestion; S5, obtaining a traffic flow prediction model according to the characteristic traffic flow data, the traffic-related index and the corresponding traffic flow level.
[0036] In this embodiment, the preset traffic flow range is obtained based on the traffic flow data of the historical time period. For example, the low flow range, medium flow range and high flow range are set according to the research purpose, road type, traffic time period and other factors, and the preset traffic flow range is obtained accordingly. The traffic related index is compared with the preset traffic flow range to obtain the traffic flow level corresponding to the characteristic traffic flow data. If it is within the low flow range, it is judged as a low level, if it is within the medium flow range, it is judged as a medium level, and if it is within the high flow range, it is judged as a high level. In the feature extraction stage, irrelevant or redundant features are avoided. The traffic flow prediction model is obtained by inputting the characteristic traffic flow data, the traffic related index and the corresponding traffic flow level into the initial model for training and verification. The characteristic traffic flow data and the traffic related index are input into the traffic flow prediction model, and the model outputs the corresponding traffic flow level. The degree of traffic congestion is judged accordingly, thereby improving the accuracy of the traffic flow prediction results of the traffic road network.
[0037] Furthermore, the specific process of obtaining the preprocessed traffic flow data is as follows: the sample data is screened according to a preset traffic flow range to obtain initial traffic flow data, the initial traffic flow data represents the screened sample data, and the sample data represents the original data set obtained from the database; the initial traffic flow data is processed for missing values to obtain the first preprocessed data, the missing value processing represents filling the missing values by the median of the initial traffic flow data, and the first preprocessed data represents the initial traffic flow data after the missing value processing; the first preprocessed data is standardized to obtain the preprocessed traffic flow data, and the standardization is used to unify the format of the first preprocessed data.
[0038] In this embodiment, the preset traffic flow range is obtained based on the traffic flow data of the historical time period. For example, the low flow range, medium flow range and high flow range are set according to the research purpose, road type, traffic period and other factors, and the preset traffic flow range is obtained accordingly. The standardization process helps to eliminate the dimensional differences and numerical range differences between different variables, making the data more suitable for subsequent analysis or model training; thus, the accuracy of the traffic flow prediction results of the traffic network is improved.
[0039] Furthermore, the specific acquisition process of characteristic traffic flow data is as follows: according to the preset time feature, the pre-processed traffic flow data is subjected to time feature extraction to obtain the first characteristic data, the first characteristic data represents the pre-processed traffic flow data after time feature extraction, and the time feature extraction is used to reflect the periodic changes of the traffic flow; according to the preset spatial feature, the first characteristic data is subjected to spatial feature extraction to obtain the second characteristic data, the second characteristic data represents the first characteristic data after spatial feature extraction, and the spatial feature extraction is used to describe the geographical location and spatial relationship of the first characteristic data; according to the preset dynamic feature, the second characteristic data is subjected to dynamic feature extraction to obtain the third characteristic data, the third characteristic data represents the second characteristic data after dynamic feature extraction, and the dynamic feature extraction is used to reflect the real-time changes of the second characteristic data; the characteristic traffic flow data includes the first characteristic data, the second characteristic data and the third characteristic data.
[0040] In this embodiment, time feature extraction is intended to reflect the periodic changes in traffic flow, such as daily periodicity (morning and evening rush hours), weekly periodicity (differences between weekdays and weekends), monthly periodicity (seasonal changes), etc. The preset time features include timestamp, date, day of the week, hour, etc. Spatial feature extraction is used to describe the geographical location and spatial relationship of traffic flow, such as road sections, intersections, areas, etc. The preset spatial features include geographical location coordinates, road types, intersection layouts, etc. Dynamic feature extraction is used to reflect the real-time changes of the second feature data, such as instantaneous changes in traffic volume, speed changes, congestion conditions, etc. The preset dynamic features include speed, acceleration, congestion index, etc.; the accuracy of traffic flow prediction results of the traffic road network is improved.
[0041] Furthermore, the specific process of obtaining the speed-related index is as follows: measuring the first-location speed of the vehicle by an instantaneous speed tester during a preset time period, the first-location speed represents the instantaneous speed of the vehicle when passing through a preset road section; measuring the first passing time of the vehicle by a timer during a preset time period, the first passing time represents the time required for the vehicle to pass through the preset road section; measuring the first road section length of the vehicle by a laser rangefinder during a preset time period, the first road section length represents the length of the preset road section; obtaining a preset time speed threshold, a preset interval speed threshold, a preset speed first weight and a preset speed second weight from a database, and obtaining the speed-related index in combination with the first-location speed, the first passing time and the first road section length, the preset speed first weight represents the degree of influence of the first-location speed on the speed-related index, and the preset speed second weight represents the degree of influence of the first passing time and the first road section length on the speed-related index.
[0042] In this embodiment, the preset time speed threshold is represented by the result of averaging the traffic flow data in the database after statistical analysis, and the preset interval speed threshold is represented by the result of averaging the traffic flow data in the database after statistical analysis; the preset speed first weight is obtained from the traffic flow database, and the relationship between the speed-related index and the first location speed is fitted to the speed-related index in the historical period and the first location speed to obtain a fitting curve, and the preset speed first weight corresponding to the input first location speed is obtained according to the fitting curve; the preset speed second weight is obtained from the traffic flow database, and the relationship between the speed-related index and the first passing time and the first section length is fitted to the speed-related index in the historical period and the first passing time and the first section length to obtain a fitting curve, and the preset speed second weight corresponding to the input first passing time and the first section length is obtained according to the fitting curve; the instantaneous speed tester can quickly and accurately capture the speed change of an object in a very short time through high-precision time measurement and distance change calculation, and the timer can be accurate to milliseconds or even microseconds to ensure the accuracy and reliability of time measurement. The laser rangefinder is a device that uses laser technology to measure distance. It emits a laser beam and measures the time required for the laser to be reflected by the target, thereby calculating the distance from the target to the rangefinder, thereby improving the accuracy of traffic flow prediction results of the traffic network.
[0043] Furthermore, the speed-related index is calculated using the following formula:
[0044]
[0045] Where X1 represents the speed-related index, v mirepresents the first location speed of the i-th vehicle in the m-th preset time period, m=1,2,...,n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1,2,...,r, i represents the number of the vehicle, r represents the total number of vehicles, t mi represents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, V1 represents the preset time speed threshold, V2 represents the preset interval speed threshold, σ1 represents the preset speed first weight, σ2 represents the preset speed second weight, and e represents a natural constant.
[0046] In this embodiment, the algorithm of this embodiment combines the first location speed v mi , the first section length D and the first passing time t mi , the speed correlation index of the mth preset time period is obtained through comprehensive analysis. The speed v of the first location in this formula is mi , the first section length D and the first passing time t mi There is a common regulatory association between them, when the first location speed v mi , when the length of the first section D increases, the first passing time t mi The speed-related index may decrease, and the speed-related index may increase, indicating the size of the comprehensive impact on the speed-related index. When the numerator in the fraction where the absolute value is located tends to 0, the speed-related index tends to σ1+σ2. If σ1+σ2=1, the speed-related index tends to 1, and the speed change of the vehicle during driving tends to be stable, which means that the vehicles on the road are no longer frequently alternating between rapid acceleration and rapid deceleration, but are traveling at a more stable and continuous speed. Therefore, a mathematical form is established for accurate analysis. To simplify the analysis, the first location speed v mi The expression is: Among them, v mi ′ represents the speed data of the first location of the i-th vehicle in the m-th preset time period, v mi 0 represents the reference first location speed data of the i-th vehicle in the m-th preset time period, Δv mi The speed reference deviation of the first location and the length D of the first section are expressed as: Where D′ represents the first section length data of the i-th vehicle in the m-th preset time period, and D 0 represents the reference first section length data of the i-th vehicle in the m-th preset time period, ΔD represents the reference deviation of the first section length, and the first passing time t mi The expression is: Among them, t mi represents the first passing time data of the i-th vehicle in the m-th preset time period, t mi 0represents the reference first passing time data of the i-th vehicle in the m-th preset time period, Δt mi Indicates the first pass time reference deviation.
[0047] It should be understood that the first location speed data of the i-th vehicle in the m-th preset time period is obtained by measurement, the reference first location speed data is obtained by statistically analyzing the first location speed data of the i-th vehicle in the m-th preset time period and taking the average value, and the first location speed reference deviation is obtained by calculating the first location speed data and the reference first location speed data through the deviation formula, the first section length data of the i-th vehicle in the m-th preset time period is obtained by measurement, and the reference first section length data is obtained by statistically analyzing the first section length data of the i-th vehicle in the m-th preset time period and taking the average value, and the first section length reference deviation is obtained by calculating the first section length reference deviation. The first road section length data and the reference first road section length data are calculated by the deviation formula, the first passing time data of the i-th vehicle in the m-th preset time period are obtained by measurement, the reference first passing time data are expressed by taking the average value after statistical analysis on the first passing time data of the i-th vehicle in the m-th preset time period, the first passing time reference deviation is calculated by the deviation formula on the first passing time data and the reference first passing time data, the deviation formula is used to measure the difference between the reference value and the actual measurement value, and is generally expressed by taking the difference between the reference value and the actual measurement value; the accuracy of the traffic flow prediction results of the traffic road network is improved.
[0048] Furthermore, the specific process of obtaining the occupancy degree index is as follows: measuring the first occupancy length of the vehicle by a total station in a preset time period, the first occupancy length indicating the length of the road occupied by the vehicle at the moment it passes the total station; measuring the first occupancy time of the vehicle by a wireless geomagnetic detector in a preset time period, the first occupancy time indicating the time occupied by the vehicle when passing the wireless geomagnetic detector; obtaining a preset spatial occupancy threshold, a preset time occupancy threshold, a preset occupancy first weight and a preset occupancy second weight from a database, and obtaining the occupancy degree index in combination with the first road section length, the first passing time, the first occupancy length and the first occupancy time, the preset occupancy first weight indicating the influence of the first occupancy length on the occupancy degree index, and the preset occupancy second weight indicating the influence of the first occupancy time on the occupancy degree index.
[0049] In this embodiment, the preset spatial occupancy threshold is represented by the result of averaging the traffic flow data in the database after statistical analysis, and the preset time occupancy threshold is represented by the result of averaging the traffic flow data in the database after statistical analysis; the preset first occupancy weight is obtained from the traffic flow database, and the relationship between the occupancy index and the first occupancy length is fitted to the occupancy index and the first occupancy length in the historical period to obtain a fitting curve, and the preset first occupancy weight corresponding to the input first occupancy length is obtained according to the fitting curve; the preset second occupancy weight is obtained from the traffic flow database, and the relationship between the occupancy index and the first occupancy time is fitted to the occupancy index and the first occupancy time in the historical period to obtain a fitting curve, and the preset second occupancy weight corresponding to the input first occupancy time is obtained according to the fitting curve; the total station is a high-tech measuring instrument integrating optics, machinery and electricity, which can automatically display observation data such as slant distance, zenith distance (vertical angle), horizontal angle, etc. The wireless geomagnetic detector adopts wireless communication technology to transmit the detected geomagnetic signal to the receiving end for processing, which has the advantages of easy installation and strong flexibility, and is more common in application scenarios such as vehicle detection and parking space management; the accuracy of traffic flow prediction results of traffic road networks is improved.
[0050] Furthermore, the occupancy index is calculated using the following formula:
[0051]
[0052] In the formula, X2 represents the occupancy index, L mi represents the first occupancy length of the i-th vehicle in the m-th preset time period, m=1,2,...,n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1,2,...,r, i represents the number of the vehicle, r represents the total number of vehicles, T mi represents the first occupancy time of the i-th vehicle in the m-th preset time period, t mi represents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, R1 represents the preset space occupancy threshold, R2 represents the preset time occupancy threshold, τ1 represents the preset occupancy first weight, and τ2 represents the preset occupancy second weight.
[0053] In this embodiment, the algorithm of this embodiment combines the first occupied length L mi and the first occupation time T mi , comprehensive analysis is performed to obtain the occupancy index of the mth preset time period. In this formula, the first occupancy length L mi and the first occupation time T mi There is a common regulatory association between them, when the first occupied length L mi When it increases, it may cause the first occupation time T miIncreases, the occupancy index may increase, indicating the size of the comprehensive impact on the occupancy index. When the occupancy index tends to 0, the density of vehicles on the preset road is smaller, which means that each vehicle has more driving space, reducing high-risk behaviors such as emergency braking and lane changes caused by close distances. In this state, the mutual influence between vehicles is weakened, the stability of traffic flow is enhanced, and the possibility of congestion is effectively reduced. Therefore, accurate analysis is performed by establishing a mathematical form.
[0054] Assume r is 1, n is 1, τ1 = 50%, τ2 = 50%, the first occupied length L mi The range is 1-10 (m), the first occupation time T mi The range is 0-20 (s), the length of the first section D is 100 (m), and the first passing time t mi The range is 10-120 (s), the preset space occupancy threshold is 0.005, and the preset time occupancy threshold is 0.005. The statistical change table of the occupancy index is shown in Table 1:
[0055] Table 1 Statistical changes of occupancy index
[0056]
[0057] It can be seen from the table that as the first occupied length L mi The first occupation time T mi The first time t mi The gradual decrease of the occupancy index X2 gradually increases, which means that the distribution density of vehicles on the preset roads increases, and also means that the possibility of traffic congestion increases; the accuracy of the traffic flow prediction results of the traffic road network is improved.
[0058] Furthermore, the specific process of obtaining the flow-related index is as follows: measuring the first number of vehicles on a preset section of road by using a radar detector and a counter during a preset time period, the first number of vehicles representing the total number of vehicles passing through the preset section of road; measuring the first total time length by using a wireless geomagnetic detector during the preset time period, the first total time length representing the total time length of the preset time period; obtaining a preset flow threshold from a database and combining the first number of vehicles and the first total time length to obtain the flow-related index.
[0059] In this embodiment, the preset flow threshold is represented by the result of taking the average value after statistical analysis of the traffic flow data in the database. The radar detector is a device that identifies vehicles by emitting microwaves to the road surface and receiving reflected waves. It works based on the principle of Doppler effect. The detector suspended at a certain distance above the lane emits a microwave beam of known frequency to the lane below and receives the reflected wave. By comparing the frequency difference between the emitted wave and the reflected wave, the radar detector can identify and track the movement state of the vehicle. The counter is usually used to process the signal received by the radar detector, count and measure the number of vehicles, and improve the accuracy of the traffic flow prediction results of the traffic network.
[0060] Furthermore, the flow correlation index is calculated using the following formula:
[0061]
[0062] In the formula, X3 represents the flow correlation index, Q m represents the number of the first vehicle in the mth preset time period, m=1, 2, ..., n, m represents the number of the preset time period, n represents the total number of preset time periods, T m represents the first total time length of the mth preset time period, f represents the preset flow threshold, and e represents the natural constant.
[0063] In this embodiment, the algorithm of this embodiment combines the first vehicle number Q m and the first passing time T m , the flow-related index of the mth preset time period is obtained through comprehensive analysis. The first vehicle number Q in this formula m and the first passing time T m There is a common regulatory association between them, when the first vehicle number Q m When the flow rate increases, the flow rate correlation index may increase, but when the first passing time T m When it is too large, the flow-related index may decrease, indicating the size of the comprehensive impact on the flow-related index. When the numerator in the fraction where the absolute value is located tends to 0, the flow-related index tends to 1, that is, the change in traffic flow gradually slows down and approaches a static or stable state. Specifically, this means that within a certain period of time, the changes in the vehicle flow speed on the road, the distance between vehicles, and the overall traffic density are very small, and there is almost no obvious fluctuation, so accurate analysis is carried out by establishing a mathematical form.
[0064] like Figure 2 As shown in the figure, it is a statistical diagram of the change of the flow-related index provided in the embodiment of the present application, where it is assumed that: the total number of preset time periods is n=100, the first vehicle number Q m The range is 0-100 (vehicles), the first passing time T mThe range is 40-200 (min), and the preset flow threshold is 5 (vehicles / min). As can be seen from the figure, as the first vehicle number Q m The gradual increase and first passing time T m The speed-related index gradually decreases, and the flow-related index gradually increases, which means that the traffic flow changes faster and faster; the combined speed-related index, occupancy index and flow-related index can be used to evaluate the speed changes of vehicles during driving, the distribution density of vehicles on preset roads and the changes in traffic flow. The traffic flow prediction model is obtained based on the characteristic traffic flow data, traffic-related index and corresponding traffic flow level, which can describe the degree of traffic road congestion and improve the accuracy of traffic flow prediction results of traffic road networks.
[0065] Furthermore, the specific acquisition process of the traffic flow prediction model is as follows: the traffic data set is divided into a training set and a validation set according to a preset ratio, the traffic data set is a sequence of characteristic traffic flow data, traffic-related indexes and corresponding traffic flow levels, the training set is used to train the initial model, and the validation set is used to evaluate the performance of the initial model; the training set is input into the initial model for training to obtain the first model, and the validation set is input into the first model to obtain the corresponding validation traffic flow level, and at the same time, the validation traffic flow level is compared with the preset level to obtain the level allocation accuracy, the first model represents the trained initial model, the validation level represents the traffic flow level corresponding to the validation set, the level allocation accuracy is used to evaluate the accuracy of the verification, and the initial model has the function of learning the intrinsic relationship between characteristic traffic flow data, traffic-related indexes and corresponding traffic flow levels based on a naive Bayes classifier; the first model is screened according to the level allocation accuracy to obtain the traffic flow prediction model, and the traffic flow prediction model is the first model with the highest level allocation accuracy.
[0066] In this embodiment, a preset ratio is obtained from the database. Assuming that the preset ratio is 7:3, and the initial model is a model for learning based on a naive Bayes classifier, the steps for obtaining the first model are: dividing the traffic data set into 70% training set and 30% validation set according to the preset ratio, inputting the training set into the initial model for training, calculating the mean square error of the initial model and repeating the iteration until the number of iterations reaches the upper limit, thereby obtaining the first model, inputting the validation set into the first model to obtain the corresponding validation traffic flow grade, calculating the grade allocation accuracy of the initial model, and the model with the highest grade allocation accuracy is the traffic flow prediction model. If the number of samples of different traffic flow grades in the data set varies greatly, the model may be biased towards the majority class. At this time, the oversampling minority class method can be used to balance the data. The oversampling minority class method refers to balancing the data set by increasing the number of minority class samples during the training process; the accuracy of the traffic flow prediction results of the traffic road network is improved.
[0067] In summary, the embodiment of the present application obtains preprocessed traffic flow data by preprocessing the collected initial traffic flow data, obtains a traffic-related index based on the characteristic traffic flow data obtained by feature extraction, and then obtains a traffic flow level corresponding to the characteristic traffic flow data by comparison with a preset traffic flow range, and finally obtains a traffic flow prediction model based on the characteristic traffic flow data, the traffic-related index and the corresponding traffic flow level, thereby achieving an improvement in the reliability of the acquired data, and further achieving an improvement in the accuracy of the traffic flow prediction results of the traffic road network, effectively solving the problem of low accuracy of the traffic flow prediction results of the traffic road network in the prior art.
[0068] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0069] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0070] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0072] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0073] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm, characterized in that: The following steps are involved: S1, preprocessing the collected initial traffic flow data to obtain preprocessed traffic flow data, wherein the preprocessing is used to integrate the initial traffic flow data to ensure that the data format is consistent; S2, extracting features from the pre-processed traffic flow data according to preset features to obtain characteristic traffic flow data, wherein the preset features include preset time features, preset spatial features, and preset dynamic features, and the feature extraction is used to obtain characteristic pre-processed traffic flow data; S3, obtaining a traffic-related index according to the characteristic traffic flow data, wherein the traffic-related index includes a speed-related index, an occupancy index, and a flow-related index, wherein the speed-related index is used to evaluate the speed change of the vehicle during driving, the occupancy index is used to evaluate the distribution density of the vehicles on the preset road, and the flow-related index is used to evaluate the change of the traffic flow; S4, comparing the traffic-related index with a preset traffic flow range to obtain a traffic flow grade corresponding to the characteristic traffic flow data, wherein the traffic flow grade is used to describe the degree of traffic road congestion; S5, obtaining a traffic flow prediction model according to the characteristic traffic flow data, the traffic-related index and the corresponding traffic flow level.
2. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific process of obtaining the pre-processed traffic flow data is as follows: Filtering the sample data according to a preset traffic flow range to obtain initial traffic flow data, wherein the initial traffic flow data represents the filtered sample data; Performing missing value processing on the initial traffic flow data to obtain first preprocessed data; The first preprocessed data is standardized to obtain preprocessed traffic flow data.
3. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific process of obtaining the characteristic traffic flow data is as follows: Performing time feature extraction on the pre-processed traffic flow data according to a preset time feature to obtain first feature data, wherein the time feature extraction is used to reflect the periodic changes of the traffic flow; Performing spatial feature extraction on the first feature data according to the preset spatial feature to obtain second feature data, wherein the spatial feature extraction is used to describe the geographical location and spatial relationship of the first feature data; Performing dynamic feature extraction on the second feature data according to preset dynamic features to obtain third feature data, wherein the dynamic feature extraction is used to reflect the real-time changes of the second feature data; The characteristic traffic flow data includes first characteristic data, second characteristic data and third characteristic data.
4. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific process of obtaining the speed-related index is as follows: Measuring the first-location speed of the vehicle by means of an instantaneous speed tester during a preset time period; measuring a first passing time of the vehicle by a timer during a preset time period; measuring the length of a first road section of the vehicle by a laser rangefinder during a preset time period; A preset time speed threshold, a preset interval speed threshold, a preset speed first weight, and a preset speed second weight are obtained, and a speed-related index is obtained in combination with the first location speed, the first passing time, and the first section length.
5. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 4, characterized in that: The speed-related index is calculated using the following formula: Where X1 represents the speed-related index, v mi represents the first location speed of the i-th vehicle in the m-th preset time period, m=1,2,...,n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1,2,...,r, i represents the number of the vehicle, r represents the total number of vehicles, t mi represents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, V1 represents the preset time speed threshold, V2 represents the preset interval speed threshold, σ1 represents the preset speed first weight, σ2 represents the preset speed second weight, and e represents a natural constant.
6. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific process of obtaining the occupancy index is as follows: measuring a first occupied length of the vehicle by a total station during a preset time period; measuring a first occupancy time of the vehicle by a wireless geomagnetic detector during a preset time period; A preset space occupancy threshold, a preset time occupancy threshold, a preset first occupancy weight and a preset second occupancy weight are obtained from a database, and an occupancy degree index is obtained in combination with the first section length, the first passing time, the first occupancy length and the first occupancy time.
7. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 6, characterized in that: The occupancy index is calculated using the following formula: In the formula, X2 represents the occupancy index, L mi represents the first occupancy length of the i-th vehicle in the m-th preset time period, m=1,2,...,n, m represents the number of the preset time period, n represents the total number of preset time periods, i=1,2,...,r, i represents the number of the vehicle, r represents the total number of vehicles, T mi represents the first occupancy time of the i-th vehicle in the m-th preset time period, t mi represents the first passing time of the i-th vehicle in the m-th preset time period, D represents the length of the first road section, R1 represents the preset space occupancy threshold, R2 represents the preset time occupancy threshold, τ1 represents the preset occupancy first weight, and τ2 represents the preset occupancy second weight.
8. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific process of obtaining the traffic-related index is as follows: measuring a first number of vehicles on a preset road section by a radar detector and a counter during a preset time period; Measuring the first total time length by a wireless geomagnetic detector during a preset time period; A preset flow threshold is obtained from a database and a flow-related index is obtained by combining the first number of vehicles and the first total time.
9. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 8, characterized in that: The flow correlation index is calculated using the following formula: In the formula, X3 represents the flow correlation index, Q m represents the number of the first vehicle in the mth preset time period, m=1, 2, ..., n, m represents the number of the preset time period, n represents the total number of preset time periods, T m represents the first total time length of the mth preset time period, f represents the preset flow threshold, and e represents the natural constant.
10. The method for predicting traffic flow in intelligent transportation network based on Bayesian algorithm as claimed in claim 1, characterized in that: The specific acquisition process of the traffic flow prediction model is as follows: Dividing a traffic data set into a training set and a validation set according to a preset ratio, the traffic data set being a sequence of characteristic traffic flow data, traffic-related indexes and corresponding traffic flow levels; The training set is input into the initial model for training to obtain the first model, and the verification set is input into the first model to obtain the corresponding verification traffic flow level, and the verification traffic flow level is compared with the preset level to obtain the level allocation accuracy, and the level allocation accuracy is used to evaluate the accuracy of the verification; The first model is screened according to the grade allocation accuracy to obtain a traffic flow prediction model.
Citation Information
Patent Citations
Short-term traffic flow prediction method and system based on Bayesian optimization
CN111192453A
Real-time prediction method for congestion risk grades of expressway
CN113327418A
Urban road section traffic jam space-time accurate judgment method based on SVR-DEA model
CN113470362A
Traffic flow prediction method and system based on Bayesian method and graph convolution
CN115660135A
Method and system for predicting traffic jam condition
CN116597642A
Cited By
Vehicle-road collaborative artificial intelligence traffic light optimization scheduling method and system
CN120199093A
