Clustering method and device for vehicle trajectories, storage medium and electronic device

By selecting cluster centers of multiple reference trajectories in the vehicle trajectory clustering method, the problem of poor accuracy in vehicle trajectory clustering under complex intersection environments is solved, and more accurate trajectory classification is achieved.

CN116467615BActive Publication Date: 2026-04-24VANJEE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VANJEE TECHNOLOGY CO LTD
Filing Date
2023-04-14
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing vehicle trajectory clustering methods are inaccurate in complex intersection environments and cannot accurately represent the location of vehicle trajectories, resulting in inaccurate clustering results.

Method used

Based on the number of drivable routes at the target intersection, N reference trajectories are selected from a set of vehicle trajectories. Cluster centers are selected in each reference trajectory to form an initial set of N cluster centers. The vehicle trajectories are then clustered using these centers to determine the trajectory clusters.

Benefits of technology

It improves the accuracy of vehicle trajectory clustering, reduces the impact of complex intersection environments on clustering results, and achieves more accurate trajectory classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116467615B_ABST
    Figure CN116467615B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle trajectory clustering method and device, a storage medium and an electronic device. The method comprises the following steps: selecting N reference trajectories from a group of vehicle trajectories of a target intersection according to the number N of drivable routes of the target intersection, wherein each vehicle trajectory in the group of vehicle trajectories is a driving trajectory of a vehicle corresponding to each vehicle trajectory from the target intersection to the exit of the target intersection, and N is a positive integer greater than or equal to 2; selecting a group of clustering center points from each reference trajectory in the N reference trajectories respectively to obtain initial N groups of clustering center points; and performing a clustering operation on the group of vehicle trajectories according to the initial N groups of clustering center points to obtain a clustering result of the group of vehicle trajectories, wherein the clustering result of the group of vehicle trajectories is used to indicate N trajectory clusters obtained by clustering the group of vehicle trajectories and vehicle trajectories contained in each trajectory cluster in the N trajectory clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle wireless communication, and more specifically, to a method and apparatus for clustering vehicle trajectories, a storage medium, and an electronic device. Background Technology

[0002] Currently, in uncertain and dynamic traffic environments, understanding the characteristics of vehicle trajectories at various intersections and clustering similar trajectories to uncover hidden patterns can provide effective datasets for vehicle trajectory prediction and vehicle behavior analysis, thereby providing timely driving guidance and improving road traffic safety and efficiency.

[0003] Conventional clustering methods typically calculate the Euclidean distance between the point to be classified and the cluster center. However, for vehicle trajectories, especially at complex intersections, there are multiple possible routes for vehicles, and each route has different driving directions and lanes. A single cluster center cannot accurately represent the location of the trajectory, resulting in poor accuracy in trajectory clustering.

[0004] It is evident that the vehicle trajectory clustering methods in related technologies suffer from poor clustering accuracy due to the complexity of intersection environments. Summary of the Invention

[0005] This application provides a method and apparatus for clustering vehicle trajectories, a storage medium, and an electronic device to at least solve the problem of poor clustering accuracy in related art vehicle trajectory clustering methods due to the complexity of intersection environments.

[0006] According to one aspect of the embodiments of this application, a method for clustering vehicle trajectories is provided, comprising: selecting N reference trajectories from a set of vehicle trajectories at a target intersection based on the number N of drivable routes at the target intersection, wherein each vehicle trajectory in the set of vehicle trajectories is a segment of driving trajectory of a vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection, and N is a positive integer greater than or equal to 2; selecting a set of clustering center points from each of the N reference trajectories to obtain an initial set of N clustering center points; performing a clustering operation on the set of vehicle trajectories according to the initial set of N clustering center points to obtain a clustering result of the set of vehicle trajectories, wherein the clustering result of the set of vehicle trajectories is used to indicate the N trajectory clusters obtained by clustering the set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0007] According to another aspect of the embodiments of this application, a vehicle trajectory clustering device is also provided, comprising: a selection unit, configured to select N reference trajectories from a set of vehicle trajectories at a target intersection based on the number N of drivable routes at the target intersection, wherein each vehicle trajectory in the set of vehicle trajectories is a segment of driving trajectory of a vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection, and N is a positive integer greater than or equal to 2; a selection unit, configured to select a set of clustering center points from each of the N reference trajectories to obtain an initial set of N clustering center points; and an execution unit, configured to perform a clustering operation on the set of vehicle trajectories according to the initial set of N clustering center points to obtain a clustering result of the set of vehicle trajectories, wherein the clustering result of the set of vehicle trajectories is used to indicate the N trajectory clusters obtained by clustering the set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described vehicle trajectory clustering method at runtime.

[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described vehicle trajectory clustering method through the computer program.

[0010] In this embodiment, a clustering operation is performed on the vehicle trajectories using a set of cluster center points. Based on the number N drivable routes to the target intersection, N reference trajectories are selected from a set of vehicle trajectories. Each vehicle trajectory in the set represents a segment of the vehicle's journey from the target intersection to its departure from the intersection, and N is a positive integer greater than or equal to 2. A set of cluster center points is selected from each of the N reference trajectories to obtain an initial N sets of cluster center points. Clustering is then performed on the set of vehicle trajectories according to the initial N sets of cluster center points to obtain a... The clustering results of a group of vehicle trajectories are used to indicate the N trajectory clusters obtained by clustering a group of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters. Since a set of cluster centers is selected in each reference trajectory based on the trajectory characteristics of each reference trajectory, the trajectory position of different trajectories can be represented more accurately through a set of cluster centers. This can reduce the impact of the complex intersection environment on the clustering results, thereby improving the clustering accuracy and solving the problem of poor clustering accuracy caused by the complex intersection environment in related technologies. Attached Figure Description

[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of the hardware environment for an optional vehicle trajectory clustering method according to an embodiment of this application;

[0014] Figure 2 This is a flowchart illustrating an optional vehicle trajectory clustering method according to an embodiment of this application;

[0015] Figure 3 This is a schematic diagram of an optional vehicle trajectory clustering method according to an embodiment of this application;

[0016] Figure 4 This is a structural block diagram of an optional vehicle trajectory clustering device according to an embodiment of this application;

[0017] Figure 5This is a structural block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] According to one aspect of the embodiments of this application, a method for clustering vehicle trajectories is provided. Optionally, in this embodiment, the above-described method for clustering vehicle trajectories can be applied to, for example... Figure 1 The hardware environment shown includes vehicle networking device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to vehicle-to-everything (V2X) device 102 via a network. A database can be set up on the server or independently to provide data storage services for server 104. Here, vehicle-to-everything (V2X) device 102 may include onboard V2X devices located in the vehicle.

[0021] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth.

[0022] The vehicle trajectory clustering method in this embodiment can be executed by server 104, or jointly by server 104 and vehicle networking device 102. Taking the execution of the vehicle trajectory clustering method in this embodiment by server 104 as an example... Figure 2This is a flowchart illustrating an optional vehicle trajectory clustering method according to an embodiment of this application, as shown below. Figure 2 As shown, the process of this method may include the following steps:

[0023] Step S202: Based on the number N of drivable routes at the target intersection, select N reference trajectories from a set of vehicle trajectories at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the driving trajectory of the vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection. N is a positive integer greater than or equal to 2.

[0024] The vehicle trajectory clustering method in this embodiment can be applied to scenarios involving cluster analysis of vehicle trajectories at target intersections. Here, the target intersection can be a crossroads, a Y-shaped intersection, a three-way intersection, or other similar intersections. The lane layout of the target intersection is diverse and complex, and vehicles starting from the same location at the target intersection can have multiple travel routes to choose from. Cluster analysis of vehicle trajectories at the target intersection can refer to classifying the vehicle trajectories at the target intersection to obtain trajectory clusters. The number of trajectory clusters corresponds to the number of possible travel routes. Under different clustering requirements, possible travel routes can have different meanings. For example, the clustering requirement might be to cluster a group of vehicle trajectories to obtain trajectory clustering results for travel routes in various directions, where travel directions are categorized as left turn, straight, right turn, etc.; or, the clustering requirement might be to cluster a group of vehicle trajectories to obtain lane-level trajectory clustering results. Understandably, in some intersection configurations, the number of drivable routes obtained from the two interpretations mentioned above can be the same, for example, when lanes correspond one-to-one with driving directions. In other intersection configurations, the number of drivable routes obtained from the two interpretations generally differs. For instance, when a road segment has multiple straight-ahead lanes, multiple left-turn lanes, or multiple right-turn lanes, clustering by driving direction will merge lanes traveling in the same direction, while clustering by lane level will cluster the routes formed by individual lanes separately. Of course, the meaning of drivable routes can also take other forms, and the number of drivable routes is related to the lane layout of the intersection and the purpose / needs of clustering.

[0025] In uncertain and dynamic traffic environments, understanding the characteristics of vehicle trajectories and clustering similar trajectories, and extracting features of clustered trajectory clusters using methods such as Gaussian regression based on the trajectory classification results, can be used for vehicle trajectory prediction, vehicle navigation, lane anchoring, collision prediction, and monitoring and scheduling at intersections with the same target intersection or the same type and specifications (e.g., lane width, driving direction regulations, lane layout, etc.). This provides an effective dataset for vehicle behavior analysis. Furthermore, using clustered trajectory subsets for learning or application can effectively improve the processing time and prediction results of subsequent trajectory prediction functions.

[0026] In this embodiment, N reference trajectories can be selected from a set of vehicle trajectories at the target intersection, based on the number N of drivable routes at the target intersection. Here, each vehicle trajectory in the set can be a segment of the vehicle's journey from the target intersection to its departure from the target intersection, and N can be a positive integer greater than or equal to 2. The N reference trajectories can be used to determine the initial cluster centers. These N reference trajectories can be selected from the set of vehicle trajectories, can be randomly selected, or can be selected based on features such as the target intersection and vehicle trajectories; this embodiment does not impose any limitations on this.

[0027] The N possible routes at the target intersection can be determined based on the lane layout of the intersection. The actual possible directions for each lane can differ (straight, left turn, right turn, etc.), and multiple lanes can have the same possible direction (multiple straight, multiple left turn, multiple right turn, etc.). For general traffic scenarios, such as vehicle trajectories at intersections, the number of trajectory clusters, k, can be set based on the actual number of possible routes, i.e., the number of the aforementioned N reference trajectories. When determining the number of trajectory clusters, k, it is necessary to first determine the actual target intersection under study, and then determine all possible routes that vehicles might take at that intersection based on the traffic rules of the target intersection. By calculating the total number of possible routes in each lane leading to the intersection, the number of trajectory clusters, k, can be determined. This reduces the uncertainty in the calculation process and avoids impacting the trajectory clustering results.

[0028] For example, consider a two-way four-lane intersection. Assume the left lane in the same direction allows both straight and left turns, and the right lane in the same direction allows both straight and right turns. The clustering requirement is to cluster vehicle trajectories according to the number of possible travel directions. Based on the possible travel directions of each lane, the number of possible routes can be determined as k = 4 * 4. Correspondingly, when clustering the above set of vehicle trajectories, the number of categories can be set to k = 4 * 4. It should be noted that the actual possible travel directions of different lanes at the same intersection may not be the same; the number of categories k only needs to be determined based on the actual road conditions and the clustering requirements.

[0029] Step S204: Select a set of cluster center points from each of the N reference trajectories to obtain the initial N sets of cluster center points.

[0030] Conventional clustering methods, such as K-means clustering, typically calculate the Euclidean distance between the point to be classified and the cluster center. However, for vehicle trajectories, especially at complex intersections, there are multiple possible routes for vehicles, and each route corresponds to different driving directions and lanes. Taking a crossroads as an example, there are trajectories in different directions such as going straight, turning left, and turning right at the same time. A single cluster center point cannot accurately represent the position of the trajectory, which leads to a large discrepancy between the clustering results and the actual vehicle trajectories.

[0031] To at least address some of the aforementioned issues, this embodiment considers that vehicle trajectories at the target intersection exhibit certain patterns, and can cluster vehicle trajectories based on their spatiotemporal similarity. Specifically, according to the trajectory characteristics of the vehicle trajectories, a set of cluster center points is selected, and clustering operations are performed on each vehicle trajectory.

[0032] In this embodiment, a set of cluster center points can be selected from each of the N reference trajectories to obtain an initial set of N cluster center points. Here, a set of cluster center points can contain multiple cluster center points. The initial N sets of cluster center points can be used for the initial calculation process in the clustering operation. Correspondingly, depending on the selection method of the set of cluster center points, a set of points to be classified can be determined in each vehicle trajectory for the calculation of the Euclidean distance with the N sets of cluster center points.

[0033] Optionally, the aforementioned set of cluster centers can be effective feature points in each reference trajectory. Compared to a single cluster center, further trajectory clustering based on a set of feature points can more effectively represent the clustered trajectory clusters.

[0034] Step S206: Perform a clustering operation on a set of vehicle trajectories according to the initial N sets of cluster centers to obtain a set of vehicle trajectory clustering results. The set of vehicle trajectory clustering results is used to indicate the N trajectory clusters obtained by clustering the set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0035] After determining the initial N cluster centers, a clustering operation can be performed on a set of vehicle trajectories according to the initial N cluster centers to obtain the clustering results of the set of vehicle trajectories. Here, the clustering results of the set of vehicle trajectories can be used to indicate the N trajectory clusters obtained by clustering the set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0036] Optionally, the above clustering operation can be performed on each vehicle trajectory in the set of vehicle trajectories, based on the initial N sets of cluster centers and a set of unclassified points for each vehicle trajectory. The category of each vehicle trajectory within the N trajectory clusters can be determined by the Euclidean distance between the N sets of cluster centers and the set of unclassified points for each vehicle trajectory.

[0037] To improve the accuracy of clustering results, a condition for ending the clustering is set: after determining the category of each vehicle trajectory in N trajectory clusters, the cluster centers can be updated and determined repeatedly, and the vehicle trajectories contained in each of the N trajectory clusters can be determined until the position of the cluster centers no longer changes significantly. It should be noted that the main motivation for clustering vehicle trajectories using N sets of cluster centers is the assumption that the vehicle motion states in the local subsets of each vehicle trajectory are similar in spatiotemporal properties.

[0038] Through steps S202 to S206, based on the number N of drivable routes at the target intersection, N reference trajectories are selected from a set of vehicle trajectories at the target intersection. Each vehicle trajectory in the set is a segment of the vehicle's journey from the target intersection to its departure from the target intersection, and N is a positive integer greater than or equal to 2. A set of cluster centers is selected from each of the N reference trajectories to obtain the initial N sets of cluster centers. Clustering is then performed on the set of vehicle trajectories according to the initial N sets of cluster centers to obtain the clustering results. These results indicate the N trajectory clusters obtained from the clustering of the vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters. This solves the problem of poor clustering accuracy caused by the complexity of intersection environments in related technologies, thus improving clustering accuracy.

[0039] In one exemplary embodiment, before selecting N reference trajectories from a set of vehicle trajectories at the target intersection based on the number N drivable routes at the target intersection, the method further includes:

[0040] S11, obtain a set of candidate vehicle trajectories passing through the target intersection, wherein the trajectory information of each candidate vehicle trajectory in the set of candidate vehicle trajectories includes the vehicle location information and time information corresponding to each vehicle trajectory;

[0041] S12, based on the characteristics of the target intersection and the vehicle location and time information corresponding to each vehicle trajectory, select a set of vehicle trajectories from a set of candidate vehicle trajectories.

[0042] For a set of vehicle trajectories at a target intersection, the information can be determined based on the spatiotemporal information of each vehicle trajectory passing through the target intersection. In this embodiment, before the clustering operation begins, the acquired vehicle trajectories passing through the target intersection can be filtered. Trajectories that do not belong to the target intersection are filtered out, as are trajectories containing information outside the intersection's boundaries. Furthermore, considering that the total travel time of vehicles passing through the target intersection (the time between the start and end points of the target intersection) follows a normal distribution, trajectories with a total travel time greater than and / or less than a certain range can be filtered out.

[0043] In this embodiment, a set of candidate vehicle trajectories passing through the target intersection can be acquired. Based on the characteristics of the target intersection and the vehicle location and time information corresponding to each vehicle trajectory, a set of vehicle trajectories is selected from the set of candidate vehicle trajectories. Here, the trajectory information of each candidate vehicle trajectory in the set of candidate vehicle trajectories can include the vehicle location and time information corresponding to each vehicle trajectory. A set of candidate vehicle trajectories can be determined by vehicle information detected by the roadside unit at the target intersection and the positioning data uploaded by the vehicles; alternatively, the relevant information can be directly uploaded by the vehicles to the server and obtained from the server.

[0044] In this embodiment, a group of vehicle trajectories to be clustered is determined based on the spatiotemporal information of vehicle trajectories passing through the target intersection. This avoids the impact of vehicle trajectories that do not belong to the target intersection on the selection of cluster center points, thereby improving the accuracy of clustering results.

[0045] In an exemplary embodiment, a set of cluster center points is selected from each of the N reference trajectories to obtain the initial N sets of cluster center points, including:

[0046] S21, select the starting point and ending point of each reference trajectory from each reference trajectory to obtain the initial N sets of cluster centers; or,

[0047] S22, select the starting point, the ending point, and at least one equally spaced point between the starting point and the ending point of each reference trajectory from each reference trajectory to obtain the initial N sets of cluster centers.

[0048] Considering the strong similarity of vehicle trajectories at intersections, vehicles starting from the same lane typically have similar starting points. Furthermore, because vehicles need to reach their corresponding lanes, their ending points after turning or going straight are usually similar, although the turning radii of each vehicle in the middle of the intersection generally vary considerably. In this embodiment, feature points that include at least the trajectory start and end points can be used as cluster centers.

[0049] In this embodiment, the starting point and ending point of each reference trajectory can be selected from each reference trajectory to obtain the initial N sets of cluster centers. Alternatively, the starting point, ending point, and at least one equally spaced point between the starting and ending points of each reference trajectory can be selected from each reference trajectory to obtain the initial N sets of cluster centers.

[0050] Optionally, the start and end points of each reference trajectory can be determined based on the vehicle position information and time information in the vehicle trajectory.

[0051] For example, taking initial cluster centers A and B as initial center points, k trajectories can be randomly selected to initialize the center points. The two endpoints (start and end points) of the k trajectory sample data are set as initial center points A and B, serving as the initial center points for different trajectory clusters. The number of center points is 2^k, and the coordinates of the initialized center points are represented by (A...B ... x A y ) and (B x B y ) represents, as shown in formula (1).

[0052]

[0053] in, and The x and y coordinates of the starting point of the i-th vehicle's trajectory are represented. and The x and y coordinates represent the endpoint of the i-th vehicle's trajectory.

[0054] Optionally, when a set of cluster centers for each reference trajectory includes the start point, end point, and at least one dividing point between the start and end points of each reference trajectory, the number of dividing points can be determined based on the trajectory characteristics of the vehicle trajectories at the target intersection. In cases where vehicle trajectories are complex (e.g., multiple drivable routes, multiple actual vehicle flow directions), more dividing points can be selected between the start and end points as cluster centers. Conversely, in cases where vehicle trajectories are simple, fewer dividing points can be selected, or fewer dividing points can be chosen between the start and end points as cluster centers.

[0055] In this embodiment, by selecting the starting and ending points of the trajectory as cluster centers based on the spatiotemporal similarity of the initial and ending positions of the vehicle trajectory at the target intersection, the representation effect of the cluster centers on the vehicle trajectory can be improved, thereby improving the accuracy of the clustering results.

[0056] In an exemplary embodiment, a clustering operation is performed on a set of vehicle trajectories according to the initial N sets of cluster centroids to obtain a clustering result of the vehicle trajectories, including:

[0057] S31, taking the initial N sets of cluster centers as N sets of current cluster centers, and taking each vehicle trajectory in a set of vehicle trajectories as the current vehicle trajectory, perform the following first clustering operation to obtain the clustering result of a set of vehicle trajectories:

[0058] Select a set of trajectory points corresponding to N sets of current cluster centers in the current vehicle trajectory to obtain a set of current trajectory points. There is a one-to-one correspondence between each current cluster center in each set of N sets of current cluster centers and each current trajectory point in the set of current trajectory points.

[0059] Calculate the sum of the distances between each current cluster center point in each group of current cluster centers and the corresponding current trajectory points in each group of current trajectory points, obtaining the distance value corresponding to each group of current cluster centers; determine the trajectory cluster corresponding to the group of current cluster centers with the smallest corresponding distance value among the N groups of current cluster centers as the trajectory cluster to which the current vehicle trajectory belongs; or,

[0060] Calculate the average distance between each current cluster center point in each group of current cluster center points and the corresponding current trajectory point in each group of current trajectory points to obtain the distance value corresponding to each group of current cluster center points; determine the trajectory cluster corresponding to the group of current cluster center points with the smallest corresponding distance value among the N groups of current cluster center points as the trajectory cluster to which the current vehicle trajectory belongs.

[0061] Clustering operations on a set of vehicle trajectories may include calculating the Euclidean distance between a set of cluster centers and a set of trajectory points (i.e., the aforementioned points to be classified) for each vehicle trajectory, so as to divide the set of vehicle trajectories into trajectory clusters based on the Euclidean distance. In this embodiment, when performing the relevant calculation of the Euclidean distance, the initial N sets of cluster centers can be used as N sets of current cluster centers, and each vehicle trajectory in the set of vehicle trajectories can be used as the current vehicle trajectory to perform the first clustering operation, thereby obtaining the clustering result of the set of vehicle trajectories.

[0062] The first clustering operation described above can be as follows: select a set of trajectory points corresponding to N sets of current cluster center points in the current vehicle trajectory to obtain a set of current trajectory points; then calculate the sum of the distances between each current cluster center point in each set of current cluster center points and the corresponding current trajectory points in the set of current trajectory points to obtain the distance value corresponding to each set of current cluster center points; and determine the trajectory cluster to which the current vehicle trajectory belongs as the set of current cluster center points with the smallest corresponding distance value among the N sets of current cluster center points.

[0063] The first clustering operation described above can also be performed as follows: After obtaining a set of current trajectory points, calculate the average distance between each current cluster center point in each set of current cluster center points and the corresponding current trajectory point in the set of current trajectory points. Obtain the distance value corresponding to each set of current cluster center points, and determine the trajectory cluster corresponding to the set of current cluster center points with the smallest corresponding distance value among the N sets of current cluster center points as the trajectory cluster to which the current vehicle trajectory belongs. It should be noted that the distance between the current cluster center point and the corresponding current trajectory point can refer to the aforementioned Euclidean distance.

[0064] For example, taking the initial cluster centers as initial center point A and initial center point B, the starting point of the trajectory of each sample to be classified can be... and end point The two center points A of the k-th trajectory cluster are respectively k and B k Calculate the Euclidean distance and sum (or calculate the mean). The calculation formula can be shown in formula (2). The distance value is expressed as distance.

[0065]

[0066] As shown in formula (3), the trajectory cluster k with the smallest distance can be selected as the category of the vehicle trajectory.

[0067] k = arg min(distance(k)) (3)

[0068] In this embodiment, by calculating the distance between the cluster center point in each group of cluster center points and the trajectory points of each vehicle trajectory, the distance between each vehicle trajectory and the reference trajectory is determined, and thus the trajectory cluster category of each vehicle trajectory is determined, which can improve the accuracy of the clustering results.

[0069] In an exemplary embodiment, clustering is performed on a set of vehicle trajectories according to the initial N sets of cluster centroids to obtain a clustering result of the vehicle trajectories, and the method further includes:

[0070] S41, Repeat the following second clustering operation until the clustering termination condition is met, to obtain a set of vehicle trajectory clustering results:

[0071] The N cluster centers after the previous clustering are used as the N current cluster centers, and each vehicle trajectory in a set of vehicle trajectories is used as the current vehicle trajectory to perform the first clustering operation, resulting in a set of vehicle trajectory clustering results. The N cluster centers after the previous clustering include a set of cluster centers corresponding to each trajectory cluster, determined according to the vehicle trajectories included in each trajectory cluster obtained from the previous clustering.

[0072] The clustering termination condition includes: the positional change of a set of cluster center points in each of the N trajectory clusters after this clustering is less than or equal to a preset change threshold compared to the corresponding set of cluster center points in the N sets of cluster center points after the previous clustering.

[0073] To improve the accuracy of clustering results, a clustering termination condition is set: new cluster centers can be determined based on the results of the first clustering operation, and the aforementioned first clustering operation is repeated until the cluster centers no longer change significantly. In this embodiment, the clustering operation performed on a set of vehicle trajectories also includes repeatedly performing the second clustering operation until the clustering termination condition is met, resulting in a clustering result for the set of vehicle trajectories.

[0074] The aforementioned second clustering operation may include using the N cluster centers from the previous clustering as the N current cluster centers, and performing the first clustering operation on each vehicle trajectory in a set of vehicle trajectories as the current vehicle trajectory, to obtain the clustering result of a set of vehicle trajectories. Here, the N cluster centers from the previous clustering may include a set of cluster centers determined based on the vehicle trajectories included in each trajectory cluster obtained from the previous clustering, corresponding to each trajectory cluster.

[0075] The clustering termination condition mentioned above may include that the positional change of a set of cluster centers in each of the N trajectory clusters after this clustering compared to the corresponding set of cluster centers in the previous N clustering is less than or equal to a preset change threshold. Here, the preset change threshold can be a pre-set threshold used to determine the magnitude of the change in the cluster centers.

[0076] Optionally, the location of the cluster center point mentioned above can refer to the coordinate position of the cluster center point. Correspondingly, the preset change threshold can be multiple change thresholds set according to the number of coordinate axes, or it can be a change threshold set according to the sum of the numerical changes corresponding to different coordinate axes, or it can be a change threshold set according to the average value of the numerical changes corresponding to different coordinate axes. This embodiment does not limit this.

[0077] In this embodiment, the cluster centers are updated based on the previous calculation results, and the clustering operation is repeated until the position change of the cluster centers is less than the threshold, thus obtaining the final clustering result.

[0078] In an exemplary embodiment, after taking the N cluster centers from the previous clustering as the N current cluster centers and performing a first clustering operation on each vehicle trajectory in a set of vehicle trajectories as the current vehicle trajectory, the method further includes:

[0079] S51. Based on the vehicle trajectories contained in each trajectory cluster obtained after this clustering, determine a set of cluster center points corresponding to each trajectory cluster, and obtain N sets of cluster center points after this clustering.

[0080] S52, determine the positional deviation of each group of cluster centers in the N groups of cluster centers after this clustering from the corresponding group of cluster centers in the N groups of cluster centers after the previous clustering, and obtain the positional deviation corresponding to each group of cluster centers;

[0081] S53, if the sum of the deviations from the positions corresponding to the cluster center points of each group is less than or equal to the first deviation threshold, then the clustering termination condition is determined to be met; or...

[0082] S54, if the average deviation of the positional deviation corresponding to the cluster center point of each group is less than or equal to the second deviation threshold, the cluster termination condition is determined to be satisfied.

[0083] During the repeated execution of the second clustering operation, after taking the N cluster center points after the previous clustering as the N current cluster center points and taking each vehicle trajectory in a group of vehicle trajectories as the current vehicle trajectory to perform the first clustering operation, based on the vehicle trajectories contained in each trajectory cluster obtained at the end of this clustering, a set of cluster center points corresponding to each trajectory cluster is determined, thus obtaining the N cluster center points after this clustering.

[0084] Optionally, the cluster center points of each of the N groups of cluster center points after this clustering are determined by analyzing and calculating the trajectory points of all vehicle trajectories contained in each trajectory cluster obtained after this clustering.

[0085] Based on the determined positions of the N cluster centers after this clustering, the positional deviation of each cluster center in the N cluster centers after this clustering is determined from the corresponding cluster center in the N cluster centers after the previous clustering, thus obtaining the positional deviation corresponding to each cluster center.

[0086] When the aforementioned preset change threshold is a change threshold set based on the sum of numerical changes corresponding to different coordinate axes (i.e., the first deviation threshold), the aforementioned positional deviation corresponding to each cluster center point can be compared with the first deviation threshold, and if the sum of the deviations of the positional deviations corresponding to each cluster center point is less than or equal to the first deviation threshold, it is determined that the clustering termination condition is met.

[0087] When the aforementioned preset change threshold is a change threshold set based on the average value of the numerical change corresponding to different coordinate axes (i.e., the second deviation threshold), the aforementioned positional deviation corresponding to each cluster center point can be compared with the second deviation threshold. If the average deviation of the positional deviation corresponding to each cluster center point is less than or equal to the second deviation threshold, it is determined that the clustering termination condition is met.

[0088] In this embodiment, by determining whether clustering has ended based on the relationship between the sum or average of the positional deviations of the cluster center points determined by the current clustering trajectory clusters and the previous cluster center points and the corresponding threshold, the accuracy of clustering results can be improved.

[0089] In an exemplary embodiment, based on the vehicle trajectories contained in each trajectory cluster obtained after this clustering, a set of cluster center points corresponding to each trajectory cluster is determined, resulting in N sets of cluster center points after this clustering, including:

[0090] S61, determine the centroids of the starting points and ending points of the vehicle trajectories included in each trajectory cluster obtained after this clustering as a set of cluster center points for each trajectory cluster after this clustering, thus obtaining N sets of cluster center points after this clustering; or,

[0091] S62, determine the centroids of the starting points of the vehicle trajectories in each trajectory cluster obtained after this clustering, the centroids of the ending points of the vehicle trajectories in each trajectory cluster obtained after this clustering, and the centroids of the points where the vehicle trajectories are equally divided in each trajectory cluster obtained after this clustering as a set of cluster center points for each trajectory cluster after this clustering, and obtain N sets of cluster center points after this clustering.

[0092] When determining the N cluster centers after this clustering based on the vehicle trajectories contained in each trajectory cluster obtained at the end of this clustering, the centroid of the corresponding trajectory point of the vehicle trajectory contained in each trajectory cluster obtained at the end of this clustering can be determined as the corresponding cluster center.

[0093] Correspondingly, when the initial set of cluster center points is the starting and ending points of the reference trajectory, the centroids of the starting points of the vehicle trajectories contained in each trajectory cluster obtained after this clustering, and the centroids of the ending points of the vehicle trajectories contained in each trajectory cluster obtained after this clustering, can be determined as a set of cluster center points for each trajectory cluster after this clustering, thus obtaining N sets of cluster center points after this clustering.

[0094] For example, taking the initial cluster centers as initial center point A and initial center point B, for each category c... ktrajectory cluster l i As shown in formulas (4) and (5), the centroids of the starting and ending points of each category can be taken as the new cluster center points.

[0095]

[0096]

[0097] When the initial set of cluster center points is the starting point, ending point, and at least one dividing point between the starting and ending points of the reference trajectory, the centroids of the starting points, ending points, and dividing points of the vehicle trajectories included in each trajectory cluster obtained after this clustering are determined as a set of cluster center points for each trajectory cluster after this clustering, thus obtaining N sets of cluster center points after this clustering.

[0098] In this embodiment, the cluster center point for the next clustering is determined based on the centroid of the corresponding trajectory points of the vehicle trajectories contained in each trajectory cluster obtained after each clustering. This can improve the correlation between the cluster center point and the vehicle trajectory cluster, thereby improving the accuracy of trajectory clustering.

[0099] The clustering method for vehicle trajectories in this application embodiment will be explained below with reference to an optional example. In this optional example, the target intersection is a crossroads, and N is k.

[0100] This optional example provides a method for clustering vehicle trajectories at intersections. By setting multiple cluster centers based on the trajectory characteristics of the vehicle trajectories, the cluster centers can more accurately represent the location of the vehicle trajectories, thereby improving the accuracy of the clustering results.

[0101] The clustering method for vehicle trajectories in this optional example can be as follows: Figure 3 As shown, the process of the vehicle trajectory clustering method may include the following steps:

[0102] Step 1: Determine the number of clusters k based on the traffic scenario and clustering objective. The traffic scenario refers to the road environment of the intersection, such as lane layout and driving direction settings; the clustering objective refers to the final classification indicator, such as all driving routes corresponding to each driving direction at the intersection, or all driving routes corresponding to each lane at the intersection, etc.

[0103] Step 2: Determine the initial center points for the cluster.

[0104] Step 3: Perform sample trajectory classification.

[0105] Step 4: Update cluster centers, and repeat step 3.

[0106] Step 5, clustering ends.

[0107] This optional example fully utilizes the spatiotemporal similarity of vehicle positions and speeds in trajectories from the same starting position to the same ending position. By selecting multiple clustering center points to cluster vehicle trajectories, the accuracy of clustering results can be improved, and trajectory features can be extracted more effectively.

[0108] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0110] According to another aspect of the embodiments of this application, a vehicle trajectory clustering apparatus for implementing the above-described vehicle trajectory clustering method is also provided. Figure 4 This is a structural block diagram of an optional vehicle trajectory clustering device according to an embodiment of this application, such as... Figure 4 As shown, the device may include:

[0111] Selection unit 402 is used to select N reference trajectories from a set of vehicle trajectories at the target intersection based on the number N of drivable routes at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the driving trajectory of the vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection, and N is a positive integer greater than or equal to 2.

[0112] Selection unit 404, connected to selection unit 402, is used to select a group of cluster center points from each of the N reference trajectories to obtain the initial N groups of cluster center points;

[0113] The execution unit 406, connected to the selection unit 404, is used to perform a clustering operation on a group of vehicle trajectories according to the initial N groups of cluster center points, and obtain a clustering result of a group of vehicle trajectories. The clustering result of a group of vehicle trajectories is used to indicate the N trajectory clusters obtained by clustering a group of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0114] It should be noted that the selection unit 402 in this embodiment can be used to execute the above step S202, the selection unit 404 in this embodiment can be used to execute the above step S204, and the execution unit 406 in this embodiment can be used to execute the above step S206.

[0115] The above module selects N reference trajectories from a set of vehicle trajectories at the target intersection based on the number N drivable routes at the intersection. Each vehicle trajectory in the set represents a segment of the vehicle's journey from the target intersection to its departure, where N is a positive integer greater than or equal to 2. A set of cluster centers is selected from each of the N reference trajectories to obtain the initial N sets of cluster centers. Clustering is then performed on the set of vehicle trajectories according to the initial N sets of cluster centers to obtain the clustering results. These results indicate the N trajectory clusters obtained from the clustering and the vehicle trajectories contained within each of the N trajectory clusters. This addresses the problem of poor clustering accuracy in related technologies due to complex intersection environments, thus improving clustering accuracy.

[0116] In one exemplary embodiment, the above-described apparatus further includes:

[0117] The acquisition unit is used to acquire a set of candidate vehicle trajectories that pass through the target intersection before selecting N reference trajectories from a set of vehicle trajectories at the target intersection based on the number of drivable routes N at the target intersection. The trajectory information of each candidate vehicle trajectory in the set of candidate vehicle trajectories includes vehicle location information and time information corresponding to each vehicle trajectory.

[0118] The filtering unit is used to select a set of vehicle trajectories from a set of candidate vehicle trajectories based on the characteristics of the target intersection and the vehicle location and time information corresponding to each vehicle trajectory.

[0119] In one exemplary embodiment, the selection unit includes:

[0120] The first selection module is used to select the start point and end point of each reference trajectory from each reference trajectory, respectively, to obtain an initial N sets of cluster center points; or,

[0121] The second selection module is used to select the starting point of each reference trajectory, the ending point of each reference trajectory, and at least one equally spaced point between the starting point and the ending point of each reference trajectory, to obtain the initial N sets of cluster center points.

[0122] In one exemplary embodiment, the execution unit includes:

[0123] The first execution module is used to take the initial N sets of cluster center points as N sets of current cluster center points, and to perform the following first clustering operation on each vehicle trajectory in a set of vehicle trajectories as the current vehicle trajectory, to obtain the clustering result of a set of vehicle trajectories:

[0124] Select a set of trajectory points corresponding to N sets of current cluster centers in the current vehicle trajectory to obtain a set of current trajectory points. There is a one-to-one correspondence between each current cluster center in each set of N sets of current cluster centers and each current trajectory point in the set of current trajectory points.

[0125] Calculate the sum of the distances between each current cluster center point in each group of current cluster centers and the corresponding current trajectory points in each group of current trajectory points, obtaining the distance value corresponding to each group of current cluster centers; determine the trajectory cluster corresponding to the group of current cluster centers with the smallest corresponding distance value among the N groups of current cluster centers as the trajectory cluster to which the current vehicle trajectory belongs; or,

[0126] Calculate the average distance between each current cluster center point in each group of current cluster center points and the corresponding current trajectory point in each group of current trajectory points to obtain the distance value corresponding to each group of current cluster center points; determine the trajectory cluster corresponding to the group of current cluster center points with the smallest corresponding distance value among the N groups of current cluster center points as the trajectory cluster to which the current vehicle trajectory belongs.

[0127] In one exemplary embodiment, the execution unit further includes:

[0128] The second execution module is used to repeatedly execute the following second clustering operation until the clustering termination condition is met, and obtain a set of vehicle trajectory clustering results:

[0129] The N cluster centers after the previous clustering are used as the N current cluster centers, and each vehicle trajectory in a set of vehicle trajectories is used as the current vehicle trajectory to perform the first clustering operation, resulting in a set of vehicle trajectory clustering results. The N cluster centers after the previous clustering include a set of cluster centers corresponding to each trajectory cluster, determined according to the vehicle trajectories included in each trajectory cluster obtained from the previous clustering.

[0130] The clustering termination condition includes: the positional change of a set of cluster center points in each of the N trajectory clusters after this clustering is less than or equal to a preset change threshold compared to the corresponding set of cluster center points in the N sets of cluster center points after the previous clustering.

[0131] In one exemplary embodiment, the above-described apparatus further includes:

[0132] The first determining unit is used to determine a set of cluster centers corresponding to each trajectory cluster based on the vehicle trajectories contained in each trajectory cluster obtained after the current clustering, after taking the N sets of cluster centers after the previous clustering as N sets of current cluster centers and taking each vehicle trajectory in a set of vehicle trajectories as the current vehicle trajectory to perform the first clustering operation, so as to obtain the N sets of cluster centers after the current clustering.

[0133] The second determining unit is used to determine the positional deviation of each group of cluster centers in the N groups of cluster centers after this clustering from the corresponding group of cluster centers in the N groups of cluster centers after the previous clustering, so as to obtain the positional deviation corresponding to each group of cluster centers.

[0134] The third determining unit is used to determine that the clustering termination condition is met if the sum of the deviations from the positional deviations corresponding to the cluster center points of each group is less than or equal to the first deviation threshold; or,

[0135] The fourth determining unit is used to determine that the clustering termination condition is met when the average deviation of the positional deviation corresponding to the cluster center point of each group is less than or equal to the second deviation threshold.

[0136] In one exemplary embodiment, the first determining unit includes:

[0137] The first determining module is used to determine the centroids of the starting points and ending points of the vehicle trajectories included in each trajectory cluster obtained after this clustering as a set of cluster center points for each trajectory cluster after this clustering, thus obtaining N sets of cluster center points after this clustering; or,

[0138] The second determining module is used to determine the centroid of the starting point of the vehicle trajectory included in each trajectory cluster obtained after this clustering, the centroid of the ending point of the vehicle trajectory included in each trajectory cluster obtained after this clustering, and the centroid of the equidistant points of the vehicle trajectory included in each trajectory cluster obtained after this clustering as a set of cluster center points for each trajectory cluster after this clustering, thereby obtaining N sets of cluster center points after this clustering.

[0139] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented through software or hardware, and the hardware environment includes the network environment.

[0140] According to another aspect of the embodiments of this application, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to execute program code for any of the vehicle trajectory clustering methods described above in the embodiments of this application.

[0141] Optionally, in this embodiment, the storage medium may be located on at least one of the network devices in the network shown in the above embodiment.

[0142] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:

[0143] S1. Based on the number of drivable routes N at the target intersection, select N reference trajectories from a set of vehicle trajectories at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the vehicle's journey from the target intersection to its departure from the target intersection. N is a positive integer greater than or equal to 2.

[0144] S2, select a set of cluster center points from each of the N reference trajectories to obtain the initial N sets of cluster center points;

[0145] S3. Based on the initial N sets of cluster centers, perform a clustering operation on a set of vehicle trajectories to obtain a set of vehicle trajectory clustering results. The set of vehicle trajectory clustering results is used to indicate the N trajectory clusters obtained by clustering a set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0146] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated in this embodiment.

[0147] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0148] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described vehicle trajectory clustering method is also provided, which may be a server, a terminal, or a combination thereof.

[0149] Figure 5 This is a structural block diagram of an optional electronic device according to an embodiment of this application, such as... Figure 5 As shown, it includes a processor 502, a communication interface 504, a memory 506, and a communication bus 508. The processor 502, communication interface 504, and memory 506 communicate with each other via the communication bus 508.

[0150] Memory 506 is used to store computer programs;

[0151] When processor 502 executes a computer program stored in memory 506, it performs the following steps:

[0152] S1. Based on the number of drivable routes N at the target intersection, select N reference trajectories from a set of vehicle trajectories at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the vehicle's journey from the target intersection to its departure from the target intersection. N is a positive integer greater than or equal to 2.

[0153] S2, select a set of cluster center points from each of the N reference trajectories to obtain the initial N sets of cluster center points;

[0154] S3. Based on the initial N sets of cluster centers, perform a clustering operation on a set of vehicle trajectories to obtain a set of vehicle trajectory clustering results. The set of vehicle trajectory clustering results is used to indicate the N trajectory clusters obtained by clustering a set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters.

[0155] Optionally, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic device and other devices.

[0156] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0157] As an example, the memory 506 described above may include, but is not limited to, the selection unit 402, the selection unit 404, and the execution unit 406 in the vehicle trajectory clustering device described above. Furthermore, it may include, but is not limited to, other module units in the vehicle trajectory clustering device described above, which will not be elaborated upon in this example.

[0158] The processors mentioned above can be general-purpose processors, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; they can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0159] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0160] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. The device that implements the above-mentioned vehicle trajectory clustering method can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, PDA, mobile Internet Device (MID), PAD, etc. Figure 5 This does not limit the structure of the aforementioned electronic device. For example, the electronic device may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.

[0161] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0162] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0163] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0164] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0165] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0166] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the solution provided in this embodiment, depending on actual needs.

[0167] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or at least two units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0168] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for clustering vehicle trajectories, characterized in that, include: Based on the number N of drivable routes at the target intersection, N reference trajectories are selected from a set of vehicle trajectories at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the driving trajectory of the vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection. N is a positive integer greater than or equal to 2. From each of the N reference trajectories, select a set of cluster center points to obtain the initial N sets of cluster center points; Based on the initial N sets of cluster centers, a clustering operation is performed on the group of vehicle trajectories to obtain the clustering result of the group of vehicle trajectories. The clustering result of the group of vehicle trajectories is used to indicate the N trajectory clusters obtained by clustering the group of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters. The step of performing a clustering operation on the set of vehicle trajectories according to the initial N sets of cluster center points to obtain the clustering result of the set of vehicle trajectories includes: taking the initial N sets of cluster center points as N sets of current cluster center points, and performing the following first clustering operation on each vehicle trajectory in the set of vehicle trajectories as the current vehicle trajectory to obtain the clustering result of the set of vehicle trajectories: selecting a set of trajectory points corresponding to the N sets of current cluster center points in the current vehicle trajectory to obtain a set of current trajectory points, wherein there is a one-to-one correspondence between each current cluster center point in each set of current cluster center points of the N sets of current cluster center points and each current trajectory point in the set of current trajectory points; calculating the clustering result of each current cluster center point in each set of current cluster center points. The sum of the distances between each current cluster center point in the N current trajectory points and the corresponding current trajectory points in the N current trajectory points is used to obtain the distance value corresponding to each current cluster center point. The trajectory cluster corresponding to the group of current cluster center points with the smallest corresponding distance value among the N current cluster center points is determined as the trajectory cluster to which the current vehicle trajectory belongs. Alternatively, the average distance between each current cluster center point in the N current cluster center points and the corresponding current trajectory points in the N current trajectory points is calculated to obtain the distance value corresponding to each current cluster center point. The trajectory cluster corresponding to the group of current cluster center points with the smallest corresponding distance value among the N current cluster center points is determined as the trajectory cluster to which the current vehicle trajectory belongs. The step of performing a clustering operation on the group of vehicle trajectories according to the initial N groups of cluster center points to obtain the clustering result of the group of vehicle trajectories further includes: repeatedly performing the following second clustering operation until the clustering termination condition is met to obtain the clustering result of the group of vehicle trajectories: taking the N groups of cluster center points after the previous clustering as the N groups of current cluster center points, and performing the first clustering operation on each vehicle trajectory in the group of vehicle trajectories as the current vehicle trajectory to obtain the clustering result of the group of vehicle trajectories, wherein the N groups of cluster center points after the previous clustering include a group of cluster center points corresponding to each trajectory cluster determined according to the vehicle trajectories included in each trajectory cluster obtained from the previous clustering; wherein the clustering termination condition includes: the positional change between a group of cluster center points of each trajectory cluster in the N trajectory clusters after this clustering and the corresponding group of cluster center points in the N groups of cluster center points after the previous clustering is less than or equal to a preset change threshold.

2. The method according to claim 1, characterized in that, Before selecting N reference trajectories from a set of vehicle trajectories at the target intersection based on the number N drivable routes at the target intersection, the method further includes: Obtain a set of candidate vehicle trajectories passing through the target intersection, wherein the trajectory information of each candidate vehicle trajectory in the set of candidate vehicle trajectories includes vehicle location information and time information corresponding to each vehicle trajectory; Based on the characteristics of the target intersection and the vehicle location and time information corresponding to each vehicle trajectory, the set of vehicle trajectories is selected from the set of candidate vehicle trajectories.

3. The method according to claim 1, characterized in that, The step of selecting a set of cluster center points from each of the N reference trajectories to obtain the initial N sets of cluster center points includes: By selecting the starting point and ending point of each reference trajectory from each reference trajectory, the initial N groups of cluster centers are obtained; or, The initial N cluster centers are obtained by selecting the starting point, the ending point, and at least one equally spaced point between the starting point and the ending point of each reference trajectory from each reference trajectory.

4. The method according to claim 1, characterized in that, After taking the N cluster centers from the previous clustering as the N current cluster centers and performing the first clustering operation on each vehicle trajectory in the group of vehicle trajectories as the current vehicle trajectory, the method further includes: Based on the vehicle trajectories contained in each trajectory cluster obtained after this clustering, a set of cluster center points corresponding to each trajectory cluster is determined, resulting in the N sets of cluster center points after this clustering. Determine the positional deviation of each cluster center point in the N cluster center points after this clustering from the corresponding cluster center point in the N cluster center points after the previous clustering, and obtain the positional deviation corresponding to each cluster center point; If the sum of the deviations from the positions corresponding to the cluster center points of each group is less than or equal to a first deviation threshold, the clustering termination condition is determined to be satisfied; or, If the average deviation of the positional deviation corresponding to the center point of each cluster is less than or equal to the second deviation threshold, the clustering termination condition is determined to be satisfied.

5. The method according to claim 4, characterized in that, The step involves determining a set of cluster center points corresponding to each trajectory cluster based on the vehicle trajectories contained in each trajectory cluster obtained after this clustering, resulting in the N sets of cluster center points after this clustering, including: The centroids of the starting and ending points of the vehicle trajectories within each trajectory cluster obtained after this clustering are determined as a set of cluster center points for each trajectory cluster after this clustering, resulting in the N sets of cluster center points after this clustering; or, The centroids of the starting points, ending points, and equal division points of the vehicle trajectories in each trajectory cluster obtained after this clustering are determined as a set of cluster center points for each trajectory cluster after this clustering, thus obtaining the N sets of cluster center points after this clustering.

6. A clustering device for vehicle trajectories, characterized in that, include: The selection unit is used to select N reference trajectories from a set of vehicle trajectories of the target intersection based on the number N of drivable routes at the target intersection. Each vehicle trajectory in the set of vehicle trajectories is a segment of the driving trajectory of the vehicle corresponding to each vehicle trajectory from the start of the target intersection to the departure of the target intersection, and N is a positive integer greater than or equal to 2. The selection unit is used to select a set of cluster center points from each of the N reference trajectories to obtain the initial N sets of cluster center points; An execution unit is configured to perform a clustering operation on the set of vehicle trajectories according to the initial N sets of cluster center points, and obtain the clustering result of the set of vehicle trajectories, wherein the clustering result of the set of vehicle trajectories is used to indicate the N trajectory clusters obtained by clustering the set of vehicle trajectories and the vehicle trajectories contained in each of the N trajectory clusters. The execution unit includes: a first execution module, configured to take the initial N groups of cluster centers as N groups of current cluster centers, and perform the following first clustering operation on each vehicle trajectory in the group of vehicle trajectories as a current vehicle trajectory, to obtain the clustering result of the group of vehicle trajectories: selecting a group of trajectory points corresponding to the N groups of current cluster centers in the current vehicle trajectory, to obtain a group of current trajectory points, wherein each current cluster center in each group of the N groups of current cluster centers has a one-to-one correspondence with each current trajectory point in the group of current trajectory points; calculating the relationship between each current cluster center in each group of current cluster centers and the group of current trajectory points. The distance to each current trajectory point in the N groups of current trajectory points is calculated by summing the distances between the current trajectory points and the corresponding current trajectory points in each group. The trajectory cluster corresponding to the group of current trajectory points with the smallest distance value among the N groups of current trajectory points is determined as the trajectory cluster to which the current vehicle trajectory belongs. Alternatively, the average distance between each current trajectory point in each group of current trajectory points and the corresponding current trajectory point in the group of current trajectory points is calculated to obtain the distance to each current trajectory point in each group of current trajectory points. The trajectory cluster corresponding to the group of current trajectory points with the smallest distance value among the N groups of current trajectory points is determined as the trajectory cluster to which the current vehicle trajectory belongs. The execution unit further includes: a second execution module, used to repeatedly execute the following second clustering operation until the clustering termination condition is met, to obtain the clustering result of the group of vehicle trajectories: taking the N groups of cluster center points after the previous clustering as the N groups of current cluster center points, and taking each vehicle trajectory in the group of vehicle trajectories as the current vehicle trajectory to execute the first clustering operation, to obtain the clustering result of the group of vehicle trajectories, wherein the N groups of cluster center points after the previous clustering include a group of cluster center points corresponding to each trajectory cluster determined according to the vehicle trajectories included in each trajectory cluster obtained by the previous clustering; wherein the clustering termination condition includes: the positional change between a group of cluster center points of each trajectory cluster in the N trajectory clusters after this clustering and the corresponding group of cluster center points in the N groups of cluster center points after the previous clustering is less than or equal to a preset change threshold.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 5.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 5 through the computer program.

Citation Information

Patent Citations

  • Method and device for determining traffic flow index, equipment and storage medium

    CN113469075A

  • Expressway parking area identification method and device, electronic equipment and medium

    CN114528365A