Dynamic vehicle flow prediction method and system based on multi-source data fusion
By employing multi-dimensional visual feature extraction and multi-source data fusion, the problem of insufficient prediction accuracy caused by neglecting traffic flow combinations in existing technologies is solved, achieving high-precision prediction and decision support for traffic congestion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING COMM INST OF TECH
- Filing Date
- 2026-02-24
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies, when predicting traffic congestion, only focus on the total number of vehicles and ignore the combination of traffic flows, resulting in insufficient prediction accuracy and inadequate response to weather factors and emergencies.
By extracting multi-dimensional visual features, a real-time traffic flow spatiotemporal attribute sequence is generated, which includes vehicle visual attributes and driving lane indexes. Combined with a historical commuting fingerprint database and an elastic matching algorithm, real-time phase anchor points are calculated. Multi-source data is then fused using real-time disturbance coefficients and environmental correction coefficients to extrapolate the traffic congestion index.
It improves the accuracy and robustness of traffic congestion prediction without requiring vehicle identification information, adapts to complex traffic environments, and provides high-precision traffic management decision support.
Smart Images

Figure CN122116655A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic digital data processing, and in particular to a dynamic traffic flow prediction method and system based on multi-source data fusion. Background Technology
[0002] With the acceleration of urbanization, traffic congestion during morning and evening rush hours has become a persistent urban management challenge. On main urban roads and key sections connecting residential and office areas, commuter traffic exhibits significant periodic and tidal characteristics. To achieve intelligent traffic light timing and accurate dissemination of guidance information, accurate prediction of road traffic flow and congestion conditions over a future period is necessary.
[0003] In related technologies, surveillance cameras are typically deployed on the roadside, and target detection algorithms (such as the YOLO series) are used to capture passing vehicles in real time. The system counts the total number of vehicles passing through the cross section within a unit time window (such as every 5 minutes) and roughly distinguishes between large and small vehicles. Subsequently, the traffic flow data sequence obtained from these statistics is input into a time series prediction model (such as LSTM or ARIMA). The model fits the traffic flow data for the next moment based on the historical trend of traffic flow data, thereby determining whether the road is about to reach saturation.
[0004] However, because these technologies only focus on the number of vehicles passing through, ignoring the composition of the traffic flow, the systems struggle to perceive the microscopic structure of the traffic flow. Furthermore, identifying the identity information of all vehicles requires significant computing power. In actual commutes, congestion conditions can vary due to weather and other factors, leading to substantial errors in the predictions of congestion duration by these technologies. Summary of the Invention
[0005] This application provides a dynamic traffic flow prediction method and system based on multi-source data fusion, which can accurately predict the evolution trend of traffic congestion during peak commuting hours without the need to identify vehicle identity information.
[0006] Firstly, this application provides a dynamic traffic flow prediction method based on multi-source data fusion, applied to a traffic flow monitoring system. The method includes: receiving real-time video streams from surveillance cameras on a target road segment; extracting multi-dimensional visual features from vehicles in the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes; retrieving historical traffic flow data from the target road segment, performing cluster analysis on the spatiotemporal distribution patterns of traffic flow attributes within historical periods, and constructing a historical commuter fingerprint database containing typical commuter traffic flow modes; employing an elastic matching algorithm based on key feature points to calculate the similarity between the real-time traffic flow spatiotemporal attribute sequence and each fingerprint pattern in the historical commuter fingerprint database, determining the real-time phase anchor point of the current traffic flow in the historical commuter period; based on the real-time phase anchor point, retrieving the evolution trend of subsequent traffic flows in the historical commuter fingerprint database, and calculating the baseline commuter traffic volume of the target road segment in a preset future time period; and combining the physical capacity of the target road segment, the real-time non-commuter disturbance coefficient, and the baseline commuter traffic volume to deduce the traffic congestion index of the target road segment in a preset future time period.
[0007] In the above embodiments, the traffic flow monitoring system extracts multi-dimensional visual features of vehicles, no longer relying solely on vehicle counting, but constructing a deep feature sequence that includes visual information such as color and size, as well as lane information. This multi-dimensional feature extraction method can capture the micro-structure of traffic flow. For example, the clustering of vehicles of specific colors or sizes often corresponds to specific commuter groups or logistics patterns. By using historical patterns to predict future traffic trends, the accuracy and robustness of predictions are improved.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, vehicle visual attributes include vehicle size and vehicle type. The step of extracting multi-dimensional visual features of vehicles passing through the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes specifically includes: extracting the central region image of the vehicle detection box in the video frame of the real-time video stream, calculating the hue feature value of the central region image in the HSV color space to determine the color code; calculating the pixel ratio and aspect ratio of the vehicle detection box in the video frame to determine the vehicle type classification code; identifying the road lane number where the center point of the vehicle detection box is located to generate the lane position code; integrating the color code, vehicle type classification code, and lane position code into a single vehicle feature coding unit, and concatenating multiple single vehicle feature coding units in chronological order to form a real-time traffic flow spatiotemporal attribute sequence.
[0009] In the above embodiments, the traffic flow monitoring system extracts hue feature values through the HSV color space. Compared with the RGB space, HSV is less sensitive to changes in illumination, thus it can more stably represent the appearance features of vehicles under different weather and lighting conditions. It transforms complex video image information into a structured digital encoding sequence, compresses the amount of data, retains the key information needed to distinguish different traffic flow patterns, and avoids the computing power bottleneck caused by full image processing.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the step of using an elastic matching algorithm based on key feature points to calculate the similarity between the real-time traffic flow spatiotemporal attribute sequence and each fingerprint pattern in the historical commuting fingerprint database, and determining the real-time phase anchor point of the current traffic flow in the historical commuting cycle, specifically includes: filtering out backbone vehicle nodes with high recognizability from the real-time traffic flow spatiotemporal attribute sequence; the backbone vehicle nodes include large-sized vehicles or vehicles with preset color combinations; using the backbone vehicle nodes as time calibration anchor points, performing coarse-grained time axis alignment in the fingerprint patterns of the historical commuting fingerprint database to determine candidate historical segments; within the time window of the candidate historical segments, calculating the histogram similarity of ordinary vehicle nodes in lane distribution and color distribution; selecting the historical time point with the highest histogram similarity as the real-time phase anchor point, and calculating the time deviation between the current system time and the real-time phase anchor point.
[0011] In the above embodiments, the traffic flow monitoring system adopts a hierarchical matching strategy. First, it uses highly identifiable backbone vehicles (such as buses, large trucks, or brightly colored vehicles) for coarse-grained time axis alignment to quickly narrow the search range, simulating the process of positioning through salient landmarks. This effectively solves the computational complexity problem in time series matching. Then, it uses the distribution histogram of ordinary vehicles within the candidate segments for fine-grained matching, ensuring the accuracy of positioning. This allows the system to accurately pinpoint the relative position of the current traffic flow in the historical cycle, i.e., the real-time phase anchor point, overcoming the limitations of simply relying on timestamps for prediction.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after determining the historical time point with the highest histogram similarity as the real-time phase anchor point and calculating the time deviation between the current system time and the real-time phase anchor point, the method further includes: extracting discrete difference feature vectors from the real-time traffic flow spatiotemporal attribute sequence that fail to match the fingerprint pattern, constructing a non-commuting residual sequence; statistically analyzing the traffic density of the non-commuting residual sequence and calculating the deviation of the traffic density from the historical benchmark density for the same period; inputting the deviation into a preset disturbance gain model to generate real-time non-commuting disturbance coefficients.
[0013] In the above embodiments, in actual traffic, sudden events, temporary controls or special activities often cause traffic flow characteristics to deviate from historical patterns. These differences are the main source of prediction errors. By calculating the flow density and deviation of the residual sequence, the current degree of abnormal disturbance can be dynamically determined, so that the prediction model is not only based on historical patterns, but can also respond to the current sudden changes in real time, thus improving the system's adaptability in atypical scenarios.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the step of retrieving the subsequent traffic flow evolution trend in the historical commuting fingerprint database based on real-time phase anchor points and calculating the baseline commuting traffic volume of the target road segment in a preset future time period specifically includes: taking the real-time phase anchor points as the starting point, extracting the historical traffic flow evolution sequence for the preset future time period from the historical commuting fingerprint database; statistically analyzing the total number of vehicles passing through and the trend of the proportion of large vehicles in the historical traffic flow evolution sequence; and weighting and correcting the total number of vehicles passing through based on the real-time non-commuting disturbance coefficient and the trend of the proportion of large vehicles to obtain the baseline commuting traffic volume of the target road segment in the preset future time period.
[0015] In the above embodiments, the traffic flow monitoring system is based on the strong periodicity assumption of commuter traffic, which assumes that the historical evolution trend will likely repeat itself. It combines the real-time non-commuter disturbance coefficient and the trend of the proportion of large vehicles obtained from the above calculation to correct the historical data. Because large vehicles have a slower start and occupy more lanes, their impact on traffic efficiency is much greater than that of small vehicles. This makes the calculation of the baseline commuter traffic volume more in line with the physical laws of the actual road carrying capacity, and improves the reliability of the predicted value.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of weighting and correcting the total number of vehicles passing through based on the real-time non-commuting disturbance coefficient and the trend of the proportion of large vehicles to obtain the baseline commuting traffic volume of the target road segment in a preset future time period, the method further includes: acquiring meteorological environmental data of the target road segment and the real-time congestion feedback index of the downstream road segment; constructing an environmental correction coefficient including a meteorological damping factor and a downstream feedback factor; and weighting and correcting the baseline commuting traffic volume based on the environmental correction coefficient and the real-time non-commuting disturbance coefficient to obtain the corrected commuting traffic volume.
[0017] In the above embodiments, the traffic flow monitoring system introduces external environmental data and road network related data to construct a correction system based on multi-source data fusion. Meteorological environment (such as rain, snow and fog) directly affects driver behavior and road friction coefficient, thereby changing traffic capacity. Congestion feedback from downstream road sections reflects the queuing overflow effect of the road network. This multi-factor weighted correction mechanism effectively solves the problem of prediction failure of traditional methods when there is severe weather or downstream congestion back transmission, and realizes accurate capture of traffic flow changes in complex traffic environments.
[0018] In some embodiments of the first aspect, the step of combining the physical capacity of the target road segment, the real-time non-commuting disturbance coefficient, and the baseline commuting traffic volume to deduce the traffic congestion index of the target road segment in a preset future time period specifically includes: obtaining the physical saturation threshold of the target road segment; calculating the predicted road load rate based on the corrected commuting traffic volume and the physical saturation threshold; retrieving the historical average speed decay rate in the historical commuting fingerprint database for the subsequent time period of the real-time phase anchor point; and integrating the predicted road load rate and the historical average speed decay rate to determine the traffic congestion index through a preset congestion mapping model.
[0019] In the above embodiments, the traffic flow monitoring system ultimately transforms traffic forecasts into an intuitive congestion index. By calculating the predicted road load ratio (V / C ratio), the relationship between future traffic demand and road supply is quantified. Combined with the historical average speed decay rate, the nonlinear impact of increased traffic flow on vehicle speed is considered, which can more comprehensively reflect the road's operational status and provide a basis for decision-making in the formulation of traffic control measures.
[0020] In a second aspect, embodiments of this application provide a traffic flow monitoring system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the traffic flow monitoring system to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a traffic flow monitoring system, cause the traffic flow monitoring system to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a traffic flow monitoring system, cause the traffic flow monitoring system to execute the method described in the first aspect and any possible implementation thereof.
[0023] Understandably, the traffic flow monitoring system provided in the second aspect, the computer storage medium provided in the third aspect, and the computer program product provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0025] 1. By adopting a phase anchor point determination method based on multi-dimensional visual feature extraction and historical commuting fingerprint database matching, the traffic flow monitoring system can deeply perceive the micro-composition pattern of traffic flow and accurately locate the evolution stage of the current traffic flow in the commuting cycle by utilizing historical patterns. This effectively solves the problem of insufficient prediction accuracy caused by existing technologies relying solely on total statistics while ignoring traffic flow structural features. As a result, it achieves high-precision prediction of traffic congestion evolution trends during peak commuting periods without the need to identify specific vehicle identity privacy information.
[0026] 2. Due to the adoption of an elastic matching algorithm that combines coarse-grained alignment based on backbone vehicle nodes with fine-grained matching based on histogram similarity, the traffic flow monitoring system can quickly and accurately find the historical segment that best matches the current traffic flow characteristics in massive historical data. This effectively solves the problem of time axis offset caused by holidays, weather or emergencies when relying solely on timestamps for prediction, thereby achieving adaptive calibration of the morning and evening peak time window drift phenomenon and improving the time sensitivity of prediction.
[0027] 3. By adopting a multi-source weighted correction mechanism that combines real-time non-commuting disturbance coefficients, large vehicle proportion trends, and environmental correction coefficients, the traffic flow monitoring system can comprehensively consider the impact of multiple factors such as sudden traffic flow disturbances, vehicle type structure differences, weather conditions, and downstream road network feedback on traffic efficiency. This effectively solves the problem of poor robustness of traditional linear prediction models in complex and ever-changing real traffic environments, thereby enabling dynamic and comprehensive projection of benchmark commuting traffic volume and congestion index for future periods, providing traffic management departments with more practical decision support. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating a dynamic traffic flow prediction method based on multi-source data fusion in an embodiment of this application.
[0029] Figure 2 This is another flowchart illustrating the dynamic traffic flow prediction method based on multi-source data fusion in this application embodiment;
[0030] Figure 3 This is a schematic diagram of the physical device structure of a traffic flow monitoring system in the embodiments of this application. Detailed Implementation
[0031] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions a, an, the above, the, and this are intended to also include the plural expressions unless the context clearly indicates otherwise. It should also be understood that the terms used in this application refer to any or all possible combinations that include one or more of the listed items.
[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0033] In the specific implementation scenario of this application, the target road segment typically refers to urban arterial roads, expressway entrances and exits, or key road sections connecting core functional areas. These road segments exhibit significant tidal traffic flow characteristics during morning and evening rush hours. Multidimensional visual features refer to attribute information extracted from the video stream, excluding the number of vehicles, including but not limited to vehicle color distribution (such as the uniform color scheme of taxis and common colors of private cars), size proportions (distinguishing between sedans, SUVs, buses, and trucks), and lane occupancy. The historical commuting fingerprint database is a database built based on long-term historical data, storing typical spatiotemporal distribution patterns of traffic flow under different date types (such as weekdays, weekends, and rainy days), similar to a biometric fingerprint, used to uniquely identify a specific traffic flow state. The real-time phase anchor point refers to the most similar time point in the historical fingerprint database corresponding to the traffic flow characteristics at the current moment. It may deviate from the current physical time (for example, if today's evening rush hour starts 15 minutes earlier than usual, the phase anchor point corresponding to the physical time 17:30 may be the historical average of 17:45). Baseline commuter traffic volume refers to the theoretically predicted traffic flow derived from historical patterns under conditions free from extreme anomalies. The traffic congestion index, on the other hand, is a quantitative indicator that comprehensively reflects the degree of road congestion, typically correlated with vehicle speed, queue length, and road saturation. Through these mechanisms, this application aims to utilize low-cost surveillance video data to mine deeper traffic flow pattern information, thereby achieving accurate short-term traffic forecasting.
[0034] The following describes the process of the method provided in this implementation. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a dynamic traffic flow prediction method based on multi-source data fusion in an embodiment of this application.
[0035] S101: Receive real-time video streams from surveillance cameras on the target road segment.
[0036] Among them, surveillance cameras refer to video acquisition devices deployed on poles or gantries along the side of the road, used to continuously capture traffic conditions across a road cross-section. Real-time video streams represent a continuous sequence of image frames captured and transmitted by the camera, typically using encoding formats such as H.264 or H.265.
[0037] Specifically, the traffic flow monitoring system receives video signals from roadside surveillance cameras in real time via a network interface. This step typically continues after the system starts up, serving as the data input source for the entire prediction process. The system decodes and preprocesses the received video stream, performing tasks such as noise reduction and image enhancement to ensure the quality of subsequent feature extraction. The system acquires image frames at preset time intervals (e.g., 25 frames per second) to ensure the real-time nature and continuity of the data.
[0038] In some embodiments, video stream reception can be achieved in several ways: Optionally, the system can directly connect to the network camera (IPC) via the RTSP (Real Time Streaming Protocol) to obtain the raw bitstream and perform software decoding; alternatively, the system can connect to the video aggregation platform of the traffic management department and retrieve historical or real-time video stream data of a specified channel via the GB / T 28181 standard protocol. It is understood that edge computing nodes can also be used to directly read the analog signals from the camera on the roadside and digitize them; this is not limited here.
[0039] In some embodiments, video streams may experience frame drops or delays due to network fluctuations. To address this, the system sets up a buffer and timestamp alignment mechanism. When the frame drop rate exceeds a preset threshold, it automatically triggers a frame interpolation algorithm or requests a retransmission. If the delay is too large, expired frames are discarded, and the latest arriving key frames are processed first to ensure the timeliness of the prediction results.
[0040] S102. Extract multi-dimensional visual features from the vehicles passing through the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes.
[0041] Multidimensional visual feature extraction refers to the process of parsing vehicle appearance attributes from images using computer vision algorithms. Real-time traffic flow spatiotemporal attribute sequences represent a data set arranged chronologically, describing the attributes and spatial locations of passing vehicles.
[0042] Specifically, the traffic flow monitoring system performs target detection on each frame of the image, identifying all vehicle targets in the scene. For each detected vehicle, the system further analyzes its pixel features in the image, extracting vehicle visual attributes such as color information (e.g., RGB mean or HSV histogram), size information (e.g., aspect ratio and area percentage of the detection box), and location information (e.g., the lane number corresponding to the image area where the vehicle's center point is located). The system sorts and aggregates these discrete single-vehicle features according to the timestamp of the vehicle's passage, forming a continuous time series data. This series not only records that vehicles passed, but also records what kind of vehicles passed in which lanes.
[0043] In some embodiments, feature extraction can be achieved in several ways: Optionally, an improved YOLOv5 network can be used to simultaneously output vehicle detection boxes and vehicle categories (cars, trucks, buses), and OpenCV can be combined for color space transformation to extract the dominant color tone; alternatively, a multi-task convolutional neural network (Multi-task CNN) can be used to simultaneously predict the vehicle's bounding box, vehicle type, color attribute, and lane affiliation during a single forward inference process. It is understood that this can also be achieved by combining traditional background modeling methods with optical flow methods to extract moving target features; this is not limited here.
[0044] In some embodiments, inaccurate color feature extraction may occur due to nighttime or insufficient lighting. To address this, the system enables a nighttime enhancement mode, reducing the weight of color features in sequence matching and instead increasing the weight of vehicle size (estimated through headlight spacing) and lane driving behavior features to maintain the robustness of the feature sequence.
[0045] S103. Retrieve historical traffic flow data for the target road segment, perform cluster analysis on the spatiotemporal distribution patterns of traffic flow attributes within the historical period, and construct a historical commuting fingerprint database containing typical commuting traffic flow modes.
[0046] Historical traffic flow data refers to the sequence of traffic flow attributes stored over a past period (such as the past three months) for that road segment. Cluster analysis is an unsupervised learning process that groups similar data objects into the same cluster. Typical commuter traffic flow modalities represent representative, recurring combinations of traffic flow features (such as Monday morning rush hour pattern, rainy evening rush hour pattern).
[0047] Specifically, the traffic flow monitoring system periodically (e.g., weekly or monthly) performs offline data mining on accumulated historical data. The system segments the historical data by day or time period, extracting statistical features of traffic flow attributes for each time period. Subsequently, clustering algorithms (such as K-Means or DBSCAN) are used to group these historical segments and identify patterns with significant commonalities. For example, all weekday morning rush hour data under sunny weather are clustered into one class, and its centroid is extracted as the fingerprint of that pattern. The resulting fingerprint database contains standard traffic flow evolution templates for various typical scenarios, serving as a reference benchmark for subsequent real-time matching.
[0048] In some embodiments, the fingerprint database can be constructed in several ways: Optionally, a time-series clustering algorithm (such as K-Means based on DTW distance) can be used to directly cluster multidimensional attribute sequences and extract the center sequence of each cluster as the fingerprint; alternatively, historical data can be first transformed into high-dimensional feature vectors (such as through an autoencoder), clustered in the feature space, and then the cluster centers can be decoded to restore the spatiotemporal attribute sequences. It is understood that a fingerprint database can also be constructed using a combination of manually labeled typical days and automatic correction, which is not limited here. In some embodiments, historical patterns may become invalid due to changes in urban planning (i.e., concept drift). To address this, the system introduces a forgetting factor mechanism, giving higher weight to recent data when constructing the fingerprint database and periodically removing outdated historical data to ensure that the fingerprint database reflects the latest traffic flow characteristics.
[0049] S104. Using an elastic matching algorithm based on key feature points, calculate the similarity between the real-time traffic flow spatiotemporal attribute sequence and each fingerprint pattern in the historical commuting fingerprint database, and determine the real-time phase anchor point of the current traffic flow in the historical commuting cycle.
[0050] Elastic matching algorithms, such as Dynamic Time Warping (DTW), allow sequences to be non-linearly scaled and aligned along the time axis. Similarity represents the degree of closeness between two sequences in terms of both morphology and numerical value. Real-time phase anchors are used to pinpoint the relative position of the current moment within the historical evolutionary pattern.
[0051] Specifically, the traffic flow monitoring system compares the currently collected real-time traffic flow spatiotemporal attribute sequence (e.g., data from the past 30 minutes) with various patterns in the fingerprint database. Since actual traffic flow may be faster or slower than the historical average due to congestion or weather conditions, the system uses an elastic matching algorithm to find the optimal alignment. The system calculates the matching score between the real-time sequence and each fingerprint pattern at different time offsets. The fingerprint pattern with the highest score (smallest difference) and its corresponding time point are identified as the current phase anchor point. This means the system determines that the current traffic flow state most closely resembles the performance of a certain historical pattern at a given moment.
[0052] In some embodiments, phase anchor points can be determined in several ways: Optionally, a sliding window method can be used, sliding the real-time sequence over a long historical sequence, calculating the Euclidean distance or cosine similarity, and taking the position corresponding to the minimum value; alternatively, a matching method based on the longest common subsequence (LCSS) can be adopted, focusing on the overlap of key vehicle sequences and ignoring noise interference. It is understood that an attention mechanism based on the Transformer model can also be used to calculate the correlation matrix between sequences, which is not limited here. In some embodiments, there may be situations where the real-time sequence is too short, leading to non-unique matching results (multiple solutions). To address this, the system will combine the current macroscopic time information (e.g., it is Monday morning at 8 AM) as a priori constraint, limiting the search range to a certain neighborhood of physical time (e.g., one hour before and after), thereby eliminating unreasonable matching results.
[0053] S105. Based on real-time phase anchor points, retrieve the evolution trend of subsequent traffic flow in the historical commuting fingerprint database, and calculate the baseline commuting traffic volume of the target road segment in a preset future time period.
[0054] Among them, traffic flow evolution trend refers to the trajectory of traffic flow attributes changing over time from a certain moment. Baseline commuter traffic volume refers to the theoretically predicted value calculated based on historical patterns.
[0055] Specifically, once the real-time phase anchor point is determined, the system is essentially finding its current location on a historical map. Next, the system directly reads the sequence data following the phase anchor point in the best-matching fingerprint pattern. This subsequent data represents the future trend of traffic flow under typical historical scenarios. The system statistically analyzes indicators such as the number of vehicles and vehicle type composition in this historical sequence, using them as baseline predictions for future time periods (such as the next 15 or 30 minutes). The core of this step lies in using the continuity of history to fill in the unknowns of the future.
[0056] In some embodiments, baseline traffic volume can be calculated in several ways: optionally, the subsequent sequence traffic of the best matched fingerprint pattern can be directly taken as the predicted value; alternatively, the top-K fingerprint patterns with the highest similarity can be selected, and the weighted average of their subsequent sequences can be extracted as a more robust baseline traffic volume. It is understood that a generative adversarial network (GAN) trained based on phase anchors can also be used to generate future traffic sequences, which is not limited here. In some embodiments, there may be situations where the historical fingerprint database lacks patterns that match the current extreme situation (such as a severe rainstorm). In response, the system calculates the matching confidence score. When the confidence score is lower than a threshold, it automatically downgrades to a backup prediction strategy based on real-time trend extrapolation (such as exponential smoothing) and issues a low-confidence alarm.
[0057] S106. Combining the physical traffic capacity of the target road segment, the real-time non-commuting disturbance coefficient, and the baseline commuting traffic volume, the traffic congestion index of the target road segment in the preset future time period is deduced.
[0058] Physical capacity refers to the maximum number of vehicles that a road can handle per unit of time under specific conditions. Real-time non-commuting disturbance coefficient is used to quantify the impact of current irregular factors on traffic flow. The traffic congestion index is a comprehensive indicator for evaluating the service level of road operations.
[0059] Specifically, the traffic flow monitoring system not only relies on historically extrapolated baseline traffic volumes but also considers current real-time disturbances and road physical constraints. The system multiplies the baseline traffic volume by a real-time non-commuting disturbance coefficient to obtain a more accurate predicted flow. Then, it compares the corrected flow with the road's physical capacity to calculate saturation (V / C ratio). Finally, combining the saturation with historical speed data, a traffic congestion index (e.g., a value from 0 to 10, with higher values indicating greater congestion) is obtained through a pre-defined mathematical model.
[0060] In some embodiments, the congestion index can be extrapolated in several ways: Optionally, the BPR (Bureau of Public Roads) road resistance function can be used, with predicted traffic flow and capacity as input, to calculate the travel time of road segments and then convert it into a congestion index; alternatively, a random forest-based regression model can be constructed, with baseline traffic flow, disturbance coefficients, weather factors, etc., as input, to directly output a congestion level classification. It is understood that microscopic traffic simulation software can also be used to extrapolate future congestion conditions online, and this is not limited here.
[0061] In some embodiments, there may be situations where the physical capacity of a road is temporarily altered due to an accident or construction. In response, the system will connect to the traffic police department's event reporting interface or use video analytics to detect abnormal parking events and dynamically adjust physical capacity parameters (such as reducing the number of lanes) to ensure the accuracy of congestion index calculations.
[0062] In the above embodiments, although the elastic matching algorithm can find real-time phase anchor points, in practical applications, relying solely on the similarity matching of the overall sequence may lead to positioning errors due to random noise from ordinary vehicles. For example, two completely different time periods may be misjudged as similar because the total number of vehicles is similar. To solve this problem, a more discriminative matching mechanism is needed that can capture the skeletal features in the traffic flow, thereby achieving more accurate time positioning.
[0063] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the dynamic traffic flow prediction method based on multi-source data fusion in this application embodiment.
[0064] S201: Receive real-time video streams from surveillance cameras on the target road segment.
[0065] Refer to step S101, which will not be repeated here.
[0066] S202. Extract multi-dimensional visual features from vehicles passing through the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes.
[0067] Refer to step S102, which will not be repeated here.
[0068] In some embodiments, the traffic flow monitoring system performs step S202 in the following manner: the traffic flow monitoring system captures the central region image of the vehicle detection box in the video frame of the real-time video stream, calculates the hue feature value of the central region image in the HSV color space to determine the color code; calculates the pixel ratio and aspect ratio of the vehicle detection box in the video frame to determine the vehicle type classification code; identifies the road lane number where the center point of the vehicle detection box is located and generates the lane position code; integrates the color code, vehicle type classification code and lane position code into a single vehicle feature coding unit, and splices multiple single vehicle feature coding units in time sequence to form a real-time traffic flow spatiotemporal attribute sequence.
[0069] In this context, the vehicle detection box refers to the rectangular boundary output by the object detection algorithm when it locates a vehicle in a video frame. The center region image is a small patch of image cropped from the center of the detection box to reduce background and halo interference. The HSV color space is a color space that represents points in the RGB color model in cylindrical coordinates, and its hue (H) component has good robustness to changes in illumination. Pixel ratio and aspect ratio are two geometric features describing the size and shape of a vehicle. A single-vehicle feature encoding unit is a structured data record that encapsulates all the extracted features of a single vehicle.
[0070] Specifically, for each frame in the video stream, the traffic flow monitoring system first runs a target detector to obtain vehicle detection boxes. For each detection box, the system extracts a 50%x50% area of its center, converts it from RGB to HSV space, calculates the histogram of the H components of all pixels within that area, takes the H value corresponding to the peak value as the vehicle's dominant color, and then quantizes it into a discrete color code. Simultaneously, the system calculates the ratio of the detection box area to the entire frame's image area as the pixel percentage, and calculates its aspect ratio as the length-to-width ratio. Based on the combination of these two values, and by consulting a preset threshold table, it determines the vehicle type classification code (e.g., small car, medium car, large car). Next, the system maps the pixel coordinates of the detection box's center point to the actual road lane number using a pre-calibrated perspective transformation matrix, generating a lane position code. Finally, the system integrates the timestamp, color code, vehicle type classification code, and lane position code into a single vehicle feature encoding unit and appends it to the end of the real-time traffic flow spatiotemporal attribute sequence.
[0071] In some embodiments, this step can be implemented in several ways: Optionally, a step-by-step processing pipeline can be used. The traffic flow monitoring system sequentially calls independent OpenCV function libraries or modules to complete various operations: first, the YOLO model is loaded using cv2.dnn.readNet for detection; then, image cropping, cv2.cvtColor color space conversion, cv2.calcHist histogram calculation for each bounding box, geometric calculations and coordinate transformations are performed; finally, the results are stored in a data structure. Optionally, an end-to-end deep learning model can be constructed. This model is designed for multi-task output, with video frames as input and output including not only detection bounding boxes but also directly including quantized color codes, vehicle type codes, and lane codes. These tasks share a feature extraction layer within the network and are output through different prediction heads, achieving integrated and efficient feature extraction. It is understood that other computer vision techniques can also be combined to achieve this, which is not limited here.
[0072] In some embodiments, differences in camera angle or installation height can cause vehicles of the same type to appear with varying pixel ratios and aspect ratios in images, affecting the accuracy of vehicle classification. To address this, the traffic flow monitoring system performs a camera self-calibration procedure during initial deployment. The operator selects several standard-sized vehicles (such as a regular sedan) in the frame, and the system automatically learns a normalization factor based on this selection. In subsequent feature extraction, all calculated pixel ratios and aspect ratios are first multiplied by this normalization factor for correction, thereby eliminating measurement biases caused by differences in camera parameters and ensuring the consistency and comparability of vehicle classification codes across different monitoring locations.
[0073] S203. Retrieve historical traffic flow data for the target road segment, perform cluster analysis on the spatiotemporal distribution patterns of traffic flow attributes within the historical period, and construct a historical commuting fingerprint database containing typical commuting traffic flow modes.
[0074] Refer to step S103, which will not be repeated here.
[0075] S204. In the real-time traffic flow spatiotemporal attribute sequence, select backbone vehicle nodes with high recognizability.
[0076] Among them, backbone vehicle nodes refer to vehicles in traffic flow that have rare, unique, or easily identifiable features, which enable them to serve as salient markers in sequence matching. High identifiability means that the visual features (such as size and color) of these vehicles are significantly different from ordinary private cars (usually medium-sized, black, white, and gray), such as buses, large trucks, taxi fleets of specific colors, or brightly colored sports cars.
[0077] Specifically, after the traffic flow monitoring system generates a real-time traffic flow spatiotemporal attribute sequence, this step is performed to perform structured annotation on the sequence. The traffic flow monitoring system traverses each single-vehicle feature coding unit in the sequence. For each unit, the traffic flow monitoring system checks its internal vehicle type classification code and color code. According to a preset rule base, if the vehicle type classification code indicates a large-size category such as a large passenger vehicle or a heavy-duty truck, or if the color code falls into a predefined special color range such as yellow or green, or conforms to a specific color combination pattern, then the single-vehicle feature coding unit is marked as a backbone vehicle node. These marked nodes are extracted to form a temporally ordered but relatively sparse backbone sequence for subsequent coarse-grained matching.
[0078] In some embodiments, the selection of backbone vehicle nodes can be implemented in several ways: Optionally, a rule-based hard-coded selection logic can be used. The traffic flow monitoring system maintains a backbone vehicle definition table, which explicitly specifies the set of vehicle type classification codes and color codes that trigger backbone node marking. When traversing the real-time sequence, the code of each vehicle is matched against the table, and vehicles that meet either rule are selected. For example, the rule can be defined as: vehicle type code > T_size or color code IN{C_1, C_2, ...}, where T_size is the size threshold that distinguishes between large and small, and C_i is the code for a special color. Optionally, a statistical anomaly detection method can be used. The traffic flow monitoring system first establishes a multidimensional Gaussian mixture model (GMM) for all vehicle features (size, color, etc.) over a period of time. This model represents the feature distribution of ordinary vehicles. When processing the real-time sequence, the probability of each vehicle feature belonging to this GMM is calculated. Vehicles with a probability value lower than a certain threshold are considered statistical outliers, i.e., they have high identifiability, and are therefore selected as backbone vehicle nodes.
[0079] In some embodiments, some vehicles may be misclassified as backbone vehicles due to feature extraction errors caused by lighting, angle, or occlusion (e.g., a white sedan appears yellowish under certain lighting conditions) or missed (e.g., a bus is partially obscured by a truck in front, causing its size to be calculated as smaller). To address this, the traffic flow monitoring system implements a temporal consistency-based verification mechanism. For a vehicle initially identified as a backbone node, the system checks its entire tracked trajectory in the video. Only when the vehicle consistently exhibits backbone features across multiple consecutive frames (e.g., more than 70% of the tracked frames) is it definitively confirmed as a backbone vehicle node. Conversely, vehicles with unstable features are classified as ordinary vehicle nodes, thereby enhancing the reliability of the screening results.
[0080] S205. Using backbone vehicle nodes as time calibration anchors, perform coarse-grained timeline alignment in the fingerprint patterns of the historical commuting fingerprint database to determine candidate historical segments.
[0081] In this context, the time calibration anchor points are the backbone vehicle node sequences selected in step S204, which serve as reference points for alignment on the timeline. Coarse-grained timeline alignment is a fast, imprecise matching process aimed at quickly narrowing the search range within a vast amount of historical data by utilizing sparse but significant backbone node sequences. Candidate historical segments refer to several time intervals in the historical fingerprint pattern where the backbone vehicle sequences exhibit high similarity to the real-time backbone sequences.
[0082] Specifically, this step is performed after obtaining the real-time backbone vehicle node sequence. The traffic flow monitoring system performs pattern matching on this real-time backbone sequence with the backbone sequence pre-stored for each fingerprint pattern in the historical commuting fingerprint database. The core of the matching algorithm is to find the similarity of the type and order of occurrence of backbone vehicles, while having a certain tolerance for the time interval between them. For example, if the real-time sequence is bus-taxi-truck, the system will look for segments in the historical fingerprints that contain similar subsequences bus-...-taxi-...-truck. All historical segments with matching scores higher than a preset threshold, along with a certain range of time windows around them, are identified as candidate historical segments and passed to the next step for refined analysis.
[0083] In some embodiments, coarse-grained timeline alignment can be achieved in several ways: Optionally, an algorithm based on sequence edit distance can be used. The traffic flow monitoring system compares the real-time backbone sequence with historical backbone sequences and calculates the minimum number of operations (insertion, deletion, replacement) required to transform one sequence into another, i.e., the edit distance. The smaller the edit distance, the more similar the two sequences are. The system selects historical positions with edit distances less than a certain threshold as the centers of candidate segments. Optionally, a hash-based index lookup method can be used. The traffic flow monitoring system hashes all consecutive backbone node subsequences (N-grams) of length N (e.g., N=3) in the historical fingerprint database and builds an inverted index that maps hash values to all their occurrence positions in historical fingerprints. During matching, the system also hashes the real-time backbone sequence using N-grams and then uses the index to quickly find all potential matching positions, which constitute candidate historical segments. Understandably, a natural language processing model that treats the backbone sequence as a special kind of vocabulary can also be used to find matching segments through word embedding and similarity calculation; this is not limited here.
[0084] In some embodiments, due to the randomness of traffic, the real-time backbone sequence may not find a completely matching pattern in historical data, resulting in the inability to determine any candidate segments. To address this, the traffic flow monitoring system employs a hierarchical backtracking matching strategy. It first attempts a complete match; if this fails, the matching conditions are relaxed. For example, it allows for some confusion in the types of backbone nodes (e.g., treating all large vehicles as the same type), or it matches only some key nodes in the sequence (e.g., matching only buses). If this still fails, the system further backtracks to matching solely based on the density of backbone nodes, i.e., searching for time periods in history where the frequency of backbone vehicle occurrence is similar to the current time. This progressively relaxed constraint approach ensures that one or more least satisfactory candidate historical segments are always found.
[0085] S206. Within the time window of the candidate historical segment, calculate the histogram similarity of ordinary vehicle nodes in terms of lane distribution and color distribution.
[0086] In this context, "ordinary vehicle nodes" refers to all other vehicles not selected as backbone vehicle nodes in step S204. "Lane distribution" refers to the distribution of the number of these ordinary vehicles across all lanes. "Color distribution" refers to the distribution of the number of ordinary vehicles within a preset color category (e.g., black, white, gray, red, blue, etc.). "Histogram similarity" is a numerical indicator used to measure the closeness between two histograms (representing two distributions in this case).
[0087] Specifically, after identifying candidate historical segments, the traffic flow monitoring system performs this step for each segment. The system first defines a time window centered on a coarse-grained alignment point (e.g., 5 minutes before and after). Then, for real-time data, the system statistically analyzes all ordinary vehicle nodes within this window and generates two normalized histograms: one representing the proportion of vehicles in each lane (lane distribution histogram), and the other representing the proportion of vehicles of each color (color distribution histogram). Similarly, the system performs the same operation for the corresponding time window within the candidate historical segments, generating their historical lane distribution and color distribution histograms. Finally, the system uses one or more metrics (such as histogram intersection, chi-square distance, etc.) to calculate the similarity between the real-time histogram and the historical histogram.
[0088] In some embodiments, there is a problem where the color classification standard remains fixed, while the actual color composition of traffic flow systematically changes with seasons or time (e.g., daytime and evening), leading to a decrease in the comparability of color histograms. To address this, the traffic flow monitoring system employs dynamic color binning technology. Before calculating similarity, the system does not use a fixed color classification. Instead, it performs a fast one-dimensional clustering (e.g., K-Means) on the color values of all ordinary vehicles within the current time window (e.g., H values in HSV space) to obtain K color centers. Then, the system uses these K dynamically generated color centers as containers for the histogram to construct color distribution histograms for both real-time and historical data. This ensures that comparisons are always performed on the most representative colors in the current traffic flow, improving the effectiveness of color distribution similarity calculation.
[0089] S207. Select the historical time point with the highest histogram similarity as the real-time phase anchor point, and calculate the time deviation between the current system time and the real-time phase anchor point.
[0090] The real-time phase anchor point is the final, determined historical time coordinate that best matches the current real-time traffic flow state. It consists of a fingerprint ID and a specific time point. The time deviation refers to the difference between the current physical clock time and the historical time represented by the real-time phase anchor point. This value reflects whether the current traffic rhythm is ahead or behind the historical average.
[0091] Specifically, this step is performed after the histogram similarity calculation for all candidate historical segments is completed. The traffic flow monitoring system integrates lane distribution similarity and color distribution similarity to calculate a total fine-grained matching score (e.g., through weighted averaging) for each candidate historical segment. Subsequently, the system selects the historical time point with the highest total score from all candidate segments. This time point is officially determined as the current real-time phase anchor point. After determining the anchor point, the system immediately performs a subtraction operation: subtracting the timestamp of the real-time phase anchor point from the current system timestamp (e.g., if the current time is 17:30 and the anchor point is 17:45 on a historical day, the time deviation is -15 minutes), and storing this deviation value for subsequent prediction and analysis.
[0092] In some embodiments, due to measurement noise or the inherent randomness of traffic flow, continuously calculated phase anchor points may exhibit illogical and drastic jumps on the timeline (e.g., one minute at 17:30, the next suddenly jumping to 18:00). To address this, the traffic flow monitoring system applies a time-smoothing filter, such as a Kalman filter, to track and predict the time deviation of the phase anchor points. Each newly calculated phase anchor point is treated as a noisy observation. The Kalman filter combines the state estimate from the previous moment with the current observation to provide a smoother and more reliable estimate of the current phase anchor point state, effectively suppressing noise and making the evolution trajectory of the phase anchor points smoother and more physically accurate.
[0093] In some embodiments, after determining the real-time phase anchor point in step S207, in order to quantify non-periodic traffic disturbances, the traffic flow monitoring system extracts discrete difference feature vectors from the real-time traffic flow spatiotemporal attribute sequence that fail to match the fingerprint pattern, constructs a non-commuting residual sequence, calculates the traffic density of the non-commuting residual sequence, and calculates the deviation of the traffic density from the historical benchmark density for the same period; inputs the deviation into a preset disturbance gain model to generate real-time non-commuting disturbance coefficients.
[0094] Discrete difference feature vectors refer to vehicle nodes that exist in the real-time sequence but are missing at their corresponding positions in the historical sequence, or whose feature differences exceed a threshold, after aligning the real-time sequence with the best-matching historical fingerprint sequence. The non-commuter residual sequence is a new sequence composed of these difference feature vectors, representing unexpected components in the current traffic flow. The perturbation gain model is a function or model used to map the statistical characteristics (deviation) of the residual sequence to a coefficient that can correct the predicted traffic volume.
[0095] Specifically, after determining the real-time phase anchor point and completing the flexible alignment of the real-time sequence with the historical fingerprint, the traffic flow monitoring system compares the two sequences on the alignment path point by point. If a vehicle node in the real-time sequence has no matching object at the corresponding position in the historical sequence (i.e., an insertion operation), or if there is a matching object but their characteristics (such as vehicle type and color) are significantly different, the real-time vehicle node is regarded as a residual term, and its feature vector is extracted. All these residual terms constitute the non-commuting residual sequence in chronological order. Next, the system calculates the traffic density of the residual sequence per unit time (i.e., residual vehicle number / hour) and queries the historical database to obtain the average residual baseline density for the same time period (e.g., Monday morning rush hour 8:00-8:15). The system calculates the deviation of the current density from the baseline density. Finally, this deviation value is input into a preset disturbance gain model (e.g., a piecewise linear function or a small neural network), and the output is the real-time non-commuting disturbance coefficient.
[0096] In some embodiments, this step can be implemented in several ways: Optionally, residual extraction based on Dynamic Time Warping (DTW) paths can be used. When calculating DTW, the optimal alignment path is recorded. The path is traversed, and the real-time sequence points corresponding to the insertion operation are identified as residuals. Then, statistics and deviation calculations are performed, and finally, the perturbation coefficient is generated using a lookup table or a simple linear function coefficient = 1 + gain * deviation. Optionally, difference analysis based on set theory can be used. The real-time sequence and the aligned historical sequence fragments are considered as multiple sets of two vehicle features. The symmetric difference set of the two sets is calculated, and the elements in this difference set are the residual vehicles. The number and attributes of the elements in the difference set are statistically analyzed, and their difference from the historical average residual set is calculated. Then, a pre-trained regression model (such as Support Vector Regression, SVR) is used to predict the perturbation coefficient.
[0097] In some embodiments, residual sequences may arise from diverse causes (such as abnormal traffic flow due to accidents or temporary traffic flow caused by large events), and a single disturbance coefficient may not be sufficient to distinguish their different impact patterns on traffic. To address this, the traffic flow monitoring system performs secondary clustering analysis on non-commuter residual sequences. The system extracts features of residual vehicles (vehicle type, direction of origin, degree of clustering, etc.) and clusters these features to identify inherent patterns in the residuals (e.g., a clustering pattern of numerous out-of-town license plate cars may correspond to tourist traffic, while a pattern of multiple construction vehicles passing continuously may correspond to nighttime construction). Based on the identified residual patterns, the system selects a specific disturbance gain model corresponding to the pattern from a pattern library to calculate the disturbance coefficient, thereby achieving differentiated and accurate modeling of different types of disturbances.
[0098] S208. Starting from the real-time phase anchor point, extract the historical traffic flow evolution sequence for a preset future time period from the historical commuting fingerprint database.
[0099] The real-time phase anchor point refers to the historical moment most similar in statistical characteristics to the current real-time traffic flow state, as determined in step S207. It consists of a unique identifier (ID) for a fingerprint pattern and a specific timestamp. The starting point here is the timestamp of the real-time phase anchor point. The historical commuting fingerprint database is a structured database storing various typical traffic patterns. The preset future time period is a configurable time length parameter that defines the target time range for prediction, such as 15 minutes or 30 minutes. The historical traffic flow evolution sequence refers to a continuous segment of multi-dimensional traffic flow attribute data extracted from the historical fingerprint database. This data segment describes the complete traffic flow dynamic process from the starting point within the preset future time period.
[0100] Specifically, this step is triggered after the traffic flow monitoring system successfully locates a high-confidence real-time phase anchor point. This anchor point provides two key pieces of information: an index pointing to a specific fingerprint pattern in the historical commuting fingerprint database, and a precise time coordinate on the timeline of that pattern. The traffic flow monitoring system first loads the corresponding complete historical fingerprint sequence from the database based on this index. Then, using the anchor point's time coordinate as the start time and a preset future time period as the end time, the system performs a time-range query operation on this historical fingerprint sequence. This operation returns a subsequence containing the feature encoding units of all vehicles passing through the monitoring section within the specified historical time window. This extracted historical data fragment, rich in microscopic information, is the historical traffic flow evolution sequence, which will serve as the basic template for predicting future traffic conditions.
[0101] In some embodiments, historical traffic flow evolution sequences can be extracted in several ways: Optionally, a sequence fusion method based on ensemble learning can be used. The traffic flow monitoring system does not simply use the single phase anchor with the highest similarity, but selects the top K candidate anchors based on similarity. The system extracts the subsequent historical traffic flow evolution sequences for each of these K anchors, forming K independent candidate sequences. Then, a weighted average is calculated on the features (such as traffic volume and vehicle type distribution) of these K sequences at each time step, with the weights determined based on the similarity scores between each candidate anchor and the real-time sequence. This method of fusion generates a comprehensive and more robust historical traffic flow evolution sequence, reducing the impact of the randomness of single historical data. Optionally, a sequence inference method based on generative models can be used. The traffic flow monitoring system can pre-train a conditional generative model, such as a conditional variational autoencoder (C-VAE) or a Transformer-based sequence generation model. This model uses real-time phase anchors (fingerprint ID and time) as conditional inputs to directly generate a novel future time-period traffic flow evolution sequence that conforms to the statistical regularity under those conditions. This method can create smooth and logical evolutionary patterns that may never have appeared in their entirety in history.
[0102] S209. Statistical analysis of the total number of vehicles passing through and the trend of the proportion of large vehicles in the historical traffic flow evolution sequence.
[0103] The total number of vehicles passing through refers to the sum of vehicle nodes included in the historical traffic flow evolution sequence extracted in step S208. The trend of large vehicle proportion refers to the proportion of large vehicles to the total traffic flow in the time segment (e.g., every 5 minutes) of the sequence, and observing the pattern of this proportion changing over time.
[0104] Specifically, after extracting the historical traffic flow evolution sequence, the traffic flow monitoring system analyzes this sequence. First, the system traverses the entire sequence, counting the individual vehicle feature coding units it contains to obtain the total number of vehicles passing through within a preset future time period. Second, the system divides the sequence into multiple sub-segments at fixed time intervals (e.g., 5 minutes). For each sub-segment, the system counts the number of large vehicles (determined by vehicle type classification codes) and the total number of vehicles, and calculates the proportion of large vehicles. Connecting these time-series proportion values constitutes the trend sequence of large vehicle proportion. These two results—the total number and the proportion trend—will be used for the next step of traffic volume adjustment.
[0105] In some embodiments, statistics can be implemented in several ways: Optionally, the sequence data structure can be directly iterated and counted. The traffic flow monitoring system loads the historical evolution sequence and initializes the total counter and large vehicle counter to zero. For each vehicle record in the sequence, the total counter is incremented by one, and the vehicle type code is checked; if it is a large vehicle, the large vehicle counter is also incremented by one. After completing the iteration, the total number and the total number of large vehicles are obtained. The proportion trend is obtained by performing this process in segments. Optionally, database query functionality can be utilized. If the historical sequence is stored in a time-series database, the traffic flow monitoring system can construct an SQL query statement to efficiently aggregate the required statistics directly from the database.
[0106] In some embodiments, incomplete or incorrect vehicle type labeling in historical sequences can lead to inaccurate statistics on the proportion of large vehicles. To address this, the traffic flow monitoring system employs a cross-validation statistical method. When counting large vehicles, the system relies not only on vehicle type classification codes but also checks the vehicle's size codes (e.g., pixel ratio and aspect ratio). A vehicle is only counted as a large vehicle if both its vehicle type classification code and size code meet the criteria for a large vehicle. This dual-condition checking mechanism effectively filters out statistical biases caused by errors in a single feature, improving the accuracy of the large vehicle proportion trend.
[0107] S210. Based on the real-time non-commuting disturbance coefficient and the trend of the proportion of large vehicles, the total number of vehicles passing through is weighted and corrected to obtain the baseline commuting traffic volume of the target road segment in the preset future time period.
[0108] The real-time non-commuting disturbance coefficient is a quantitative indicator reflecting the abnormal increase or decrease in current traffic flow relative to historical commuting patterns. This coefficient is calculated in previous steps by analyzing the residual sequence. The large vehicle proportion trend refers to the time series of the proportion of large vehicles to total traffic flow within a preset future time period, as statistically analyzed in step S209. The total number of vehicles passing through is the original number of vehicles directly statistically analyzed from the historical traffic flow evolution sequence. The baseline commuting traffic volume is the final theoretical prediction of traffic flow for the future time period, obtained after multiple corrections, and is measured in passenger vehicle units (PCUs) or other standardized units.
[0109] Specifically, this step is performed after obtaining the statistical results of the historical sequence, aiming to combine historical extrapolation with real-time conditions and physical laws. The traffic flow monitoring system performs a two-stage correction calculation. In the first stage, the system handles the impact of vehicle type structure. It decomposes the total number of vehicles in the historical sequence into the number of small vehicles (Nsmal) and the number of large vehicles (Nlarge) based on the trend of large vehicle proportion. Then, using a preset Passenger Vehicle Unit (PCU) conversion factor (e.g., PCU for small vehicles is 1.0, and PCU for large vehicles is 2.5), it calculates the equivalent standard traffic volume represented by the historical sequence: Vpcu = Nsmall * PCUsmall + Nlarge * PCUlarge. In the second stage, the system introduces the impact of real-time disturbances. The equivalent standard traffic volume Vpcu calculated in the first stage is multiplied by the real-time non-commuting disturbance factor. The final product is the baseline commuting traffic volume: Qbase = Vpcu * real-time non-commuting disturbance factor. This result reflects both historical periodicity and the actual occupancy of road capacity by vehicle type composition, and is scaled according to real-time anomalies.
[0110] In some embodiments, weighted correction can be implemented in several ways: Optionally, a refined correction model with time-varying parameters can be used. Instead of using a single average large vehicle proportion, the traffic flow monitoring system divides a preset future time period into multiple smaller time slices (e.g., every 5 minutes). For each time slice i, the system calculates its historical standard traffic volume V(pcu, i). Simultaneously, assuming that the real-time non-commuting disturbance coefficient evolves over time (e.g., decays exponentially), the disturbance coefficient value coeffi_i corresponding to each time slice is calculated. The predicted traffic volume for this time slice is Qi = V(pcu, i) * coeff_i. The final baseline commuting traffic volume is the sum of the predicted volumes for all time slices, Qbase = ∑Qi. This method can more finely characterize the dynamic changes in traffic flow within the prediction period. Optionally, a neural network-based fusion module can be used. The traffic flow monitoring system constructs a small multilayer perceptron (MLP) or recurrent neural network (RNN) as the fusion module. The input to this network includes multiple features: the historical total number of vehicles passing through, the initial value of the real-time non-commuting disturbance coefficient, and the complete trend sequence of the large vehicle proportion. The network learns the complex nonlinear mapping between these input factors and actual traffic volume by training on a large amount of historical data. During prediction, the currently calculated indicators are input into the network, and its output is the final baseline commuter traffic volume.
[0111] In some embodiments, there may be situations where the sources of real-time non-commuting disturbance coefficients (e.g., whether due to the end of a sporting event or a traffic accident) have completely different impact patterns on future traffic evolution. A single multiplicative coefficient cannot distinguish such differences. To address this, the traffic flow monitoring system performs pattern recognition on the residual sequence while calculating the disturbance coefficient, labeling the disturbance with a causal tag (e.g., event-based, activity-based). During the weighted correction in this step, the system selects different correction functions or models based on this causal tag. For example, for activity-based disturbances, whose impact may be long-lasting and stable, the system uses a disturbance coefficient close to a constant; while for event-based (e.g., accident) disturbances, whose impact is usually severe but short-lived, the system uses a disturbance coefficient function that decays rapidly over time. This adaptive correction strategy based on the cause of the disturbance significantly improves the model's prediction accuracy under different abnormal scenarios.
[0112] In some embodiments, after calculating the baseline commuter traffic volume in step S210, in order to further improve the prediction accuracy, the traffic flow monitoring system will acquire meteorological environmental data of the target road segment and the real-time congestion feedback index of the downstream road segment; construct an environmental correction coefficient that includes meteorological damping factors and downstream feedback factors; and perform weighted correction on the baseline commuter traffic volume based on the environmental correction coefficient and the real-time non-commuter disturbance coefficient to obtain the corrected commuter traffic volume.
[0113] The meteorological environmental data includes factors such as rainfall, visibility, and wind speed that affect driving behavior and road capacity. The real-time congestion feedback index for downstream road sections measures traffic pressure at predicted exits; a high index indicates downstream congestion and may lead to traffic backtracking. The environmental correction coefficient is a multiplicative factor that integrates the effects of meteorological and downstream traffic conditions. The corrected commuter traffic volume is the final predicted flow rate after comprehensive correction based on multi-source data.
[0114] Specifically, the traffic flow monitoring system periodically obtains real-time and forecast meteorological data for the target road segment area from the meteorological service platform via an API interface. Simultaneously, it also obtains the calculated real-time congestion index from adjacent downstream monitoring systems within the road network. The system internally maintains multiple mapping functions: for example, one maps rainfall (mm / h) to a meteorological damping factor (a number less than 1), where the heavier the rainfall, the smaller the factor; another maps the downstream congestion index to a downstream feedback factor (also less than 1), where the more congested the downstream area, the smaller the factor. The system multiplies these two factors or combines them through other logical mechanisms to obtain a comprehensive environmental correction coefficient. Finally, the system multiplies the baseline commuter traffic volume by this environmental correction coefficient and the aforementioned calculated real-time non-commuter disturbance coefficient to obtain the final corrected commuter traffic volume.
[0115] In some embodiments, this step can be implemented in several ways: Optionally, a fuzzy logic-based correction system can be used. The traffic flow monitoring system uses meteorological data (such as light rain or heavy fog) and downstream congestion indices (such as smooth traffic, slow traffic, or congestion) as input linguistic variables. Fuzzy reasoning is performed through a series of fuzzy rules defined by traffic experts, ultimately defuzzifying to obtain an accurate environmental correction coefficient value. Optionally, a data-driven multiple regression model can be used. The traffic flow monitoring system uses historical data to train a multiple linear regression or more complex machine learning model with historical prediction errors as the target variable and meteorological data, downstream congestion data, etc., as feature variables. During real-time prediction, current environmental data is input into the model, and the model directly outputs an additive or multiplicative correction value for the baseline traffic volume.
[0116] In some embodiments, there are coupled and nonlinear relationships between different factors affecting traffic, which simple multiplicative corrections cannot accurately capture (for example, light rain itself has little impact, but if downstream congestion occurs simultaneously, the impact will be drastically amplified). To address this, the traffic flow monitoring system constructs a neural network correction module based on an attention mechanism. This module receives baseline commuter traffic volume, real-time non-commuter disturbance coefficients, meteorological factor vectors, and downstream feedback factors as inputs. The attention mechanism learns the interdependencies between different input features and dynamically assigns weights to them. For example, when downstream congestion is detected, the model adaptively increases the attention given to meteorological factors. The network output is the highly nonlinearly fused corrected commuter traffic volume, thus more accurately simulating the complex traffic dynamics under the combined influence of multiple factors.
[0117] S211. Combining the physical capacity of the target road segment, the real-time non-commuting disturbance coefficient, and the baseline commuting traffic volume, the traffic congestion index of the target road segment in the preset future time period is deduced.
[0118] Referring to step S106, the baseline commuter traffic volume here is the value corrected by step S210, making the input of the entire simulation process more accurate.
[0119] In some embodiments, the traffic flow monitoring system performs step S211 in the following manner: the traffic flow monitoring system obtains the physical saturation threshold of the target road segment; calculates the predicted road load rate based on the corrected commuter traffic volume and the physical saturation threshold; retrieves the historical average traffic speed decay rate in the subsequent time period of the real-time phase anchor point from the historical commuter fingerprint database; integrates the predicted road load rate and the historical average traffic speed decay rate, and determines the traffic congestion index through a preset congestion mapping model.
[0120] Physical saturation threshold, or physical capacity, is the maximum number of vehicles a road can handle per unit of time. Predicted road load factor is the ratio of predicted traffic volume to capacity (V / Cratio). Historical average speed decay rate refers to the rate at which the average vehicle speed decreases as traffic volume increases over historical periods, reflecting the deteriorating trend of road service levels. A congestion mapping model is a mathematical or logical model that transforms multiple input indicators into a single congestion index.
[0121] Specifically, the traffic flow monitoring system first reads the physical saturation threshold of the target road segment from its configuration database (this value can be determined by the road segment design parameters). Then, it divides the corrected commuter traffic volume obtained in the previous step by this threshold to calculate the predicted road load factor. Simultaneously, using established real-time phase anchor points, the system retrieves all historical segments corresponding to the time period following each anchor point from the historical database and calculates the average rate of decay of the average traffic speed relative to the free-flow speed in these segments. Finally, the system provides these two key indicators—the predicted road load factor and the historical average traffic speed decay rate—as inputs to a pre-defined congestion mapping model (e.g., a two-dimensional lookup table, a decision tree, or a neural network). This model, after training, can output a standardized traffic congestion index based on the combination of these two inputs.
[0122] In some embodiments, the congestion index, as a single numerical value, may not fully reflect the spatial distribution and dynamic evolution of congestion (e.g., whether it's uniform slow traffic or a fixed congestion bottleneck). To address this, the traffic flow monitoring system generates a congestion cause diagnostic label along with the congestion index. This diagnosis is based on the analysis of input features: if the predicted load rate is high (>0.9) but the historical speed decay rate is normal, the label is flow-type congestion; if the load rate is low but the historical speed decay rate is significant, it may indicate an inherent bottleneck, and the label is bottleneck-type congestion; if the non-commuting residual sequence shows abnormal events, the label is event-type congestion. This output with diagnostic information provides traffic managers with richer decision-making basis for taking targeted traffic management measures.
[0123] In this embodiment, by employing a phase anchor point determination method based on multi-dimensional visual feature extraction and historical commuting fingerprint database matching, and a two-stage elastic matching algorithm based on backbone vehicle nodes, the traffic flow monitoring system can deeply perceive the micro-composition pattern of traffic flow and accurately locate the evolution stage of the current traffic flow in the commuting cycle by utilizing historical patterns. This effectively solves the problems of insufficient prediction accuracy caused by relying solely on total statistics while ignoring traffic flow structural features, and matching failure caused by time axis offset when relying solely on timestamps for prediction. Thus, it achieves high-precision and robust prediction of traffic congestion evolution trends during peak commuting periods without needing to identify specific vehicle identity privacy information.
[0124] The traffic flow monitoring system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 3 This is a schematic diagram of the physical device structure of a traffic flow monitoring system in this application embodiment.
[0125] It should be noted that, Figure 3 The structure of the traffic flow monitoring system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0126] like Figure 3 As shown, the traffic flow monitoring system includes a CPU 301, which can perform various appropriate actions and processes according to a program stored in ROM 302 or a program loaded from storage section 308 into RAM 303, such as executing the methods described in the above embodiments. RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via bus 304. I / O interface 305 is also connected to bus 304.
[0127] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including hard disks, etc.; and communication section 309 including network interface cards such as LAN (Local Area Network) cards, modems, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.
[0128] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by CPU 301, it performs the various functions defined in the present invention.
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0130] Specifically, the traffic flow monitoring system in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the dynamic traffic flow prediction method based on multi-source data fusion provided in the above embodiment.
[0131] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the traffic flow monitoring system described in the above embodiments; or it may exist independently and not incorporated into the traffic flow monitoring system. The storage medium carries one or more computer programs that, when executed by a processor of the traffic flow monitoring system, enable the traffic flow monitoring system to implement the dynamic traffic flow prediction method based on multi-source data fusion provided in the above embodiments.
[0132] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0133] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning if... or after... or in response to determining... or in response to detecting... Similarly, depending on the context, the phrase "when determining... or if (the stated condition or event) is interpreted as meaning if determining... or in response to determining... or in response to detecting (the stated condition or event)" or in response to detecting (the stated condition or event).
Claims
1. A dynamic traffic flow prediction method based on multi-source data fusion, characterized in that, The method, applied to a traffic flow monitoring system, includes: Receive real-time video streams from surveillance cameras on the target road segment; Multidimensional visual features are extracted from the vehicles passing through the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes. Historical traffic flow data of the target road segment is retrieved, and cluster analysis is performed on the spatiotemporal distribution patterns of traffic flow attributes within the historical period to construct a historical commuting fingerprint database containing typical commuting traffic flow modes. An elastic matching algorithm based on key feature points is used to calculate the similarity between the real-time traffic flow spatiotemporal attribute sequence and each fingerprint pattern in the historical commuting fingerprint database, and to determine the real-time phase anchor point of the current traffic flow in the historical commuting cycle. Based on the real-time phase anchor points, the evolution trend of subsequent traffic flow to be passed is retrieved from the historical commuting fingerprint database, and the baseline commuting traffic volume of the target road segment in a preset future time period is calculated. By combining the physical capacity of the target road segment, the real-time non-commuting disturbance coefficient, and the baseline commuting traffic volume, the traffic congestion index of the target road segment in the preset future time period is deduced.
2. The method according to claim 1, characterized in that, The vehicle visual attributes include vehicle size and vehicle type; the step of extracting multi-dimensional visual features from the vehicles passing through the real-time video stream to generate a real-time traffic flow spatiotemporal attribute sequence containing vehicle visual attributes and driving lane indexes specifically includes: The image of the central region of the vehicle detection box in the video frame of the real-time video stream is extracted, and the hue feature value of the central region image in the HSV color space is calculated to determine the color encoding. Calculate the pixel percentage and aspect ratio of the vehicle detection box in the video frame to determine the vehicle type classification code; Identify the road lane number where the center point of the vehicle detection frame is located, and generate a lane position code; The color code, vehicle type classification code, and lane position code are integrated into a single vehicle feature coding unit, and multiple single vehicle feature coding units are spliced together in chronological order to form a real-time traffic flow spatiotemporal attribute sequence.
3. The method according to claim 1, characterized in that, The step of using a key feature point-based elastic matching algorithm to calculate the similarity between the real-time traffic flow spatiotemporal attribute sequence and each fingerprint pattern in the historical commuting fingerprint database, and determining the real-time phase anchor point of the current traffic flow in the historical commuting cycle, specifically includes: In the real-time traffic flow spatiotemporal attribute sequence, backbone vehicle nodes with high recognizability are selected; the backbone vehicle nodes include large-sized vehicles or vehicles with preset color combinations. Using the backbone vehicle nodes as time calibration anchors, coarse-grained time axis alignment is performed in the fingerprint patterns of the historical commuting fingerprint database to determine candidate historical segments. Within the time window of the candidate historical segment, calculate the histogram similarity of ordinary vehicle nodes in terms of lane distribution and color distribution; The historical time point with the highest histogram similarity is selected as the real-time phase anchor point, and the time deviation between the current system time and the real-time phase anchor point is calculated.
4. The method according to claim 3, characterized in that, After determining the historical time point with the highest histogram similarity as the real-time phase anchor point and calculating the time deviation between the current system time and the real-time phase anchor point, the method further includes: Extract discrete difference feature vectors from the real-time traffic flow spatiotemporal attribute sequence that fail to match the fingerprint pattern, and construct a non-commuter residual sequence; The flow density of the non-commuting residual sequence is statistically analyzed, and the deviation of the flow density from the historical baseline density is calculated. The deviation is input into a preset disturbance gain model to generate real-time non-commuting disturbance coefficients.
5. The method according to claim 1 or 4, characterized in that, The step of retrieving the evolution trend of subsequent traffic flow based on the real-time phase anchor point in the historical commuting fingerprint database and calculating the baseline commuting traffic volume of the target road segment in a preset future time period specifically includes: Starting from the real-time phase anchor point, extract the historical traffic flow evolution sequence for a preset future time period from the historical commuting fingerprint database; Statistically analyze the trends of the total number of vehicles passing through and the proportion of large vehicles in the historical traffic flow evolution sequence; Based on the real-time non-commuting disturbance coefficient and the trend of the proportion of large vehicles, the total number of vehicles passing through is weighted and corrected to obtain the baseline commuting traffic volume of the target road segment in a preset future time period.
6. The method according to claim 5, characterized in that, After the step of weighting and correcting the total number of vehicles passing through based on the real-time non-commuting disturbance coefficient and the trend of the proportion of large vehicles to obtain the baseline commuting traffic volume of the target road segment in a preset future time period, the method further includes: Obtain meteorological environmental data of the target road segment and real-time congestion feedback index of the downstream road segment; Construct an environmental correction coefficient that includes meteorological damping factors and downstream feedback factors; Based on the environmental correction coefficient and the real-time non-commuting disturbance coefficient, the baseline commuting traffic volume is weighted and corrected to obtain the corrected commuting traffic volume.
7. The method according to claim 6, characterized in that, The step of combining the physical capacity of the target road segment, the real-time non-commuter disturbance coefficient, and the baseline commuter traffic volume to deduce the traffic congestion index of the target road segment in the preset future time period specifically includes: Obtain the physical saturation traffic threshold of the target road segment; Calculate the predicted road load factor based on the corrected commuter traffic volume and the physical saturation threshold; Retrieve the historical average traffic speed attenuation rate in the historical commuting fingerprint database for the subsequent time period of the real-time phase anchor point; By integrating the predicted road load rate and the historical average traffic speed decay rate, a traffic congestion index is determined through a preset congestion mapping model.
8. A traffic flow monitoring system, characterized in that, The traffic flow monitoring system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the traffic flow monitoring system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the traffic flow monitoring system, the traffic flow monitoring system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the traffic flow monitoring system, the traffic flow monitoring system performs the method as described in any one of claims 1-7.