Clustering and grouping method, device and equipment for multi-source trajectory data
By sorting multi-source trajectory data by timestamp and clustering by trajectory point spacing and angle, combined with sparse matrix and node graph cutting, the problem of inaccurate grouping of trajectory data in intersection and turning scenarios is solved, and efficient and accurate trajectory data grouping is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies struggle to effectively distinguish between different trajectory data when processing trajectory data, especially in intersection and curve scenarios, leading to inaccurate grouping or a reduction in the number of groups.
By sorting multi-source trajectory data by timestamp, using trajectory point spacing and angle as clustering parameters, and combining distance and angle clustering methods, a sparse matrix is constructed for clustering. The connections in the node graph are cut off, and different clusters are merged to achieve accurate grouping of trajectory data.
It effectively solves the problem of different paths for trajectory data in intersection and turning scenarios, improves the accuracy of grouping and computational efficiency, avoids group overlap and increased computational complexity, and saves memory usage.
Smart Images

Figure CN121637104A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of trajectory data processing in geographic data, and particularly relates to a multi-source trajectory data clustering grouping method, device and equipment. BACKGROUND
[0002] At present, the method for realizing trajectory segmentation in trajectory data analysis and processing mainly includes a density clustering-based algorithm, such as a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) combined with a Frechet distance method. The Frechet distance method can describe the similarity between trajectories by calculating the distance between trajectories, and the DBSCAN clustering with the Frechet distance as a parameter can group the data with similar shapes and close distances. Referring to the example shown in FIG. 1, different trajectory data is divided into two groups. Figure 1 SUMMARY
[0003] In order to solve the technical problem that the trajectory data paths of vehicles change in scenarios such as intersections and curves, and the trajectory data is still segmented and clustered into branches or paths after clustering, and is divided into multiple groups due to different lengths of trajectories, the present application provides a multi-source trajectory data clustering grouping method, device and equipment to further enrich the technical route and increase the selection space.
[0004] In a first aspect, the present application provides a multi-source trajectory data clustering grouping method, which can include the following steps.
[0005] sequencing the trajectory points in each trajectory data based on timestamps to obtain sequence points of the trajectory points in each trajectory data;
[0006] clustering based on the distance between the trajectory points of the same sequence points in the multi-source trajectory data and the angle between the trajectory points of the same sequence points as clustering parameters to group the multi-source trajectory data.
[0007] In one embodiment, the clustering based on the distance between the trajectory points of the same sequence points in the multi-source trajectory data and the angle between the trajectory points of the same sequence points as clustering parameters can include the following steps.
[0008] distance clustering based on the distance between the trajectory points of the same sequence points in the multi-source trajectory data as a clustering parameter to cluster the trajectory data of the same section into clusters;
[0009] The trajectory point angle between the trajectory points of the same sequence point position is taken as a clustering parameter to perform angle clustering on the same road section trajectory data included in the same cluster, so as to cluster the trajectory data of the same road section and the same direction into a cluster.
[0010] In another embodiment, the distance clustering is performed on the trajectory point distance between the trajectory points of the same sequence point position in the multi-pass trajectory data, so as to cluster the trajectory data of the same road section into a cluster, which can include:
[0011] The distance matrix of the trajectory point distance is constructed by the trajectory point distance between the trajectory points of the same sequence point position included in each pass of trajectory data and the trajectory points of the same sequence point position included in other trajectory data;
[0012] The distance clustering is performed on the distance matrix of the trajectory point distance, so as to cluster the trajectory data of the same road section into a cluster.
[0013] In another embodiment, the distance matrix of the trajectory point distance is constructed by the trajectory point distance between the trajectory points of the same sequence point position included in each pass of trajectory data and the trajectory points of the same sequence point position included in other trajectory data, which can include:
[0014] The one-way calculation is performed on the trajectory point distance between the trajectory points of the same sequence point position included in each pass of trajectory data and the trajectory points of the same sequence point position included in other trajectory data, so as to construct a sparse matrix of the trajectory point distance; and correspondingly, the distance clustering is performed on the sparse matrix as a clustering parameter.
[0015] In another embodiment, the angle clustering is performed on the same road section trajectory data included in the same cluster, so as to cluster the trajectory data of the same road section and the same direction into a cluster, which can include:
[0016] The angle clustering is performed on the same road section trajectory data included in the same cluster, so as to obtain a plurality of transverse clusters of the same road section and the same direction;
[0017] The transverse clusters are sequentially connected according to the sequence point positions of the trajectory points in the plurality of transverse clusters to obtain at least one longitudinal cluster, and a node graph representing the association relationship between the transverse clusters is constructed based on the longitudinal cluster;
[0018] The corresponding relationship between the transverse clusters in the node graph is determined;
[0019] If the transverse clusters are in a one-to-one relationship, the longitudinal cluster is fused into one group of multi-source trajectory data; if the transverse clusters are in a one-to-many relationship, the connection lines between the nodes in the node graph are cut, and the cut transverse clusters are respectively fused into at least two groups.
[0020] In another embodiment, the cutting of the connections between the nodes in the node graph can include:
[0021] The center point of the transverse cluster point set constructed for each transverse cluster is respectively accumulated with the distance between all other points in the transverse cluster point set to determine the first distance of each transverse cluster;
[0022] The first distances of all transverse clusters in each longitudinal cluster are accumulated to determine the second distance of each longitudinal cluster;
[0023] The second distances of the longitudinal clusters are compared, and the longitudinal cluster with the smallest second distance is fused, and the connections between the nodes of the other longitudinal clusters in the node graph are cut.
[0024] In another embodiment, the cutting of the connections between the nodes in the node graph can include:
[0025] The number of transverse clusters included in all longitudinal clusters in the node graph is respectively determined;
[0026] The longitudinal cluster with the smallest number is fused, and the connections between the nodes of the other longitudinal clusters in the node graph are cut.
[0027] In another embodiment, after the angle clustering based on the angle between the track points of the same sequence point as the clustering parameter, the cluster merging of different clusters based on the distance between the convex hulls constructed by the transverse cluster point sets included in the different clusters can be further included.
[0028] In another embodiment, the cluster merging of different clusters based on the distance between the convex hulls constructed by the transverse cluster point sets included in the different clusters can include:
[0029] The transverse cluster point set convex hull of the transverse cluster point set included in each cluster is constructed as a unit of each cluster;
[0030] The distance clustering is performed based on the distance between the transverse cluster point set convex hulls of different clusters as the clustering parameter to merge the different clusters.
[0031] In another embodiment, before the clustering, the trajectory data can be normalized by supplementing or deleting points based on the distance between adjacent track points.
[0032] In a second aspect, an embodiment of the present application provides a multi-source trajectory data clustering and grouping device, which can include:
[0033] The sorting module is configured to sort each piece of trajectory data in the multi-piece trajectory data based on the time stamp to obtain the sequence point of the track point in each piece of trajectory data;
[0034] The clustering and grouping module is used to cluster the multi-source trajectory data by using the distance between trajectory points of the same sequence position and the angle between trajectory points of the same sequence position as clustering parameters.
[0035] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the clustering and grouping method for multi-source trajectory data as described in the first aspect.
[0036] Fourthly, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the clustering and grouping method for multi-source trajectory data as described in the first aspect.
[0037] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0038] This invention provides a clustering and grouping method, apparatus, and device for multi-source trajectory data. The clustering and grouping method uses the distance between trajectory points of the same sequence position and the angle between trajectory points of the same sequence position in multiple trajectory data as clustering parameters for clustering. It can group trajectory data of different road segments and group trajectory data at the location where the trajectory data path changes. This solves the technical problem that DBSCAN characteristics cannot effectively distinguish trajectory data with different paths in intersections or turning scenarios.
[0039] Furthermore, by first performing distance clustering and then angular clustering based on the distance clustering results, we not only avoid the technical problems of direct angular clustering, such as the significant reduction in the number of groups and the lack of meaningful clustering due to the density reachability characteristics of DBSCAN; but also avoid the technical problem of the time complexity of distance clustering increasing exponentially due to the large amount of trajectory data in a single cluster in direct angular clustering.
[0040] Furthermore, when performing distance clustering, a sparse matrix of the distance between trajectory points is constructed using unidirectional calculation. Using the sparse matrix as a clustering parameter for distance clustering saves memory usage of the distance matrix and improves computational efficiency.
[0041] Furthermore, clustering trajectory data with the same path but inconsistent trajectory lengths solves the technical problem of excessively large distances caused by inconsistent trajectory data lengths, ultimately resulting in different clustering groups.
[0042] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0043] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0044] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0045] Figure 1 This is one of the schematic diagrams of trajectory data clustering based on DBSCAN in existing technologies;
[0046] Figure 2 This is the second illustration of DBSCAN clustering and grouping of trajectory data in existing technologies;
[0047] Figure 3 This is the third illustration of DBSCAN clustering and grouping of trajectory data in existing technologies;
[0048] Figure 4 This is a flowchart of a clustering and grouping method for multi-source trajectory data provided in an embodiment of the present invention;
[0049] Figure 5 This is a flowchart illustrating the detailed clustering and grouping method for multi-source trajectory data provided in this embodiment of the invention.
[0050] Figure 6 This is a schematic diagram of the trajectory point spacing normalization processing provided in an embodiment of the present invention;
[0051] Figure 7 This is a diagram showing the effect of distance clustering in step S53 of this embodiment of the invention;
[0052] Figure 8 This is a diagram showing the effect of angle clustering in step S54 of this embodiment of the invention;
[0053] Figure 9 This is a flowchart illustrating the specific execution of step S54 in an embodiment of the present invention.
[0054] Figure 10 This is a diagram illustrating the effect of constructing a vertical cluster as provided in an embodiment of the present invention.
[0055] Figure 11 This is a diagram illustrating the effect of merging different clusters provided in an embodiment of the present invention.
[0056] Figure 12 This is a schematic diagram of a sparse matrix provided in an embodiment of the present invention;
[0057] Figure 13 This is a schematic diagram of the structure of the clustering and grouping device for multi-source trajectory data provided in an embodiment of the present invention. Detailed Implementation
[0058] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0059] The inventors discovered in practical work that although the DBSCAN method can effectively divide trajectory data into regions and group them according to the distance between point sets to form clusters of various shapes, in special scenarios, such as intersections or curves, due to the characteristics of DBSCAN, it may eventually cluster even densely accessible points into one cluster. That is, it may cluster two densely accessible points that are relatively far apart into one cluster, which does not match the expected cluster shape. (See reference...) Figure 2 In the example shown, trajectory data 3 and trajectory data 4 are similar in shape and close in distance, so they are grouped into one cluster. However, trajectory data 2 and trajectory data 3 may also meet the clustering conditions, so trajectory data 2 and trajectory data 3 can be called a cluster. In this case, trajectory data 2 is density reachable from trajectory data 4. Similarly, trajectory data 1 and trajectory data 2 may cluster into one cluster, and trajectory data 1, trajectory data 3, and trajectory data 4 can all be called density reachable. Therefore, DBSCAN clustering will group these four trajectory data into one cluster, so it cannot effectively distinguish trajectory data with different paths.
[0060] The inventors also discovered in their practical work that trajectory data with similar paths may contain trajectory segments with significantly different lengths, resulting in large Frechet distances. Therefore, when clustering based on DBSCAN, these segments are divided into different clusters, referring to... Figure 3 The example shown, ultimately Figure 3 Five trajectory data points will be divided into two clusters. Given that existing technologies in multi-source trajectory data processing often group data with altered trajectory paths into the same cluster, or group data with the same path but different lengths into different clusters, failing to fully achieve the goal of clustering and segmenting trajectory data, this invention is proposed to address these issues. It aims to provide a method, apparatus, and device for clustering and grouping multi-source trajectory data that overcomes or at least partially solves these problems.
[0061] This invention provides a clustering and grouping method for multi-source trajectory data, referring to...Figure 4 As shown, the above method may include the following steps:
[0062] Step S41: Sort each of the multiple trajectory data based on the timestamp to obtain the sequence points of the trajectory points in each trajectory data.
[0063] This step first divides the road network data into multiple trajectory data based on the vehicle number (vehicle ID). Then, it sorts the data according to the time sequence based on the timestamps in each trajectory data. The time sequence can then be used to determine the sequence of trajectory points, thus obtaining the sequence of trajectory points in each trajectory data.
[0064] Step S42: Clustering is performed based on the distance between trajectory points of the same sequence position and the angle between trajectory points of the same sequence position in multiple trajectory data as clustering parameters, so as to group the multi-source trajectory data.
[0065] The clustering and grouping method for multi-source trajectory data provided in this embodiment of the invention uses the distance between trajectory points of the same sequence position and the angle between trajectory points of the same sequence position in multiple trajectory data as clustering parameters for clustering. This method can group trajectory data of different road segments and group trajectory data at the location where the path changes. It solves the technical problem that multiple trajectory data cannot effectively distinguish trajectory data with different paths in intersections or turning scenarios due to the characteristics of DBSCAN.
[0066] In a detailed embodiment, the inventors discovered in practice that although both trajectory point spacing and trajectory point angle can be used as clustering parameters, the clustering effect (grouping effect and computing power effect) varies significantly depending on the order of their execution or when they are executed simultaneously. Therefore, the inventors further improved the above embodiment. (Refer to...) Figure 5 As shown, this embodiment of the invention provides a detailed clustering and grouping method for multi-source trajectory data, which may include the following steps:
[0067] Step S51: Sort each trajectory data in the multiple trajectory data based on the timestamp to obtain the sequence position of the trajectory points in each trajectory data. The specific implementation of this step can refer to step S41 in the above embodiment, and will not be repeated here.
[0068] Step S52: Based on the distance between adjacent trajectory points, add or delete points in the trajectory data to achieve normalization of the trajectory data.
[0069] This step is performed after obtaining the sequence of trajectory points in each trajectory data set, but before the clustering and grouping step. The inventors discovered that, regardless of whether it's a single or multiple trajectory data sets, the large fluctuations in the spacing between trajectory points can affect the clustering results. Therefore, this step requires normalizing the trajectory spacing. Specifically, this can be achieved by calculating the spacing between adjacent trajectory points in a single trajectory data set, and then adding or deleting points to ensure a uniform density of trajectory points in each set.
[0070] In this embodiment of the invention, different spacing between adjacent trajectory points can be set based on the attributes of the road where the trajectory data is located, such as highways, urban roads, or rural roads. For example, this embodiment sets the spacing between trajectory points to be no less than 10 meters and no more than 20 meters. For trajectory points exceeding 20 meters, interpolation is performed to add points (trajectory points), calculating the number of added points based on the distance between the two points and the direction of the added points based on the angle difference. For trajectory points less than 10 meters apart, the trajectory points are deleted. (Refer to...) Figure 6 As shown, the red dots are the original trajectory points, the yellow dots are the supplementary points, the angle of the supplementary point is the midpoint of the angles of the two points before and after, and the black dots are the deleted points. In this step, it is ensured that after supplementing and deleting points, the distance between adjacent trajectory points meets the trajectory point distance set in the embodiment of this invention.
[0071] Step S53: Based on the distance between trajectory points of the same sequence in multiple trajectory data, perform distance clustering to cluster the trajectory data of the same road segment into clusters.
[0072] This step uses the distance between trajectory points of the same sequence in multiple trajectory data as a clustering parameter for distance clustering. In practice, each trajectory data is first traversed, and a distance matrix of trajectory point distances is constructed using the distance between trajectory points of the same sequence in each trajectory data and the distance between trajectory points of the same sequence in other trajectory data. Then, distance clustering is performed using the distance matrix of trajectory point distances as a clustering parameter to cluster trajectory data of the same road segment into clusters.
[0073] The inventors conducted in-depth research on how to represent the distance between trajectory points. By traversing each trajectory data set, they constructed a distance matrix by analyzing the distances between trajectory points with the same sequence of points in each set and those with the same sequence in other sets. They innovatively proposed using this distance matrix as the distance parameter for clustering, thus clustering trajectory data of the same road segment into a single cluster. (Refer to...) Figure 7 As shown, clustering is performed based on the distance matrix as a clustering parameter of the DBSCAN method. Figure 7Each red circle represents a cluster (horizontal cluster). Taking multiple trajectory data as an example, A, B, and F, and C and D are clustered together according to distance on the same sequence. E is not clustered with other trajectory data because its distance on the same sequence does not meet the clustering criteria. This completes the clustering of trajectory data on the same road segment. In a specific example, if the starting points of two trajectory data are far apart, it cannot be determined that they traveled on the same road segment. Alternatively, if the distance between the 100th and 150th trajectory points in two trajectory data is very close, then these 50 trajectory points can be determined to have traveled on the same road segment.
[0074] Step S54: Based on the angle between trajectory points of the same sequence location, perform angle clustering on the trajectory data of the same road segment included in the same cluster, so as to cluster the trajectory data of the same road segment and the same direction into clusters.
[0075] Step S54 builds upon step S53 by using the trajectory point angle as a clustering parameter and further performing angle clustering using the DBSCAN method. In this embodiment of the invention, compared to performing angle clustering first and then distance clustering, or performing both angle and distance clustering simultaneously, this embodiment performs distance clustering first and then angle clustering. Firstly, because the angle range is fixed (0°-360°), if an angle threshold of 10° is set, ideally it can be divided into 36 groups. Due to the characteristic of DBSCAN density reaching clustering, group adhesion may occur, significantly reducing the final number of groups, making distance clustering meaningless. Therefore, this process is suitable for situations where the overall angle information of the trajectory data is relatively discrete. Secondly, because the number of angle clustering groups is small, and each group contains a large amount of trajectory data, distance clustering, if calculated with a time complexity of O(n^2), will result in a higher time complexity. 2 The computational load for each group increases significantly, and the computation time multiplies. In terms of computational performance (computing power), it is inferior to performing distance clustering followed by angle clustering. (Refer to step S54 in this embodiment of the invention.) Figure 8 As shown, after the trajectory data A and B are clustered in this step, there are trajectory points whose road segment direction changes. An angle parameter is added to separate them into clusters, thus obtaining multiple clusters of the same road segment and the same direction.
[0076] In a more specific embodiment, refer to Figure 9 As shown, in this embodiment of the invention, step S54, clustering trajectory data of the same road segment and the same direction into clusters, may specifically include the following steps:
[0077] Step S541: Perform angular clustering on the trajectory data of the same road segment included in the same cluster to obtain multiple horizontal clusters of the same road segment in the same direction.
[0078] Step S542: Connect the horizontal clusters sequentially according to the sequence points of the trajectory points in multiple horizontal clusters to obtain at least one vertical cluster, and construct a node graph representing the relationship between the horizontal clusters based on the vertical clusters. (Refer to...) Figure 10 As shown, in this step, horizontal clusters are connected based on the sequence of trajectory points in each trajectory data. Each trajectory point (node) is connected sequentially to obtain multiple vertical clusters (such as...). Figure 10 The nodes 0→1→2→3→4→5→7 and 0→1→2→3→4→6 are two vertical clusters, which enables the construction of a node graph representing the horizontal cluster relationships from road network data.
[0079] Step S543: Determine the correspondence between horizontal clusters in the node graph. If the horizontal clusters have a one-to-one relationship, proceed to step S544; if the horizontal clusters have a one-to-many relationship, proceed to step S545. In this step, after merging the nodes (trajectory points) into multiple vertical clusters, it is determined whether the correspondence between the horizontal clusters in the node graph is a one-to-one relationship. If a node has multiple edges, it is not a one-to-one relationship, and the connecting lines corresponding to that node are cut to avoid clustering grouping errors. Refer to the above. Figure 10 As shown, node 4 corresponds to two branches, and the branch corresponding to node 4 should be further pruned.
[0080] Step S544: Merge the longitudinal clusters into a group of multi-source trajectory data.
[0081] Step S545: Cut the lines between nodes in the node graph and merge the cut horizontal clusters into at least two groups.
[0082] In this embodiment of the invention, by cutting the lines connecting nodes in the node graph, the location of path change can be accurately identified, solving the problem that multiple trajectory data are grouped together due to the DBSCAN feature in intersection or turning scenarios.
[0083] Step S55: Merge different clusters based on the distance between the convex hulls constructed from the lateral cluster point sets included in different clusters.
[0084] In step S55 of this embodiment of the invention, because the principle of the same sequence of points is adopted when performing distance clustering, trajectory data with different sequence of points on the same path are clustered into different clusters. To avoid trajectory data with similar paths potentially having trajectory segments with large differences in length, resulting in a large Frechet distance, they are divided into different clusters during DBSCAN clustering. In step S55 of this embodiment of the invention, different clusters are merged (cluster clustering). (Refer to...) Figure 11As shown, in this embodiment of the invention, cluster merging is performed based on the distance between the convex hulls constructed from the horizontal cluster point sets included in different clusters. In specific implementation, this invention creates a convex hull for each horizontal cluster point set (the smallest convex polygon that can contain a given point set, and uses the ConvexHull function to calculate the convex hull of the point set). By judging the distance between the horizontal cluster convex hulls, the DBSCAN clustering method is still used to perform a third fusion.
[0085] In this embodiment of the invention, step S55 finally merges the lateral clusters of different sequences, combining trajectory data with the same path but different trajectory lengths into one cluster, thus solving the problem that the distance is too large due to the inconsistent trajectory lengths, resulting in the data being divided into two groups.
[0086] In another optional embodiment, to avoid repetitive calculations during distance clustering, the inventors have further improved the construction of the distance matrix in this embodiment. In step S53 above, the distance matrix for the distance between trajectory points of the same sequence included in each trajectory data and the distance between trajectory points of the same sequence included in other trajectory data can be constructed by: performing a one-way calculation on the distance between trajectory points of the same sequence included in each trajectory data and the distance between trajectory points of the same sequence included in other trajectory data to construct a sparse matrix of trajectory point distances; correspondingly, the sparse matrix is used as a clustering parameter for distance clustering.
[0087] In this embodiment, during the traversal of each trajectory, the distance between each trajectory and other trajectories is calculated only in one direction (for example, if the distance between the first sequence points of trajectory data A and the first sequence points of trajectory data B is calculated using the first sequence points of trajectory data A, the distance between trajectory data B and the first sequence points of trajectory data A will not be calculated again). This results in a sparse matrix containing the distances between each identical sequence of trajectory points. In this embodiment, if the number of elements with a value of 0 in the matrix is far greater than the number of non-zero elements, then the matrix is called a sparse matrix.
[0088] Reference Figure 12 The sparse matrix constructed as shown is obtained by calculating the distance between trajectory data of the same sequence in each unidirectional direction. Figure 12There are 5 trajectory data points, numbered 1, 2, 3, and 4. For the same sequence of points, the distances between points 2 and 1, 3 and 1, 4 and 1, 3 and 2, 4 and 2, and 4 and 3 are calculated only in one direction. The purpose of constructing this sparse matrix is to save runtime memory. When the number of trajectory data points is large, the matrix becomes very large, and the other half doesn't need to be calculated or stored. For example, after calculating the distances between trajectory data 1 and 2, trajectory data 2 doesn't need to be calculated again with trajectory data 1, nor does it need to store the calculated value. In this embodiment of the invention, a sparse matrix of trajectory point distances is constructed by calculating the distances in one direction during distance clustering. Using the sparse matrix as a clustering parameter for distance clustering saves the memory usage of the distance matrix (for example, in the example provided by this invention, approximately 50% of the memory used to store the distance matrix is saved), thus improving computational efficiency.
[0089] It should be noted that the trajectory data (route) obtained through the above-described cutting steps in this embodiment of the invention will be stored in a database for use in subsequent mapping (road network map or navigation map). Based on the above steps, the segmented clustering results of multi-source trajectories are obtained, thus achieving the purpose of clustering grouping and filtering in this embodiment of the invention.
[0090] In an optional embodiment, the lines connecting nodes in the node graph are cut. This embodiment provides two cutting methods, as follows:
[0091] <Method 1>
[0092] The first step is to accumulate the distances between the center point of each horizontal cluster and all other points in the horizontal cluster to determine the first distance of each horizontal cluster. Within each horizontal cluster, the center point of the point set is selected, the distance from that center point to other trajectory points is calculated, and the calculated distances between trajectory points are accumulated to obtain the first distance of each horizontal cluster.
[0093] The second step involves summing the first distances of all horizontal clusters within each vertical cluster to determine the second distance for each vertical cluster. In this step, for each vertical cluster's route (trajectory data), the first distances of each horizontal cluster are summed to obtain the second distance. The larger the summed value, the more dispersed the trajectory points are. The route with the largest second distance is then clipped.
[0094] The third step is to compare the second distance of the vertical clusters, merge the vertical clusters with the smallest second distance, and cut the connections between nodes of other vertical clusters in the node graph.
[0095] <Method 2>
[0096] The first step is to determine the number of horizontal clusters included in each vertical cluster in the node graph. In this step, the number of horizontal clusters on each path formed by a vertical cluster is obtained, and the path with the fewest horizontal clusters is cut.
[0097] The second step is to merge the vertical clusters with the fewest numbers and cut the connections between nodes in other vertical clusters in the node graph.
[0098] In a specific embodiment, the above step S55, which merges different clusters based on the distance between the convex hulls constructed from the lateral cluster point sets included in different clusters, may specifically include: first, constructing the lateral cluster point set convex hull of the lateral cluster point set included in each cluster as a unit; then, performing distance clustering using the distance between the lateral cluster point set convex hulls of different clusters as a clustering parameter to merge different clusters.
[0099] Referring to the above Figure 11 As shown, firstly, the distance between convex hulls is calculated. If the distance falls within a threshold range, lateral cluster fusion is performed, i.e., the cluster IDs are changed to be the same. Specifically, two lateral clusters that meet the DBSCAN distance threshold are merged. Ultimately, the three lateral clusters of trajectory G will be in the same cluster as A, F, and B, thus achieving multi-source trajectory grouping and obtaining multiple sets of trajectory data with the same path and small directional differences. In this embodiment, two lateral clusters that meet the DBSCAN distance threshold are merged, and ultimately, the three lateral clusters of trajectory G will be in the same cluster as A, F, and B. This ultimately achieves multi-source trajectory grouping, realizing the grouping of multiple sets of trajectory data with the same path and small directional differences.
[0100] Based on the same inventive concept, this invention also provides a clustering and grouping device for multi-source trajectory data, referring to... Figure 13 As shown, the device may include a sorting module 131 and a clustering grouping module 132, and its working principle is as follows:
[0101] The sorting module 131 is used to sort each of the multiple trajectory data based on the timestamp, so as to obtain the sequence points of the trajectory points in each trajectory data.
[0102] The clustering and grouping module 132 is used to cluster data based on the distance between trajectory points of the same sequence position and the angle between trajectory points of the same sequence position in multiple trajectory data as clustering parameters, so as to achieve grouping of multi-source trajectory data.
[0103] In an optional embodiment, the clustering grouping module 132 is specifically used for:
[0104] Distance clustering is performed based on the distance between trajectory points of the same sequence in multiple trajectory data, so as to cluster trajectory data of the same road segment into clusters;
[0105] Using the angle between trajectory points of the same sequence location as the clustering parameter, the trajectory data of the same road segment included in the same cluster are clustered by angle, so as to cluster the trajectory data of the same road segment and the same direction into clusters.
[0106] In one specific embodiment, the clustering and grouping module 132 is specifically used for:
[0107] Iterate through each trajectory data and construct a distance matrix of trajectory point spacing based on the trajectory points of the same sequence included in each trajectory data and the trajectory points of the same sequence included in other trajectory data.
[0108] Distance clustering is performed using the distance matrix between the trajectory points as a clustering parameter to cluster trajectory data of the same road segment into clusters.
[0109] In another alternative embodiment, the clustering grouping module 132 is specifically used for:
[0110] A sparse matrix of trajectory point spacing is constructed by unidirectionally calculating the distance between trajectory points of the same sequence included in each trajectory data and the trajectory points of the same sequence included in other trajectory data; correspondingly, the sparse matrix is used as a clustering parameter for distance clustering.
[0111] In another optional embodiment, the clustering grouping module 132 is further configured to:
[0112] Angular clustering is performed on the trajectory data of the same road segment included in the same cluster to obtain multiple horizontal clusters of the same road segment in the same direction;
[0113] The horizontal clusters are sequentially connected according to the sequence of trajectory points in the multiple horizontal clusters to obtain at least one vertical cluster, and a node graph representing the relationship between the horizontal clusters is constructed based on the vertical cluster.
[0114] Determine the correspondence between horizontal clusters in the node graph;
[0115] If the horizontal clusters are in a one-to-one relationship, the vertical clusters are merged into a group of multi-source trajectory data; if the horizontal clusters are in a one-to-many relationship, the lines connecting the nodes in the node graph are cut, and the cut horizontal clusters are merged into at least two groups respectively.
[0116] In another optional embodiment, the clustering grouping module 132 is further configured to:
[0117] The distances between the center point of each horizontal cluster point set and all other points in the horizontal cluster point set are accumulated to determine the first distance of each horizontal cluster.
[0118] The first distances of all the lateral clusters in each vertical cluster are summed to determine the second distance of each vertical cluster;
[0119] The second distance of the vertical clusters is compared, and the vertical cluster with the smallest second distance is merged. The connections between nodes of other vertical clusters in the node graph are cut.
[0120] In another optional embodiment, the clustering grouping module 132 is further configured to:
[0121] Determine the number of horizontal clusters included in each vertical cluster of the node graph;
[0122] The vertical clusters with the fewest elements are merged, and the connections between nodes in other vertical clusters in the node graph are cut.
[0123] In another alternative embodiment, refer to Figure 13 As shown, the device may further include a merging module 133, which is used to merge different clusters based on the distance between the convex hulls constructed from the lateral cluster point sets included in the different clusters.
[0124] In one specific embodiment, the merging module 133 is specifically used for:
[0125] Using each cluster as a unit, construct the convex hull of the lateral cluster point set included in each cluster;
[0126] Distance clustering is performed using the distance between the convex hulls of the lateral cluster point sets of different clusters as the clustering parameter, so as to merge different clusters.
[0127] In another alternative embodiment, refer to Figure 13 As shown, the device may further include a normalization processing module 134, which is used to add or delete points in the trajectory data based on the spacing between adjacent trajectory points, so as to achieve normalization processing of the trajectory data.
[0128] Based on the same inventive concept, this embodiment of the invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described clustering and grouping method for multi-source trajectory data.
[0129] Based on the same inventive concept, this embodiment of the invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-mentioned clustering and grouping method for multi-source trajectory data.
[0130] The principle of the problem solved by the above-mentioned device, medium and related equipment in the embodiments of the present invention is similar to the aforementioned clustering and grouping method for multi-source trajectory data. Therefore, its implementation can refer to the implementation of the aforementioned clustering and grouping method for multi-source trajectory data, and the repeated parts will not be described again.
[0131] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0132] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0133] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0134] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0135] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for clustering grouping of multi-source trajectory data, characterized in that, The method comprises the following steps: sequencing each trajectory data in the multi-trajectory data based on a timestamp to obtain a sequence point of a trajectory point in each trajectory data; clustering based on a trajectory point distance between trajectory points of the same sequence point in the multi-trajectory data and a trajectory point angle between trajectory points of the same sequence point as clustering parameters to group the multi-source trajectory data.
2. The method of claim 1, wherein, The clustering based on a trajectory point distance between trajectory points of the same sequence point in the multi-trajectory data and a trajectory point angle between trajectory points of the same sequence point as clustering parameters comprises: distance clustering based on a trajectory point distance between trajectory points of the same sequence point in the multi-trajectory data as a clustering parameter to cluster trajectory data of the same road section into a cluster; angle clustering of the same road section trajectory data included in the same cluster based on a trajectory point angle between trajectory points of the same sequence point to cluster trajectory data of the same road section and the same direction into a cluster.
3. The method of claim 2, wherein, The distance clustering based on a trajectory point distance between trajectory points of the same sequence point in the multi-trajectory data as a clustering parameter to cluster trajectory data of the same road section into a cluster comprises: traversing each trajectory data to construct a distance matrix of the trajectory point distance between the same sequence point trajectory points included in each trajectory data and the same sequence point trajectory points included in other trajectory data; distance clustering based on the distance matrix of the trajectory point distance as a clustering parameter to cluster trajectory data of the same road section into a cluster.
4. The method of claim 3, wherein, The construction of the distance matrix of the trajectory point distance between the same sequence point trajectory points included in each trajectory data and the same sequence point trajectory points included in other trajectory data comprises: one-way calculation of the trajectory point distance between the same sequence point trajectory points included in each trajectory data and the same sequence point trajectory points included in other trajectory data to construct a sparse matrix of the trajectory point distance; and distance clustering based on the sparse matrix as a clustering parameter.
5. The method of claim 2, wherein, The angle clustering of the same road section trajectory data included in the same cluster to cluster trajectory data of the same road section and the same direction into a cluster comprises: angle clustering of the same road section trajectory data included in the same cluster to obtain a plurality of transverse clusters of the same road section and the same direction; connecting the transverse clusters in sequence according to the sequence points of the trajectory points in the plurality of transverse clusters to obtain at least one longitudinal cluster, and constructing a node graph representing the association relationship between the transverse clusters based on the longitudinal cluster; judging the corresponding relationship between the transverse clusters in the node graph; if the transverse clusters are in a one-to-one relationship, the longitudinal cluster is fused into one group of multi-source trajectory data; if the transverse clusters are in a one-to-many relationship, the connection between the nodes in the node graph is cut, and the cut transverse clusters are fused into at least two groups respectively.
6. The method of claim 5, wherein, The cutting of the connection between the nodes in the node graph comprises: accumulating the distances between the center point of the transverse cluster point set constructed by each transverse cluster and all other points in the transverse cluster point set to determine a first distance of each transverse cluster; accumulating the first distances of all the transverse clusters in each longitudinal cluster to determine second distances of each longitudinal cluster; comparing the second distances of the longitudinal clusters, fusing the longitudinal cluster with the smallest second distance, and cutting the connections between the nodes of other longitudinal clusters in the node graph.
7. The method of claim 5, wherein, The cutting of the connections between the nodes in the node graph comprises: determining the number of transverse clusters included in each longitudinal cluster in the node graph respectively; fusing the longitudinal cluster with the smallest number of transverse clusters and cutting the connections between the nodes of other longitudinal clusters in the node graph.
8. The method of claim 2, wherein, After the angle clustering based on the angle between the track points of the same sequence point as the clustering parameter, the method further comprises cluster merging based on the distance between the convex hulls constructed based on the transverse cluster point sets included in different clusters.
9. The method of claim 8, wherein, The cluster merging based on the distance between the convex hulls constructed based on the transverse cluster point sets included in different clusters comprises: constructing a transverse cluster point set convex hull of the transverse cluster point set included in each cluster as a unit; distance clustering based on the distance between the transverse cluster point set convex hulls of different clusters as the clustering parameter to perform cluster merging of different clusters.
10. The method according to any one of claims 1 to 9, characterized in that, Before the clustering, the method further comprises point supplementing or point deleting of the track data based on the interval between adjacent track points to realize normalization processing of the track data.
11. A device for clustering grouping of multi-source trajectory data, characterized in that, The method comprises: a sorting module configured to sort each track data in the multi-pass track data based on a timestamp to obtain a sequence point of a track point in each track data respectively; a clustering and grouping module configured to perform clustering based on the track point interval between the track points of the same sequence point and the track point angle between the track points of the same sequence point in the multi-source track data respectively as the clustering parameter to realize grouping of the multi-source track data.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the clustering and grouping method of the multi-source track data according to any one of claims 1-10.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the clustering and grouping method of the multi-source track data according to any one of claims 1-10.
Citation Information
Patent Citations
Track space-time clustering method and system and storage device
CN112749743A
Ocean data acquisition method based on AUV assistance and improved cross-layer clustering
CN115243212A
Traffic flow feature extraction method and system
WO2022032781A1