A trajectory fitting generation method and device, electronic equipment and storage medium
By performing relative metric conversion and multi-scale key point screening on trajectory data, anomaly detection trajectories are generated and coordinate compensation is performed, solving the scalability and error problems of trajectory generation in existing technologies and achieving high-precision fitting trajectory generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LEADOR SPATIAL INFORMATION TECH CORP
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, trajectory generation methods suffer from limited extensibility of discrimination rules, difficulty in obtaining high-quality training data, and large interpolation errors, resulting in the inability to accurately generate fitted trajectories.
By acquiring the original spatiotemporal trajectory data and performing relative metric coordinate transformation, key points are screened multiple times at different scales to generate multiple sets of key point subsets. Anomaly detection is performed based on each set of key point subsets, abnormal trajectory points are removed, and the target fitted trajectory is generated and coordinate compensation is performed.
It achieves the output of high-precision, high-fidelity and continuous complete fitting trajectories under harsh data conditions, improves the robustness of the system in adaptively recognizing complex extreme noise, and avoids the problems of limited extensibility of discrimination rules and difficulty in obtaining high-quality training data.
Smart Images

Figure CN122153753A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating a fitting trajectory. Background Technology
[0002] Traditional methods for anomaly detection in trajectory data during trajectory generation mainly fall into two categories: rule-based discrimination methods and learning-based recognition methods. Rule-based discrimination methods rely on feature construction, feature selection, and threshold setting. Learning-based recognition methods require a large amount of labeled data, and the spatiotemporal characteristics of the data significantly affect the accuracy of the model's discrimination. Traditional interpolation methods, such as linear interpolation and cubic splines, do not utilize information about anomalous trajectory points during interpolation, resulting in a mismatch between the interpolated results and the spatial characteristics of the true trajectory. Existing trajectory generation and compensation methods suffer from at least the following technical problems: First, rule-based discrimination methods require specialized domain knowledge to construct features and set thresholds, which results in discrimination methods that, while highly targeted, have limited scalability. The features and thresholds need to be adjusted to meet the positioning results of different carriers and different sensors. Secondly, learning-based recognition methods require a large amount of labeled data for model training. Data quality and data characteristics both affect the model's discrimination accuracy. There are many combinations of carrier platforms and positioning sensors, making it difficult to obtain a large amount of labeled data, which leads to difficulties in model training. Third, traditional interpolation methods do not use information about abnormal trajectory points at all, resulting in information loss. This leads to changes in the spatial distribution characteristics of the compensated coordinates, and the trajectory data is complex and nonlinear, which makes the error of traditional interpolation methods larger. It can be seen that existing technical methods have problems such as limited extensibility of discrimination rules, difficulty in obtaining high-quality training data, and large interpolation errors. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, apparatus, electronic device, and storage medium for generating a fitted trajectory, in order to solve the problems in the prior art where the extensibility of the discrimination rules is limited, high-quality training data is difficult to obtain, and the interpolation error is large, resulting in the inability to accurately generate a fitted trajectory.
[0004] A first aspect of this application provides a method for generating a fitted trajectory. The method includes: acquiring original spatiotemporal trajectory data; performing a relative metric coordinate transformation on the original spatiotemporal trajectory data to obtain target trajectory data; performing multiple keypoint filtering operations on the target trajectory data at different scales to obtain multiple sets of different keypoint subsets; generating anomaly judgment trajectories corresponding to each keypoint subset based on each keypoint subset, and performing anomaly judgment on trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain anomaly judgment results corresponding to each trajectory point under each anomaly judgment trajectory; determining normal trajectory points and abnormal trajectory points in the target trajectory data based on multiple anomaly judgment results for each trajectory point; generating a target fitted trajectory based on the normal trajectory points; and performing coordinate compensation on the abnormal trajectory points based on the target fitted trajectory. A second aspect of this application provides a fitting trajectory generation apparatus, comprising: a conversion module for acquiring original spatiotemporal trajectory data and performing relative metric coordinate conversion on the original spatiotemporal trajectory data to obtain target trajectory data; a filtering module for performing multiple key point filtering operations on the target trajectory data at different scales to obtain multiple sets of different key point subsets; a judgment module for generating anomaly judgment trajectories corresponding to each set of key point subsets based on each set of key point subsets, and performing anomaly judgment on trajectory points in the target trajectory data based on each anomaly judgment trajectory to obtain anomaly judgment results corresponding to each trajectory point under each anomaly judgment trajectory; and a generation module for determining normal trajectory points and abnormal trajectory points in the target trajectory data based on multiple anomaly judgment results for each trajectory point, generating a target fitting trajectory based on the normal trajectory points, and performing coordinate compensation on the abnormal trajectory points based on the target fitting trajectory.
[0005] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0006] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0007] The beneficial effects of this application embodiment compared with the prior art are as follows: The method of this application embodiment obtains the original spatiotemporal trajectory data, performs relative metric coordinate transformation on the original spatiotemporal trajectory data to obtain the target trajectory data; performs multiple key point screenings at different scales on the target trajectory data to obtain multiple sets of different key point subsets; based on each set of key point subsets, generates the anomaly judgment trajectory corresponding to each set of key point subsets, and performs anomaly judgment on the trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory; based on the multiple anomaly judgment results of each trajectory point, determines the normal trajectory points and abnormal trajectory points in the target trajectory data, generates the target fitting trajectory based on the normal trajectory points, and performs coordinate compensation on the abnormal trajectory points based on the target fitting trajectory. This method acquires raw spatiotemporal trajectory data and performs relative metric coordinate transformation. It then performs multiple keypoint filtering at different scales to obtain multiple keypoint subsets. Based on these subsets, it generates parallel anomaly detection trajectories and performs multiple cross-validations. Finally, based on the multi-dimensional judgment results, it accurately isolates anomalies and generates a target fitting trajectory solely based on pure, normal trajectory points to compensate for the coordinates of the anomaly points. This application, by introducing a decoupled closed-loop mechanism of multi-scale cross-validation and "purification before reconstruction," not only fundamentally eliminates the heavy reliance on externally labeled data and greatly improves the system's robustness in adaptively recognizing complex and extreme noise, but also prevents outlier noise from contaminating the fitting benchmark. Ultimately, it achieves extremely robust output of high-precision, high-fidelity, and continuous fitting trajectories even under harsh data conditions, avoiding the problems in existing technologies where the extensibility of discrimination rules is limited, high-quality training data is difficult to obtain, and interpolation errors are large, leading to the inability to accurately generate fitting trajectories. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a flowchart illustrating a method for generating a fitting trajectory provided in an embodiment of this application; Figure 2 This is a schematic diagram of another fitting trajectory generation device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0010] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, fitting trajectory generation apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail.
[0011] A method and apparatus for generating a fitting trajectory according to an embodiment of this application will now be described in detail with reference to the accompanying drawings.
[0012] Figure 1 This application provides a method for generating a fitting trajectory, such as... Figure 1 As shown, the method includes: S101. Obtain the original spatiotemporal trajectory data, perform relative metric coordinate transformation on the original spatiotemporal trajectory data, and obtain the target trajectory data; It is understood that the fitting trajectory generation method and its steps provided in this application can be executed by a server or a terminal device alone, or by a server and a terminal device working together. The terminal device includes, but is not limited to, an in-vehicle computing platform, a smartphone, a drone flight control system, or a dedicated surveying terminal; the server can be an independent physical server or a cloud server providing cloud computing services. For the sake of brevity and clarity, the following embodiments will use the server as the execution subject to describe the fitting trajectory generation method provided in this application.
[0013] In this embodiment, the original spatiotemporal trajectory data typically originates from positioning point sequences collected by various positioning devices (such as Global Navigation Satellite System (GNSS), Inertial Navigation System (INS), and LiDAR (LiDAR SLAM) modules). In complex real-world business scenarios, the positioning frequencies and result formats output by different positioning devices and methods often differ significantly. For example, GNSS typically outputs spherical geographic coordinates (latitude and longitude) at a frequency of 5–10 Hz, while LiDAR SLAM typically outputs local planar relative position coordinates at a frequency of 1–5 Hz. Due to the fundamental differences in data format, coordinate space, and dimensions of multi-source trajectory data, they cannot be directly spatially aligned and jointly calculated within the same mathematical framework. Furthermore, even considering only single spherical positioning data, since the Earth is an irregular ellipsoid, directly calculating the distance and geometric relationship between two points in a spherical geographic coordinate system is not only computationally intensive but also prone to scale distortion errors, failing to meet the requirements of high-precision trajectory analysis.
[0014] Therefore, this embodiment first uses the starting point of the trajectory data as the origin and employs a coordinate projection algorithm (such as local tangent plane projection or Mercator projection) to uniformly map the original spatiotemporal trajectory data from different positioning devices or methods into a local two-dimensional or three-dimensional plane coordinate system, thereby converting it into relative coordinate data in meters. The resulting data sequence containing time information and metric coordinate information is the target trajectory data. This step not only eliminates the data barriers of multi-source heterogeneous sensors but also lays a unified scale foundation for subsequent high-precision geometric distance calculation and curve fitting. It is understood that although this embodiment is described in metric units, in other embodiments, it can also be converted to relative coordinate data in inches, feet, etc., as needed, and this application does not limit this.
[0015] For example, this application establishes a metric-unit relative coordinate system with the east direction as the positive X-axis and the north direction as the positive Y-axis, and denotes the transformed target trajectory data as follows: Understandably, target trajectory data It contains multiple trajectory points in chronological order. For target trajectory data The trajectory point at any time t Taking the conversion of latitude and longitude to a relative metric coordinate system as an example, its corresponding relative metric coordinates ( , The conversion formula for ) is: ; ; In the formula Let t be the trajectory point The relative coordinates of the X-axis. Let t be the trajectory point The relative Y-axis coordinates For target trajectory data The longitude of the starting trajectory point (which refers to the first trajectory point in the target trajectory data arranged in a time series, i.e., the reference anchor point serving as the origin of the local relative coordinate system). Let t be the trajectory point longitude, for The latitude of the starting trajectory point. Let t be the trajectory point The latitude and longitude are both in radians; Let t be the trajectory point The radius of the Maoyou circle calculated based on latitude, longitude, and altitude. Let t be the trajectory point The radius of the meridian circle is calculated based on latitude, longitude, and altitude. The unit of the above radius and the final converted relative coordinates are all meters.
[0016] S102. Perform multiple key point filtering operations on the target trajectory data at different scales to obtain multiple different subsets of key points; In this embodiment, it is considered that trajectory data may be affected by environmental occlusion, signal multipath effects, etc. during the acquisition process, resulting in varying degrees of drift or noise. If only all trajectory points or key points extracted at a single time are used for analysis, it is very easy to fall into random errors.
[0017] Therefore, this step employs a multi-scale, multiple-sampling strategy. Specifically, different error tolerance thresholds (i.e., scales) can be set, or random sampling can be combined to extract feature points from the target trajectory data in multiple rounds. Since each round uses a different extraction scale or initial conditions, multiple distinct subsets of key points will ultimately be selected. This approach can capture the topological skeleton features of the trajectory from macroscopic to microscopic details at multiple different levels, providing a rich and diverse set of data samples for subsequent cross-validation.
[0018] For example, the server can preset three different spatial error tolerance thresholds (e.g., 1 meter, 3 meters, and 5 meters), and use the starting and ending trajectory points of the target trajectory data as fixed endpoints respectively, and call basic trajectory thinning algorithms (such as the traditional Douglas-Puk algorithm and its variants) for parallel processing to obtain three sets of key point subsets with different macroscopic coarseness.
[0019] The specific method for filtering key points at different scales on the target trajectory data multiple times to obtain multiple sets of different key point subsets will be described in detail in subsequent embodiments of this application, and will not be repeated here.
[0020] S103. Based on each set of key points subset, generate the anomaly judgment trajectory corresponding to each set of key points subset, and perform anomaly judgment on the trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory. In this embodiment, for the multiple key point subsets obtained in S102, the server uses each key point subset as a basis and employs curve generation or fitting algorithms to generate an anomaly judgment trajectory that can characterize the spatiotemporal trend of the current key point subset. Since there are multiple differentiated key point subsets, the server generates multiple independent anomaly judgment trajectories.
[0021] Subsequently, the server substitutes all the target trajectory data (i.e., all the original trajectory points) into each anomaly detection trajectory for review and verification. Specifically, for any trajectory point in the target trajectory data, the server calculates the degree of deviation between that trajectory point and each anomaly detection trajectory (e.g., spatial vertical distance or spatiotemporal projection deviation). Based on preset judgment rules, for each anomaly detection trajectory, that trajectory point will obtain an independent anomaly judgment result (e.g., classified as "normal" or "abnormal" by binary classification). In this way, each trajectory point in the target trajectory data will carry multiple independent cross-validation judgment results given by multiple different trajectories.
[0022] It should be noted that, in order to completely solve the technical defects of a single fitting scale easily masking local anomalies and a single algorithm easily causing overfitting, this application innovatively proposes a "macro-micro dual-track decoupling" mechanism in this step and introduces a heterogeneous algorithm model matrix. Regarding how to generate anomaly judgment trajectories based on key point subsets and how to perform more accurate anomaly judgment, this application will elaborate on this in detail in subsequent embodiments, and will not repeat it here.
[0023] S104. Based on the multiple anomaly judgment results of each trajectory point, determine the normal trajectory points and abnormal trajectory points in the target trajectory data, generate the target fitting trajectory based on the normal trajectory points, and perform coordinate compensation on the abnormal trajectory points based on the target fitting trajectory.
[0024] In this embodiment, since a single judgment model is easily affected by extreme noise and may produce misjudgments, this step summarizes the "multiple abnormal judgment results" carried by each trajectory point and adopts a comprehensive evaluation strategy (such as a voting mechanism based on the majority of results, weighted scoring, etc.) to determine the final classification of the trajectory point, thereby extremely robustly and accurately classifying the target trajectory data into "normal trajectory points" and "abnormal trajectory points". After successfully removing or stripping outlier trajectory points, the server uses only those "normal trajectory points" that have been cross-validated as pure as high-quality samples to perform trajectory fitting or reconstruction again, thereby generating an extremely smooth "target fitted trajectory" that conforms to the laws of actual physical motion. Finally, the server uses this healthy target fitted trajectory as a reference benchmark to pull back or map the data points previously identified as "outlier trajectory points" onto this benchmark, completing the correction and compensation of outlier trajectory points. Through the above closed-loop processing, even under extremely poor original data quality, this method can still output a high-precision, high-fidelity, and continuous reconstructed trajectory.
[0025] According to the solution provided in the embodiments of this application, the method obtains target trajectory data by acquiring original spatiotemporal trajectory data, performing relative metric coordinate transformation on the original spatiotemporal trajectory data, and then performing multiple key point screenings at different scales on the target trajectory data to obtain multiple sets of different key point subsets. Based on each set of key point subsets, anomaly judgment trajectories corresponding to each set of key point subsets are generated, and anomaly judgments are performed on the trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory. Based on the multiple anomaly judgment results of each trajectory point, normal trajectory points and abnormal trajectory points in the target trajectory data are determined, a target fitting trajectory is generated based on the normal trajectory points, and coordinate compensation is performed on the abnormal trajectory points based on the target fitting trajectory. This method acquires raw spatiotemporal trajectory data and performs relative metric coordinate transformation. It then performs multiple keypoint filtering at different scales to obtain multiple keypoint subsets. Based on these subsets, it generates parallel anomaly detection trajectories and performs multiple cross-validations. Finally, based on the multi-dimensional judgment results, it accurately isolates anomalies and generates a target fitting trajectory solely based on pure, normal trajectory points to compensate for the coordinates of the anomaly points. This application, by introducing a decoupled closed-loop mechanism of multi-scale cross-validation and "purification before reconstruction," not only fundamentally eliminates the heavy reliance on externally labeled data and greatly improves the system's robustness in adaptively recognizing complex and extreme noise, but also prevents outlier noise from contaminating the fitting benchmark. Ultimately, it achieves extremely robust output of high-precision, high-fidelity, and continuous fitting trajectories even under harsh data conditions, avoiding the problems in existing technologies where the extensibility of discrimination rules is limited, high-quality training data is difficult to obtain, and interpolation errors are large, leading to the inability to accurately generate fitting trajectories.
[0026] In some examples, the target trajectory data is filtered multiple times at different scales to obtain multiple different subsets of key points, including: S201. Randomly select trajectory points from the target trajectory data to generate multiple initial key point sets, and configure the key point error threshold corresponding to each initial key point set. Each initial key point set contains initial key points with time information. In this embodiment, to avoid local extremum traps caused by a single deterministic starting point, the server employs a random seed strategy, randomly selecting several time-sequential trajectory points from the target trajectory data TRA as initial keypoints, forming multiple parallel sets of initial keypoints. Simultaneously, a keypoint error threshold of different scales (e.g., ...) is assigned to each initial keypoint set. rice, rice, (meters). This combination of "random starting point + multiple thresholds" can construct a spatial pyramid similar to a "parallel universe", thereby capturing the diverse topological skeleton of the trajectory under different macroscopic thicknesses.
[0027] Regarding the number and rules for randomly selecting initial key points, in order to ensure the integrity of the overall trajectory's spatiotemporal span, the selected initial key points usually include fixed boundary points and random intermediate points, and the total number of selected points is much smaller than the total number of points in the target trajectory data.
[0028] For example, suppose the target trajectory data TRA contains N trajectory points in a time series (e.g., N=1000). When generating an initial set of keypoints, the server first extracts the 1st and Nth points as mandatory first and last boundary keypoints; then, from the intermediate N-2 trajectory points, a small number of k trajectory points are randomly selected using a random function (e.g., setting an upper limit on the number of random selections, such as...). If the 300th and 650th trajectory points are randomly selected this time (i.e., k=2), the server will arrange the 1st, 300th, 650th and Nth trajectory points in chronological order to form an initial keypoint set containing 4 initial keypoints.
[0029] By repeatedly changing the random seed and the number of extractions k, multiple distinct sets of initial keypoints can be generated, providing a rich set of initial topological states for subsequent parallel iterative segmentation. It is understood that each initial keypoint set corresponds to a keypoint error threshold; however, the keypoint error thresholds corresponding to different initial keypoint sets can be the same or different, and this application does not strictly limit this.
[0030] S202. Take two initial key points that are adjacent in time sequence within the initial key point set as a group of adjacent key points, construct a baseline connection based on each group of adjacent key points, and determine the trajectory points in the time period between each group of adjacent key points from the target trajectory data as reference trajectory points for each group of adjacent key points. It is understandable that if an initial keypoint set contains M initial keypoints, then pairing them up in chronological order will create M-1 groups of adjacent keypoints.
[0031] Following the aforementioned embodiment, suppose the server arranges the 1st, 300th, 650th, and Nth (e.g., 1000th) trajectory points in chronological order, forming a set containing 4 initial key points; at this time, the server will pair (1st, 300th), (300th, 650th), and (650th, Nth) in pairs to divide them into three groups of adjacent key points.
[0032] Then, the server constructs a baseline connection based on each set of adjacent keypoints. For example, suppose a set of adjacent keypoints is the starting keypoint. and termination key points The server will directly establish a connection in the local metric coordinate space. and The straight line segment is used as a reference line. Physically, this spatial straight line segment represents the target object's position from... arrive The theoretical perfect trajectory is assumed to be that the trajectory does not drift and moves at an absolutely uniform linear speed within a certain time period.
[0033] Finally, the server needs to determine the trajectory points within the time interval between each group of adjacent key points from the target trajectory data, as reference trajectory points for each group of adjacent key points. Specifically, the server uses adjacent key points... and timestamp Using a time-sliding window, within the full sequence of the target trajectory data TRA, timestamps between... All trajectory points between them are extracted. Taking the above-mentioned group of adjacent key points (300th and 650th) as an example again, the server will extract all trajectory points from the 301st to the 649th in the target trajectory data and classify them into this group as the set of "reference trajectory points" whose deviation needs to be verified.
[0034] S203. Calculate the spatiotemporal deviation distance between each reference trajectory point and the corresponding baseline line, and determine the target reference trajectory point corresponding to each group of adjacent key points based on each spatiotemporal deviation distance. This is the core step that distinguishes this application from traditional pure spatial thinning algorithms (such as the Douglas-Puk algorithm, which only calculates the perpendicular distance from a point to a line). Traditional algorithms cannot identify abnormal acceleration or deceleration or abnormal drifting of a target object in a straight line, while this embodiment innovatively introduces a "time-scale interpolation" mechanism, which deeply physically binds the time dimension and the spatial dimension.
[0035] This embodiment introduces a "time-scale interpolation" mechanism. For any reference trajectory point, the server first calculates its corresponding spatiotemporal synchronization theoretical point (i.e., the ideal position under uniform linear motion) on the baseline based on its actual timestamp t. The formula for calculating the theoretical position coordinates of each trajectory point on the baseline is as follows: ; ; in, and These are the coordinates and timestamps of the starting and ending key points in the group of adjacent key points, respectively; t is the timestamp of the current reference trajectory point. Let t be the coordinates of the theoretical point of spatiotemporal synchronization at time t.
[0036] Subsequently, the server calculates the actual coordinates of the reference trajectory points. With theoretical coordinates The Euclidean distance between them is the spatiotemporal deviation distance. The server iterates through all reference trajectory points in the group, selects the point with the largest spatiotemporal deviation distance, and marks it as the target reference trajectory point.
[0037] Among them, the spatiotemporal deviation distance between each reference trajectory point and its corresponding synchronization theoretical point The calculation formula is: ; in, , The actual coordinates of the reference trajectory point at time t; , Let t be the coordinates of the synchronous theoretical point on the baseline connecting the reference trajectory point at time t.
[0038] It is understood that this application does not impose strict limitations on the specific implementation methods for key point screening, and is not limited to the aforementioned TD-TR (Top-Down Time-Ratio) algorithm based on time ratio interpolation. Those skilled in the art can flexibly select other specific trajectory thinning or feature point extraction algorithms in practical applications, based on limitations of computing resources and different business accuracy requirements.
[0039] For example, traditional Douglas-Peucker algorithms, spatio-temporal Douglas-Peucker algorithms (ST-DP), sliding window algorithms, open window algorithms, or feature extraction algorithms based on changes in heading angle or velocity thresholds can be used. As long as they can perform multiple key point filtering operations on the target trajectory data at different scales to obtain multiple different subsets of key points, they should be included within the scope of protection of this application.
[0040] S204. If the spatiotemporal deviation distance corresponding to the target reference trajectory point is greater than the corresponding key point error threshold, then the target reference trajectory point is determined as a new key point. After determining the target reference trajectory point (i.e., the reference trajectory point with the largest spatiotemporal deviation distance within the interval of adjacent keypoints in this group), the server compares and verifies the maximum spatiotemporal deviation distance corresponding to the target reference trajectory point with the current corresponding keypoint error threshold. It should be noted that the keypoint error threshold here is the specific error threshold pre-configured in step S201 for the initial keypoint set containing the target reference trajectory point (e.g., the one mentioned in the previous example). 2 meters or rice).
[0041] If the spatiotemporal deviation distance corresponding to the target reference trajectory point is greater than the corresponding key point error threshold, the key point addition mechanism is triggered, and the server officially determines the target reference trajectory point as a new key point.
[0042] Understandably, when the maximum spatiotemporal deviation distance within an interval exceeds the keypoint error threshold corresponding to the initial set of keypoints, it physically signifies a severe deviation in the trajectory shape or an anomalous velocity change in the target object at that point (i.e., violating the assumption of uniform linear motion within that interval). Therefore, this target reference trajectory point must contain extremely important spatial topological inflection points or temporal dynamic features, and the server forcibly upgrades it to a "new keypoint" to serve as a solid anchor point for further refinement of the fitting.
[0043] S205. Based on the new key points, the original adjacent key points are divided into new adjacent key point combinations, and the reference connection lines corresponding to the new adjacent key points are reconstructed and iteratively filtered until the spatiotemporal deviation distance of all reference trajectory points is not greater than the key point error threshold, thus obtaining the key point subset corresponding to the initial key point set.
[0044] Once a new keypoint is generated, the original combination of adjacent keypoints (such as the aforementioned starting keypoint) will be affected. and termination key points This means that the new key point "cuts off" the sequence in time, thus splitting it into two new combinations of adjacent key points: and .
[0045] For example, following the specific example above, assuming the original interval is (the 300th trajectory point, the 650th trajectory point), if after the aforementioned step S204, the server determines that the 480th trajectory point with the largest deviation in the interval is the "new key point", then the original interval will be immediately divided into two completely new sub-intervals: (the 300th, the 480th) and (the 480th, the 650th).
[0046] For new combinations of adjacent key points, the server will automatically trigger a recursive verification mechanism. Specifically, the server will reconstruct new baseline connections for the newly divided sub-intervals and re-extract the reference trajectory points within each sub-interval, and then recalculate the new spatiotemporal synchronization theoretical point and spatiotemporal deviation distance (i.e., repeat the verification and segmentation actions of steps S202 to S204 above for each sub-interval).
[0047] This tree-like splitting iteration based on spatiotemporal synchronization physical logic will continue in parallel until, after a certain deep iteration, the spatiotemporal deviation distance of all reference trajectory points within a certain subdivision interval is no longer greater than ( When the keypoint error threshold corresponding to the given condition is reached, the segmentation of that interval ceases. When all derived sub-intervals satisfy this termination condition, the overall iterative traversal of the current initial keypoint set completely ends. At this point, the initially selected initial keypoints and all "new keypoints" generated in each previous splitting iteration are merged in chronological order, forming a complete, high-fidelity subset of keypoints corresponding to the initial keypoint set at that specific error threshold scale.
[0048] The above-mentioned solution according to this application has the following beneficial effects: 1. Existing technologies (such as the traditional Douglas-Puk DP algorithm) rely solely on calculating the "spatial vertical distance" from a point to a line when extracting trajectory features. This purely spatial dimensionality reduction makes it completely immune to temporal anomalies such as "abnormal rapid acceleration / deceleration" or "drifting and spinning in place" that occur during the target object's straight-line movement (i.e., the vertical distance approaches 0, thus missing detection). This application introduces a "time-proportional interpolation" mechanism, constructing a spatiotemporal synchronization reference point based on the theoretical assumption of "uniform linear motion" in physics, and incorporating the time variable as a core constraint into the calculation of "spatiotemporal deviation distance." This mechanism enables the server to extremely sensitively capture any hidden anomalies that disrupt the temporal dynamics, achieving truly high-fidelity spatiotemporal feature extraction. A "random seed + multi-scale threshold" pyramid is constructed to perfectly avoid local extrema and random errors.
[0049] 2. Existing feature extraction methods typically rely on a single deterministic starting point and a fixed error threshold, making them prone to falling into local optima traps. This results in extracted skeletons that are either too coarse (losing details) or too redundant (preserving noise). This application fundamentally breaks the limitations of randomness in single, precise segmentation by introducing a "seed strategy" that randomly selects initial keypoints. Simultaneously, it combines this with a stepped multi-keypoint error threshold to construct a hierarchical "spatiotemporal pyramid" structure. This enables the system to capture diverse topological skeletons in parallel at different macroscopic and microscopic scales, providing extremely rich and highly robust, differentiated, high-quality input samples for subsequent heterogeneous model cross-validation (ensemble voting).
[0050] 3. Adaptive segmentation based on recursive splitting achieves unsupervised, self-driven extraction closure. This application utilizes dynamic comparison of the maximum spatiotemporal deviation distance and the keypoint error threshold to automatically trigger tree-like splitting and recursive iteration mechanisms. Without manual intervention or pre-labeling, the server can adaptively determine the segmentation depth of each interval based on the degree of spatiotemporal distortion of the trajectory itself, until all subdivided intervals satisfy the high-confidence linear motion assumption. This self-driven divide-and-conquer method not only greatly improves the execution efficiency of the algorithm but also ensures the absolute rigor and completeness of the mathematical logic of each keypoint subset in the final output.
[0051] It is understandable that the server can also employ a deterministic extraction strategy, extracting only the beginning and end boundary points of the target trajectory data, or extracting a very small number of trajectory points as initial key points at a fixed time step / spatial interval (e.g., every 100 points), thereby generating a single or a fixed number of initial key point sets. In this case, apart from the simplification of the method for obtaining the initial key points and the number of generated subsets, the subsequent core segmentation logic (i.e., iterative screening steps S202 to S205 based on the baseline connection and spatiotemporal deviation distance) is completely consistent with the aforementioned embodiment, and can also achieve high-precision and high-fidelity extraction of trajectory physical features, which will not be elaborated further in this application.
[0052] In some examples, the anomaly detection trajectory includes: a macro-level anomaly detection trajectory and a micro-level segmented detection trajectory; based on each subset of key points, an anomaly detection trajectory corresponding to each subset of key points is generated, including: S301. Input the subset of key points as a whole into the selected curve fitting algorithm to perform global curve fitting, and generate a macroscopic anomaly judgment trajectory to characterize the global spatiotemporal trend of the subset of key points. In this embodiment, since the "keypoint subset" extracted in the aforementioned steps has filtered out most of the random noise and retained the sparse skeleton that can represent the true intent of the trajectory, the server treats each sparse keypoint subset as an indivisible whole and inputs it into a selected curve fitting algorithm (such as multinomial regression, B-spline curve fitting, Bézier curve fitting, or support vector regression SVR) for global modeling.
[0053] The "macroscopic anomaly detection trajectory" generated by global curve fitting represents, in a physical sense, the macroscopic motion trend and global topological skeleton of the target object within that time period. This macroscopic trajectory is extremely smooth and robust, completely immune to minor local jitters, and is specifically designed for subsequent capture of "long-distance super noise" or "large-scale drift" that have undergone severe deviations.
[0054] It is understood that this application is not limited to generating only a single macroscopic anomaly detection trajectory. In fact, each subset of key points can correspond to at least one macroscopic anomaly detection trajectory. The server inputs the key points in the key point subset into at least two heterogeneous algorithms for independent fitting, generating multiple parallel macroscopic anomaly detection trajectories corresponding to each key point subset. For example, in order to completely eliminate the inherent model biases caused by a single fitting algorithm (such as Runge's phenomenon or overfitting defects in polynomials), the server can input the same subset of key points into multiple underlying heterogeneous models in parallel (e.g., simultaneously input into the high-order polynomial regression model Poly, the support vector regression model SVR, and the tree-based XGBoost regression algorithm). Thus, for this same subset of key points, the server will output multiple (e.g., three) macroscopic anomaly detection trajectories based on completely different mathematical mechanisms in parallel. This "homogeneous heterogeneous" design lays an extremely solid foundation for the subsequent construction of multidimensional vote matrices and ensemble voting.
[0055] S302. Based on each key point in the key point subset as a boundary node, the target trajectory data is divided into multiple time-continuous segmented trajectory subsets. For each segmented trajectory subset, all trajectory points contained within it are input into a curve fitting algorithm for local curve fitting, generating multiple micro-segmented judgment trajectories to characterize the local spatiotemporal fluctuations of each segmented trajectory subset. The multiple micro-segmented judgment trajectories are combined to form the micro-anomaly judgment trajectory corresponding to the key point subset.
[0056] Unlike macro-level global fitting, micro-level fitting aims to capture local high-frequency noise. Specifically, the server uses adjacent key points in the key point subset as natural "physical isolation boundaries" to divide the target trajectory data, which contains all the original dense scattered points, into multiple independent and temporally continuous segmented trajectory subsets (i.e., the full set of original scattered points between each pair of adjacent key points).
[0057] Subsequently, for each segmented trajectory subset, the server individually feeds its densely packed points into the same or corresponding curve fitting algorithm for local modeling, thereby generating a "micro-segment judgment trajectory" that only represents the local trend within that extremely small time window. Finally, the server splices and combines these multiple interconnected micro-segment judgment trajectories in the time domain to form the "micro-anomaly judgment trajectory".
[0058] This local fitting is extremely sensitive, and it can faithfully reflect the local spatiotemporal fluctuations and tiny spikes of the target object between two key nodes. It is specifically used to subsequently identify those "high-frequency small noises" hidden near the normal trajectory.
[0059] Similarly, to avoid overfitting or oscillating distortion in extremely small time windows or extremely dense scatter plots by a single local fitting algorithm, each segmented trajectory subset can also correspond to at least one micro-segmented judgment trajectory. For example, the server can input dense scatter plots within the same segmented trajectory subset into multiple heterogeneous local fitting models (e.g., local weighted regression, smoothed spline curves, or local support vector regression). Thus, for that local interval, the server will generate multiple micro-segmented judgment trajectories based on different mathematical mechanisms. This "homogeneous heterogeneous" processing at the micro-scale not only greatly enhances local anti-interference capabilities but also provides extremely rich decision dimensions for subsequent fine-grained cross-validation targeting high-frequency, low-noise points.
[0060] In some examples, anomaly detection is performed on the trajectory points in the target trajectory data for each anomaly detection trajectory, resulting in the anomaly detection result for each trajectory point under each anomaly detection trajectory, including: S401. For each trajectory point in the target trajectory data, determine its belonging status under each key point subset division; In this embodiment, since the server has constructed multiple sets of key point subsets at different scales in the early stage (S201-S205), the physical role played by the same original trajectory point is dynamically changing under different "key point subset" division systems.
[0061] For example, following the aforementioned embodiment, for the 480th trajectory point in the target trajectory data, in a fine-scale key point subset with a small error threshold (e.g., 2 meters), its 3-meter spatiotemporal deviation distance exceeds this stringent threshold, so it will be forcibly upgraded and extracted as a "key point" by the system. However, in a macro-scale key point subset with a large error threshold (e.g., 10 meters), the 3-meter deviation of this point is considered to be a fluctuation completely within the normal tolerance range and does not trigger the splitting mechanism. Therefore, at this scale, it is merely a "trajectory point within a segmented trajectory subset" between two macro-key points.
[0062] Therefore, before making a qualitative judgment, the server first needs to clarify whether the trajectory point under investigation is a "key point" or a trajectory point in a regular "segmented trajectory subset" sandwiched between two points in this specific key point subset division system, so as to determine the applicable judgment trajectory.
[0063] S402. If the trajectory point belongs to a key point in the key point subset, calculate the spatiotemporal projection distance from the trajectory point to the corresponding macroscopic anomaly judgment trajectory. If the spatiotemporal projection distance is greater than the macroscopic threshold, the trajectory point is determined to be an anomaly under the current macroscopic anomaly judgment trajectory. If a trajectory point belongs to a key point within a subset of key points, it represents the macroscopic skeleton of the trajectory. The server will send it to the macroscopic judgment track and calculate the shortest spatiotemporal projection distance from the actual coordinates of the key point to the "macroscopic anomaly judgment trajectory" corresponding to the aforementioned key point subset. Since the macroscopic trajectory itself is extremely smooth, if the projection distance of the key point still exceeds the preset "macroscopic threshold" (this threshold is usually set relatively large to tolerate normal macroscopic curves in the route), it physically means that the key point itself is a "super noise point" or "system-level large drift" that has deviated significantly. At this time, the server will unhesitatingly determine that the trajectory point is "abnormal" from the current macroscopic perspective and record a macroscopic anomaly judgment result (i.e., cast a macroscopic dissenting vote); conversely, if the spatiotemporal projection distance is less than or equal to the macroscopic threshold, the trajectory point is determined to be normal under the current macroscopic anomaly judgment trajectory (i.e., cast a macroscopic affirmative vote).
[0064] It is understandable that the determination of the aforementioned macroscopic threshold can be varied. In one basic implementation, the macroscopic threshold can be a fixed empirical value (e.g., set to 15 meters) pre-defined based on historical experience data, device positioning accuracy level, or current business scenario (such as highway scenario and urban congested road scenario).
[0065] In a superior, highly robust adaptive implementation, the macroscopic threshold can be dynamically calculated based on the statistical distribution characteristics of the projected distances from all keypoints in the current keypoint subset to the macroscopic anomaly detection trajectory. For example, the server can calculate the mean and standard deviation of the spatiotemporal projected distances corresponding to all keypoints, and based on... In principle, or by using the interquartile range rule, a threshold specific to that particular macroscopic trajectory can be dynamically generated. This "personalized" adaptive threshold mechanism can dynamically adjust according to fluctuations in the quality of the original data, thereby effectively avoiding cross-scenario misjudgments or omissions caused by hard-coded fixed thresholds.
[0066] S403. If the trajectory point belongs to the trajectory point within the segmented trajectory subset, calculate the spatiotemporal projection distance from the trajectory point to the corresponding micro-segmented judgment trajectory. If the spatiotemporal projection distance is greater than the micro threshold, the trajectory point is determined to be abnormal under the current micro-segmented judgment trajectory.
[0067] Corresponding to the examination logic of the macro framework, if a trajectory point belongs to a "trajectory point within a common "segmented trajectory subset" sandwiched between adjacent key points under the current segmentation, it indicates that it mainly reflects the local high-frequency details of the trajectory. The server will send it into the micro-decision orbit and calculate the shortest spatiotemporal projection distance from the actual coordinates of the trajectory point to the aforementioned generated local "micro-segmented judgment trajectory" to which it belongs.
[0068] Since the microscopic segmented trajectory already closely matches the original local trajectory, if the projected distance of the point still exceeds the preset "microscopic threshold" (this microscopic threshold is usually set extremely strictly and much smaller than the macroscopic threshold to allow for extremely small sensor jitter), it physically means that the trajectory point has experienced a "high-frequency local noise" or "glitch jump" that does not conform to the physical inertia of motion within a very short time window. At this time, the server will accurately determine that the trajectory point is "abnormal" from the current microscopic perspective and record a microscopic abnormality judgment result (i.e., cast a microscopic dissenting vote for the trajectory point); conversely, if the spatiotemporal projection distance is less than or equal to the microscopic threshold, the trajectory point is determined to be "normal" from the current microscopic perspective (i.e., cast a microscopic affirmative vote).
[0069] Similarly, it is understood that the determination of the aforementioned microscopic threshold can be either fixed or adaptive. In the basic implementation, the microscopic threshold can be set to a small, fixed empirical value (e.g., 2 meters).
[0070] In a more optimized adaptive implementation, to adapt to the differences in local noise characteristics across different road segments (such as severely shaded sections versus open sections), the micro-threshold can be obtained through "local dynamic calculation" based on the statistical distribution of the projected distances from all scattered points within a specific segmented trajectory subset to the micro-judgment trajectory. For example, the server only calculates the local mean and local standard deviation of the projected distances from scattered points within the current small interval, and based on the local... The principle is dynamically generated. This "one zone, one foot" extreme local adaptive mechanism eliminates the risk of local overfitting or underfitting that may be caused by a globally uniform micro threshold, and achieves precise micro noise removal.
[0071] To better understand the above steps, this application provides a more specific example for illustration.
[0072] Taking the heterogeneous algorithm of polynomial regression as an example, assuming the server uses this polynomial regression algorithm to process the macroscopic set of trajectory key points... and the microscopic segmented trajectory subsets Perform fitting to generate corresponding macroscopic anomaly detection trajectories. and micro-segmentation to determine trajectory Subsequently, the spatiotemporal projection distance between the trajectory point at each time step and the corresponding fitted trajectory point is calculated and compared with the macroscopic threshold. and micro threshold The results are compared to output the independent anomaly judgment result of the trajectory point under the multinomial model. .
[0073] Specifically, key points of the trajectory from a macro perspective For example, key points Includes time t, x-axis and ordinate Information, where i represents the i-th random trial, j represents the error threshold for different key points, trajectory anomalies are correlated with both the horizontal and vertical axes, and to avoid mutual influence between the horizontal and vertical axes, the horizontal axis is used as the reference value. and ordinate Using time t and the x-axis or y-axis of the preceding moments as the dependent variable, a fitting model is established.
[0074] The general mathematical expression of this multivariate polynomial regression model can be represented as: ; In the formula, These are the model coefficients. For model residuals, and As the independent variable, Let p be the dependent variable (i.e., the predicted coordinates), and p be the feature dimension of the independent variable. As the dimension p increases, the model complexity and the ability to capture curve details increase rapidly.
[0075] After model training and inference, the theoretical x-axis predicted by multinomial regression is... and theoretical ordinate The combination constitutes the theoretical points on the macroscopic anomaly judgment trajectory. Next, the server calculates the Euclidean distance (i.e., spatiotemporal projection distance) between the key points at each time step and the corresponding fitted trajectory points in the macroscopic anomaly judgment trajectory: ; in, and The theoretical horizontal and vertical coordinates on the trajectory for predicting macroscopic anomalies at time t. and The original horizontal and vertical coordinates (the true coordinates of the key points) are at time t.
[0076] when Less than the threshold When the time is t, the key point corresponding to time t is considered a normal trajectory point; otherwise, it is considered an abnormal trajectory point. The result of segmenting and judging the trajectory of all key points is denoted as . This serves as an independent vote for that point in a specific parallel universe characterized by the i-th random trial, the j-th scale, and the use of the Poly model.
[0077] Taking the heterogeneous algorithm Support Vector Regression (SVR / SVM) as an example, assuming the server uses this SVM algorithm to process the macroscopic set of trajectory key points... and the microscopic segmented trajectory subsets Perform fitting to generate corresponding macroscopic anomaly detection trajectories. and micro-segmentation to determine trajectory Subsequently, the spatiotemporal projection distance between the trajectory point at each time step and the corresponding fitted trajectory point is calculated and compared with the macroscopic threshold. and micro threshold The results are compared to output the independent anomaly detection results of the trajectory point under the SVM model. Specifically, key points of the trajectory from a macro perspective For example, key points Includes time t, x-axis and ordinate Information, where i represents the i-th random trial, j represents the error threshold for different key points, trajectory anomalies are correlated with both the horizontal and vertical axes, and to avoid mutual influence between the horizontal and vertical axes, the horizontal axis is used as the reference value. and ordinate Using time t and the x-axis or y-axis of the preceding moments as the dependent variable, an SVM fitting model is established.
[0078] The core objective function of this support vector regression is: ; ; ; ; In the formula, The independent variable can be mapped to a high-dimensional space (it can be mapped to a high-dimensional feature space through a kernel function). As the dependent variable, The coefficient matrix, For bias terms, It is a high training error. It is a low training error. and Slack variables (representing excess) The training error limits at the upper and lower boundaries of the pipeline, and satisfying... . These are hyperparameters of SVM, used to control the balance between model smoothness and error tolerance. The interval width for the insensitive loss function. For kernel functions, in order to capture the complex nonlinear characteristics of the trajectory, the kernel function can be flexibly selected from radial basis function (RBF), sigmoid kernel function or polynomial kernel function, etc.
[0079] After kernel function mapping and hyperparameter optimization, the theoretical x-axis of SVM regression prediction is obtained. and theoretical ordinate These can be combined to form theoretical points on the macroscopic anomaly judgment trajectory. Then, the server calculates the Euclidean distance (i.e., spatiotemporal projection distance) between the key points at each time step and the corresponding fitted theoretical points in the macroscopic anomaly judgment trajectory: ; In the formula, and The x and y coordinates at time t are predicted by the SVM model. and The original x and y coordinates of the key points at time t.
[0080] when Less than the threshold When the time is t, the key point corresponding to time t is considered a normal trajectory point; otherwise, it is considered an abnormal trajectory point. The result of segmenting and judging the trajectory of all key points is denoted as . This serves as an independent vote for that point in a specific parallel universe characterized by the i-th random trial, the j-th scale, and the use of the SVM model.
[0081] Taking the XGBoost algorithm as an example of a heterogeneous algorithm, assuming the server uses the Extreme Gradient Boosting Tree (XGBoost) algorithm to process the macroscopic set of trajectory key points... and the microscopic segmented trajectory subsets Perform fitting to generate corresponding macroscopic anomaly detection trajectories. and micro-segmentation to determine trajectory Subsequently, the spatiotemporal projection distance between the trajectory point at each time step and the corresponding fitted trajectory point is calculated and compared with the macroscopic threshold. and micro threshold The results are compared to output the independent anomaly detection results of the trajectory point under the XGBoost ensemble tree model. Specifically, key points of the trajectory from a macro perspective For example, key points Includes time t, x-axis and ordinate Information, where i represents the i-th random trial, j represents the error threshold for different key points, trajectory anomalies are correlated with both the horizontal and vertical axes, and to avoid mutual influence between the horizontal and vertical axes, the horizontal axis is used as the reference value. and ordinate Using time t and the x-axis or y-axis of the preceding time points as the dependent variable, an XGBoost fitting model is established.
[0082] Assuming the number of training samples for the input model is n, and the feature dimension is m, then the constructed XGBoost tree ensemble model is: ; In the formula, It is the set of structure spaces of CART decision trees, where, Here, q represents the training sample index, q represents the tree structure mapping samples to leaf nodes, T represents the number of leaf nodes, w represents the real number fraction of the leaf nodes, and k represents the number of base models.
[0083] The objective function is: ; ; In the formula, L is the training error function term that measures the difference between the predicted value and the true value. The regularization function term is used to control the complexity of the model. It is an L1 regularization term that controls the number of leaf nodes. yes Regularization terms are used to prevent the tree model from overfitting at areas with dense noise.
[0084] After gradient boosting training and inference using multiple trees, the theoretical x-axis predicted by XGBoost is... and theoretical ordinate Combined into Then, the server calculates the Euclidean distance (i.e., spatiotemporal projection distance) between the key points at each time step and the corresponding fitted theoretical points in the macroscopic anomaly judgment trajectory: ; In the formula, and The XGBoost model predicts the theoretical x and y coordinates at time t. and The original x and y coordinates of the key points at time t.
[0085] when Less than the threshold When the time is t, the key point corresponding to time t is considered a normal trajectory point; otherwise, it is considered an abnormal trajectory point. The result of segmenting and judging the trajectory of all key points is denoted as . This serves as another crucial independent vote for this point in a specific parallel universe of "the i-th random trial, the j-th scale, and the use of the XGBoost model".
[0086] In some examples, based on multiple anomaly detection results corresponding to each trajectory point, normal and abnormal trajectory points in the target trajectory data are determined, including: S501. For each anomaly judgment result of the trajectory point, obtain the spatiotemporal projection distance between the trajectory point and the corresponding anomaly judgment trajectory. In this embodiment, for any trajectory point in the target trajectory data, multiple anomaly judgment results (i.e., votes, usually represented as Boolean values of 1 for anomaly and 0 for normal) from different dimensions (i.e., different initial keypoints, different error scales (different keypoint error thresholds), and different heterogeneous algorithms, such as Poly, SVM, and XGBoost) have been collected in the preceding steps. The server first backtracks and obtains the original spatiotemporal projection distance from the trajectory point to the anomaly judgment trajectory fitted by the corresponding model when each vote is cast.
[0087] S502. Based on the spatiotemporal projection distance, assign dynamic voting weights to each anomaly judgment result; wherein, the dynamic voting weights have an exponential decay relationship with the corresponding spatiotemporal projection distances; This is the core defense mechanism of this application against "model hijacking." Traditional hard voting mechanisms assume that all models' votes have equal validity, which is highly susceptible to interference from locally failing models. To address this, this application innovatively introduces a dynamic weight allocation strategy based on spatiotemporal projection distance. The physical logic is that if a model calculates a very large projection distance (with an extremely large deviation), it often means that the fitted model has experienced algorithmic oscillations or severe overfitting in this local region, and its votes have extremely low credibility.
[0088] Therefore, the server sets dynamic voting weights. Distance from projection It exhibits a strong negative correlation with an exponentially decaying relationship. For example, its weighting formula can be expressed as: ; In the formula, The preset exponential decay decay coefficient ( The value >0 is used to control the degree to which the weight decreases with increasing distance. With this formula, the closer the model fits to the actual trend, the higher the weight of the votes cast (close to 1); while the more exaggerated the deviation of the model, the more exponentially the weight of the votes will drop (rapidly approaching 0), thus automatically depriving it of its say in the final result.
[0089] S503. Based on all anomaly judgment results and corresponding dynamic voting weights, calculate the comprehensive anomaly score of the trajectory points; After obtaining the anomaly detection results for each ballot (Values can be 1 or 0) and their corresponding dynamic voting weights Then, the server uses a weighted soft voting mechanism to calculate the final comprehensive anomaly score for the trajectory point. The calculation formula is as follows: The overall abnormal score It is a continuous probability value between [0, 1], which smoothly integrates the weighted consensus of all macroscopic skeletons, microscopic spikes and heterogeneous algorithms such as Poly / SVM / XGBoost.
[0090] S504. If the overall abnormal score of the trajectory point exceeds the preset classification judgment threshold, the trajectory point is determined to be an abnormal trajectory point; otherwise, the trajectory point is determined to be a normal trajectory point.
[0091] Finally, the server compares the calculated overall anomaly score (Score) with a preset classification threshold (e.g., a commonly set 0.5, or 0.6 or 0.7 set according to business tolerance). If the Score > 0.5, it means that after rigorous cross-validation to remove the weights of outlier models, most high-confidence models still consider it abnormal, and the trajectory point is determined as the final "abnormal trajectory point"; otherwise (Score ≤ 0.5), it is determined as a "normal trajectory point".
[0092] In some examples, in addition to the “soft voting” mechanism based on exponentially decaying weights mentioned above, this application may also use a “hard voting (i.e., majority voting)” strategy with lower computational complexity and higher execution efficiency to make the final decision.
[0093] Specifically, when using a hard voting mechanism, the server can directly count the total number of votes for "normal" and the total number of votes for "abnormal" among all multidimensional independent anomaly judgments for a trajectory point at a specific time. If the number of trajectory points judged as "normal" at that time is strictly greater than the number judged as "abnormal," the system considers the trajectory point at that time as a normal trajectory point based on the consensus principle of majority rule; otherwise (i.e., when the number of judged as "abnormal" is greater than or equal to the number of "normal"), the trajectory point at that time is considered the final abnormal trajectory point.
[0094] For example, assuming that under the aforementioned heterogeneous model matrix and multi-scale pyramid architecture, a total of 15 independent votes from different parallel dimensions were collected for the 480th trajectory point in the original trajectory (e.g., including 5 Poly model votes, 5 SVM model votes, and 5 XGBoost model votes). After direct counting, if 11 of the votes are judged as "abnormal" and only 4 are judged as "normal", since the number of abnormal votes (11) absolutely overwhelms the number of normal votes (4), the server will skip the exponential calculation of the weights and directly confirm it as the final abnormal trajectory point based on the hard voting logic. This hard voting mechanism can greatly reduce the concurrent computing overhead of the server in edge computing scenarios with strict requirements for computing resources or relatively uniform trajectory noise characteristics. At the same time, relying on the large heterogeneous vote base in the early stage, it can still maintain extremely strong anti-interference ability and baseline robustness.
[0095] In some examples, after generating the target fitted trajectory based on normal trajectory points, the method also includes: S601. For each abnormal trajectory point, obtain the target timestamp corresponding to the abnormal trajectory point; In this embodiment, when a trajectory point is identified as an abnormal trajectory point, it means that its originally acquired spatial coordinates (such as latitude and longitude or X, Y coordinates) have undergone severe physical drift or high-frequency abrupt changes, rendering them worthless. However, the "target timestamp" recorded by the sensor for this point remains an objective and extremely valuable temporal feature. Therefore, the server first strips away and discards the distorted spatial coordinates of the abnormal trajectory point, but extracts and retains its corresponding target timestamp as a "time anchor" for subsequent reconstruction.
[0096] S602. Based on the target timestamp corresponding to the abnormal trajectory point, match and obtain the corresponding time-series mapping point on the target fitted trajectory; Since the preceding steps have already utilized an absolutely pure set of "normal trajectory points" to reconstruct a "target fitted trajectory" representing the true physical motion intention of the target object through a global smoothing algorithm (such as B-spline curve interpolation or high-order polynomial smoothing fitting), this target fitted trajectory is mathematically a continuous spatiotemporal function.
[0097] In some examples, the server uses the target timestamp retained from the previous step as an independent variable in the parametric equation of the target fitted trajectory, thereby accurately calculating (or mapping and interpolating) the ideal spatial position that should be at that specific timestamp on an extremely smooth theoretical curve. This ideal position is the "time-series mapping point".
[0098] In some examples, the server uses the target timestamp t retained from the previous step as the search anchor point, and extends forward and backward from this center to capture a dynamic time window with a preset tolerance range. Subsequently, the server uses the original true distortion coordinates of the anomalous trajectory point as a reference anchor point, and performs continuous traversal or gradient optimization within the target fitting trajectory segment corresponding to the aforementioned time window constraint. By solving for the minimum spatial Euclidean distance between the true coordinates of the anomalous point and each theoretical fitting point on the curve, the server can pinpoint a location on an extremely smooth theoretical curve that is physically closest to the anomalous point. This ideal fitting position, satisfying the time window constraint and being spatially closest, is precisely matched as the temporal mapping point of this application.
[0099] S603. Use the spatial coordinates corresponding to the time-series mapping points as compensation coordinates for abnormal trajectory points, so as to correct the abnormal trajectory points to the target fitted trajectory.
[0100] Finally, the server forcibly overwrites and replaces the original distorted spatial coordinates of the anomalous trajectory point with the calculated spatial coordinates (i.e., pure theoretical coordinates) of the time-series mapping point located on the perfectly fitted curve. Thus, the anomalous trajectory point is "forcibly pulled back" to the correct physical track with extreme precision.
[0101] Through the compensation and reconstruction mechanisms described in S601 to S603, this application not only completely smooths out all macroscopic drifts and microscopic glitches at all scales in the original trajectory, but also outputs a high-quality cleaned trajectory with extremely high spatial fidelity and temporal continuity without discarding any original sampling points (i.e., perfectly maintaining the original temporal sampling rate and temporal topology). This provides an extremely solid and reliable underlying data foundation for downstream industrial applications such as accurate mileage tolling, path topology mining, and high-precision ETA (Estimated Time of Arrival) prediction.
[0102] In some examples, generating a target fitting trajectory based on normal trajectory points includes: sorting all trajectory points that are classified as normal in the target trajectory data according to the chronological order of the time series; inputting the sorted normal trajectory points into a preset continuous curve generation algorithm for spatiotemporal function reconstruction to generate a target fitting trajectory represented by a continuous mathematical equation.
[0103] In this embodiment, after the rigorous cross-judgment and elimination by the aforementioned "heterogeneous vote matrix," all abnormal points in the original trajectory that have experienced physical drift or high-frequency mutations have been filtered out. The server reorders the points according to their own timestamps t in ascending order, and connects all the remaining normal trajectory points sequentially to construct a spatially pure sequence of pure trajectory points that may have intervals or discontinuities in temporal sampling (denoted as ). ).
[0104] Since precise "temporal interpolation mapping" (i.e., the aforementioned step S602) is required for the timestamps of outliers, simply connecting these pure, normal trajectory points end-to-end with straight line segments (polylines) is far from sufficient, because polylines do not have smooth derivatives at the connection points (i.e., velocity and acceleration will undergo abrupt changes that do not conform to physical laws). Therefore, the server inputs the sorted normal trajectory points into a preset continuous curve generation algorithm (such as the non-uniform rational B-spline algorithm NURBS, the cubic spline interpolation algorithm Cubic Spline, or the higher-order Bezier curve algorithm) for global or local smoothing function reconstruction.
[0105] Taking cubic spline interpolation as an example, the server uses time t as the independent variable, requiring the reconstructed curve to not only smoothly pass through every normal, clean trajectory point, but also to maintain continuity in both the first derivative (velocity) and the second derivative (acceleration) at each node. Ultimately, the algorithm outputs a set of continuous parametric equations (such as piecewise polynomial functions of X(t) and Y(t)) with time t as the parameter. This smooth curve, perfectly characterized by continuous mathematical equations, is the final target fitted trajectory. Through this dimensional reconstruction operation, the originally discrete trajectory points are sublimated into a everywhere differentiable and smooth "spatiotemporal continuum," perfectly restoring the true motion trajectory of the target object and providing a precise mapping coordinate space for subsequent tiny timestamps.
[0106] Through this dimensional reconstruction operation, the originally discrete trajectory points were transformed into a "spatiotemporal continuum" that is differentiable and smooth everywhere. This not only perfectly restored the actual motion trajectory of the target object, but also provided a perfectly mapped coordinate space accurate to the decimal point for any subsequent extremely small timestamps.
[0107] For example, in addition to the traditional numerical analysis algorithms mentioned above, continuous curve generation algorithms can also use multi-input multi-output neural networks (MIMO Neural Networks) with strong learning capabilities to perform end-to-end trajectory reconstruction.
[0108] For example, the input feature variables of this neural network are vectors. The number of neurons in the hidden layer is h, and the output of the hidden layer is... The output layer is The target output is The computation process of a neural network is as follows: The formula for calculating hidden layer nodes is: ; The formula for calculating output layer nodes is: ; In the formula, f() and g() are both activation functions. The weights from the input layer to the hidden layer. These are the weights from the hidden layer to the output layer.
[0109] During the training phase, the backpropagation objective loss function of this network is: ; In practical reasoning applications, the server uses the trained neural network described above to identify normal trajectory points. For the x-axis respectively and ordinate By performing nonlinear mapping and depth fitting, the neural network will eventually output a smooth theoretical x-coordinate fitted at any time stamp t. and theoretical ordinate The fitted horizontal and vertical coordinates together constitute a complete target fitting trajectory that closely approximates the real physical laws of motion. .
[0110] After obtaining the target fitted trajectory, this application calculates the fitted complete trajectory of each abnormal trajectory point and several time points before and after it. The nearest point. For any original trajectory point that is determined to be abnormal at time t (its true abnormal coordinates are denoted as ). and The server will take time t as the center and extract a reasonable time window before and after it. (in (This is the preset tolerance time step).
[0111] Subsequently, within this time window, the server traverses the previously generated target fitting trajectory to search for theoretical fitting points, calculates the spatial Euclidean distance between the true coordinates of the abnormal trajectory point and each theoretical fitting point within the time window, and solves for the minimum value of this distance. The optimization search objective function is as follows: ; In the formula, For time windows A time-series index within (representing several times before and after time t). and Let K be the fitted x and y coordinates of the target fitted trajectory at time K. and The original horizontal and vertical coordinates at time t are used to determine the point as an abnormal trajectory point.
[0112] Through the above optimization solution, the server can accurately locate a "maximum point" (i.e., the optimal projection point) on the smooth curve with the closest spatial distance. Finally, the server extracts the fitted horizontal and vertical coordinates corresponding to this optimal matching time k, as the final compensation coordinates for the abnormal trajectory point (denoted as k). ).
[0113] ; Through this local search compensation, this application not only forcibly pulls the derailed anomaly back onto a smooth track, but also perfectly resolves the inherent "timestamp jitter" error at the sensor hardware level through the time window tolerance mechanism, giving the entire trajectory reconstruction system unparalleled industrial-grade fault tolerance and robustness.
[0114] This application extracts key points from the positioning data after unifying the coordinate system, constructs the trajectory into data at multiple scales based on the spatial pyramid concept, decomposes the data into key points and trajectory segments, and uses multiple algorithms to vote on and identify abnormal trajectory points. The identified normal trajectory points are used to fit the trajectory, and the mapping of abnormal trajectory points onto the fitted trajectory is used as compensation. This results in a scalable, adaptive, label-free method for identifying and compensating for abnormal trajectories that fully utilizes spatial distribution information of the trajectory. It can efficiently and accurately process abnormal trajectory data, improving the quality and reliability of trajectory data.
[0115] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0116] Based on the same concept, this application also provides a fitting trajectory generation device, such as... Figure 2 As shown, the fitting trajectory generation device includes: The conversion module 201 is used to acquire the original spatiotemporal trajectory data, perform relative metric coordinate conversion on the original spatiotemporal trajectory data, and obtain the target trajectory data. The filtering module 202 is used to filter key points of the target trajectory data at different scales multiple times to obtain multiple different subsets of key points. The judgment module 203 is used to generate an anomaly judgment trajectory corresponding to each set of key points based on each set of key points, and to perform anomaly judgment on the trajectory points in the target trajectory data according to each anomaly judgment trajectory, so as to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory. The generation module 204 is used to determine the normal trajectory points and abnormal trajectory points in the target trajectory data based on multiple anomaly judgment results for each trajectory point, generate the target fitting trajectory based on the normal trajectory points, and perform coordinate compensation on the abnormal trajectory points based on the target fitting trajectory.
[0117] In some examples, keypoints are filtered multiple times at different scales on the target trajectory data to obtain multiple different subsets of keypoints. This includes: randomly selecting trajectory points from the target trajectory data to generate multiple initial keypoint sets, configuring a keypoint error threshold for each initial keypoint set, and including initial keypoints with time information in each initial keypoint set; taking two initial keypoints that are temporally adjacent within the initial keypoint set as a group of adjacent keypoints, constructing a baseline connection based on each group of adjacent keypoints, and determining trajectory points in the target trajectory data that fall within the time interval between each group of adjacent keypoints as each group of adjacent keypoints. Reference trajectory points; calculate the spatiotemporal deviation distance between each reference trajectory point and its corresponding baseline, and determine the target reference trajectory point corresponding to each group of adjacent key points based on each spatiotemporal deviation distance; if the spatiotemporal deviation distance corresponding to the target reference trajectory point is greater than the corresponding key point error threshold, then the target reference trajectory point is determined as a new key point; based on the new key points, the original adjacent key points are divided into new adjacent key point combinations, and the baseline connection corresponding to the new adjacent key points is reconstructed for iterative filtering until the spatiotemporal deviation distance of all reference trajectory points is not greater than the key point error threshold, thus obtaining the key point subset corresponding to the initial key point set.
[0118] In some examples, the anomaly detection trajectory includes: a macroscopic anomaly detection trajectory and a microscopic segmented detection trajectory. Based on each set of key point subsets, anomaly detection trajectories corresponding to each set of key point subsets are generated, including: inputting the key point subsets as a whole into a selected curve fitting algorithm for global curve fitting to generate a macroscopic anomaly detection trajectory that characterizes the global spatiotemporal trend of the key point subsets; using each key point in the key point subset as a boundary node to divide the target trajectory data into multiple temporally continuous segmented trajectory subsets; for each segmented trajectory subset, inputting all trajectory points contained within it into a curve fitting algorithm for local curve fitting to generate multiple microscopic segmented detection trajectories that characterize the local spatiotemporal fluctuations of each segmented trajectory subset.
[0119] In some examples, anomaly judgments are performed on trajectory points in the target trajectory data according to each anomaly judgment trajectory, resulting in anomaly judgment results for each trajectory point under each anomaly judgment trajectory. This includes: for each trajectory point in the target trajectory data, determining its affiliation status under each key point subset; if the trajectory point belongs to a key point in the key point subset, calculating the spatiotemporal projection distance from the trajectory point to the corresponding macroscopic anomaly judgment trajectory; if the spatiotemporal projection distance is greater than the macroscopic threshold, the trajectory point is determined to be anomaly under the current macroscopic anomaly judgment trajectory; if the trajectory point belongs to a trajectory point within a segmented trajectory subset, calculating the spatiotemporal projection distance from the trajectory point to the corresponding microscopic segmented judgment trajectory; if the spatiotemporal projection distance is greater than the microscopic threshold, the trajectory point is determined to be anomaly under the current microscopic segmented judgment trajectory.
[0120] In some examples, the key point subset is input as a whole into a selected curve fitting algorithm for global curve fitting to generate a macroscopic anomaly judgment trajectory that characterizes the global spatiotemporal trend of the key point subset. This includes: inputting the key points in the key point subset into at least two heterogeneous algorithms for independent fitting to generate multiple parallel macroscopic anomaly judgment trajectories corresponding to each key point subset.
[0121] In some examples, based on multiple anomaly judgment results corresponding to each trajectory point, normal and abnormal trajectory points in the target trajectory data are determined. This includes: for each anomaly judgment result of a trajectory point, obtaining the spatiotemporal projection distance between the trajectory point and the corresponding anomaly judgment trajectory; assigning dynamic voting weights to each anomaly judgment result based on the spatiotemporal projection distance; wherein the dynamic voting weights have an exponential decay relationship with the corresponding spatiotemporal projection distances; calculating the comprehensive anomaly score of the trajectory point based on all anomaly judgment results and the corresponding dynamic voting weights; if the comprehensive anomaly score of the trajectory point exceeds a preset classification judgment threshold, the trajectory point is determined to be an abnormal trajectory point; otherwise, the trajectory point is determined to be a normal trajectory point.
[0122] In some examples, coordinate compensation is performed on abnormal trajectory points based on the target fitted trajectory, including: for each abnormal trajectory point, obtaining the target timestamp corresponding to the abnormal trajectory point; matching and obtaining the corresponding time-series mapping point on the target fitted trajectory based on the target timestamp corresponding to the abnormal trajectory point; and using the spatial coordinates corresponding to the time-series mapping point as the compensation coordinates of the abnormal trajectory point to correct the abnormal trajectory point to the target fitted trajectory.
[0123] According to the solution provided in the embodiments of this application, the device obtains target trajectory data by acquiring original spatiotemporal trajectory data, performing relative metric coordinate transformation on the original spatiotemporal trajectory data, and then performing multiple key point screenings at different scales on the target trajectory data to obtain multiple sets of different key point subsets. Based on each set of key point subsets, anomaly judgment trajectories corresponding to each set of key point subsets are generated, and anomaly judgments are performed on the trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory. Based on the multiple anomaly judgment results of each trajectory point, normal trajectory points and abnormal trajectory points in the target trajectory data are determined, a target fitting trajectory is generated based on the normal trajectory points, and coordinate compensation is performed on the abnormal trajectory points based on the target fitting trajectory. This method acquires raw spatiotemporal trajectory data and performs relative metric coordinate transformation. It then performs multiple keypoint filtering at different scales to obtain multiple keypoint subsets. Based on these subsets, it generates parallel anomaly detection trajectories and performs multiple cross-validations. Finally, based on the multi-dimensional judgment results, it accurately isolates anomalies and generates a target fitting trajectory solely based on pure, normal trajectory points to compensate for the coordinates of the anomaly points. This application, by introducing a decoupled closed-loop mechanism of multi-scale cross-validation and "purification before reconstruction," not only fundamentally eliminates the heavy reliance on externally labeled data and greatly improves the system's robustness in adaptively recognizing complex and extreme noise, but also prevents outlier noise from contaminating the fitting benchmark. Ultimately, it achieves extremely robust output of high-precision, high-fidelity, and continuous fitting trajectories even under harsh data conditions, avoiding the problems in existing technologies where the extensibility of discrimination rules is limited, high-quality training data is difficult to obtain, and interpolation errors are large, leading to the inability to accurately generate fitting trajectories.
[0124] Figure 3 This is a schematic diagram of the electronic device 3 provided in an embodiment of this application. Figure 3 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, it implements the steps in the various method embodiments described above. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the various fitting trajectory generation device embodiments described above.
[0125] Electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 3 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or different components.
[0126] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0127] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. The memory 302 can also include both internal and external storage units of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the fitting trajectory generation device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0129] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium may include: any entity or fitting trajectory generation device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to regional requirements and patent practice requirements. For example, in some regions, according to regional requirements and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0130] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating a fitted trajectory, characterized in that, The method includes: Obtain the original spatiotemporal trajectory data, and perform relative metric coordinate transformation on the original spatiotemporal trajectory data to obtain the target trajectory data; The target trajectory data is subjected to multiple key point filtering at different scales to obtain multiple different subsets of key points. Based on each set of key points subset, an anomaly judgment trajectory corresponding to each set of key points subset is generated, and anomaly judgment is performed on the trajectory points in the target trajectory data according to each anomaly judgment trajectory to obtain the anomaly judgment result corresponding to each trajectory point under each anomaly judgment trajectory. Based on multiple anomaly judgment results for each trajectory point, normal trajectory points and abnormal trajectory points in the target trajectory data are determined. A target fitting trajectory is generated based on the normal trajectory points, and coordinate compensation is performed on the abnormal trajectory points based on the target fitting trajectory.
2. The method according to claim 1, characterized in that, The target trajectory data is subjected to multiple key point filtering at different scales to obtain multiple different subsets of key points, including: Randomly select trajectory points from the target trajectory data to generate multiple initial key point sets, and configure a key point error threshold corresponding to each initial key point set. Each initial key point set contains initial key points with time information. Two initial key points that are sequentially adjacent in time within the initial key point set are taken as a group of adjacent key points. A baseline connection is constructed based on each group of adjacent key points, and the trajectory points located in the time period between each group of adjacent key points are determined from the target trajectory data as reference trajectory points for each group of adjacent key points. Calculate the spatiotemporal deviation distance between each of the reference trajectory points and the corresponding baseline line, and determine the target reference trajectory point corresponding to each group of adjacent key points based on each of the spatiotemporal deviation distances; If the spatiotemporal deviation distance corresponding to the target reference trajectory point is greater than the corresponding key point error threshold, then the target reference trajectory point is determined as a new key point; Based on the new key points, the original adjacent key points are divided into new adjacent key point combinations, and the reference connection lines corresponding to the new adjacent key points are reconstructed and iteratively filtered until the spatiotemporal deviation distance of all reference trajectory points is not greater than the key point error threshold, thus obtaining the key point subset corresponding to the initial key point set.
3. The method according to claim 1, characterized in that, The anomaly detection trajectory includes: a macroscopic anomaly detection trajectory and a microscopic segmented detection trajectory; based on each set of key point subsets, anomaly detection trajectories corresponding to each set of key point subsets are generated, including: The subset of key points is input as a whole into the selected curve fitting algorithm for global curve fitting, generating a macroscopic anomaly judgment trajectory to characterize the global spatiotemporal trend of the subset of key points. Based on each key point in the key point subset as a boundary node, the target trajectory data is divided into multiple time-continuous segmented trajectory subsets; for each segmented trajectory subset, all trajectory points contained therein are input into the curve fitting algorithm for local curve fitting, generating multiple micro-segmented judgment trajectories to characterize the local spatiotemporal fluctuations of each segmented trajectory subset.
4. The method according to claim 3, characterized in that, Anomaly detection is performed on the trajectory points in the target trajectory data according to each of the aforementioned anomaly detection trajectories, to obtain the anomaly detection result corresponding to each trajectory point under each of the aforementioned anomaly detection trajectories, including: For each trajectory point in the target trajectory data, determine its belonging status under each of the key point subsets; If the trajectory point belongs to a key point in the key point subset, then calculate the spatiotemporal projection distance from the trajectory point to the corresponding macroscopic anomaly judgment trajectory. If the spatiotemporal projection distance is greater than the macroscopic threshold, then determine that the trajectory point is anomaly under the current macroscopic anomaly judgment trajectory. If the trajectory point belongs to the trajectory point within the segmented trajectory subset, then the spatiotemporal projection distance from the trajectory point to the corresponding micro-segmented judgment trajectory is calculated. If the spatiotemporal projection distance is greater than the micro threshold, then the trajectory point is determined to be abnormal under the current micro-segmented judgment trajectory.
5. The method according to claim 3, characterized in that, The subset of key points is input as a whole into a selected curve fitting algorithm for global curve fitting, generating a macroscopic anomaly judgment trajectory to characterize the global spatiotemporal trend of the subset of key points, including: The key points in the key point subset are input into at least two heterogeneous algorithms for independent fitting, generating multiple parallel macroscopic anomaly judgment trajectories corresponding to each key point subset.
6. The method according to claim 1, characterized in that, Based on multiple anomaly judgment results corresponding to each trajectory point, normal trajectory points and abnormal trajectory points in the target trajectory data are determined, including: For each anomaly judgment result of the trajectory point, obtain the spatiotemporal projection distance between the trajectory point and the corresponding anomaly judgment trajectory; Based on the spatiotemporal projection distance, a dynamic voting weight is assigned to each of the anomaly judgment results; wherein, the dynamic voting weight has an exponential decay relationship with the corresponding spatiotemporal projection distance; Based on all the anomaly judgment results and the corresponding dynamic voting weights, calculate the comprehensive anomaly score of the trajectory point; If the overall anomaly score of the trajectory point exceeds a preset classification threshold, the trajectory point is determined to be an abnormal trajectory point; otherwise, the trajectory point is determined to be a normal trajectory point.
7. The method according to claim 1, characterized in that, Based on the target fitted trajectory, coordinate compensation is performed on the abnormal trajectory points, including: For each of the abnormal trajectory points, obtain the target timestamp corresponding to the abnormal trajectory point; Based on the target timestamp corresponding to the abnormal trajectory point, the corresponding time-series mapping point is obtained by matching on the target fitted trajectory; The spatial coordinates corresponding to the time-series mapping points are used as the compensation coordinates of the abnormal trajectory points to correct the abnormal trajectory points to the target fitted trajectory.
8. A fitting trajectory generation device, characterized in that, The device includes: The conversion module is used to acquire the original spatiotemporal trajectory data, perform relative metric coordinate conversion on the original spatiotemporal trajectory data, and obtain the target trajectory data. The filtering module is used to filter the target trajectory data at different scales multiple times to obtain multiple different subsets of key points; The judgment module is used to generate an anomaly judgment trajectory corresponding to each set of key points based on each set of key points, and to perform anomaly judgment on the trajectory points in the target trajectory data according to each set of anomaly judgment trajectory, so as to obtain the anomaly judgment result corresponding to each trajectory point under each set of anomaly judgment trajectory. The generation module is used to determine the normal trajectory points and abnormal trajectory points in the target trajectory data based on multiple anomaly judgment results for each trajectory point, generate a target fitting trajectory based on the normal trajectory points, and perform coordinate compensation on the abnormal trajectory points based on the target fitting trajectory.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.