Trajectory point clustering method and device, electronic equipment, storage medium and program product

By using GeoHash gridding and local clustering, the trajectory point set is split into subsets within the grid for processing, which solves the problem of high computational complexity in existing technologies and improves processing efficiency and recognition capability.

CN122152943APending Publication Date: 2026-06-05WISDOM FOOTPRINT DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WISDOM FOOTPRINT DATA TECH CO LTD
Filing Date
2026-03-11
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies suffer from high computational complexity and low processing efficiency when dealing with ultra-large-scale or high-density geographic locations, making it difficult to perform effective cluster analysis.

Method used

The GeoHash gridding method is used to split the trajectory point set into subsets within the grid, perform local clustering within the grid, and then integrate across grids to generate a global cluster.

Benefits of technology

By using gridding and local clustering methods, the computational complexity of global clustering is greatly reduced, the processing efficiency is improved, and regions with spatial clustering characteristics can be effectively identified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152943A_ABST
    Figure CN122152943A_ABST
Patent Text Reader

Abstract

The application provides a trajectory point clustering method and device, electronic equipment, storage medium and program product, and relates to the technical field of big data. First, a trajectory point set of a target area within a specified time is obtained, the trajectory point set including longitude and latitude coordinates of a plurality of trajectory points; then, a GeoHash grid to which each trajectory point belongs is determined based on the longitude and latitude coordinates of the trajectory point, to obtain a trajectory point subset corresponding to the GeoHash grid; and then, for each two adjacent GeoHash grids, a trajectory point distribution distance between the two GeoHash grids is determined, and if the trajectory point distribution distance is lower than a preset interval, the two GeoHash grids are taken as a to-be-reviewed grid pair. The application splits the global trajectory point set into trajectory point subsets in the grids in a grid manner, then integrates across the grids after local clustering processing in the grids, greatly reduces the calculation complexity of global clustering, and improves the processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and more specifically, to a trajectory point clustering method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] With the continuous advancement of smart city construction and the rapid development of mobile internet technology, the demand for analyzing large-scale geographic trajectory data is also increasing. Geographic points (such as user travel records and mobile device positioning) are continuously generated at high frequency and over a wide area, making it crucial to identify areas with spatial clustering characteristics. Cluster analysis, as an important means of mining the inherent structure of spatial data, is particularly suitable for discovering irregularly shaped and highly dense hotspots, providing data support for traffic management, crowd monitoring, and business layout.

[0003] In existing technologies, density-based spatial clustering of applications with noise (DBSCAN) algorithms combined with distributed computing frameworks are commonly used to perform clustering analysis of geographic locations. However, since this approach directly clusters all geographic locations after calculating pairwise distances, it suffers from high computational complexity and significantly reduced processing efficiency when dealing with extremely large or high-density distributions of geographic locations. Summary of the Invention

[0004] The purpose of this invention is to provide a trajectory point clustering method, apparatus, electronic device, storage medium, and program product to improve the problems existing in the prior art.

[0005] The embodiments of the present invention can be implemented as follows: In a first aspect, the present invention provides a trajectory point clustering method, comprising: Obtain a set of trajectory points in a target area within a specified time period; the set of trajectory points includes the latitude and longitude coordinates of several trajectory points; Based on the latitude and longitude coordinates of each trajectory point, determine the GeoHash grid to which it belongs, and obtain the subset of trajectory points corresponding to the GeoHash grid; For every two adjacent GeoHash grids, the distance between the trajectory points is determined. If the distance between the trajectory points is less than a preset interval, the two GeoHash grids are considered as a pair of grids to be reviewed. Local clustering is performed on each subset of trajectory points to obtain the local clustering results within each GeoHash grid. After cross-grid integration of the two local clustering results corresponding to each grid pair to be verified, global cluster extraction is performed.

[0006] In an optional implementation, the step of determining the trajectory point distribution distance between two adjacent GeoHash grids includes: Determine the minimum bounding rectangle of all trajectory points in each GeoHash grid to obtain the envelope of trajectory points inside each GeoHash grid; For every two adjacent GeoHash grids, calculate the distance between the envelopes of their corresponding trajectory points to obtain the trajectory point distribution distance between the two GeoHash grids.

[0007] In an optional implementation, the step of determining the trajectory point distribution distance between two adjacent GeoHash grids includes: Determine the geometric center point of all trajectory points in each GeoHash grid; For every two adjacent GeoHash grids, calculate the distance between their geometric center points to obtain the trajectory point distribution distance between the two GeoHash grids.

[0008] In an optional implementation, the step of performing local clustering processing on each subset of trajectory points to obtain the local clustering result within each GeoHash grid includes: For each subset of trajectory points, a neighborhood set for each trajectory point is determined based on the latitude and longitude coordinates of each trajectory point in the subset. Each trajectory point in the neighborhood set whose number of trajectory points exceeds a set threshold is designated as a core point; Based on each core point and its neighborhood set, connectivity analysis is performed on each core point to generate a local undirected graph. The local clustering result includes the local undirected graph and the neighborhood set of each core point therein.

[0009] In an optional implementation, the step of performing connectivity analysis on each core point and its neighborhood set to generate a local undirected graph includes: Based on the neighborhood set of each core point, each core point pair with a density reachability relationship is selected from all core points. The density reachability relationship reflects that the two core points of the core point pair are in each other's neighborhood set. For each pair of core points, assign node IDs to the two core points of the pair and create an undirected edge between the two core points. A local undirected graph is generated based on each core point pair and its undirected edge.

[0010] In an optional implementation, the local clustering result includes a local undirected graph and a neighborhood set of each core point therein; The step of integrating the two local clustering results corresponding to each grid pair to be reviewed includes: For each grid pair to be verified, the core points of the two local undirected graphs corresponding to the grid pair are paired one by one to obtain multiple cross-grid point pairs; Select each target cross-grid point pair from all cross-grid point pairs, with an interval distance not exceeding the preset neighborhood radius, and create a cross-grid undirected edge between the two core points of each target cross-grid point pair; Generate a global undirected graph based on all local undirected graphs and all cross-grid undirected edges; A connected component algorithm is used to identify each connected cluster graph in the global undirected graph; wherein any two core points of the connected cluster graph are reachable through at least one undirected edge; Set the same cluster ID for each trajectory point of all core points and their neighborhood sets in each of the connected cluster graphs.

[0011] In a second aspect, the present invention provides a trajectory point clustering device, comprising: The acquisition module is used to acquire a set of trajectory points of a target area within a specified time period; the set of trajectory points includes the latitude and longitude coordinates of several trajectory points; The gridding module is used to determine the GeoHash grid to which each trajectory point belongs based on its latitude and longitude coordinates, and to obtain a subset of trajectory points corresponding to the GeoHash grid. The grid pairing module is used to determine the trajectory point distribution distance between two adjacent GeoHash grids. If the trajectory point distribution distance is less than a preset interval, the two GeoHash grids are regarded as a grid pair to be reviewed. The local clustering module is used to perform local clustering processing on each subset of trajectory points to obtain the local clustering results within each GeoHash grid. The global integration module is used to perform cross-grid integration of the two local clustering results corresponding to each grid pair to be reviewed, and then perform global cluster extraction.

[0012] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the trajectory point clustering method as described in the first aspect.

[0013] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the trajectory point clustering method described in the first aspect.

[0014] Fifthly, the present invention provides a program product that, when executed by a processor, implements the trajectory point clustering method described in the first aspect.

[0015] Compared with existing technologies, embodiments of the present invention provide a trajectory point clustering method, apparatus, electronic device, storage medium, and program product. First, a set of trajectory points in a target area within a specified time period is obtained, including the latitude and longitude coordinates of several trajectory points. Next, the GeoHash grid to which each trajectory point belongs is determined based on its latitude and longitude coordinates, resulting in a subset of trajectory points corresponding to each GeoHash grid. Then, for every two adjacent GeoHash grids, the trajectory point distribution distance between the two GeoHash grids is determined. If the trajectory point distribution distance is less than a preset interval, the two GeoHash grids are considered as a pair of grids to be reviewed. Local clustering processing is performed on each subset of trajectory points to obtain local clustering results within each GeoHash grid. Cross-grid integration is then performed on the two local clustering results corresponding to each pair of grids to be reviewed. This method, by dividing the global trajectory point set into subsets of trajectory points within grids through gridding, followed by cross-grid integration after local clustering processing within the grids, significantly reduces the computational complexity of global clustering and improves processing efficiency. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of a GeoHash grid for a local geographic region.

[0018] Figure 2 This is a flowchart illustrating a trajectory point clustering method provided in an embodiment of the present invention.

[0019] Figure 3 This is one of the schematic diagrams of trajectory point distribution between adjacent GeoHash grids provided in an embodiment of the present invention.

[0020] Figure 4 Four local undirected graphs are provided for embodiments of the present invention.

[0021] Figure 5 This is an example diagram of cross-grid integration provided in an embodiment of the present invention.

[0022] Figure 6 This is a schematic diagram of the structure of a trajectory point clustering device provided in an embodiment of the present invention.

[0023] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0026] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0027] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.

[0028] The technical terms involved in this invention are introduced as follows: 1. GeoHash is a method of dividing the Earth's surface into a series of grid cells. All points within the geographic area of ​​each grid cell with the same precision (same precision for latitude and longitude coordinates) share the same unique GeoHash code. The GeoHash encoding process is as follows: (1) Longitude range is usually from -180 to 180 degrees; latitude range is usually from -90 to 90 degrees.

[0029] (2) Convert latitude and longitude coordinates to binary representation: Convert longitude and latitude into binary strings respectively to obtain longitude binary strings and latitude binary strings. Taking longitude as an example, the conversion process is as follows: use the binary division method to divide the longitude range multiple times. After each division, compare the longitude with the midpoint of the division to determine a binary bit: take 0 if the longitude is to the left of the midpoint of the division, and take 1 otherwise.

[0030] (3) Latitude and longitude interlacing: The longitude binary string and the latitude binary string are interlaced according to certain rules to obtain a longer binary string; (4) Convert the binary string to Base32 encoding: Convert the interleaved binary string to Base32 encoding, which is to obtain a GeoHash encoding for easy reading and storage. For example, the geohash encoding of the latitude and longitude point (-74.00245, 41.73215) is wx4g07w.

[0031] 2. The characteristics of GeoHash encoding include: (1) Precision: The length of the GeoHash determines its precision. Generally speaking, the longer the GeoHash code, the more precise the location it represents; taking precision level 7 as an example, the generated GeoHash code can divide the space into cells of approximately 150 meters × 150 meters (e.g. Figure 1 (The GeoHash code for grid 1 is wx4g07w). When the precision is increased to level 9, the corresponding cell size shrinks to approximately 4 meters × 8 meters.

[0032] (2) Proximity: Locations with similar GeoHash codes are geographically close. This means that if two GeoHash codes have the same prefix, then the two locations are geographically close (e.g., Figure 1 In the text, grid 1 and grid 2 have the same prefix.

[0033] (3) Grid size: The size of the GeoHash grid is not fixed. As latitude increases, the grid width will become narrower because the Earth is an approximate ellipsoid.

[0034] Please see Figure 2 , Figure 2 This is a flowchart illustrating a trajectory point clustering method provided in an embodiment of the present invention. The execution subject of this method can be an electronic device such as a smartphone, personal laptop, personal computer, or server. The trajectory point clustering method may include the following steps S101 to S104.

[0035] S101. Obtain the set of trajectory points of the target area within a specified time period.

[0036] In this embodiment, the set of trajectory points includes the latitude and longitude coordinates of several trajectory points and trajectory numbers (which can identify a user trajectory to which the trajectory point belongs). The target area can be the whole country, a province or city, multiple provinces or cities, a district of a province or city, or an artificially defined geographical area, etc. The specified time can be working hours, a day, a week, or a month, etc.

[0037] The trajectory point set can be obtained by analyzing user trajectory based on mobile phone signaling data, or it can be the location data reported by a large number of vehicles (such as the riding location data of shared bicycles).

[0038] For example, in a smart traffic management scenario, the target area could be a new urban planning area, with the specified time being the daytime hours (6:00 AM to 10:00 PM) for seven consecutive days. By integrating mobile phone signaling data and public transportation card swipe data, the locations where residents spend their daily activities are extracted as trajectory points, thereby constructing a set of trajectory points covering a wide range of time and spatial scales. It should be noted that this example is merely illustrative and is not intended to be limiting.

[0039] S102. Determine the GeoHash grid to which each trajectory point belongs based on its latitude and longitude coordinates, and obtain the subset of trajectory points corresponding to the GeoHash grid.

[0040] In this embodiment, by setting a precision (which can be selected based on the neighborhood radius r during clustering), the latitude and longitude coordinates of each trajectory point can be converted into a GeoHash code. This GeoHash code represents the GeoHash grid to which the trajectory point belongs. After conversion, trajectory points with the same GeoHash code belong to the same GeoHash grid. The conversion process is existing technology and will not be described in detail here.

[0041] S103. For every two adjacent GeoHash grids, determine the trajectory point distribution distance between the two GeoHash grids. If the trajectory point distribution distance is lower than the preset interval, then the two GeoHash grids are used as a pair of grids to be reviewed.

[0042] It is understandable that the distance between trajectory points reflects the proximity of trajectory points in two adjacent GeoHash grids.

[0043] S104. Perform local clustering on each subset of trajectory points to obtain the local clustering results within each GeoHash grid.

[0044] For each GeoHash grid, local clustering within the grid needs to be performed based on the corresponding subset of trajectory points to identify which points within the grid belong to the same activity area or behavior pattern.

[0045] S105. After integrating the two local clustering results corresponding to each grid pair to be reviewed across grids, global cluster extraction is performed.

[0046] It is understandable that the closer the trajectory points are distributed in two adjacent GeoHash grids, the more likely there is an activity area or behavior pattern across grids. Therefore, after completing the local clustering process within each GeoHash grid, it is necessary to integrate the two local clustering results of each grid pair to be reviewed.

[0047] The trajectory point clustering method provided in this invention splits the global trajectory point set into a subset of trajectory points within a grid by means of gridding. Then, after local clustering within the grid, cross-grid integration is performed, which greatly reduces the computational complexity of global clustering and improves processing efficiency.

[0048] In the optional implementation, when determining whether two adjacent GeoHash grids need to be merged in step S103 above, it is necessary to analyze whether the actual spatial distribution of the trajectory points contained in the two grids is close. Therefore, the present invention provides the following two implementation methods.

[0049] One possible implementation method is to "determine the trajectory point distribution distance between two adjacent GeoHash grids for every two adjacent GeoHash grids", which may include steps S103A to S103B.

[0050] S103A. Determine the minimum bounding rectangle of all trajectory points in each GeoHash grid to obtain the envelope of trajectory points inside each GeoHash grid.

[0051] It can be understood that for a GeoHash grid, by finding the maximum longitude, minimum longitude, maximum latitude, and minimum latitude from the latitude and longitude coordinates of all trajectory points in the GeoHash grid, the minimum bounding rectangle of these trajectory points can be determined, which reflects the actual spatial distribution boundary of these trajectory points. In this way, each GeoHash grid determines a minimum bounding rectangle that represents the spatial distribution boundary of its internal trajectory points, i.e., the trajectory point envelope.

[0052] S103B. For every two adjacent GeoHash grids, calculate the interval distance between the corresponding trajectory point envelopes to obtain the trajectory point distribution distance between the two GeoHash grids.

[0053] In this embodiment, for every two adjacent GeoHash grids, the interval distance between the envelopes of their corresponding trajectory points is calculated. This interval distance refers to the shortest spatial distance between two smallest bounding rectangles, which can be understood as the closest distance from one envelope edge to another. This value can effectively reflect the actual separation degree between the point groups in the two grids: if this distance is very small or even zero, it indicates that the two sets of points are very close or have an overlapping tendency; if the distance is large, it indicates that the two are far apart.

[0054] For example, please see Figure 3 , Figure 3 The diagram shows four GeoHash grids (referred to as grids 1 to 4). Each point (black and green dots) represents a trajectory point. It can be seen that the interval between the trajectory point envelopes corresponding to grids 1 and 2 is d1, the interval between the trajectory point envelopes corresponding to grids 2 and 4 is d2, the interval between the trajectory point envelopes corresponding to grids 1 and 3 is d3, and the interval between the trajectory point envelopes corresponding to grids 3 and 4 is d4.

[0055] like Figure 3 With a neighborhood radius r (e.g., r = 100m or 200m) as the preset interval, if d2 < r and d4 < r, then grid 2 and grid 4 need to form a grid pair to be checked, and grid 3 and grid 4 also need to form a grid pair to be checked.

[0056] It should be noted that, Figure 3 The examples shown are merely illustrative and are not intended to be limiting.

[0057] The second optional implementation method, "for every two adjacent GeoHash grids, determine the distance between the trajectory points of the two GeoHash grids", may include steps S103a to S103b.

[0058] S103a. Determine the geometric center point of all trajectory points in each GeoHash grid.

[0059] In this embodiment, the geometric center point can be obtained by averaging the longitude and latitude of all trajectory points within a GeoHash grid, and can be regarded as the "center of gravity" of these trajectory points in geographic space.

[0060] S103b. For every two adjacent GeoHash grids, calculate the distance between their geometric center points to obtain the trajectory point distribution distance between the two GeoHash grids.

[0061] In this embodiment, for every two adjacent GeoHash grids, the distance between the corresponding geometric center points of these two grids is directly calculated. This distance is typically calculated using a planar or spherical distance formula (such as the Haversine formula), reflecting the actual geographical distance between the two center points.

[0062] In this case, the distance between the geometric center points is used as the distance between the trajectory points of two GeoHash grids. The preset interval needs to be greater than the neighborhood radius r. For example, if the neighborhood radius r is 100m, the preset interval can be set to 200m or 180m. It should be noted that this example is only an example and is not a limitation.

[0063] In this way, the shortest interval between the envelopes of trajectory points corresponding to two adjacent GeoHash grids or the distance between the geometric center points corresponding to two adjacent GeoHash grids is used to measure the proximity of trajectory point distribution. This significantly reduces computational complexity while still reasonably reflecting the proximity of trajectory point distribution within two adjacent GeoHash grids. It is suitable for large-scale trajectory data processing scenarios with high computational efficiency requirements.

[0064] It should be understood that after splitting the trajectory point subsets, each subset needs to be clustered individually to identify activity regions with dense spatial distribution characteristics. This clustering process mimics the idea of ​​density-based clustering, discovering naturally formed clustering patterns by analyzing the proximity relationships between points. Specifically, taking a subset of trajectory points corresponding to a GeoHash grid as an example, the implementation process of clustering this subset of trajectory points can include the following sub-steps S1041~S1044.

[0065] S1041. Based on the latitude and longitude coordinates of each trajectory point in the subset of trajectory points, determine the neighborhood set of each trajectory point.

[0066] In this embodiment, based on the latitude and longitude coordinates of each trajectory point in the trajectory point subset, the interval distance between any two trajectory points can be calculated. Then, for each trajectory point, each neighboring trajectory point whose interval distance does not exceed the preset neighborhood radius r is found from other trajectory points, thus obtaining the neighborhood set of the trajectory point.

[0067] S1042. Take each trajectory point in the neighborhood set whose number of trajectory points exceeds a set threshold as the core point.

[0068] In this embodiment, for a trajectory point in the subset of trajectory points, if the number of trajectory points in its neighborhood exceeds a set threshold (e.g., 7 or 10), the trajectory point can be considered a core point. A core point represents a key location within a high-density area, with a sufficient number of neighbors to support its potential to become a cluster center. For example, Figure 3 Each green dot in the diagram represents a core point.

[0069] S1043. Based on each core point and its neighborhood set, perform connectivity analysis on each core point to generate a local undirected graph.

[0070] In this embodiment, connectivity analysis is performed on all identified core points. This process mainly examines which core points have density-reachable relationships, meaning that two core points are in each other's neighborhood sets, or can be understood as neighbors. This analysis yields a local undirected graph corresponding to the GeoHash grid containing the subset of trajectory points. Each core point in this local undirected graph is connected to at least one other core point via an undirected edge. Therefore, a local clustering result includes the local undirected graph and the neighborhood set of each core point in that graph.

[0071] Optionally, a graph structure can be used to organize and analyze the density reachability relationships between core points within a GeoHash grid. This extends isolated core points to a local undirected graph, which is helpful for subsequent global cluster extraction.

[0072] That is, the process of generating a corresponding local undirected graph in a GeoHash grid can include steps a1 to a3: Step a1: Based on the neighborhood set of each core point, select each pair of core points that have a density reachability relationship from all core points. Here, the density reachability relationship reflects that the two core points of the core point pair are in each other's neighborhood set. Specifically, for all core points within a GeoHash grid, it is possible to determine whether there is a density reachable relationship between any two core points; Step a2: For each pair of core points, assign a unique node ID to each of the two core points in the pair, and create an undirected edge between the two core points. Step a3: Generate a local undirected graph based on each core point pair and its undirected edges.

[0073] For example, for Figure 3 After performing connectivity analysis on each core point within each grid, four local undirected graphs are obtained that can be entered. Figure 4 As shown. Figure 4 In the diagram, each red edge represents an undirected edge. It should be noted that this example is merely illustrative and is not intended to be limiting.

[0074] In an optional implementation, for step S105 above, cross-mesh integration can be performed by checking the connectivity between the two local undirected graphs corresponding to each pair of adjacent grids to be checked. That is, the implementation process of step S105 may include the following sub-steps S1051 to S1055.

[0075] S1051. For each grid pair to be verified, the core points of the two local undirected graphs corresponding to the grid pair to be verified are paired one by one to obtain multiple cross-grid point pairs.

[0076] For example, with Figure 4Local undirected Figure 2 and local undirected Figure 4 For example, locally undirected Figure 2 Each core point in the process needs to be related to the local undirected... Figure 4 Each core point is paired up one by one. It should be noted that this example is for illustrative purposes only and is not intended to be limiting.

[0077] S1052. Select each target cross-grid point pair from all cross-grid point pairs, with an interval distance not exceeding the preset neighborhood radius, and create a cross-grid undirected edge between the two core points of each target cross-grid point pair.

[0078] In this embodiment, each cross-grid point pair needs to calculate the distance between the two core points. If the distance does not exceed the preset neighborhood radius, a cross-grid undirected edge can be created between the two core points.

[0079] That is, for each pair of grids to be verified in the target area, steps S1051 to S1052 need to be executed. This can identify the connectivity between two adjacent GeoHash grids with similar trajectory point distributions, and achieve cross-grid integration.

[0080] S1053. Generate a global undirected graph based on all local undirected graphs and all cross-grid undirected edges.

[0081] S1054. Use the connected component algorithm to identify each connected cluster graph in the global undirected graph.

[0082] In a connected cluster graph, any two core nodes are reachable through at least one undirected edge. That is, there is no connection between two connected cluster graphs, while any two nodes within a connected cluster graph are directly reachable or reachable across at least one node. Each such connected cluster graph corresponds to an independent high-density clustered region.

[0083] For example, for Figure 4 After cross-grid integration of the two grid pairs to be reviewed, grids 2 and 4, and grids 3 and 4, can be used to create a grid like... Figure 5 The two blue, undirected edges spanning the grid are shown. Figure 5 The global undirected graph can be obtained by merging the four local undirected graphs and the two cross-grid undirected edges, and the four connected clusters can be identified by using the connected component algorithm.

[0084] S1055. Set the same cluster ID for each trajectory point of all core points and their neighborhood sets in each connected cluster graph.

[0085] Specifically, for each connected cluster graph, all core points and each trajectory point in the neighborhood set of each core point are assigned the same cluster ID, thus obtaining a target cluster. This target cluster includes not only multiple density-reachable core points but also their surrounding neighbor trajectory points. Therefore, by executing steps S1053~S1055, global cluster extraction is completed.

[0086] Combination Figures 3-5 As can be seen, the local clustering method after gridding in this invention can reduce the resource consumption caused by trajectory point pairing and distance calculation in global clustering and improve clustering efficiency, while cross-grid integration can avoid missing cross-grid clustering.

[0087] It should be noted that, Figures 3-5 The colors of the midpoint and the edges are only for easy distinction, and the execution order of each step in the above method embodiment is not limited to the order shown in the figure or the order of the step numbers. The execution order of each step is subject to the actual application.

[0088] In order to perform the corresponding steps in the above method embodiments and various possible implementations, an implementation of a trajectory point clustering device is given below.

[0089] Please see Figure 6 , Figure 6 A schematic diagram of the trajectory point clustering device provided in an embodiment of the present invention is shown. The trajectory point clustering device 200 includes: an acquisition module 210, a gridding module 220, a grid matching module 230, and a clustering module 240.

[0090] The acquisition module 210 is used to acquire a set of trajectory points of a target area within a specified time period; the set of trajectory points includes the latitude and longitude coordinates of several trajectory points; The gridding module 220 is used to determine the GeoHash grid to which each trajectory point belongs based on its latitude and longitude coordinates, and to obtain a subset of trajectory points corresponding to the GeoHash grid. The grid pairing module 230 is used to determine the trajectory point distribution distance between two adjacent GeoHash grids. If the trajectory point distribution distance is less than the preset interval, the two GeoHash grids are used as a grid pair to be reviewed. Local clustering module 240 is used to perform local clustering processing on each subset of trajectory points to obtain the local clustering results within each GeoHash grid. The global integration module 250 is used to perform cross-grid integration of the two local clustering results corresponding to each grid pair to be reviewed, and then perform global cluster extraction.

[0091] Optionally, the grid pairing module 230 can be used to: determine the minimum bounding rectangle of all trajectory points in each GeoHash grid to obtain the trajectory point envelope inside each GeoHash grid; for every two adjacent GeoHash grids, calculate the interval distance between the corresponding trajectory point envelopes to obtain the trajectory point distribution distance between the two GeoHash grids.

[0092] Optionally, the grid pairing module 230 can be used to: determine the geometric center point of all trajectory points in each GeoHash grid; and for every two adjacent GeoHash grids, calculate the distance between their geometric center points to obtain the trajectory point distribution distance between the two GeoHash grids.

[0093] Optionally, the local clustering module 240 can be used to: for each subset of trajectory points, determine the neighborhood set of each trajectory point based on the latitude and longitude coordinates of each trajectory point in the subset; take each trajectory point whose number of trajectory points in the neighborhood set exceeds a set threshold as a core point; and perform connectivity analysis on each core point and its neighborhood set to generate a local undirected graph. The local clustering result includes the local undirected graph and the neighborhood set of each core point.

[0094] Optionally, the local clustering module 240 can also be used to: based on the neighborhood set of each core point, select each pair of core points that have a density reachability relationship from all core points, where the density reachability relationship reflects that the two core points of the core point pair are in each other's neighborhood set; for each pair of core points, assign node IDs to the two core points of the pair respectively, and create an undirected edge between the two core points; and generate a local undirected graph based on each pair of core points and its undirected edge.

[0095] Optionally, the global integration module 250 can be used to: for each grid pair to be verified, pair the core points of the two local undirected graphs corresponding to the grid pair to obtain multiple cross-grid point pairs; select each target cross-grid point pair from all cross-grid point pairs with an interval distance not exceeding a preset neighborhood radius, and create a cross-grid undirected edge between the two core points of each target cross-grid point pair; generate a global undirected graph based on all local undirected graphs and all cross-grid undirected edges; use a connected component algorithm to identify each connected cluster graph in the global undirected graph; wherein any two core points of a connected cluster graph are reachable through at least one undirected edge; and set the same cluster ID for each trajectory point of all core points and their neighborhood set in each connected cluster graph.

[0096] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the trajectory point clustering device 200 described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0097] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 300 includes a processor 310, a memory 320, and a bus 330, with the processor 310 connected to the memory 320 via the bus 330.

[0098] The memory 320 can be used to store software programs or firmware, for example, the software program or firmware corresponding to the trajectory point clustering device 200 described above. The processor 310 executes various functional applications and data processing by running the software program stored in the memory 320 to implement the trajectory point clustering method provided in the embodiments of the present invention.

[0099] The memory 320 may be, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), FLASH (Flash Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0100] The processor 310 can be an integrated circuit chip with signal processing capabilities, capable of executing software programs, such as the software program corresponding to the trajectory point clustering device 200 described above. The processor 310 can be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), SoC (System on Chip), etc.; it 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.

[0101] Understandable. Figure 7 The structure shown is for illustrative purposes only; the electronic device 300 may also include components that are more advanced than those shown. Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown. Figure 7 The components shown can be implemented using hardware, software, or a combination thereof.

[0102] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the trajectory point clustering method disclosed in the above embodiments. The computer-readable storage medium can be, but is not limited to, various media capable of storing program code, such as a USB flash drive, external hard drive, ROM, RAM, PROM, EPROM, EEPROM, FLASH disk, or optical disk.

[0103] This invention also provides a computer program product that, when executed by a processor, implements the trajectory point clustering method disclosed in the above embodiments.

[0104] In summary, this invention provides a trajectory point clustering method, apparatus, electronic device, storage medium, and program product. First, it obtains a set of trajectory points in a target area within a specified time period, including the latitude and longitude coordinates of several trajectory points. Then, based on the latitude and longitude coordinates of each trajectory point, it determines its corresponding GeoHash grid, obtaining a subset of trajectory points corresponding to each GeoHash grid. Next, for every two adjacent GeoHash grids, it determines the trajectory point distribution distance between them. If the trajectory point distribution distance is less than a preset interval, the two GeoHash grids are considered as a pair of grids to be reviewed. Local clustering processing is performed on each subset of trajectory points to obtain local clustering results within each GeoHash grid. Finally, the two local clustering results corresponding to each pair of grids to be reviewed are integrated across grids. This method, by dividing the global trajectory point set into subsets within grids through gridding, and then performing local clustering processing within the grid followed by cross-grid integration, significantly reduces the computational complexity of global clustering and improves processing efficiency. The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A trajectory point clustering method, characterized in that, include: Obtain a set of trajectory points in a target area within a specified time period; the set of trajectory points includes the latitude and longitude coordinates of several trajectory points; Based on the latitude and longitude coordinates of each trajectory point, determine the GeoHash grid to which it belongs, and obtain the subset of trajectory points corresponding to the GeoHash grid; For every two adjacent GeoHash grids, the distance between the trajectory points is determined. If the distance between the trajectory points is less than a preset interval, the two GeoHash grids are considered as a pair of grids to be reviewed. Local clustering is performed on each subset of trajectory points to obtain the local clustering results within each GeoHash grid. After cross-grid integration of the two local clustering results corresponding to each grid pair to be verified, global cluster extraction is performed.

2. The trajectory point clustering method according to claim 1, characterized in that, The step of determining the trajectory point distribution distance between two adjacent GeoHash grids includes: Determine the minimum bounding rectangle of all trajectory points in each GeoHash grid to obtain the envelope of trajectory points inside each GeoHash grid; For every two adjacent GeoHash grids, calculate the distance between the envelopes of their corresponding trajectory points to obtain the trajectory point distribution distance between the two GeoHash grids.

3. The trajectory point clustering method according to claim 1, characterized in that, The step of determining the trajectory point distribution distance between two adjacent GeoHash grids includes: Determine the geometric center point of all trajectory points in each GeoHash grid; For every two adjacent GeoHash grids, calculate the distance between their geometric center points to obtain the trajectory point distribution distance between the two GeoHash grids.

4. The trajectory point clustering method according to claim 1, characterized in that, The step of performing local clustering processing on each subset of trajectory points to obtain the local clustering result within each GeoHash grid includes: For each subset of trajectory points, a neighborhood set for each trajectory point is determined based on the latitude and longitude coordinates of each trajectory point in the subset. Each trajectory point in the neighborhood set whose number of trajectory points exceeds a set threshold is designated as a core point; Based on each core point and its neighborhood set, connectivity analysis is performed on each core point to generate a local undirected graph. The local clustering result includes the local undirected graph and the neighborhood set of each core point therein.

5. The trajectory point clustering method according to claim 4, characterized in that, The step of performing connectivity analysis on each core point and its neighborhood set to generate a local undirected graph includes: Based on the neighborhood set of each core point, each core point pair with a density reachability relationship is selected from all core points. The density reachability relationship reflects that the two core points of the core point pair are in each other's neighborhood set. For each pair of core points, assign node IDs to the two core points of the pair and create an undirected edge between the two core points. A local undirected graph is generated based on each core point pair and its undirected edge.

6. The trajectory point clustering method according to claim 1, characterized in that, The local clustering results include a local undirected graph and the neighborhood set of each core point therein; The step of integrating the two local clustering results corresponding to each grid pair to be reviewed includes: For each grid pair to be verified, the core points of the two local undirected graphs corresponding to the grid pair are paired one by one to obtain multiple cross-grid point pairs; Select each target cross-grid point pair from all cross-grid point pairs, with an interval distance not exceeding the preset neighborhood radius, and create a cross-grid undirected edge between the two core points of each target cross-grid point pair; Generate a global undirected graph based on all local undirected graphs and all cross-grid undirected edges; A connected component algorithm is used to identify each connected cluster graph in the global undirected graph; wherein any two core points of the connected cluster graph are reachable through at least one undirected edge; Set the same cluster ID for each trajectory point of all core points and their neighborhood sets in each of the connected cluster graphs.

7. A trajectory point clustering device, characterized in that, include: The acquisition module is used to acquire a set of trajectory points of a target area within a specified time period; the set of trajectory points includes the latitude and longitude coordinates of several trajectory points; The gridding module is used to determine the GeoHash grid to which each trajectory point belongs based on its latitude and longitude coordinates, and to obtain a subset of trajectory points corresponding to the GeoHash grid. The grid pairing module is used to determine the trajectory point distribution distance between two adjacent GeoHash grids. If the trajectory point distribution distance is less than a preset interval, the two GeoHash grids are regarded as a grid pair to be reviewed. The local clustering module is used to perform local clustering processing on each subset of trajectory points to obtain the local clustering results within each GeoHash grid. The global integration module is used to perform cross-grid integration of the two local clustering results corresponding to each grid pair to be reviewed, and then perform global cluster extraction.

8. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a software program, and the processor executes the software program when the electronic device is running to implement the trajectory point clustering method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the trajectory point clustering method according to any one of claims 1-6.

10. A program product, characterized in that, When the program product is executed by the processor, it implements the trajectory point clustering method as described in any one of claims 1-6.