Urban traffic sub-region division method based on overall trajectory clustering

Through adaptive cutting and improved DTW and DBSCAN algorithms, combined with the fine-grained division of polygon boundaries, the problems of overall trajectory characteristics and blurred boundaries in the existing urban traffic sub-region are solved, and efficient and accurate traffic sub-region are achieved.

CN120470347APending Publication Date: 2025-08-12UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510550856.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing urban traffic sub-region division method ignores the overall characteristics of the trajectory. The DBSCAN algorithm erroneously merges the trajectory in complex road networks, and insufficient processing of space-time dimensions, resulting in inaccurate division results and poor real-time performance.

Method used

Using the method based on overall trajectory clustering, the DTW algorithm is adaptively cut the trajectory segments, and the DBSCAN algorithm is improved for initial clustering, and fine-grained division is performed in combination with polygon boundaries to ensure clear trajectory boundaries.

Benefits of technology

It improves the accuracy and real-time division of urban traffic sub-regions, can effectively identify sub-regions with similar functions and consistent traffic behaviors, provide an accurate spatial division basis, and improves the efficiency of urban road network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470347A_ABST
    Figure CN120470347A_ABST
Patent Text Reader

Abstract

The invention discloses an urban traffic sub-region division method based on overall trajectory clustering, and belongs to the technical field of intelligent traffic management. The method comprises the following steps: carrying out adaptive cutting and matching on a GPS track through a time dimension, and constructing a segmented track data set; based on an improved DTW algorithm, fusing vertical, parallel and angular distances to define trajectory similarity measurement, and retaining overall shape features of the trajectory; carrying out initial clustering by adopting an improved DBSCAN algorithm, and avoiding an over-aggregation problem through a dynamic core trajectory judgment mechanism; and designing a two-stage fine-grained division strategy, and performing secondary classification on unclassified trajectories in combination with polygonal boundaries and trajectory matching information to generate traffic sub-regions with clear boundaries. The method overcomes the defects that a traditional method neglects track space-time characteristics and boundaries are fuzzy, urban traffic zoning with high dynamic performance and high consistency is achieved, an accurate space division basis is provided for real-time traffic control, and the urban road network management efficiency is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to traffic sub-area division, and in particular to an urban traffic sub-area division method based on overall trajectory clustering. Background Art

[0002] Traffic coordination strategies based on artificial intelligence and machine learning technologies contribute to traffic management and control. Traffic coordination technologies such as vehicle identification, traffic flow prediction, and traffic signal control can reduce traffic congestion and delays, improving people's lives while creating significant economic value. However, implementing traffic coordination strategies within unbalanced traffic structures and constantly changing traffic conditions has become a key research topic in current traffic control. Within this context, urban traffic subregionalization has become a critical step before implementing specific traffic coordination strategies. Traffic subregionalization improves the efficiency of urban space utilization, facilitates the implementation of consistent traffic control strategies within subregions with the same structure, and promotes interoperability between different subregions. The key to urban traffic subregionalization lies in how to capture the spatiotemporal characteristics of urban traffic from complex and ever-changing traffic data while ensuring the real-time and dynamic nature of traffic subregionalization. Existing research articles categorize traffic subregionalization methods into three categories: geometry-based subregionalization, road network-based subregionalization, and data mining-based subregionalization. However, geometric-based zoning methods often rely on the city's existing administrative divisions or census results, and fail to meet the variability requirements of traffic sub-regions. Road grid-based zoning is limited by the pre-determined grid range and fails to consider the time dimension when dividing traffic sub-regions.

[0003] Therefore, the present invention uses a data-driven method to divide traffic sub-areas. The advanced data-driven method for dividing traffic sub-areas has the following disadvantages:

[0004] 1. The relevant clustering algorithms focus on trajectory points or segments and ignore the overall characteristics and shape features of the trajectory, which can actually serve as alternative representations of road network characteristics.

[0005] 2. The DBScAN algorithm is usually used for clustering related trajectories, but it may encounter difficulties in complex urban road networks. The algorithm may mistakenly merge trajectories that should be separated, resulting in overly large clusters and low trajectory similarity at the cluster boundaries.

[0006] 3. Trajectory data can meet the requirements of real-time updating, variability and accessibility, but many sub-area division algorithms fail to reflect the spatiotemporal dimensions.

[0007] 4. The data selection and algorithm construction in the data mining method fail to have a unified framework. At the same time, due to the limitations of the application scenario, the final sub-regions obtained do not have corresponding boundaries, and the corresponding boundaries of the sub-regions are very important in the management and control of downstream sub-regions.

[0008] The shortcomings of the above-mentioned existing technologies will affect the efficiency and real-time performance of the traffic sub-area division algorithm. Therefore, the present invention proposes a method for dividing urban traffic sub-areas based on overall trajectory clustering. Summary of the Invention

[0009] The purpose of the present invention is to solve the problems of inaccurate division results and poor real-time performance in existing urban traffic sub-region division methods due to ignoring the overall characteristics of trajectories, incorrect merging of trajectories by the DBSCAN algorithm in complex road networks, insufficient processing of spatiotemporal dimensions, and fuzzy sub-region boundaries.

[0010] Based on the above objectives, the present invention proposes a method for dividing urban traffic sub-areas based on overall trajectory clustering, comprising the following steps:

[0011] Step S1: perform trajectory preprocessing according to the time dimension, define the trajectory adaptive cutting formula based on the trajectory segment, and record the matching information between two trajectories according to the trajectory cutting;

[0012] Step S2: Based on the matching information between each two trajectories, a similarity measurement calculation method between the trajectories is defined based on the improved DTW algorithm;

[0013] Step S3: Perform initial clustering of trajectories based on the improved DBSCAN algorithm. Apply the similarity measurement method defined in S2 during the clustering process to obtain the initial result clusters.

[0014] Step S4: Obtain the polygonal boundary of the initial result cluster, define two types of trajectory fine-grained partitioning algorithms to process the currently unpartitioned trajectories, and thus obtain the final cluster result;

[0015] In the above solution, in step S1, obtaining matching information includes the following steps:

[0016] S11: The initial input trajectory consists of GPS points. For each point, K-Means clustering is performed independently on the time dimension using the {longitude, latitude, timestamp} triple as the basic operation unit. By identifying the "inflection point" of the correlation curve, the optimal K value is determined to partition the original dataset.

[0017] S111: Run K-Means for K values starting from smaller numbers (such as 1 to 10).

[0018] S112: For each K, record the total intra-cluster sum of squares of the cluster:

[0019] S113: Draw an evaluation curve, where the horizontal axis is the K value (number of clusters) and the vertical axis is the total intra-cluster sum of squares.

[0020] S114: Check that the position where the curve changes from a sharp decline to a slow decline is the "inflection point", and use the K value corresponding to the "inflection point" as the optimal K value to divide the original data set.

[0021] S12: The MDL (minimum description length) method is further used to segment the trajectory on each subset, and each line segment in the trajectory is numbered, so as to finally obtain data subsets within different time periods composed of trajectory segments.

[0022] S121: Assume a trajectory p1, p2, p3. Now consider segmenting at p2. Instead of segmenting into line segment p1p3, segment p1p2 and line segment p2p3. Now calculate two coding lengths: line segment coding length L(H) and error coding length L(D|H). The relevant calculation formulas are shown in (1)(2):

[0023] L(H)=log2(length) (1)

[0024] L(D|H)=∑log2(error i ) (2)

[0025] Among them, length is p i to p j Euclidean distance between points, error i is the vertical distance from each point (i.e., p1, p2, p3) to p1p3 (see formula (5)).

[0026] S122: Calculate the case of no segmentation: calculate L(H) for the line segment p1p3, calculate L(D|H) based on the vertical distance from point p2 to p1p3, and finally obtain L(H)+L(D|H).

[0027] S123: Calculate the segmentation. At this point, all points are on the line segment, L(D|H) = 0, and calculate the sum of the code lengths of the line segments p1p2 and p2p3, L(H). This gives L(H) + L(D|H).

[0028] S123: Compare the two L(H)+L(D|H) in the split case and the non-split case. If the split value is smaller, split it, otherwise do not split it;

[0029] S13: Define the adaptive cutting formula for the longer track of any two tracks in the data set to complete the matching of the two tracks. The number of cutting segments is rounded down according to the result of formula (3):

[0030]

[0031] The variables m and n represent the number of line segments in the two trajectories respectively, max() represents the maximum number of line segments in the two trajectories, and min() represents the minimum number of line segments in the two trajectories.

[0032] S14: After the long track in the pairwise track is cut, the two tracks are matched after executing formula (3). After the matching is completed, the long track is cut, and the relevant matching information is recorded in the longer track: which track segments in the long track are retained, indicating which track segments match the short track. The relevant matching information can be used in subsequent steps, and the relevant matching information (MI) will be recorded in the longer track. The recording format of MI is shown in formula (4):

[0033] MI=[sid,a,b] (4)

[0034] In MI, a and b are unique identifiers of the trajectory segments in the current longer trajectory, and sid is a unique identifier of the shorter trajectory.

[0035] In the above scheme, in S2, based on the matching information between each two trajectories, a similarity measurement calculation method between trajectories is defined based on the improved DTW algorithm, so that the shape characteristics of the overall trajectory are preserved and the time overhead is reduced. S2 includes the following steps:

[0036] S21: Define the final similarity between two trajectory segments by the vertical distance d ⊥ , parallel distance d || and angular distance d θ The sum of .

[0037] S211: Calculate the vertical distance d⊥. The relevant formula is shown in (5):

[0038]

[0039] Among them, the trajectory segment L j Endpoints on j and point e j In the trajectory segment L i The projection points on are point p s and point p e , then l ⊥1 Indicates s j To the projection point p s The Euclidean distance, then l ⊥2 Indicates e j To the projection point p e The Euclidean distance of .

[0040] S212: Calculate parallel distance d ||The relevant formula is shown in (6):

[0041] d || (L i , L j )=min(l ||1 , l ||2 ) (6)

[0042] Among them, point s j and point e j In the trajectory segment L i The projection points on are point p s and point p e , then l ||1 Indicates p s to e i and s i The smaller the Euclidean distance between them, the smaller the l ||2 Indicates p e to e l and s i The smaller value of the Euclidean distance between i 、s i is the trajectory segment L i The endpoint on ;

[0043] S213: Calculate parallel distance d || The relevant formula is shown in (7):

[0044]

[0045] Among them, ||L j || represents the trajectory segment L j The length of the trajectory segment L i and L j Smaller angle between them.

[0046] S22: Based on the remaining track segments after track cutting, the similarity between the two tracks is calculated based on the improved DTW formula. The final formulas are shown in (8) and (9).

[0047]

[0048] Among them, D(l, j) is the similarity between two trajectories numbered i and j, and d(L i , L j ) is the number L in the overall trajectory i and L j The distance between them is calculated as shown in (9):

[0049] d(L i , L j )=d ⊥ (Li , L j )+d || (L i , L j )+d θ (L i , L j ) (9)

[0050] In the above scheme, in S3, the initial clustering of trajectories is performed based on the improved DBSCAN algorithm to solve the problem of low similarity of boundary trajectories within the same cluster caused by the DBSCAN core point propagation step. The defined similarity measurement method in S2 is applied in the clustering process to obtain the initial result clusters, which are described in detail as follows.

[0051] S31: Traverse all trajectories in the trajectory subset and perform clustering based on the improved DBSCAN algorithm.

[0052] S311: Set the radius threshold ε and the minimum number of neighbors threshold MinLns.

[0053] S312: Set neighbors to the neighbor set of the current trajectory. The remaining trajectories within the given half threshold ε are called neighbors of the current trajectory. If len(neighbors) ≥ MinLns, set the core trajectory, where len(neighbors) represents the number of neighbors calculated for the current trajectory.

[0054] S313: Define creation criteria, if the trajectory TR i It is identified as a core trajectory. If a new cluster can be initialized at this time, the length of the trajectory (determined by the trajectory segments within the trajectory) must be less than or equal to the maximum length of the neighbors. Otherwise, if this condition is not met, the processing of the trajectory TR will be postponed. i .

[0055] S314: Traverse each unclassified trajectory and find neighbors whose similarity is less than a given threshold ε according to the similarity measurement method defined in S2.

[0056] s315: When the number of neighbors is greater than or equal to a given threshold MinLns, the current trajectory is set as the core trajectory.

[0057] S316: Create a new cluster C while satisfying the creation criteria i , all current neighbors are classified into this cluster and added to the queue Q, and the trajectory in the current neighbors is temporarily defined as the boundary trajectory.

[0058] S32: Expand the cluster according to the queue Q and determine whether more trajectories can be added to the current new cluster Ci middle.

[0059] S321: Traverse each track TR in the queue Q according to the first-in-first-out principle i , find neighbors whose similarity is less than a given threshold ε,

[0060] S322: If the current neighbor satisfies the core trajectory, all neighbors of the current neighbor are grouped into this cluster and added to the queue Q.

[0061] S323: If the current neighbor does not satisfy the core trajectory, set the current neighbor as the boundary trajectory.

[0062] S324: Repeat the above operation until all trajectories are labeled. The labels are core trajectories, boundary trajectories, and noise trajectories.

[0063] S33: Define the remaining trajectories as noise trajectories, and pass the initial cluster results and corresponding trajectory labels to step s4.

[0064] In the above scheme, the polygonal boundary of the initial result cluster is obtained in s4, and two types of trajectory fine-grained segmentation algorithms are defined to process the currently undivided trajectories, thereby obtaining the final cluster result. The detailed description is as follows.

[0065] S41: traverse the initial result cluster set C = {C1, C2.....C n}, find their respective polygon boundaries Polygon i .

[0066] S42: Given the partitioning thresholds LenTra and LenLns, create inclusion criteria.

[0067] S43: Find the core trajectories that have not yet been classified as candidate trajectories based on the trajectory labels and perform fine-grained segmentation;

[0068] S431: traverse the initial result cluster set C = {C1, C2.....C n}, merge the current candidate trajectory with cluster C i Matching information of all trajectories in .

[0069] S432: Calculate the actual length ratio ActualLengthRatio. The relevant calculation formula is shown in (10):

[0070]

[0071] Among them, ActualLen(MI) is the sum of the actual lengths of the matched trajectory segments in the matching information, and ActualLen(candidate trajectory) is the sum of the actual lengths of the matched trajectory segments in the candidate trajectory.

[0072] S433: Calculate the segment ratio SegmentRatio. The relevant calculation formula is shown in (11):

[0073]

[0074] Among them, Len(MI) is the number of matched trajectory segments in the matching information, and Len(candidate trajectory) is the number of matched trajectory segments in the candidate trajectory.

[0075] S434: Given a segmentation threshold LenLns, if the segmentation ratio SegmentRatio is greater than the threshold LenLns, the current candidate trajectory is placed in the current cluster C i End the traversal.

[0076] S435: Given a partition threshold LenTra, if the actual length ratio ActualLengthRatio is greater than the threshold LenTra, the current candidate trajectory is placed into the current cluster C i End the traversal.

[0077] S44: Find the boundary trajectories that have not been classified yet as candidate trajectories according to the trajectory labels and perform fine-grained segmentation;

[0078] S441: traverse the current result cluster set C = {C1, C2.....C n}, find the polygon boundary Polygon i , find the intersection of the current candidate trajectory and the polygon, and put it into the current cluster C in units of trajectory segments i middle.

[0079] S442: All processes are completed, and the final cluster set C = {C1, C2.....C n}return.

[0080] S45: Define the final cluster set C = {C1, C2.....C n} is a polygon with a boundary of Polygon = {Polygon1, Polygon2.....Polygon n}, returned as the final result.

[0081] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0082] 1. This paper provides a method for demarcating urban traffic subregions based on overall trajectory clustering, fully considering the distribution characteristics of trajectory data in both time and space. During the trajectory preprocessing stage, the method cleans and regularizes the raw GPS trajectory data, removing outliers and noise interference. Trajectory quality is enhanced through trajectory segmentation and smoothing to ensure the accuracy of subsequent cluster analysis. By extracting and standardizing the spatiotemporal characteristics of trajectories, this method lays a solid foundation for subsequent overall trajectory similarity measurement and clustering operations, thereby better revealing the structural patterns and behavioral laws in urban transportation systems.

[0083] 2. This invention innovatively defines a new similarity measurement method between trajectory clustering units and trajectories, and uses the entire trajectory as the basic analysis object for clustering. Unlike traditional clustering methods based on points or line segments, this method introduces a dynamic time warping (DTW) algorithm in the similarity measurement stage. By dynamically aligning the distance relationship between trajectory points, it effectively preserves the overall shape and dynamic characteristics of the trajectory. This method not only reflects the similarity of trajectories in spatial paths, but also takes into account the density distribution of trajectories, so that the clustering results can more realistically reflect the traffic distribution and functional zoning of urban roads, and have stronger expressive power and practical application value.

[0084] 3. This paper proposes a two-stage clustering algorithm that overcomes the limitations of the traditional DBSCAN algorithm in boundary identification and effectively improves the quality of clustering results. In the first stage, the trajectories are preliminarily clustered using an improved DBSCAN algorithm to identify an initial cluster structure with strong internal consistency. In the second stage, the trajectories at the boundaries of the initial clusters are fine-grainedly subdivided to improve the similarity of trajectories in the boundary area, avoiding the over-aggregation problem caused by the parameter sensitivity of the original DBSCAN algorithm. This two-stage strategy significantly enhances the boundary clarity and cluster stability of the clusters, improves the rationality and interpretability of the division, and provides a more robust technical solution for sub-area division in complex transportation networks.

[0085] 4. The method of the present invention has clear cluster boundaries and high trajectory consistency, giving it a significant advantage in the delineation of urban traffic sub-regions. By preserving the overall structure and density characteristics of the trajectories, this method can effectively identify urban sub-regions with similar functions and consistent traffic behavior during the delineation process, thereby providing accurate and operational foundational support for various application scenarios such as traffic management, congestion control, and urban planning. In addition, the obtained traffic sub-regions have good visualization and spatial coherence, facilitating docking and integration with other urban management systems, demonstrating the practicality and promotional value of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Figure 1 A flow chart of a method for dividing urban traffic sub-areas based on overall trajectory clustering is provided for the implementation of the present invention;

[0087] Figure 2 A first-stage flow chart for the implementation of the present invention;

[0088] Figure 3 A second-stage flow chart is provided for the implementation of the present invention;

[0089] Figure 4 Schematic diagram of trajectory preprocessing for MDL;

[0090] Figure 5 After the trajectory preprocessing, the trajectory cutting is first performed, as shown in the example diagram of trajectory cutting;

[0091] Figure 6 Schematic diagram of the improved DTW calculation method;

[0092] Figure 7 Schematic diagram of the distance calculation method for trajectory segments;

[0093] Figure 8 This is the flow chart of the improved DBSCAN algorithm;

[0094] Figure 9 Flowchart of the algorithm for fine-grained partitioning of trajectories. DETAILED DESCRIPTION

[0095] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with certain specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions of the present invention are intended to fall within the scope of the claims of the present invention.

[0096] In addition, in order to better illustrate the present invention, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.

[0097] Based on the above objectives, the present invention proposes a method for dividing urban traffic sub-areas based on overall trajectory clustering, comprising the following steps:

[0098] Step S1: perform trajectory preprocessing according to the time dimension, define the trajectory adaptive cutting formula based on the trajectory segment, and record the matching information between two trajectories according to the trajectory cutting;

[0099] Step S2: Based on the matching information between each two trajectories, a similarity measurement calculation method between the trajectories is defined based on the improved DTW algorithm;

[0100] Step S3: Perform initial clustering of trajectories based on the improved DBSCAN algorithm. Apply the similarity measurement method defined in S2 during the clustering process to obtain the initial result clusters.

[0101] Step S4: Obtain the polygonal boundary of the initial result cluster, define two types of trajectory fine-grained partitioning algorithms to process the currently unpartitioned trajectories, and thus obtain the final cluster result;

[0102] In the above solution, in step S1, obtaining matching information includes the following steps:

[0103] S11: The initial input trajectory consists of GPS points. For each point, K-Means clustering is performed independently on the time dimension using the {longitude, latitude, timestamp} triple as the basic operation unit. By identifying the "inflection point" of the correlation curve, the optimal K value is determined to partition the original dataset.

[0104] S111: Run K-Means for K values starting from smaller numbers (such as 1 to 10).

[0105] S112: For each K, record the total intra-cluster sum of squares of the cluster:

[0106] S113: Draw an evaluation curve, where the horizontal axis is the K value (number of clusters) and the vertical axis is the total intra-cluster sum of squares.

[0107] S114: Check that the position where the curve changes from a sharp decline to a slow decline is the "inflection point", and use the K value corresponding to the "inflection point" as the optimal K value to divide the original data set.

[0108] S12: The MDL (minimum description length) method is further used to segment the trajectory on each subset, and each line segment in the trajectory is numbered, so as to finally obtain data subsets within different time periods composed of trajectory segments.

[0109] S121: Assume a trajectory p1, p2, p3. Now consider segmenting at p2. Instead of segmenting into line segment p1p3, segment p1p2 and line segment p2p3. Now calculate two coding lengths: line segment coding length L(H) and error coding length L(D|H). The relevant calculation formulas are shown in (1)(2):

[0110] L(H)=log2(length) (1)

[0111] L(D|H)=∑log2(error i ) (2)

[0112] Among them, length is p i to p jEuclidean distance between points, error i is the vertical distance from each point (i.e., p1, p2, p3) to p1p3 (see formula (5)).

[0113] S122: Calculate the case of no segmentation: calculate L(H) for the line segment p1p3, calculate L(D|H) based on the vertical distance from point p2 to p1p3, and finally obtain L(H)+L(D|H).

[0114] S123: Calculate the segmentation. At this point, all points are on the line segment, L(D|H) = 0, and calculate the sum of the code lengths of the line segments p1p2 and p2p3, L(H). This gives L(H) + L(D|H).

[0115] S123: Compare the two L(H)+L(D|H) in the split case and the non-split case. If the split value is smaller, split it, otherwise do not split it;

[0116] S13: Define the adaptive cutting formula for the longer track of any two tracks in the data set to complete the matching of the two tracks. The number of cutting segments is rounded down according to the result of formula (3):

[0117]

[0118] The variables m and n represent the number of line segments in the two trajectories respectively, max() represents the maximum number of line segments in the two trajectories, and min() represents the minimum number of line segments in the two trajectories.

[0119] S14: After the long track in the pairwise track is cut, the two tracks are matched after executing formula (3). After the matching is completed, the long track is cut, and the relevant matching information is recorded in the longer track: which track segments in the long track are retained, indicating which track segments match the short track. The relevant matching information can be used in subsequent steps, and the relevant matching information (MI) will be recorded in the longer track. The recording format of MI is shown in formula (4):

[0120] MI=[sid,a,b] (4)

[0121] In M1, a and b are unique identifiers of the trajectory segments in the current longer trajectory, and sid is the unique identifier of the shorter trajectory.

[0122] In the above scheme, in S2, based on the matching information between each two trajectories, a similarity measurement calculation method between trajectories is defined based on the improved DTW algorithm, so that the shape characteristics of the overall trajectory are preserved and the time overhead is reduced. S2 includes the following steps:

[0123] S21: Define the final similarity between two trajectory segments by the vertical distance d ⊥ , parallel distance d ‖| and angular distance d θ The sum of .

[0124] S211: Calculate vertical distance d ⊥ The relevant formula is shown in (5):

[0125]

[0126] Among them, the trajectory segment L j Endpoints on j and point e j In the trajectory segment L i The projection points on are point p s and point p e , then l ⊥1 Indicates s j To the projection point p s The Euclidean distance, then l ⊥2 Indicates e j To the projection point p e The Euclidean distance of .

[0127] S212: Calculate parallel distance d || The relevant formula is shown in (6):

[0128] d || (L i , L j )=min(l ||1 , l ||2 ) (6)

[0129] Among them, point s j and point e j In the trajectory segment L l The projection points on are point p s and point p e , then l ||1 Indicates p s to e i and s i The smaller the Euclidean distance between them, the smaller the l ||2 Indicates p e to e i and s i The smaller value of the Euclidean distance between i 、s i is the trajectory segment L i The endpoint on ;

[0130] S213: Calculate parallel distance d || The relevant formula is shown in (7):

[0131]

[0132] Among them, ||L j || represents the trajectory segment L j The length of the trajectory segment L i and L j Smaller angle between them.

[0133] S22: Based on the remaining track segments after track cutting, the similarity between the two tracks is calculated based on the improved DTW formula. The final formulas are shown in (8) and (9).

[0134]

[0135] Among them, D(i, j) is the similarity between two trajectories numbered i and j, and d(L i , L j ) is the number L in the overall trajectory i and L j The distance between them is calculated as shown in (9):

[0136] d(L i , L j )=d ⊥ (L l , L j )+d || (L i , L j )+d θ (L i , L j ) (9)

[0137] In the above scheme, in S3, the initial clustering of trajectories is performed based on the improved DBSCAN algorithm to solve the problem of low similarity of boundary trajectories within the same cluster caused by the DBSCAN core point propagation step. The defined similarity measurement method in S2 is applied in the clustering process to obtain the initial result clusters, which are described in detail as follows.

[0138] S31: Traverse all trajectories in the trajectory subset and perform clustering based on the improved DBSCAN algorithm.

[0139] S311: Set the radius threshold ε and the minimum number of neighbors threshold MinLns.

[0140] S312: Set neighbors to the neighbor set of the current trajectory. The remaining trajectories within the given half threshold ε are called neighbors of the current trajectory. If len(neighbors) ≥ MinLns, set the core trajectory, where len(neighbors) represents the number of neighbors calculated for the current trajectory.

[0141] S313: Define creation criteria, if the trajectory TR i It is identified as a core trajectory. If a new cluster can be initialized at this time, the length of the trajectory (determined by the trajectory segments within the trajectory) must be less than or equal to the maximum length of the neighbors. Otherwise, if this condition is not met, the processing of the trajectory TR will be postponed. i .

[0142] S314: Traverse each unclassified trajectory and find neighbors whose similarity is less than a given threshold ε according to the similarity measurement method defined in S2.

[0143] S315: When the number of neighbors is greater than or equal to a given threshold MinLns, the current trajectory is set as the core trajectory.

[0144] S316: Create a new cluster C while satisfying the creation criteria i , all current neighbors are classified into this cluster and added to the queue Q, and the trajectory in the current neighbors is temporarily defined as the boundary trajectory.

[0145] S32: Expand the cluster according to the queue Q and determine whether more trajectories can be added to the current new cluster C i middle.

[0146] S321: Traverse each track TR in the queue Q according to the first-in-first-out principle i , find neighbors whose similarity is less than a given threshold ε,

[0147] S322: If the current neighbor satisfies the core trajectory, all neighbors of the current neighbor are grouped into this cluster and added to the queue Q.

[0148] S323: If the current neighbor does not satisfy the core trajectory, set the current neighbor as the boundary trajectory.

[0149] S324: Repeat the above operation until all trajectories are labeled. The labels are core trajectories, boundary trajectories, and noise trajectories.

[0150] S33: Define the remaining trajectories as noise trajectories, and pass the initial cluster results and corresponding trajectory labels to step S4.

[0151] In the above scheme, the polygonal boundary of the initial result cluster is obtained in S4, and two types of trajectory fine-grained partitioning algorithms are defined to process the currently unpartitioned trajectories, thereby obtaining the final cluster result. A detailed description is as follows.

[0152] S41: traverse the initial result cluster set C = {C1, C2.....C n}, find their respective polygon boundaries Polygon i .

[0153] S42: Given the partitioning thresholds LenTra and LenLns, create inclusion criteria.

[0154] S43: Find the core trajectories that have not yet been classified as candidate trajectories based on the trajectory labels and perform fine-grained segmentation;

[0155] S431: traverse the initial result cluster set C = {C1, C2.....C n}, merge the current candidate trajectory with cluster C i Matching information of all trajectories in .

[0156] S432: Calculate the actual length ratio ActualLengthRatio. The relevant calculation formula is shown in (10):

[0157]

[0158] Among them, ActualLen(MI) is the sum of the actual lengths of the matched trajectory segments in the matching information, and ActualLen(candidate trajectory) is the sum of the actual lengths of the matched trajectory segments in the candidate trajectory.

[0159] S433: Calculate the segment ratio SegmentRatio. The relevant calculation formula is shown in (11):

[0160]

[0161] Among them, Len(MI) is the number of matched trajectory segments in the matching information, and Len(candidate trajectory) is the number of matched trajectory segments in the candidate trajectory.

[0162] S434: Given a segmentation threshold LenLns, if the segmentation ratio SegmentRatio is greater than the threshold LenLns, the current candidate trajectory is placed in the current cluster C i End the traversal.

[0163] S435: Given a partition threshold LenTra, if the actual length ratio ActualLengthRatio is greater than the threshold LenTra, the current candidate trajectory is placed into the current cluster C i End the traversal.

[0164] S44: Find the boundary trajectories that have not been classified yet as candidate trajectories according to the trajectory labels and perform fine-grained segmentation;

[0165] S441: traverse the current result cluster set C = {C1, C2.....C n}, find the polygon boundary Polygon i , find the intersection of the current candidate trajectory and the polygon, and put it into the current cluster C in units of trajectory segments i middle.

[0166] S442: All processes are completed, and the final cluster set C = {C1, C2.....C n}return.

[0167] S45: Define the final cluster set C = {C1, C2.....C n} is a polygon with a boundary of Polygon = {Polygon1, Polygon2.....Polygon n}, returned as the final result.

[0168] Application examples:

[0169] The input is a trajectory dataset consisting of GPS points. For each point, the {longitude, latitude, timestamp} triple is used as the basic operation unit.

[0170] The final output is the final cluster set C={C1,C2.....C n} and the polygon boundary:

[0171] Polygon={Polygon1, Polygon2....Polygon n}.

[0172] Based on the above steps, a trajectory cluster with clear boundaries can be obtained for use by the rear area control system.

Claims

1. A method for dividing urban traffic sub-areas based on overall trajectory clustering, characterized in that: include: Step s1: Preprocess the original trajectory data according to the time dimension, cut the long trajectory using the trajectory adaptive cutting formula, and record the matching information between each two trajectories; Step S2: Based on the improved DTW algorithm, the similarity measure between the trajectories is calculated by combining the vertical distance, parallel distance and angular distance between the trajectory segments; Step S3: Perform initial clustering of trajectories based on the improved DBSCAN algorithm. Apply the similarity measurement method defined in S2 during the clustering process to obtain the initial result clusters. Step S4: Obtain the polygonal boundaries of the initial cluster and use the fine-grained partitioning algorithm to process the unclassified trajectories to obtain the final traffic sub-region and its boundaries.

2. According to claim 1, a method for dividing urban traffic sub-areas based on overall trajectory clustering is characterized in that: In step S1, obtaining matching information includes the following steps: S11: The initial input trajectory consists of GPS points. For each point, a {longitude, latitude, timestamp} triple is used as the basic operation unit. K-Means clustering is performed independently in the time dimension. By identifying the "inflection point" of the correlation curve, the optimal K value is determined to partition the original dataset. S12: Use the minimum description length method to segment the trajectory on each subset and number each line segment in the trajectory, finally obtaining data subsets composed of trajectory segments in different time periods; S13: Define the adaptive cutting formula for the longer track of any two tracks in the data set to complete the matching of the two tracks. The number of cutting segments is rounded down according to the result of formula (3): The variables m and n represent the number of line segments in the trajectory. S14: After performing track cutting on the longer track in the pairwise track, relevant matching information is recorded in the longer track for easy use in subsequent steps. The relevant matching information (MI) will be recorded in the longer track. The recording format of MI is shown in formula (2): MI=[sid,a,b] (4) In MI, a and b are unique identifiers of the trajectory segments in the current longer trajectory, and sid is a unique identifier of the shorter trajectory.

3. The urban traffic sub-area division method based on overall trajectory clustering according to claim 1 is characterized in that: S12 includes the following steps: S121: Define a trajectory p i , p m , p j , in p m Split at, not split into line segments p i p j , split into line segments p i p m and line segment p m p j , calculate two coding lengths: segment coding length L(H) and error coding length L(D|H), and the relevant calculation formulas are shown in (1)(2): L(H)=log2(length) (1) L(D|H)=∑log2(error i ) (2) Among them, length is p i to p j Euclidean distance between points, error i For each point, p i , p m , p j to p m p j The vertical distance; S122: Calculate the case of non-segmentation: for line segment p i p j Calculate L(H) according to p m Point to p i p j Calculate the vertical distance L(D|H) and finally get L(H)+L(D|H); S123: Calculate the segmentation. At this time, all points are on the line segment, L(D|H)=0, and for the line segment p i p m and line segment p m p j Calculate the sum of the lengths of the two line segments, L(H), and obtain L(H)+L(D|H) in this case; S123: Compare the two L(H)+L(D|H) in the split case and the non-split case. If the split value is smaller, split the case; otherwise, do not split the case.

4. The urban traffic sub-area division method based on overall trajectory clustering according to claim 1 is characterized in that: In S2, based on the matching information between each two trajectories, the similarity measurement calculation method between the trajectories is defined based on the improved DTW algorithm, including the following steps: S21: Define the final similarity between two trajectory segments by the vertical distance d ⊥ , parallel distance d || and angular distance d θ The sum of the S211: Calculate vertical distance d ⊥ The relevant formula is shown in (5): Among them, the trajectory segment L j The endpoint e on j and point e j In the trajectory segment L i The projection points on are point p s and point p e , then l ⊥1 Indicates s j To the projection point p s The Euclidean distance, then l ⊥2 Indicates e j To the projection point p e The Euclidean distance of . S212: Calculate parallel distance d || The relevant formula is shown in (6): d || (L i ,L j )=min(l ||1 ,L ||2 ) (6) Among them, point s j and point e j In the trajectory segment L i The projection points on are points p s and point p e , then l ||1 Indicates p s to e i and s i The smaller the Euclidean distance between them, the smaller the l ||2 Indicates p e to e l and s i The smaller value of the Euclidean distance between them; S213: Calculate parallel distance d || The relevant formula is shown in (7): Among them, ||L j || represents the trajectory segment L j The length of the trajectory segment L i and L j Smaller angle between them; S22: Based on the remaining track segments after track cutting and the distance calculation method between track segments, the similarity of two tracks is calculated based on the DTW formula after the track segments are cut. The final formula is shown in (8): Among them, D(i, j) is the similarity between two trajectories numbered l and j, and d(L l , L j ) is the number L in the overall trajectory i and L j The distance between them is calculated as shown in (9): d(L i ,L j )=d ⊥ (L i ,L j )+d || (L i ,L j )+d θ (L i ,L j ) (9)。 5. The urban traffic sub-area division method based on overall trajectory clustering according to claim 1 is characterized in that: In S3, the initial clustering of trajectories is performed based on the improved DBSCAN algorithm. The similarity measurement method defined in S2 is applied in the clustering process to obtain the initial result clusters, which are described in detail as follows. S31: Traverse all trajectories in the trajectory subset and perform clustering based on the improved DBSCAN algorithm; S311: Setting the radius threshold ε and the minimum number of neighbors threshold MinLns; S312: Set neighbors as the neighbor set of the current trajectory. The remaining trajectories within the given half threshold ε are called neighbors of the current trajectory. If len(neighbors) ≥ MinLns, set the core trajectory, where len(neighbors) represents the number of neighbors calculated for the current trajectory. S313: Define creation criteria, if the trajectory TR i It is identified as a core trajectory. If a new cluster can be initialized at this time, the length of the trajectory must be less than or equal to the maximum length of the neighbors. Otherwise, if this condition is not met, the processing of the trajectory TR will be postponed. i ; S314: Traverse each unclassified trajectory and find neighbors whose similarity is less than a given threshold ε according to the similarity measurement method defined in S2. S315: When the number of neighbors is greater than or equal to a given threshold MinLns, the current trajectory is set as the core trajectory. S316: Create a new cluster C while satisfying the creation criteria i , all current neighbors are classified into this cluster and added to the queue Q, and the trajectory in the current neighbors is temporarily defined as the boundary trajectory; S32: Expand the cluster according to the queue Q and determine whether more trajectories can be added to the current new cluster C i middle; S321: Traverse each track TR in the queue Q according to the first-in-first-out principle i , find neighbors whose similarity is less than a given threshold ε, S322: If the current neighbor satisfies the core trajectory, all neighbors of the current neighbor are grouped into this cluster and added to queue Q; S323: If the current neighbor does not satisfy the core trajectory, set the current neighbor to the boundary trajectory; S324: Repeat the above steps until all trajectories are labeled. The labels are core trajectories, boundary trajectories, and noise trajectories. S33: The remaining trajectories are defined as noise trajectories, and the initial cluster results and corresponding trajectory labels are passed to the next step S4.

6. The urban traffic sub-area division method based on overall trajectory clustering according to claim 1 is characterized in that: In S4, the polygonal boundary of the initial result cluster is obtained, and two types of trajectory fine-grained partitioning algorithms are defined to process the currently unpartitioned trajectories, thereby obtaining the final cluster result. The detailed steps include: S41: traverse the initial result cluster set C=(C1, C2...C n }, find their respective polygon boundaries Polygon i ; S42: Given the partitioning thresholds LenTra and LenLns, create a counting criterion; S43: Find the core trajectories that have not yet been classified as candidate trajectories based on the trajectory labels and perform fine-grained segmentation; S431: traverse the initial result cluster set C = {C1, C2.....C n }, merge the current candidate trajectory with cluster C i Matching information of all trajectories in ; S432: Calculate the actual length ratio ActualLengthRatio. The relevant calculation formula is shown in (10): Among them, ActualLen(MI) is the sum of the actual lengths of the matched trajectory segments in the matching information, and ActualLen(candidate trajectory is the sum of the actual lengths of the matched trajectory segments in the candidate trajectory; S433: Calculate the segment ratio SegmentRatio. The relevant calculation formula is shown in (11): Among them, Len(MI) is the number of matched trajectory segments in the matching information, and Len(candidate trajectory) is the number of matched trajectory segments in the candidate trajectory; S434: Given a segmentation threshold LenLns, if the segmentation ratio SegmentRatio is greater than the threshold LenLns, the current candidate trajectory is placed in the current cluster C i In, end the traversal; S435: Given a partition threshold LenTra, if the actual length ratio ActualLengthRatio is greater than the threshold LenTra, the current candidate trajectory is placed into the current cluster C i In, end the traversal; S44: Find the boundary trajectories that have not been classified yet as candidate trajectories according to the trajectory labels and perform fine-grained segmentation; S441: traverse the current result cluster set C = {C1, C2.....C n }, find the polygon boundary Polygon i , find the intersection of the current candidate trajectory and the polygon, and put it into the current cluster C in units of trajectory segments i middle; S442: All processes are completed, and the final cluster set C = {C1, C2.....C n }return; S45: Define the final cluster set C = {C1, C2.....C n } is a polygon with a boundary of Polygon = {Polygon1, Polygon2.....Polygon n }, returned as the final result.

Citation Information

Cited By

  • Cross-camera vehicle tracking and trajectory matching method

    CN120672803A