A method and system for identifying and dividing time periods of space-time state of traffic flow
By optimizing traffic flow time period division using an adaptive spatiotemporal feature fusion model and a dynamic time warp algorithm, the problem of traditional time period division not adapting to dynamic changes in traffic flow is solved, and an efficient and stable signal control scheme is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF SCI & TECH
- Filing Date
- 2026-07-02
- Publication Date
- 2026-07-31
AI Technical Summary
In urban intersection signal control, existing technologies cannot adapt to the dynamic spatiotemporal changes of traffic flow using traditional time-segmentation methods, leading to timing imbalances. Furthermore, existing deep learning-based methods cannot dynamically adjust the contribution of traffic flow characteristics and time characteristics, resulting in unstable clustering results and evaluation metrics that do not fully consider the robustness of the solution.
An adaptive spatiotemporal feature fusion model (ASTF-Net) is used to dynamically generate traffic and time feature weights. Combined with a dynamic time warp algorithm, multi-day traffic sequences are aligned. The time period division is optimized through statistical significance testing and clustering algorithms. A comprehensive evaluation index is introduced to optimize the signal control scheme.
It achieves adaptive adjustment of feature contribution based on real-time traffic conditions, improves feature representation accuracy and clustering results stability, and the output time period division scheme is more in line with traffic operation patterns, thereby improving the efficiency and stability of intersection signal control.
Smart Images

Figure CN122490458A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent traffic control technology, specifically to a method and system for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-knowledge coupled approach. Background Technology
[0002] Traffic signal control at urban intersections is a core component of urban traffic management, and the scientific division of signal control periods directly determines the effectiveness of timing schemes. Traditional fixed-period division methods rely heavily on human experience and are difficult to adapt to the dynamic spatiotemporal changes in traffic flow. When traffic flow fluctuates significantly, timing imbalances easily occur, leading to decreased intersection efficiency. Time-division methods based on simple numerical clustering only focus on the similarity of traffic flow values, ignoring the temporal continuity and spatial correlation of traffic flow, which can easily result in isolated points and unreasonable time-period boundaries.
[0003] While existing deep learning-based traffic flow feature extraction methods can capture complex spatiotemporal features, they mostly employ fixed-weight feature fusion strategies, failing to dynamically adjust the contribution of flow and time features based on traffic conditions, resulting in an imbalance in feature representation accuracy between peak and off-peak periods. Furthermore, traffic flows exhibit significant temporal shifts across different dates; directly averaging multi-day data can obscure typical temporal characteristics, and the random initialization of centroids in the traditional KMeans algorithm leads to unstable clustering results, making it difficult to meet the needs of practical engineering applications.
[0004] Furthermore, most existing time-segmentation effectiveness evaluation metrics focus only on total delay, failing to adequately consider the robustness of the scheme under traffic fluctuations. This leads to a sharp performance drop in the time-segmentation schemes during sudden traffic emergencies. Therefore, there is an urgent need to develop a traffic flow time-segmentation method that can adaptively integrate spatiotemporal characteristics, accurately identify essential traffic state transitions, and simultaneously balance control efficiency and scheme robustness. Summary of the Invention
[0005] To address the above problems, this invention provides a method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-driven coupled traffic flow model, comprising: Obtain multi-day, multi-direction traffic flow data at the target intersection and generate a traffic flow sequence sorted by time. The traffic flow sequence's flow characteristics and time characteristics are dynamically weighted and fused using a trained adaptive spatiotemporal feature fusion model to obtain spatiotemporal fusion features; Time alignment of multi-day traffic flow sequences is performed to generate fused flow sequences characterizing typical traffic evolution processes; Candidate time periods are determined based on the flow evolution trend of the fused flow sequence, and adjacent candidate time periods are merged based on statistical significance test to obtain initial cluster centers; Clustering is performed using the spatiotemporal fusion features and the initial cluster centers to obtain the initial time period division results; The initial time period division results are subjected to time continuity constraints and boundary smoothing processing, and the optimal solution is found within a preset number of clusters based on the traffic signal control benefit evaluation, and the target time period division scheme is output.
[0006] Preferably, the step of acquiring multi-day, multi-direction traffic flow data of the target intersection to form a time-ordered traffic flow sequence specifically includes: collecting traffic flow data for each direction at fixed time intervals over several consecutive days, decomposing it into the flow rate of each turn and calculating the total flow rate, using linear interpolation to fill in missing values and median filtering to correct outliers, and forming an ordered flow rate sequence in ascending order of time each day. ,in They represent the first The first day Total flow rate over time intervals; This represents the number of time points per day; the total flow at each time point is the sum of the flow from each turn.
[0007] Preferably, the adaptive spatiotemporal feature fusion model dynamically generates traffic feature weights and time feature weights through an adaptive gating mechanism. Specifically, the adaptive gating mechanism generates weights that satisfy the following conditions through a ReLU layer and a softmax layer: The weight automatically increases during peak periods. Automatic increase during off-peak hours ; and These are the traffic flow feature weights and time feature weights adaptively generated based on the current traffic conditions; the joint loss function. for: ; For the first The actual traffic flow value at each time step. For the next moment The predicted flow value The traffic flow feature weights are adaptively generated based on the traffic conditions of the previous time step. Hyperparameters used to adjust the importance of the weighted smoothing penalty term and the mean squared error.
[0008] Preferably, the multi-day traffic flow sequence is time-aligned and a fused traffic flow sequence representing a typical traffic evolution process is generated, including: constructing an N×N distance matrix and calculating a cumulative cost matrix, backtracking to obtain the optimal corresponding path, selecting the traffic flow sequence with the minimum total cumulative cost as the benchmark sequence, averaging the aligned traffic flow values collected at each time point of the benchmark sequence, and generating the fused traffic flow sequence.
[0009] Preferably, determining candidate time periods based on the flow evolution trend of the fused flow sequence includes: using a sliding window of length SN to perform mean smoothing on the fused flow sequence; identifying key feature points by solving for the zeros of the first and second derivatives of the trend function; and combining the start and end points to form a trend segmentation point set; taking the geometric center time point for odd-numbered element intervals; and determining the feature time point for even-numbered element intervals based on the flow difference with adjacent intervals.
[0010] Preferably, adjacent candidate time periods are merged based on statistical significance tests to obtain initial cluster centers, including: constructing time period sample groups by retrospectively observing the original observation space over multiple days, performing independent samples t-tests on adjacent time periods, and performing one-way ANOVA on consecutive time periods; and meeting the preset number of clusters. Under constraints, the merge is performed according to capacity constraints, size priority, and significance priority.
[0011] Preferably, clustering is performed using the spatiotemporal fusion features and the initial cluster centers to obtain the initial time period division result, including: if the preset number of clusters is greater than or equal to the number of candidate centers, it is directly used as the initial centroid; otherwise, it is reduced to the preset number of clusters through the merging mechanism in step S5; the original data and the initial centroids are feature-encoded and weighted fused using ASTF-Net to generate fused sequence data and initial cluster center points for clustering.
[0012] Preferably, the initial time period division result is subject to time continuity constraints, including: sorting the data point index of each cluster label in ascending time order, determining time continuity through dual time thresholds, and updating the labels of discontinuous isolated points to other class labels with the smallest absolute difference between them and their traffic.
[0013] Preferably, the boundary smoothing process specifically involves: extracting label change points as initial candidate breakpoints; after preliminary screening using time thresholds; constructing sample groups by backtracking multiple days of data from the remaining breakpoints; determining the significance of forward and backward merging through independent samples t-tests; and performing merging according to the principle of minimizing relative differences in flow when bidirectional merging is possible. The optimization of traffic signal control benefits within a preset cluster number range includes: calculating the actual delay of the unified time-sharing scheme for each time period and the ideal delay of the ideal optimal scheme at a single point, constructing the mean and variance of the delay error value sequence, and combining the total delay to form a comprehensive evaluation index. Perform a full search within the preset cluster size range and select... The minimum number of clusters is taken as the optimal solution.
[0014] This invention also provides a data-driven traffic flow spatiotemporal state identification and time period segmentation system, which is used to implement a data-driven traffic flow spatiotemporal state identification and time period segmentation method.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention constructs an adaptive spatiotemporal feature fusion neural network ASTF-Net, which dynamically generates traffic flow and time feature weights through a gating mechanism. During peak periods, the traffic flow feature weights are automatically increased, and during off-peak periods, the time feature weights are automatically increased. This effectively solves the problem of poor adaptability of fixed weight fusion and significantly improves the feature representation accuracy under different traffic conditions.
[0016] 2. This invention uses a dynamic time warp algorithm to align multi-day traffic sequences, which suppresses random noise and time shift while preserving typical time-series structure. Candidate cluster centers are selected based on traffic evolution trends, and scientific interval merging is achieved by combining independent sample t-tests and analysis of variance. This fundamentally avoids the problem of unstable clustering results caused by random initialization of centroids in traditional KMeans.
[0017] 3. This invention establishes a comprehensive evaluation index based on the Webster calculation model, taking into account both total delay and scheme robustness. The optimal number of clusters is determined through full search automatic optimization. After label correction, boundary optimization, and spatiotemporal joint voting smoothing, the output time period division scheme is more in line with traffic operation patterns, significantly improving the efficiency and stability of intersection signal control. Attached Figure Description
[0018] Figure 1 This is an overall flowchart of the method of the present invention. Detailed Implementation
[0019] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0020] refer to Figure 1 This invention discloses a method and system for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-knowledge coupling approach. Data-knowledge coupling refers to a technical paradigm that deeply integrates data-driven intelligent computing methods (data) with prior knowledge, physical laws, and engineering rules in the transportation field (knowledge), employing bidirectional constraints. Based on massive traffic flow data, it leverages the adaptive fitting capabilities of data methods such as deep learning and clustering algorithms. Simultaneously, it embeds traffic engineering principles, statistical science rules, and prior engineering knowledge into the entire algorithm process, anchoring the physical rationality and engineering practicality of the results, avoiding deviations from the objective laws of traffic operation by purely data-driven results. This invention achieves automatic optimization of time period division schemes by constructing an adaptive spatiotemporal feature enhancement model and a physical optimization closed loop. This method can automatically balance the contribution of flow characteristics and time characteristics based on real-time traffic conditions, effectively identifying random fluctuations and essential state transitions in traffic flow over multiple days, and ultimately outputting a signal control time period division scheme that balances traffic efficiency and control robustness.
[0021] 1. Data preparation and preprocessing: Traffic flow data for each direction is collected every 5 minutes over a continuous period of DN days using intersection monitoring equipment (such as loop detectors, video detectors, and radar detectors). This results in a daily ordered traffic flow sequence in ascending order of time. ,in They represent the first The first day Total flow rate over time intervals; This represents the number of time points per day.
[0022] For each time point, it is further decomposed into the flow rates of each turning point. ,in They represent the first The first day The time interval is the first Traffic flow at each turn; The number of turns at an intersection, typically a crossroads. (Four directions of entry, each with three turns: left turn, straight, and right turn).
[0023] The total flow at each time point is the sum of the flow at each turning point: ; In the formula Indicates the first The first day Total flow rate over time intervals; Indicates the first The first day The time interval is the first Traffic flow at each turn.
[0024] During the data preprocessing stage, it is also necessary to process abnormal data: for missing values, linear interpolation between adjacent time points is used to fill them in; for abnormal values that are significantly outside the reasonable range (such as negative traffic flow or traffic flow that is much greater than the intersection's capacity), median filtering is used for correction.
[0025] 2. Construction and training of the adaptive spatiotemporal feature fusion neural network ASTF-Net: This step aims to build a deep learning model that can automatically balance the contributions of flow characteristics and time characteristics based on real-time traffic conditions, and dynamically learn the weights of flow characteristics. and time feature weights (in ), which scales and re-fuses the embedded features.
[0026] 2.1 Spatiotemporal Dataset Construction: Based on ordered flow sequence and its corresponding time data Construct an associated dataset containing time and traffic features. ; They represent the first The timestamp of each time step They represent the first A time-flow data pair for each time step.
[0027] 2.2 Enhanced Embedding Coding of Spatiotemporal Features: Using sine / cosine position encoding rules, each flow data in the dataset is processed separately. and timestamp data Perform a nonlinear mapping to obtain a traffic embedding vector with metric semantics. and timestamp embedding vector This encoding mechanism ensures that vectors with similar timestamps or similar traffic values are closer in the embedding space. The specific encoding formula is as follows: ; ; ; ; In the formula , , and They are and No. , The location's encoded numerical value; and These are the encoding dimensions for traffic data and timestamp data, respectively.
[0028] 2.3 Construction and Training of the Adaptive Spatiotemporal Feature Fusion Network (ASTF-Net): (1) Feature splicing: splicing and Generate the original comprehensive feature vector that integrates spatiotemporal information. .
[0029] (2) Adaptive gating fusion: An adaptive spatiotemporal feature fusion network (ASTF-Net) is constructed, which dynamically adjusts the contribution of traffic features and temporal features using its internal adaptive gating mechanism: ; ; ; In the formula, Let be the hidden state vector output by the first layer of the gated network. , These are the weight matrices for different learnable layers. , These are the corresponding bias terms; and These are the flow feature weights and time feature weights, respectively, adaptively generated based on the current traffic conditions, and satisfying the following conditions: ; This is the final weighted fusion feature vector.
[0030] During peak traffic hours, traffic flow fluctuates dramatically, at which point the network will automatically increase its capacity. The value of [value] makes traffic characteristics dominate the fusion process; during off-peak traffic periods, traffic changes are gradual, and the temporal patterns are more obvious, so the network will automatically increase [the value]. The value of makes the time feature dominant in the fusion.
[0031] (3) Proxy task verification and unified training: To train gated network parameters in an unsupervised environment, a traffic prediction agent task based on feature fusion is constructed: ; In the formula, and These are the weights and biases of the prediction layer, respectively; For the next moment The predicted flow value for The output features after subsequent prediction network processing.
[0032] (4) Joint loss function design: Design a joint loss function that includes a prediction error term and a smoothing constraint term to perform end-to-end training of the network: ; In the formula, This represents the total loss value of the model. The mean squared error (MSE) is used to force the network to learn features that can accurately characterize the evolution trend of traffic flow. and If the weighting assignment fails to accurately reflect the current traffic conditions (e.g., failing to assign sufficient weight to flow characteristics during peak hours), it will lead to increased prediction errors. For the first The actual traffic flow value at each time step; The traffic flow feature weights are adaptively generated based on the traffic conditions of the previous time step. The weight smoothing penalty term is determined by constraining the weights. The dramatic jumps between adjacent time points ensure the continuity of the fused features on the time axis, thereby improving the stability of subsequent time segmentation results; Hyperparameters are used to adjust the importance of both.
[0033] 3. Time period alignment for multi-day data dynamic time warp (DTW): Because traffic flow varies in time across different days (e.g., Monday morning rush hour may be 10-15 minutes earlier or later than Tuesday morning rush hour), directly averaging multi-day data can obscure typical temporal characteristics. This step employs the Dynamic Time Warp (DTW) algorithm to align multi-day traffic sequences, preserving typical temporal structure while suppressing random noise and time shifts.
[0034] 3.1 Calculate the similarity between different flow sequences, DTW distance: 3.1.1 Construct the distance matrix: for and ( Indicates the first The first day (total flow over time intervals), construct a Distance matrix : ; In the formula , This is the global time window threshold, used to limit the maximum range of time warp and avoid unreasonable alignment results.
[0035] 3.1.2 Calculate the cumulative cost matrix: In this invention, the cumulative cost matrix C adopts a coordinate system with the lower left corner as the origin, that is, (1,1) is the lower left corner of the matrix (corresponding to the first element of the two sequences). The upper right corner of the matrix (corresponding to the last element of the two sequences) is the row number m, which increases from bottom to top, and the column number n, which increases from left to right.
[0036] From the starting position Calculate the cumulative cost using the following recursive formula. : ; This represents the cumulative cost of points below the current position. This represents the cumulative cost of the point to the left of the current position. This represents the cumulative cost of the point to the lower left of the current position.
[0037] Boundary conditions: ; ; ; This indicates the starting point of the cumulative cost matrix. This represents the cumulative cost in the first row and nth column. This represents the cumulative cost in the first column of the m-th row. This represents the distance between the first points of two sequences. This indicates that the first point of sequence A and the first point of sequence B are related. The distance between points Indicated to The minimum total distance, Represents the sequence A, the first... The distance between each point and the first point of sequence B. Indicated to The minimum total distance.
[0038] Then construct the cumulative cost matrix .
[0039] 3.1.3 Backtracking the optimal path: In the cumulative cost matrix In China, with As the baseline sequence, starting from the top right corner of the cumulative cost matrix, the endpoint element... Start by backtracking to Select the current position at each step The forerunner position with the lowest cumulative cost among the three points in the lower left corner Subsequently, with Continue the above process from the current position until the starting position. And thus obtain and Optimal corresponding path : ; ; These represent the first and second digits of the optimal path, respectively. Alignment point pairs.
[0040] 3.1.4 Based on the optimal path ,calculate and Optimal cumulative total cost : ; In the cumulative cost matrix Element.
[0041] 3.1.5 Calculation Total cumulative cost compared to other traffic sequences : ; 3.1.6 Select the flow sequence with the minimum total cumulative cost as the benchmark flow sequence for flow averaging. , These represent the first and second elements in the reference sequence, respectively. Data points.
[0042] 3.1.7 Iterate through the baseline flow sequence sequentially For each data point, the traffic value of that data point along the optimal corresponding path is extracted and averaged with other traffic sequences to obtain the final traffic sequence used for time period segmentation. .
[0043] For the first in the benchmark sequence Data points Define its corresponding set of flow values. for: ; Represents the first in the benchmark sequence Data points.
[0044] The final merged traffic sequence used for time period division , These represent the fusion sequence at the th... The flow values at time intervals, the fused sequence at the th time interval Flow value per time interval Defined as: ; in express The number of elements in the array, f is a general traversal variable.
[0045] Physical meaning: For each time point in the baseline sequence, the flow values from all other sequences aligned with it via the optimal path are collected, and together with the baseline value itself, the arithmetic mean is taken as the final fused flow value for that time point. This operation effectively suppresses random fluctuations and time-shift noise between multi-day data while preserving the typical time-series structure.
[0046] 4. Selection of candidate cluster centers: To improve the stability of the clustering algorithm and give the cluster centers a clear traffic physical meaning, this method establishes a centroid initialization mechanism based on the traffic evolution trend, which avoids the instability of clustering results caused by the random initialization of centroids in the traditional KMeans algorithm.
[0047] 4.1 Smoothing of traffic data: based on Using a length of A sliding window is used for mean smoothing to filter out random fluctuations and obtain a sequence for trend fitting. , respectively representing the first There are n smooth points. Among them, the nth Smooth points The calculation formula is: ; Indicates the fusion sequence at the th The flow rate value for each time interval.
[0048] 4.2 Trend Feature Point Identification: Using the least squares method on the sequence Perform polynomial fitting to construct a continuous flow trend function By solving for the zeros of the first and second derivatives of this function, the extreme points and inflection points of the flow evolution can be identified: (1) Find the set of key feature points ; The first derivative of the trend function. The second derivative of the trend function.
[0049] (2) Change the sequence The start time point End time Stored in this set, it forms a complete set of traffic trend segmentation points. , respectively representing the first A dividing point.
[0050] Extreme points correspond to moments when the traffic flow trend changes from rising to falling or vice versa (such as the start and end of the morning rush hour), while inflection points correspond to moments when the rate of traffic flow change changes significantly (such as the transition from a rapid increase to a slow increase). These points are key nodes where traffic conditions undergo fundamental changes.
[0051] 4.3 Steady-state flow feature extraction: by Using this as a baseline, calculate adjacent dividing points. ( They represent the first and The arithmetic mean of the flow rate within the interval (divided by points). This is used as the steady-state flow value characterizing the traffic state during that period: ; 4.4 Determination of candidate cluster centers at specific time points: When constructing the cluster candidate center sequence, each cluster needs to be determined simultaneously. Corresponding time attribute Let the k-th traffic time period be... The set of original data points included is The number of its elements is . The selection follows the following mathematical logic: (1) Odd-numbered element interval rules: If the kth traffic period The number of data points contained is odd (i.e.) If the geometric center time point of the interval is taken as the characteristic time, then the characteristic time point is taken as the geometric center time point of the interval. ; In the formula, For set The timestamp corresponding to the median point after sorting by time.
[0052] (2) Even-numbered element interval rule: If the interval The number of data points included is even (i.e.) Then, by examining the degree of deviation between the mean flow rate of this interval and the flow characteristics of adjacent intervals, the determination can be made. The bias is that the time point should be selected from the side where the flow trend is more stable (i.e., the difference is smaller).
[0053] ; In the formula, and They represent The two closest observation timestamps on either side of the midpoint of the time axis. and They are respectively and as well as and The absolute flow difference represents the first... and During traffic periods, ; ; For the first Steady-state flow values for each time period For the first Steady-state flow values for each time period.
[0054] 4.5 Construction of Cluster Candidate Center Sequence: Fusion and Construct a clustering candidate center sequence with traffic characteristics and corresponding time attributes. .
[0055] They represent the first Cluster candidate centers for each time period.
[0056] 5. Interval adaptive merging mechanism based on mathematical statistical tests: In the initial determination of the traffic trend segmentation point set Subsequently, instead of using a simple flow difference threshold for interval merging, this invention introduces a multidimensional statistical testing mechanism based on t-test and ANOVA to perform significance analysis on adjacent time periods, thereby achieving scientific merging of time periods. The specific implementation steps are as follows: 5.1 Construction of the time-segment sample space: This step does not use the fused flow directly, but instead traces back to the original observation space over multiple days.
[0057] (1) Baseline division: First, based on the time axis, the baseline sequence is divided into several initial intervals according to the dividing points.
[0058] (2) Multi-day sample alignment: For each initial interval, all observation days are retrieved based on the optimal corresponding path established by dynamic time warp (DTW). The flow observations corresponding to the time index of that interval.
[0059] (3) Definition of sample group: Let For the first A traffic sample group for each time period, which contains all traffic sampling points within the corresponding time window over multiple days.
[0060] 5.2 Independent samples t-test for adjacent time periods: For two adjacent time period sample groups: With the Traffic sample groups for each time period Perform an independent samples t-test to assess whether there is a significant difference in their means: (1) Hypothesis testing: Null hypothesis (That is, the mean flow distribution of two adjacent time periods is not significantly different, and they have the characteristics of merging).
[0061] Alternative Hypothesis .
[0062] For the first The true average of the total traffic volume over a given period. For the first The true average of the total traffic volume over a given period.
[0063] Decision logic: Calculate the t-statistic and its corresponding significance level. Value. If ( If a significance level is preset (e.g., 0.05), then the null hypothesis is accepted. If two adjacent time periods are determined to be identically distributed, they are marked as "to be merged".
[0064] 5.3 Multi-period combined analysis of variance (ANOVA): Based on the determination of merging two adjacent segments, the significance of merging multiple adjacent segments is further checked sequentially (until no significant difference is found), and one-way ANOVA is introduced: F-statistic calculation: For the continuous data to be verified Sample groups for each time period ( ),like ( For the first Calculate the F-statistic, which reflects the proportion of inter-group differences and intra-group fluctuations, from the traffic sample groups for each time period. : ; In the formula, The mean square between groups represents the degree of dispersion of traffic conditions across different time periods; The mean square within a group represents the degree of random fluctuation in traffic data over multiple days within the same time period.
[0065] (2) Decision logic: Based on the preset significance level (like The critical value can be obtained by looking up a table or calculating the corresponding degrees of freedom. The decision logic is as follows: If the calculated result (Right now If the consecutive adjacent time periods in the group are statistically significant to belong to the same stage of traffic evolution, they are marked as "to be merged" and the next adjacent time period is included in the sample group for a new analysis of variance. like (Right now If a significant traffic state change is detected in the current time period group, the merging detection of the current group will be stopped.
[0066] 5.4 Constraint-Based Optimal Merging Decision: Meeting the preset number of clusters Under the constraints, the following priority merging strategy is executed: (1) Capacity constraint priority: The total number of time periods after merging must be equal to .
[0067] (2) Size priority: Under the premise of passing the statistical significance, adjacent intervals with more intervals are merged first to ensure that the generated time period has sufficient steady-state characteristics.
[0068] (3) Significance priority: Among candidate merging schemes with the same number of intervals, priority is given to selecting value or Interval groups with larger values (i.e., those with the closest distribution and most suitable for merging) are merged.
[0069] Technical significance: By introducing t-tests and analysis of variance, this scheme elevates time-period merging from a "numerical-driven" to a "distribution-driven" approach. This mechanism can effectively identify random fluctuations and essential state transitions in traffic flow over multiple days, ensuring that the initial merged intervals not only have similar mean traffic volumes but also belong to the same stage of traffic evolution in a statistical sense, providing higher-quality physical centroids for subsequent clustering.
[0070] 6. Time period segmentation based on traffic time feature fusion: This step aims to use the trained Adaptive Spatiotemporal Feature Fusion Network (ASTF-Net) to perform high-dimensional mapping of spatiotemporal features and combine it with the optimized initial centroid to complete the time period segmentation.
[0071] 6.1 Initial Cluster Center Selection: Set the preset number of cluster centers to According to the candidate center sequence Number of elements Execute the following logic: (1) If , directly All elements are used as initial cluster centers. .
[0072] (2) If The interval adaptive merging mechanism based on mathematical statistical tests is used for merging.
[0073] (3) Update rules: The new interval flow value after merging is the average of the original two interval flows. The new interval time value is recalculated and updated using the odd / even element interval rule. This process is repeated until the number of center points is reduced to Until then, the final initial cluster centers are obtained.
[0074] 6.2 Traffic Flow Time Feature Coding and Weighted Fusion: For the fused traffic sequence and its corresponding time axis, as well as the initial cluster centers, ASTF-Net is used for feature enhancement: (1) Enhanced embedding encoding: Using the sine / cosine position encoding rule, the original flow value and timestamp, as well as the flow value and timestamp in the initial cluster center point, are mapped to embedding vectors with metric semantics.
[0075] (2) Spatiotemporal feature synthesis: Combine the trained adaptive spatiotemporal feature fusion network ASTF-Net to output the corresponding traffic feature weights. and time feature weights Combined into flow time feature coding ( Embed vectors for traffic features. (As a time feature embedding vector), the final result is sequence data fused with traffic time feature encoding for time period segmentation. and initial cluster centers .
[0076] 6.3 Clustering Execution: by As the initial centroid, the KMeans algorithm is used to analyze the data. Perform clustering and output the initial label sequence of data points. .
[0077] The first The cluster number assigned at each time point.
[0078] This method considers not only the similarity of traffic values but also... and The dynamic introduction of time-dimensional constraints ensures the consistency of the partitioning results in spatiotemporal semantics.
[0079] 7. Initial correction of time period labels for data points based on time continuity: To address the potential isolated points in the clustering results on the time axis (i.e., a data point with a certain label lacks similar points in its time neighborhood), and the fact that data points with the same state but from different time periods are also assigned to the same class, an initial correction based on the temporal continuity of traffic differences is implemented: 7.1 Clustering Index Construction: Define cluster label set For each tag Construct its corresponding data point index set : ; For the first The cluster number assigned at each time point.
[0080] 7.2 Time sorting: For each The indexes within the sequence are sorted in ascending order by time to obtain an ordered sequence. .
[0081] 7.3 Determination of temporal continuity: Define data points and adjacent data points time interval : ; in For data points timestamp, for Timestamp. Set two time thresholds. and .
[0082] if or Then the semantic continuity determination function ,otherwise .
[0083] In the formula express Continuous in time, express Discontinuous in time; time threshold for Threshold for determining continuity over time; time threshold for The threshold for judging similar traffic conditions at different time periods, such as morning off-peak and night off-peak, is used. Although they are not continuous in time, their traffic conditions are similar, and subsequent classification is based on the breakpoint. .
[0084] 7.4 Initial Correction of Time Period Labels for Data Points: For discontinuous data points Update its cluster label to the label of the data point in the other class with the smallest absolute difference in its traffic: ; In the formula For data points New clustering labels For data points Current clustering labels and Data points and The flow rate value.
[0085] 8. Time period boundary identification and optimization: To prevent excessively frequent switching of signal control schemes and disruption of traffic flow, control time period boundaries, i.e., breakpoints, are identified and optimized. 8.1 Construction of labeled time series data: Initial cluster labels Applied to the time-sorted merged traffic sequence, a labeled sequence is obtained. .
[0086] 8.2 Initial Boundary Extraction: Traversal First, index the first and last breakpoints to 1 and 2. Add to candidate breakpoint set ,like Then the data points Add to candidate breakpoint set .
[0087] 8.3 Boundary filtering based on duration prior: Set time threshold and Iterate starting from the second item. Calculate and define the current breakpoint and the previous breakpoint Time difference : ; In the formula breakpoint timestamp, For the previous breakpoint Timestamp.
[0088] like Then in the candidate breakpoint set Delete data points ;like Then in the candidate breakpoint set Preserve data points Otherwise, proceed to step 7.4 to determine traffic similarity. 8.4 Boundary merging based on traffic similarity: In the initial identification of candidate breakpoint sets Subsequently, this invention introduces a composite judgment mechanism based on independent sample t-tests and relative differences in flow rates to refine the screening and merging of time period boundaries, thereby ensuring the steady-state characteristics of the control period. The specific steps are as follows: 8.4.1 Construction of Time Period Sample Groups and Calculation of Mean: Based on candidate breakpoint set and labeled sequences Extract traffic samples from adjacent time periods: Sample extraction: backtracking Use the original data to construct the current breakpoint. With the previous breakpoint Corresponding time period sample group and the next breakpoint Corresponding time period sample group .
[0089] Mean calculation: Calculate the average flow rate for the corresponding time period. (Average flow rate of the current segment) (The average flow rate in the second half) and (Average flow rate of the previous period).
[0090] 8.4.2 Determination of pooled significance based on t-test: The consistency of distribution between the current time period and the adjacent time periods before and after it is assessed using the independent samples t-test: Forward consistency check: for the sample group and The previous adjacent candidate period Perform a t-test; if the forward test p-value... If the significance level is determined, the current segment can be merged with the previous interval and marked as such. . This is a left-to-right merge marker.
[0091] Backward consistency check: for sample groups and Perform a t-test; if the p-value of the backward test... If the current segment can be merged with the next interval, it is marked as such. . This is a right-to-right merge marker.
[0092] This indicates that they can be merged. This indicates that they absolutely cannot be merged.
[0093] 8.4.3 Boundary Preservation and Merging Decision Logic: Based on the t-test results and the relative difference in flow rate Execute the following branch logic: 1. Two-way reservation criterion: If and All (i.e., there are significant differences between the current segment and the segments before and after it), then in the candidate breakpoint set Data points are retained in the middle The merge will not be performed.
[0094] 2. Bidirectional Merge Criterion: If and All Then the traffic similarity competition rule will be activated: Calculate separately and , and relative differences in traffic and : ; ; like Then the current paragraph label will be reset to the previous paragraph label, and in Delete the current breakpoint; Otherwise, reset the current paragraph label to the next paragraph label, and in Delete the current breakpoint.
[0095] 3. One-way merging criteria: If only for Then the current segment will be directly merged with the previous interval, from Delete the current breakpoint.
[0096] If only for Then the current segment is directly merged with the next interval, from Delete the current breakpoint.
[0097] Technical effect description: This optimization step uses a t-test to ensure the rigor of time-period merging from a mathematical and statistical perspective, avoiding erroneous merging caused by random fluctuations in traffic. Simultaneously, in fuzzy intervals where merging is possible in both directions, the principle of minimizing relative differences is applied. This ensures that the merged time periods have the highest internal similarity, thereby effectively reducing traffic fluctuation losses caused by the switching of signal control schemes.
[0098] 9. Cluster label smoothing optimization based on spatiotemporal joint voting: To eliminate random noise from traffic fluctuations, the final cluster labels are non-linearly smoothed. 9.1 Temporal Neighborhood Selection: For each data point Calculate its relationship with all other points. absolute time difference : ; for Timestamp.
[0099] Select the time neighborhood size with the smallest time difference Composition of data points Time Neighborhood .
[0100] 9.2 Traffic Neighborhood Filtering: exist Inside, calculate data points With all other points The traffic is absolutely bad : ; Select the flow neighborhood size with the smallest flow difference ( ) constitute a spatiotemporal joint neighborhood .
[0101] 9.3 Voting Decisions: Extend the spatiotemporal joint neighborhood Statistics on the frequency of various tags : ; That is, select the label with the highest frequency as the data point. The final cluster label.
[0102] Repeat the voting process described above, iterating until the convergence condition that "any data point has the same label as at least one of its adjacent sides" is met, ensuring that the final label sequence has good continuity on the time axis.
[0103] 10. Evaluation indicators for the effectiveness of time period segmentation: To verify the operational effectiveness of the time-segmentation scheme in real-world traffic scenarios, this invention introduces a comprehensive delay and robustness evaluation index based on the Webster calculation model: 10.1 Boundary Feature Extraction: For smoothing optimization Call the boundary breakpoint set of the identified time period division ,in The total number of breakpoints identified. For the first The fusion features of each breakpoint For the first Time period labels for each breakpoint For the first The timestamp of each breakpoint It is defined as a complete signal control time period unit.
[0104] 10.2 Calculation of average turning flow rate: Calculation observation Throughout the day, at different times Each flow direction within the interior changes direction average daily flow : ; In the formula, This represents the set of time point indices that fall within this time period. For the first Heaven, the First The time point, the first Instantaneous flow rate value for each turn; 10.3 Signal Timing Scheme Derivation: based on and each data point per day The optimal cycle length and green light time for each phase of the day were determined using Webster's classic timing method, as well as the optimal cycle length for each data point of the day. and the green light time for each phase .
[0105] 10.4 Operational Benefit Assessment (Delay Calculation): This step quantifies the performance loss of the proposed solutions by comparing the "unified time-slot scheduling scheme" with the "ideal optimal single-point scheme": (1) Calculation of actual time delay: Based on the simulated signal timing scheme, calculate the comprehensive average delay for each time period and sum them up to obtain the total delay evaluation function. : ; ; ; In the formula, For the first Heaven, the First The first original time point, the first Ideal average delay for each turn.
[0106] For the first Heavenly Weighted average delay (seconds / vehicle) for each time period.
[0107] For the first Heavenly The first time period The green light ratio of the phase to which each turn belongs.
[0108] For the first Heavenly The first time period Saturation of each turn, , For saturation flow rate, based on the collected data of the first... The instantaneous flow rate values at all time points for all days of each turning point are selected, and the instantaneous flow rate value at a certain quantile in the range of 85% to 90% is then converted into hourly flow rate as the saturation flow rate.
[0109] (2) Calculation of ideal delay at a single point: Calculate the ideal delay of each data point based on the simulated signal timing scheme for each data point. and average delay : ; ; In the formula, For the first Heavenly The ideal optimal signal period at each time point; , The total lost time over one cycle , The total number of phases, The startup loss per phase is typically taken as 3-4 seconds. For the first Heaven, the First The ratio of total flow at each point in time, , , For the first Heaven, the First The time point, the first The flow ratio of the critical lane (i.e. the lane with the highest flow) in each phase.
[0110] For the first Heavenly The data point of the th data point The green light ratio of the phase to which each turn belongs.
[0111] For the first Heavenly The data point of the th data point Saturation of each turn, .
[0112] (3) Construction of delay error value sequence: Calculate the delay error value (i.e. regret) of the two schemes at each time point. and the mean of delay error values at all time points and variance .
[0113] (4) Evaluation index synthesis: combined with total delay mean and variance Constructing comprehensive evaluation indicators : ; In the formula , , These are the weighting coefficients for the linear combination.
[0114] 11. Automatic optimization mechanism for the optimal number of clusters: To achieve automated closed-loop algorithm parameter selection, this invention establishes an adaptive parameter selection mechanism with traffic efficiency as the objective: 11.1 Definition of the objective function: Based on comprehensive evaluation indicators The objective function is defined within a predefined set of cluster numbers. Perform a full search within it. To minimize the number of clusters, This represents the maximum number of clusters.
[0115] 11.2 Criteria for Selecting the Optimal Solution: Select the cluster number with the smallest comprehensive evaluation index As the optimal number of clusters in the system: ; At the same time, the corresponding The label sequence under the value is used as the final intersection time segmentation result. This mechanism ensures that the segmentation scheme output by the algorithm not only minimizes vehicle passage delays, but also has higher stability and robustness in the face of traffic fluctuations.
[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0117] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for identifying the spatiotemporal state and dividing time periods of traffic flow using a data-driven coupling mechanism, characterized in that, include: Obtain multi-day, multi-direction traffic flow data at the target intersection and generate a traffic flow sequence sorted by time. The traffic flow sequence's flow characteristics and time characteristics are dynamically weighted and fused using a trained adaptive spatiotemporal feature fusion model to obtain spatiotemporal fusion features; Time alignment of multi-day traffic flow sequences is performed to generate fused flow sequences characterizing typical traffic evolution processes; Candidate time periods are determined based on the flow evolution trend of the fused flow sequence, and adjacent candidate time periods are merged based on statistical significance test to obtain initial cluster centers; Clustering is performed using the spatiotemporal fusion features and the initial cluster centers to obtain the initial time period division results; The initial time period division results are subjected to time continuity constraints and boundary smoothing processing, and the optimal solution is found within a preset number of clusters based on the traffic signal control benefit evaluation, and the target time period division scheme is output.
2. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The process of acquiring multi-day, multi-directional traffic flow data at the target intersection and forming a time-ordered traffic flow sequence specifically includes: collecting traffic flow data for each direction at fixed time intervals over several consecutive days, decomposing it into flow rates for each turn and calculating the total flow rate, using linear interpolation to fill in missing values and median filtering to correct outliers, and generating an ordered flow sequence in ascending order of time for each day. ,in They represent the first The first day Total flow rate over time intervals; This represents the number of time points per day; the total flow at each time point is the sum of the flow from each redirection.
3. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The adaptive spatiotemporal feature fusion model dynamically generates traffic feature weights and time feature weights through an adaptive gating mechanism. Specifically, the adaptive gating mechanism generates weights that satisfy the requirements of ReLU and softmax layers. The weight automatically increases during peak periods. Automatic increase during off-peak hours ; and These are the traffic flow feature weights and time feature weights adaptively generated based on the current traffic conditions; the joint loss function. for: ; For the first The actual traffic flow value at each time step. For the next moment The predicted flow value The traffic flow feature weights are adaptively generated based on the traffic conditions of the previous time step. Hyperparameters used to adjust the importance of the weighted smoothing penalty term and the mean squared error.
4. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The process involves time alignment of multi-day traffic flow sequences and generation of fused flow sequences that characterize typical traffic evolution processes. This includes: constructing an N×N distance matrix and calculating a cumulative cost matrix; backtracking to obtain the optimal corresponding path; selecting the flow sequence with the minimum total cumulative cost as the baseline sequence; averaging the aligned flow values collected at each time point of the baseline sequence; and generating the fused flow sequence.
5. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The candidate time period is determined based on the flow evolution trend of the fused flow sequence, including: using a sliding window of length SN to perform mean smoothing on the fused flow sequence, identifying key feature points by solving the zero points of the first and second derivatives of the trend function, and forming a trend segmentation point set by combining the start and end points; the geometric center time point is taken for the odd-numbered element interval, and the feature time point is determined for the even-numbered element interval based on the flow difference with the adjacent interval.
6. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, Adjacent candidate time periods are merged based on statistical significance tests to obtain initial cluster centers. This includes: constructing time period sample groups by retrospectively analyzing the original observation space over multiple days; performing independent samples t-tests on adjacent time periods; and performing one-way ANOVA on consecutive time periods. This process is repeated until a preset number of clusters is achieved. Under constraints, the merge is performed according to capacity constraints, size priority, and significance priority.
7. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, Clustering is performed using the spatiotemporal fusion features and the initial cluster centers to obtain the initial time period division results, including: if the preset number of clusters is greater than or equal to the number of candidate centers, it is directly used as the initial centroid; otherwise, it is reduced to the preset number of clusters through the merging mechanism in step S5; the original data and the initial centroids are feature-encoded and weighted fused using ASTF-Net to generate fused sequence data and initial cluster center points for clustering.
8. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The initial time period division results are subject to time continuity constraints, including: sorting the data point indexes of each cluster label in ascending time order, determining time continuity through dual time thresholds, and updating the labels of discontinuous isolated points to other class labels with the smallest absolute difference in their traffic.
9. The method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled approach according to claim 1, characterized in that, The boundary smoothing process specifically involves: extracting label change points as initial candidate breakpoints; after preliminary screening using time thresholds, constructing sample groups by backtracking multiple days of data from the remaining breakpoints; determining the significance of forward and backward merging through independent samples t-tests; and performing merging in both directions based on the principle of minimizing relative differences in flow when merging is possible. The optimization of traffic signal control benefits within a preset cluster number range includes: calculating the actual delay of the unified time-sharing scheme for each time period and the ideal delay of the ideal optimal scheme at a single point, constructing the mean and variance of the delay error value sequence, and combining the total delay to form a comprehensive evaluation index. Perform a full search within the preset cluster size range and select... The minimum number of clusters is taken as the optimal solution.
10. A data-driven, knowledge-coupled system for identifying the spatiotemporal state of traffic flow and dividing time periods, characterized in that, This method is used to implement the method for identifying the spatiotemporal state of traffic flow and dividing time periods using a data-coupled system as described in any one of claims 1 to 9.