A trajectory playback method and system based on graph structure spatiotemporal trajectory analysis

By employing a graph-based spatiotemporal trajectory analysis method, and utilizing K-Means clustering and a greedy algorithm to repair spatiotemporal trajectories, the problem of inconsistent trajectory data quality in smart cities is solved, enabling efficient trajectory playback and analysis.

CN116821262BActive Publication Date: 2026-06-09BEIJING HAIZHI TECH GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING HAIZHI TECH GRP CO LTD
Filing Date
2023-05-30
Publication Date
2026-06-09

Smart Images

  • Figure CN116821262B_ABST
    Figure CN116821262B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computers.A trajectory playback method based on space-time trajectory analysis of a graph structure comprises the following steps: acquiring original space-time trajectory data, wherein the space-time trajectory data comprises a plurality of space-time trajectory points; using a K-Means clustering algorithm to cluster the space-time trajectory data into different clusters according to the space-time trajectory points; constructing a graph structure of the space-time trajectory according to the clusters obtained by clustering, to form a trajectory graph; using a greedy algorithm to find an optimal path of the trajectory graph; repairing the space-time trajectory according to the found path, to obtain the repaired space-time trajectory; and applying the repaired space-time trajectory in a map engine to realize 2D or 3D trajectory playback.The method can effectively repair a broken trajectory and meet various characteristic requirements, so that the method can be better applied to space-time trajectory analysis, the analysis effect is improved, and the space-time trajectory is obtained at low cost and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, specifically to a business scenario of implementing trajectory spatiotemporal analysis based on graph structures, and particularly to a trajectory playback method and system based on spatiotemporal trajectory analysis using graph structures. Background Technology

[0002] With the continuous development of urban sensing technology, a large amount of spatiotemporal data has been accumulated in cities, such as traffic flow, GPS trajectory, and sensor records. These data contain a wealth of knowledge about urban development and changes. For example, traffic flow and GPS trajectory data describe the travel patterns of urban residents, while sensor data such as air quality reflect the distribution of air pollutants in the city. Therefore, analyzing and accurately predicting urban spatiotemporal data is an important research issue in the construction of intelligent cities.

[0003] The vigorous advancement of smart city construction in China has led to a surge in the analysis and mining of spatiotemporal data related to smart cities. In smart twin-based urban scenarios, numerous spatiotemporal prediction tasks exist, such as time-sharing traffic flow prediction in urban traffic scenarios and spatiotemporal trajectory analysis of key personnel in police-related matters. However, designing neural networks for these specific application scenarios requires extensive domain-specific expertise and a large amount of experimental data for validation, resulting in high manpower costs. This makes it difficult to efficiently support the complex and diverse spatiotemporal application needs during the implementation of real-world smart city projects.

[0004] To illustrate this with an example from one of the aforementioned application areas, such as trajectory analysis of key personnel in smart policing scenarios, the following problems may arise: Because there are many ways to acquire the spatiotemporal trajectory data of key personnel (captured by surveillance cameras, monitoring of key locations, personnel and location registration information, IMSI code acquisition, etc.), the quality of the original spatiotemporal data becomes inconsistent, with a large amount of redundant identical locations and instances of missing or offset locations. This problem can lead to the generated personnel trajectories deviating from expectations or exhibiting deviations. Summary of the Invention

[0005] This invention provides a trajectory playback method and system based on graph structure spatiotemporal trajectory analysis, which addresses the problems of high cost, low efficiency, and complexity of spatiotemporal trajectory analysis in urban scenarios.

[0006] The first aspect of this application provides a trajectory playback method based on spatiotemporal trajectory analysis using graph structures, the method comprising:

[0007] Obtain the original spatiotemporal trajectory data, wherein the spatiotemporal trajectory data includes multiple spatiotemporal trajectory points;

[0008] The K-Means clustering algorithm is used to cluster the spatiotemporal trajectory data by spatiotemporal trajectory points and divide them into different clusters;

[0009] Based on the clusters obtained from clustering, a graph structure of spatiotemporal trajectories is constructed to form a trajectory graph;

[0010] A greedy algorithm is used to find the optimal path in the trajectory map;

[0011] Based on the found path, the spatiotemporal trajectory is repaired to obtain the repaired spatiotemporal trajectory;

[0012] The repaired spatiotemporal trajectory is applied to a map engine to achieve 2D or 3D trajectory playback.

[0013] In one feasible approach, the step of acquiring the original spatiotemporal trajectory data includes:

[0014] The acquired spatiotemporal trajectory data is cleaned to obtain non-redundant spatiotemporal trajectory data. The data cleaning includes using a rule matching algorithm to remove continuous and repeated coordinates from the spatiotemporal trajectory data in chronological order.

[0015] If the time interval of the coordinates in the spatiotemporal trajectory points is less than a set threshold, a thinning algorithm is used to determine whether the spatiotemporal trajectory points should be deleted based on the time interval and distance interval; or,

[0016] By using a fitting method, the coordinates of the spatiotemporal trajectory are fitted according to a preset accuracy threshold.

[0017] In one feasible approach, the step of using the K-Means clustering algorithm to cluster the spatiotemporal trajectory data into different clusters based on spatiotemporal trajectory points includes:

[0018] Obtain the initial center point of the spatiotemporal trajectory points, wherein the initial center point represents multiple representative points selected from the data features of the spatiotemporal trajectory points as the initial center point;

[0019] Each spatiotemporal trajectory point is assigned to the initial center point that is closest to it, clustered, and the centroid of each cluster center is calculated;

[0020] Update the position of each cluster center based on its centroid, and repeat the iteration.

[0021] When the position of each cluster center no longer changes, or the maximum number of iterations is reached, the final cluster centers are obtained, and the final cluster centers are used as clusters.

[0022] In one feasible approach, the step of constructing a graph structure of spatiotemporal trajectories based on clusters obtained from clustering to form a trajectory graph includes:

[0023] Construct the nodes of the graph structure, wherein the nodes represent the clusters;

[0024] Construct edges connecting the nodes, where each edge represents the distance between the nodes;

[0025] Based on the nodes and edges, the graph structure is formed, creating a trajectory graph.

[0026] In one feasible approach, the step of using a greedy algorithm to find the optimal path in the trajectory map includes:

[0027] Based on the nodes of the trajectory graph, the starting point and the ending point are obtained, wherein the starting point and the ending point each represent a node;

[0028] Based on the starting point and the ending point, the cost from the starting point to the ending point is obtained, where the cost represents the time spent or the distance traveled;

[0029] Using a greedy algorithm, calculate the path with the minimum cost from the starting point to the ending point.

[0030] In one feasible approach, the step of repairing the spatiotemporal trajectory based on the found path to obtain the repaired spatiotemporal trajectory includes:

[0031] Starting from the origin, add the current node in the graph structure to the openlist;

[0032] Remove a node with a minimum heuristic function from the openlist;

[0033] If this node is the target node, the path search is complete, and the path is constructed by backtracking from this node.

[0034] If this node is not the target node, then add all adjacent nodes of the current node to the openlist;

[0035] Add the current node to the closedlist;

[0036] Repeat the process of "If this node is the target node, the path search is complete. Start backtracking from this node and build the path back to the step of putting the current node into the closedlist" until there are no more nodes in the openlist, thus completing the repair of the spatiotemporal trajectory.

[0037] In one feasible approach, the step of applying the repaired spatiotemporal trajectory to a map engine to achieve 2D or 3D trajectory playback includes:

[0038] Obtain the map engine;

[0039] The repaired spatiotemporal trajectory points are then applied to the map engine, where 2D or 3D trajectory retracing is implemented.

[0040] A second aspect of this application provides a trajectory playback system based on spatiotemporal trajectory analysis using graph structures, characterized in that it includes the aforementioned trajectory playback method based on spatiotemporal trajectory analysis using graph structures, the system comprising:

[0041] An acquisition unit is used to acquire the original spatiotemporal trajectory data, wherein the spatiotemporal trajectory data includes multiple spatiotemporal trajectory points;

[0042] The cluster partitioning unit is used to cluster the spatiotemporal trajectory data by spatiotemporal trajectory points using the K-Means clustering algorithm and divide it into different clusters;

[0043] Graph structure unit, used to construct a graph structure of spatiotemporal trajectory based on clusters obtained from clustering, forming a trajectory graph;

[0044] The optimal path unit is used to find the optimal path in the trajectory map using a greedy algorithm.

[0045] The repair unit is used to repair the spatiotemporal trajectory based on the found path to obtain the repaired spatiotemporal trajectory.

[0046] The playback unit is used to apply the repaired spatiotemporal trajectory to the map engine to achieve 2D or 3D trajectory playback.

[0047] A third aspect of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the aforementioned trajectory playback method based on graph structure spatiotemporal trajectory analysis.

[0048] The fourth aspect of this application provides a computer storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the aforementioned trajectory playback method based on graph structure spatiotemporal trajectory analysis.

[0049] Beneficial effects of this invention:

[0050] This application presents a trajectory playback method based on graph-structured spatiotemporal trajectory analysis. First, it acquires the original spatiotemporal trajectory data, which includes multiple spatiotemporal trajectory points. Next, using the K-Means clustering algorithm, the spatiotemporal trajectory data is clustered into different clusters based on these points. A graph structure of the spatiotemporal trajectory is constructed based on the clusters, forming a trajectory graph. Then, a greedy algorithm is used to find the optimal path on the trajectory graph. Based on the found path, the spatiotemporal trajectory is repaired to obtain the repaired spatiotemporal trajectory. Finally, the repaired spatiotemporal trajectory is applied in a map engine to achieve 2D or 3D trajectory playback. This method can effectively repair broken trajectories and meet various feature requirements. Therefore, it can be better applied to spatiotemporal trajectory analysis, improving analysis results and achieving low cost and high efficiency in obtaining spatiotemporal trajectories. Attached Figure Description

[0051] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0052] Figure 1 This is a flowchart of a trajectory playback method based on graph structure spatiotemporal trajectory analysis according to the present invention;

[0053] Figure 2 The flowchart of the K-Means clustering algorithm for a trajectory playback method based on graph structure spatiotemporal trajectory analysis according to the present invention is shown below.

[0054] Figure 3 This invention provides a graph-based spatiotemporal trajectory analysis method that uses the K-Means clustering algorithm to divide spatiotemporal trajectory points into different clusters.

[0055] Figure 4 The trajectory playback method of the present invention, which is a spatiotemporal trajectory analysis method based on graph structure, constructs a graph structure of spatiotemporal trajectory based on the clustering results;

[0056] Figure 5 This invention provides a trajectory playback method based on graph structure-based spatiotemporal trajectory analysis, which enables 2 / 3D trajectory playback based on repaired spatiotemporal trajectory data.

[0057] Figure 6 This is a flowchart illustrating the working principle of a trajectory playback method based on graph structure spatiotemporal trajectory analysis according to the present invention. Detailed Implementation

[0058] In the description of the embodiments of the present invention, those skilled in the art should understand that the embodiments of the present invention can be implemented as methods, apparatuses, electronic devices, and computer-readable storage media. Therefore, the embodiments of the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. Furthermore, in some embodiments, the embodiments of the present invention can also be implemented as a computer program product in one or more computer-readable storage media, the computer-readable storage media containing computer program code.

[0059] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable storage media. Computer-readable storage media include: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, optical disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any combination thereof. In embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0060] The computer program code contained in the aforementioned computer-readable storage medium may be transmitted using any suitable medium, including wireless, wire, optical fiber, radio frequency (RF), or any suitable combination thereof.

[0061] Computer program code for performing the operations of the embodiments of the present invention can be written in assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The computer program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer or an external computer via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0062] The embodiments of the present invention describe the provided methods, apparatus, and electronic devices through flowcharts and / or block diagrams.

[0063] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine that, when executed by a computer or other programmable data processing apparatus, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0064] These computer-readable program instructions may also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to function in a particular manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the blocks of a flowchart and / or block diagram.

[0065] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0066] In the specification and claims of this invention, the terms "first" and "second," etc., are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0067] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0068] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.

[0069] The following is an explanation of some terms used in this application:

[0070] Rule-based matching algorithms refer to matching based on set rules to determine whether something is true or false; they are a common type of algorithm.

[0071] The thinning algorithm involves drawing a straight line AB between points A and B at the beginning and end of a curve; this line is considered a chord of the curve. The algorithm then identifies the point C on the curve that is furthest from this line segment and calculates its distance d from AB. This distance is compared to a pre-defined threshold. If the distance is less than the threshold, the line segment is considered an approximation of the curve, and that segment is processed. If the distance is greater than the threshold, the curve is divided into two segments AC and BC by line C, and each segment is processed using steps 1 through 3. Once all curves have been processed, the broken line formed by connecting the dividing points sequentially can be used as an approximation of the curve.

[0072] K-Means clustering algorithm is a type of clustering algorithm, specifically a partitioning clustering algorithm that divides samples into several classes based on the similarity or distance of their features.

[0073] Greedy algorithms, also known as greedy methods, are methods for finding the optimal solution to a problem. This approach typically divides the solution process into several steps, but each step applies the greedy principle to select the best / optimal choice (the locally most advantageous choice) under the current state, hoping that the final result will also be the best / optimal solution.

[0074] A heuristic function is used to determine the path in a pathfinding context. Blindly searching wastes time and space, so during pathfinding, the most promising node is selected first. This selection is achieved through a heuristic function. In other words, a heuristic function is a function used to estimate the distance between the current state and the target state, used for path decision-making.

[0075] See Figure 1 The first aspect of this application provides a trajectory playback method based on spatiotemporal trajectory analysis using graph structures, the method comprising the following steps:

[0076] S100: Obtain the original spatiotemporal trajectory data.

[0077] The spatiotemporal trajectory data includes multiple spatiotemporal trajectory points.

[0078] Specifically, the spatiotemporal trajectory data of an individual is obtained through various methods, including capturing images from cameras in the city's surveillance system, monitoring key locations, registering personnel and locations, and acquiring IMSI (International Mobile Subscriber Identification Number) codes. This spatiotemporal trajectory data comprises multiple spatiotemporal trajectory points, each representing a single data point collected through these methods. It's important to note that the locations used for camera capture, key location monitoring, personnel and location registration, and IMSI code acquisition must have city coordinates. This allows the city coordinates of the spatiotemporal trajectory points to be obtained, facilitating subsequent steps for trajectory reconstruction.

[0079] It should be noted that the obtained raw spatiotemporal trajectory data can be understood as unprocessed spatiotemporal trajectory data. This type of data often contains complex and disordered information. Therefore, it is necessary to clean the spatiotemporal trajectory data, or preprocess it, to obtain redundant spatiotemporal trajectory data. Data cleaning includes the following methods:

[0080] A rule-matching algorithm is used to clean the data. In the spatiotemporal trajectory data, consecutive and repeated coordinates are removed in chronological order. This effectively removes redundant data. For example, if a person stands still or moves slightly within the area captured by a SkyNet camera, and the camera captures that person multiple times, redundant data is generated. Therefore, this redundant data needs to be removed, retaining only one record.

[0081] The thinning algorithm works by identifying coordinates with short time intervals along the path. Specifically, if any coordinates in the spatiotemporal trajectory have a time interval less than a set threshold, the algorithm determines whether to delete them based on the time interval and distance. The set threshold can be configured as needed; for example, a time interval of 10 seconds might delete one coordinate from two points with intervals less than 10 seconds. This application does not impose a specific limitation on this. In this way, the thinning algorithm reduces the number of coordinates along the spatiotemporal trajectory path, compressing a large amount of data while maintaining the original waveform, and providing good fidelity for the spatiotemporal trajectory.

[0082] The fitting method, based on a preset accuracy threshold, fits the continuous coordinates of the spatiotemporal trajectory data, thereby obtaining more concise data. For example, the fitting method can be a curve fitting algorithm. Using a curve fitting algorithm, based on a given accuracy, the minimum coordinate point is fitted, thus obtaining more concise data. Specifically, the curve fitting algorithm can use the least squares method (also known as the least squares method) to fit the curve.

[0083] The rule matching algorithm, thinning algorithm, and fitting method mentioned above can be combined or used individually as needed.

[0084] The preprocessed spatiotemporal trajectory data is obtained using the above method.

[0085] S200: Using the K-Means clustering algorithm, the spatiotemporal trajectory data is clustered by spatiotemporal trajectory points and divided into different clusters.

[0086] like Figure 2 and Figure 3 As shown, the application of the K-Means clustering algorithm in this application includes the following steps:

[0087] S201: Obtain the initial center point of the spatiotemporal trajectory point.

[0088] The initial center point refers to selecting multiple representative points from the spatiotemporal trajectory points as initial center points based on the data characteristics of the data features.

[0089] Specifically, the initial center point can be set according to conditions, which are not limited in this application. For example, the conditions can be time as a data feature, such as the hour of the day, or the trajectory can be divided into several segments as conditions. Alternatively, a point can be randomly selected as the first initial center point, and then the point farthest from that point can be selected as the second initial center point. Then, the point with the largest nearest distance to the first two points can be selected as the third initial center point, and so on, until K initial center points are selected.

[0090] S202: Assign each of the spatiotemporal trajectory points to the initial center point that is closest to it, perform clustering, and calculate the centroid of each cluster center.

[0091] In this process, after selecting an initial center point, all spatiotemporal trajectory points are assigned to the nearest initial center point for clustering. This process implements the clustering action of the K-Means clustering algorithm. Next, the centroid of each cluster center is calculated so that the centroid can be used as the center point for repeated clustering.

[0092] S203: Update the position of the cluster center based on the centroid of each cluster center, and repeat the iteration.

[0093] Once the centroid of the cluster centers is obtained, the position of the cluster centers is updated. That is, the initial center point is updated, and the centroid is used to replace the initial center point to form a new center point. Then, the clusters are re-clustered using this center point.

[0094] Repeat steps S202 and S203 to perform the iteration.

[0095] S204: When the position of each cluster center no longer changes, or the maximum number of iterations is reached, the final cluster centers are obtained, and the final cluster centers are used as clusters.

[0096] In this process, when the position of the cluster center no longer changes during repeated iterations, or when the maximum number of iterations is reached, the clustering is considered complete, the final cluster center is obtained, and the last cluster is taken as the cluster.

[0097] It should be noted that the fact that the location of the cluster center no longer changes means that the relative change is very small, not that there is absolutely no change.

[0098] By using the above method, a preliminary analysis of the spatiotemporal trajectory data is performed to obtain the spatiotemporal trajectory points.

[0099] like Figure 4 As shown, where, Figure 4 In the diagram, x, y, and t represent coordinate systems and t represents time. S300: Based on the clusters obtained from clustering, construct the spatiotemporal trajectory graph structure to form the trajectory graph.

[0100] The graph structure is composed of nodes and edges. Specifically, first, the nodes of the graph structure are constructed, where each node represents a cluster. Second, edges connecting the nodes are constructed, where each edge represents the distance between the nodes. Having obtained the nodes and edges, the graph structure is formed using these nodes and edges, ultimately resulting in a trajectory graph.

[0101] S400: Use a greedy algorithm to find the optimal path for the trajectory map.

[0102] In the aforementioned steps, a trajectory map was obtained. Next, a greedy algorithm was used to calculate the optimal path in the trajectory map for each node.

[0103] Specifically, firstly, based on the nodes of the trajectory graph, the starting point and the ending point are obtained, where the starting point and the ending point represent two corresponding nodes in the trajectory graph. Next, based on the starting point and the ending point, the cost from the starting point to the ending point is obtained, where the cost represents the time spent or the distance traveled. That is, the optimal path can be determined by being time-optimal or distance-optimal. Finally, a greedy algorithm is used to calculate the path with the minimum cost from the starting point to the ending point.

[0104] The minimum path between two nodes can be obtained using a greedy algorithm, and the minimum path is used as the edge connecting the nodes.

[0105] S500: Based on the found path, repair the spatiotemporal trajectory to obtain the repaired spatiotemporal trajectory.

[0106] The specific repair method is as follows:

[0107] 1. Starting from the starting point, place the current node in the graph structure into the open list (which stores known but unexplored regions). The current node can be any node other than the starting point.

[0108] 2. Remove a node with the minimum heuristic function from the openlist.

[0109] 3. If this node is the target node, the path search is complete. Start backtracking from this node to build the path.

[0110] 4. If this node is not the target node, then add all adjacent nodes of the current node to the open list.

[0111] 5. Add the current node to the closedlist (which stores the regions that have already been explored).

[0112] 6. Repeat the process of "If this node is the target node, the path search is complete. Start backtracking from this node and build the path back to the step of putting the current node into the closed list" until there are no more nodes in the open list, thus completing the repair of the spatiotemporal trajectory.

[0113] The above method was used to repair the spatiotemporal trajectory points.

[0114] S600: The repaired spatiotemporal trajectory is applied to the map engine to achieve 2D or 3D trajectory playback.

[0115] In the process of realizing 2D or 3D trajectory playback, firstly, a map engine is acquired, which converts the repaired spatiotemporal trajectory points into points on a map. Next, the repaired spatiotemporal trajectory points are applied to the map engine, and the 2D or 3D trajectory playback is realized within the map engine.

[0116] like Figure 5 As shown, Figure 5 The numbers represent spatiotemporal trajectory points. Specifically, the spatiotemporal trajectory points obtained in the aforementioned steps are converted into a map by the engine and presented in a map format. This application does not limit the conversion to 2D or 3D based on the 2D or 3D form of the map; 2D or 3D trajectory playback can meet the needs of real-world scenarios.

[0117] In summary, the trajectory playback method based on graph structure spatiotemporal trajectory analysis provided in this application addresses the issue of trajectory interruption in spatiotemporal trajectory analysis caused by the inconsistent quality of spatiotemporal trajectory data available in real-world urban scenarios, which may lead to deviations or redundancy in the actual drawn trajectory. Figure 6 As shown, the working principle is as follows: After preprocessing the collected raw spatiotemporal trajectory data, firstly, the K-Means clustering algorithm is used to divide the trajectory points into different clusters; secondly, a graph structure of the trajectory is constructed based on the clustering results; finally, a greedy algorithm is used to find the optimal path in the trajectory graph to achieve automatic trajectory repair. Experimental results show that this method effectively repairs a large number of broken trajectories and can meet various feature requirements. Therefore, it can be better applied to spatiotemporal trajectory analysis, improving the analysis effect.

[0118] A second aspect of this application provides a trajectory playback system based on spatiotemporal trajectory analysis using graph structures, characterized in that it includes the aforementioned trajectory playback method based on spatiotemporal trajectory analysis using graph structures, the system comprising:

[0119] An acquisition unit is used to acquire the original spatiotemporal trajectory data, wherein the spatiotemporal trajectory data includes multiple spatiotemporal trajectory points;

[0120] The cluster partitioning unit is used to cluster the spatiotemporal trajectory data by spatiotemporal trajectory points using the K-Means clustering algorithm and divide it into different clusters;

[0121] Graph structure unit, used to construct a graph structure of spatiotemporal trajectory based on clusters obtained from clustering, forming a trajectory graph;

[0122] The optimal path unit is used to find the optimal path in the trajectory map using a greedy algorithm.

[0123] The repair unit is used to repair the spatiotemporal trajectory based on the found path to obtain the repaired spatiotemporal trajectory.

[0124] The playback unit is used to apply the repaired spatiotemporal trajectory to the map engine to achieve 2D or 3D trajectory playback.

[0125] A third aspect of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the aforementioned trajectory playback method based on graph structure spatiotemporal trajectory analysis.

[0126] The fourth aspect of this application provides a computer storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the aforementioned trajectory playback method based on graph structure spatiotemporal trajectory analysis.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A trajectory playback method based on spatiotemporal trajectory analysis using graph structures, characterized in that, The methods include: Obtain the original spatiotemporal trajectory data, wherein the spatiotemporal trajectory data includes multiple spatiotemporal trajectory points; The K-Means clustering algorithm is used to cluster the spatiotemporal trajectory data by spatiotemporal trajectory points and divide them into different clusters; Based on the clusters obtained from clustering, a graph structure of spatiotemporal trajectories is constructed to form a trajectory graph; A greedy algorithm is used to find the optimal path in the trajectory map; Based on the found path, the spatiotemporal trajectory is repaired to obtain the repaired spatiotemporal trajectory; The repaired spatiotemporal trajectory is applied to a map engine to achieve 2D or 3D trajectory playback. The step of constructing a graph structure of spatiotemporal trajectories based on the clusters obtained from clustering to form a trajectory graph includes: Construct the nodes of the graph structure, wherein the nodes represent the clusters; Construct edges connecting the nodes, where each edge represents the distance between the nodes; Based on the nodes and edges, the graph structure is formed to create a trajectory graph; The step of using a greedy algorithm to find the optimal path in the trajectory map includes: Based on the nodes of the trajectory graph, the starting point and the ending point are obtained, wherein the starting point and the ending point each represent a node; Based on the starting point and the ending point, the cost from the starting point to the ending point is obtained, where the cost represents the time spent or the distance traveled; Using a greedy algorithm, calculate the path with the minimum cost from the starting point to the ending point; The step of repairing the spatiotemporal trajectory based on the found path to obtain the repaired spatiotemporal trajectory includes: Starting from the origin, add the current node in the graph structure to the openlist; Remove a node with a minimum heuristic function from the openlist; If this node is the target node, the path search is complete, and the path is constructed by backtracking from this node. If this node is not the target node, then add all adjacent nodes of the current node to the openlist; Add the current node to the closedlist; Repeat the process of "If this node is the target node, the path search is complete. Start backtracking from this node and build the path back to the step of putting the current node into the closedlist" until there are no more nodes in the openlist, thus completing the repair of the spatiotemporal trajectory.

2. The trajectory playback method based on spatiotemporal trajectory analysis according to claim 1, characterized in that, The step of obtaining the original spatiotemporal trajectory data includes: The acquired spatiotemporal trajectory data is cleaned to obtain non-redundant spatiotemporal trajectory data. The data cleaning includes using a rule matching algorithm to remove continuous and repeated coordinates from the spatiotemporal trajectory data in chronological order. If the time interval of the coordinates in the spatiotemporal trajectory points is less than a set threshold, a thinning algorithm is used to determine whether the spatiotemporal trajectory points should be deleted based on the time interval and distance interval; or, By using a fitting method, the coordinates of the spatiotemporal trajectory are fitted according to a preset accuracy threshold.

3. The trajectory playback method based on spatiotemporal trajectory analysis according to claim 1, characterized in that, The step of using the K-Means clustering algorithm to cluster the spatiotemporal trajectory data into different clusters based on spatiotemporal trajectory points includes: Obtain the initial center point of the spatiotemporal trajectory points, wherein the initial center point represents multiple representative points selected from the data features of the spatiotemporal trajectory points as the initial center point; Each spatiotemporal trajectory point is assigned to the initial center point that is closest to it, clustered, and the centroid of each cluster center is calculated; Update the position of each cluster center based on its centroid, and repeat the iteration. When the position of each cluster center no longer changes, or the maximum number of iterations is reached, the final cluster centers are obtained, and the final cluster centers are used as clusters.

4. The trajectory playback method based on spatiotemporal trajectory analysis according to claim 1, characterized in that, The step of applying the repaired spatiotemporal trajectory to a map engine to achieve 2D or 3D trajectory playback includes: Obtain the map engine; The repaired spatiotemporal trajectory points are then applied to the map engine, where 2D or 3D trajectory retracing is implemented.

5. A trajectory playback system based on spatiotemporal trajectory analysis using graph structures, characterized in that, The system includes a trajectory playback method based on spatiotemporal trajectory analysis according to any one of claims 1-4, wherein the system comprises: An acquisition unit is used to acquire the original spatiotemporal trajectory data, wherein the spatiotemporal trajectory data includes multiple spatiotemporal trajectory points; The cluster partitioning unit is used to cluster the spatiotemporal trajectory data by spatiotemporal trajectory points using the K-Means clustering algorithm and divide it into different clusters; Graph structure unit, used to construct a graph structure of spatiotemporal trajectory based on clusters obtained from clustering, forming a trajectory graph; The optimal path unit is used to find the optimal path in the trajectory map using a greedy algorithm. The repair unit is used to repair the spatiotemporal trajectory based on the found path to obtain the repaired spatiotemporal trajectory. The playback unit is used to apply the repaired spatiotemporal trajectory to the map engine to achieve 2D or 3D trajectory playback. Specifically, the graph structure unit is used for: Construct the nodes of the graph structure, wherein the nodes represent the clusters; Construct edges connecting the nodes, where each edge represents the distance between the nodes; Based on the nodes and edges, the graph structure is formed to create a trajectory graph; The optimal path unit is specifically used for: Based on the nodes of the trajectory graph, the starting point and the ending point are obtained, wherein the starting point and the ending point each represent a node; Based on the starting point and the ending point, the cost from the starting point to the ending point is obtained, where the cost represents the time spent or the distance traveled; Using a greedy algorithm, calculate the path with the minimum cost from the starting point to the ending point; Specifically, the repair unit is used for: Starting from the origin, add the current node in the graph structure to the openlist; Remove a node with a minimum heuristic function from the openlist; If this node is the target node, the path search is complete, and the path is constructed by backtracking from this node. If this node is not the target node, then add all adjacent nodes of the current node to the openlist; Add the current node to the closedlist; Repeat the process of "If this node is the target node, the path search is complete. Start backtracking from this node and build the path back to the step of putting the current node into the closedlist" until there are no more nodes in the openlist, thus completing the repair of the spatiotemporal trajectory.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the trajectory playback method based on graph structure spatiotemporal trajectory analysis according to any one of claims 1 to 4.

7. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the trajectory playback method based on graph structure spatiotemporal trajectory analysis according to any one of claims 1 to 4.