Vehicle trajectory clustering and tracking system and method in real-time data flow environment

By using geomagnetic sensors and microcluster clustering algorithms in intelligent transportation systems, high-precision and real-time vehicle trajectory tracking in complex environments is achieved, and the problem of reduced positioning accuracy when GPS signals are lost or disturbed is solved, and stable and reliable trajectory data is provided.

CN120164321APending Publication Date: 2025-06-17XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510204301.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision and real-time vehicle trajectory tracking in complex environments, especially when GPS signals are lost or disturbed, the positioning accuracy is reduced and external interference is greatly affected.

Method used

Geomagnetic sensors combined with microcluster clustering algorithms are used to collect vehicle magnetic field changes data in real time, and transmit them to the data processing module through wireless communication protocols. After analysis and processing, the vehicle's driving trajectory, position information, driving speed and driving state are obtained, and trajectory clustering and tracking are performed.

Benefits of technology

In areas where GPS signal coverage is insufficient, stable and accurate vehicle position data are provided, which improves the accuracy of trajectory tracking and the stability and reliability of the system, and can effectively filter external interference and ensure high-quality trajectory data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164321A_ABST
    Figure CN120164321A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle trajectory clustering and tracking system and method in a real-time data flow environment, and relates to the technical field of intelligent traffic, and the system comprises a geomagnetic sensor which is used for collecting magnetic field changes generated by vehicles passing through a road in real time to obtain magnetic field data; the data transmission module is used for sending the magnetic field data to the data processing module through a wireless communication protocol; the data processing module is used for receiving, analyzing and processing the magnetic field data and obtaining a vehicle analysis result, and the vehicle analysis result at least comprises a driving track, position information, a driving speed and a driving state of the vehicle; the alarm module is used for triggering alarm according to the vehicle analysis result. According to the invention, the data processing efficiency and precision of the intelligent traffic system are improved, and powerful technical support is provided for traffic management and smart city construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent transportation, and particularly relates to a vehicle trajectory clustering and tracking system and method in a real-time data stream environment. Background Art

[0002] With the development of intelligent transportation systems, accurately monitoring and tracking vehicle trajectories has become an important part of improving traffic efficiency and ensuring road safety. Existing vehicle trajectory tracking technologies mainly rely on means such as the Global Positioning System (GPS), ground radar, and video surveillance. Although these technologies have relatively high accuracy in some cases, they also have some significant limitations, especially in specific application environments.

[0003] Limitations of GPS technology: The Global Positioning System (GPS), as the most common positioning technology, determines the position of a vehicle through satellite signals. However, in some special environments, such as underground parking lots, tunnels, and cities with high-rise buildings, GPS signals are prone to loss or interference, resulting in a decrease in positioning accuracy. In addition, the positioning accuracy of the GPS system is usually at the meter level, which is difficult to meet the requirements of high-precision vehicle trajectory tracking.

[0004] Challenges of ground radar and video surveillance: Ground radar and video surveillance systems can be used for vehicle monitoring, but their application in large-scale areas still faces many challenges. Ground radar requires a high installation cost, and in high-traffic or complex road environments, the coverage range and resolution of radar signals are limited. Although the video surveillance system can provide real-time image data, due to its dependence on the viewing angle and lighting conditions, its accuracy and stability are easily affected by factors such as weather and light changes, especially at night or in bad weather conditions.

[0005] Advantages and disadvantages of geomagnetic sensors: As an emerging positioning technology, geomagnetic sensors have the advantages of low power consumption, low cost, and strong anti-interference ability. Geomagnetic sensors can monitor the changes in the ground magnetic field in real time and then infer the driving trajectory and position of the vehicle. Compared with GPS and video surveillance technologies, geomagnetic sensors can still provide stable position information in areas where GPS signals are difficult to cover, such as tunnels and underground parking lots. In addition, geomagnetic sensors have good responsiveness to the dynamic behavior of vehicles and can be used to monitor vehicle states such as parking, acceleration, and deceleration.

[0006] However, existing geomagnetic sensor application technologies still face some problems. First, the positioning accuracy of geomagnetic sensors is limited by the layout density of sensors and signal processing algorithms. Especially in cases where the lanes are dense or the sensor layout is uneven, it may lead to large data noise or high errors. Second, existing technologies usually rely on simple pattern recognition methods and are difficult to effectively process the trajectory recognition and classification of different vehicles in complex traffic environments.

[0007] Therefore, how to use geomagnetic sensors to achieve high-precision and real-time vehicle trajectory tracking, especially to improve the positioning accuracy and reduce the influence of external interference in complex environments, has become an urgent problem to be solved in current intelligent transportation technologies. Summary of the Invention

[0008] To solve the above problems existing in the prior art, the present invention provides a vehicle trajectory clustering and tracking system and method in a real-time data stream environment. The technical problems to be solved by the present invention are achieved through the following technical solutions:

[0009] In a first aspect, the present invention provides a vehicle trajectory clustering and tracking system in a real-time data stream environment, including:

[0010] A geomagnetic sensor for real-time collecting magnetic field changes generated by vehicles passing on the road to obtain magnetic field data;

[0011] A data transmission module for sending the magnetic field data to a data processing module through a wireless communication protocol;

[0012] A data processing module for receiving the magnetic field data and analyzing and processing it to obtain a vehicle analysis result, where the vehicle analysis result at least includes the driving trajectory, position information, driving speed, and driving state of the vehicle;

[0013] An alarm module for triggering an alarm according to the vehicle analysis result.

[0014] In an embodiment of the present invention, the data transmission module is specifically used to send the magnetic field data to the data processing module through the LoRa communication protocol.

[0015] In an embodiment of the present invention, the alarm module is specifically used to trigger an audible alarm or a visual alarm according to a preset rule when detecting abnormal behavior of the vehicle.

[0016] In a second aspect, the present invention provides a vehicle trajectory clustering and tracking method in a real-time data stream environment, which is characterized in that it is applied to the system in the first aspect and includes:

[0017] Obtaining magnetic field data, where the magnetic field data is collected by at least one geomagnetic sensor pre-deployed on both sides of the road;

[0018] Analyzing the magnetic field data to obtain a vehicle analysis result, where the vehicle analysis result at least includes the driving trajectory, position information, driving speed, and driving state of the vehicle;

[0019] Based on the vehicle analysis result, clustering the driving trajectories of the vehicles and tracking the vehicle trajectories according to the clustering.

[0020] In one embodiment of the present invention, the steps of clustering the driving trajectory of a vehicle based on the vehicle analysis result and performing vehicle trajectory tracking according to the clustering include:

[0021] Obtain the driving trajectory in the vehicle analysis result;

[0022] Using the microcluster clustering algorithm, divide the driving trajectory into multiple clusters according to similarity.

[0023] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0024] (1) The traditional GPS positioning system is limited by signal interference or loss. Especially in places such as tunnels, underground parking lots, and areas with dense high-rise buildings, the GPS signal is prone to interruption or failure, resulting in the loss or inaccuracy of vehicle trajectory data. The present invention uses a geomagnetic sensor for vehicle position tracking. By measuring the interaction between the vehicle and the geomagnetic field, the geomagnetic sensor can still provide stable and accurate position data in an environment where GPS is unavailable, significantly improving the accuracy of trajectory tracking. Therefore, the present invention is particularly suitable for areas with insufficient GPS signal coverage, such as tunnels, underground parking lots, and areas with dense high-rise buildings. Through the fusion processing of real-time data captured by the geomagnetic sensor and other sensor information, seamless trajectory tracking services can be provided in these areas, avoiding the loss of vehicle trajectories when GPS positioning fails.

[0025] (2) The existing GPS positioning system is sensitive to external interference factors such as weather, environment, and building reflections, resulting in a significant decrease in positioning accuracy. The geomagnetic sensor has strong anti-interference ability against these interferences and can effectively filter the influence brought by external environmental changes. Through the trajectory clustering and data fusion algorithm of the present invention, the stability and reliability of the system can be further improved, and high-quality trajectory data can still be provided in a complex environment.

[0026] (3) The present invention introduces a microcluster clustering algorithm to cluster vehicle trajectories, which can effectively divide the motion data of the vehicle into multiple clusters, and perform tracking and prediction according to the motion trajectories of each cluster. This algorithm not only improves the efficiency of data processing, but also enhances the adaptability of the system to real-time data streams, ensuring efficient calculation and processing under a large amount of data input.

[0027] (4) The system architecture of the present invention has strong robustness and can cope with emergencies or environmental changes to ensure continuous tracking and monitoring of vehicle trajectories. The characteristics of the geomagnetic sensor enable it to work stably in various environments. Even when the GPS signal is lost or interfered, the trajectory tracking of the geomagnetic sensor can still provide reliable data support for the system.

[0028] In summary, the present invention improves the data processing efficiency and accuracy of the intelligent transportation system, providing strong technical support for traffic management and the construction of smart cities.

[0029] The following will further elaborate on the present invention in conjunction with the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a schematic structural diagram of a vehicle trajectory clustering and tracking system in a real-time data stream environment provided by an embodiment of the present invention;

[0031] Figure 2 is a flowchart of a vehicle trajectory clustering and tracking method in a real-time data stream environment provided by an embodiment of the present invention;

[0032] Figure 3 is another flowchart of a vehicle trajectory clustering and tracking method in a real-time data stream environment provided by an embodiment of the present invention;

[0033] Figure 4 is a deployment schematic diagram of a geomagnetic sensor provided by an embodiment of the present invention;

[0034] Figure 5 is a flowchart of trajectory clustering provided by an embodiment of the present invention;

[0035] Figure 6 is a data distribution schematic diagram in the data association process provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0036] The following further describes the present invention in detail with specific embodiments, but the implementation manners of the present invention are not limited thereto.

[0037] Figure 1 is a schematic structural diagram of a vehicle trajectory clustering and tracking system in a real-time data stream environment provided by an embodiment of the present invention. As Figure 1 shown, an embodiment of the present invention provides a vehicle trajectory clustering and tracking system in a real-time data stream environment, including:

[0038] A geomagnetic sensor for real-time collection of magnetic field changes generated by vehicles passing on the road to obtain magnetic field data;

[0039] A data transmission module for sending the magnetic field data to the data processing module through a wireless communication protocol;

[0040] A data processing module for receiving the magnetic field data and analyzing and processing it to obtain a vehicle analysis result, where the vehicle analysis result at least includes the driving trajectory, position information, driving speed, and driving state of the vehicle;

[0041] An alarm module for triggering an alarm according to the vehicle analysis result.

[0042] Optionally, the data transmission module is specifically configured to send the magnetic field data to the data processing module through the LoRa communication protocol.

[0043] Optionally, the alarm module is specifically configured to trigger an audible alarm or a visual alarm according to a preset rule when an abnormal behavior of the vehicle is detected.

[0044] First, a plurality of geomagnetic sensors are deployed along the roadside lane lines. After the vehicle passes by the geomagnetic sensors, the induced magnetic field disturbance will trigger the detection of the geomagnetic sensors. Subsequently, the geomagnetic sensors transmit the vehicle magnetic field characteristic data and the corresponding timestamps of the vehicle passing by to the base station through a wireless connection. As an intermediate medium for data transmission, the base station receives the timestamp information and the vehicle magnetic field characteristic information detected by each geomagnetic sensor, saves the vehicle information such as the timestamp data of the vehicle passing by, the vehicle passing position data, and the vehicle magnetic field characteristics sent by each geomagnetic sensor, and sends the sensor detection data to the cloud platform.

[0045] The base station sends real-time data to the cloud platform, and the cloud platform processes the received geomagnetic sensor data. The processing method of the cloud platform for the geomagnetic sensor data is as follows:

[0046] First, since the vehicle data received by the platform is real-time data, considering the problem of network fluctuations, the measurement data may not be uploaded strictly according to the measurement time, that is, the measurement data generated by one geomagnetic sensor may arrive later than the data generated by another geomagnetic sensor due to network latency. Therefore, the system records a current maximum time as the latest update time t update . When the measurement time t of the arrived data new is less than this time, the data between the two is rolled back. When the vehicle is rolled back, there may be more than one measurement data. The association process is that the measurement data of the same geomagnetic sensor should compete for all vehicles at the same time. The measurement data of different geomagnetic sensors are associated in chronological order. The logic of data association is mainly to determine which cluster the data point belongs to by calculating the distance and direction similarity between the new data point and the existing cluster center, and calculate its association possibility. The association possibility is used as the allocation benefit to generate an allocation matrix, and finally the final allocation result is generated through the Hungarian algorithm, and the sensor measurement values are allocated to the corresponding vehicle trajectories.

[0047] Figures 2-3 is a flowchart of the vehicle trajectory clustering and tracking method in a real-time data stream environment provided by an embodiment of the present invention. As Figures 2-3 shown, an embodiment of the present invention also provides a vehicle trajectory clustering and tracking method in a real-time data stream environment, which is applied to the above system and includes:

[0048] S1. Obtain magnetic field data, which is collected by at least one geomagnetic sensor pre-deployed on both sides of the road;

[0049] S2. Analyze the magnetic field data to obtain vehicle analysis results, which at least include the driving trajectory, position information, driving speed, and driving state of the vehicle;

[0050] S3. Based on the vehicle analysis results, cluster the driving trajectories of the vehicle and perform vehicle trajectory tracking according to the clustering.

[0051] In step S3, the step of clustering the driving trajectories of the vehicle based on the vehicle analysis results and performing vehicle trajectory tracking according to the clustering includes:

[0052] Obtain the driving trajectory in the vehicle analysis results;

[0053] Use the micro-cluster clustering algorithm to divide the driving trajectory into multiple clusters according to similarity.

[0054] In the above vehicle trajectory clustering and tracking method in a real-time data stream environment, first deploy geomagnetic sensors along the roadside lane lines and deploy other communication devices.

[0055] Figure 4 It is a deployment schematic diagram of the geomagnetic sensor provided by an embodiment of the present invention. Specifically, in a two-lane scenario, the geomagnetic sensors are deployed along the lane lines, as Figure 4 shown. Generally speaking, there are three lane lines in a one-way two-lane road, and the geomagnetic sensors are deployed along the outer lane lines of the lanes. The leftmost geomagnetic sensor is deployed on the leftmost lane line, the rightmost geomagnetic sensor is deployed on the rightmost lane line, and no geomagnetic sensor is deployed on the middle lane line. For a lane coordinate system, define the first geomagnetic sensor on the leftmost lane line along the vehicle driving direction as the coordinate origin, its x-axis coincides with the leftmost lane line in the driving direction, and the y-axis points to the rightmost lane direction. Note that due to the bending and undulation of the lane lines, the x-axis is a curve in three-dimensional space. In the whole scenario, considering that the vehicle drives close to the ground, the position change of the vehicle on the z-axis is not considered. Number the geomagnetic sensors sequentially along the vehicle driving direction. Mark the leftmost lane line along the vehicle driving direction as lane line 0. Then, the j-th geomagnetic sensor on the i-th lane line is marked as geomagnetic sensor b i,j , and its position in the lane coordinate system is marked as (x j , y i ). Define the geomagnetic sensors with the same x j coordinate as the same group, and the subscript starts from 0. For example, b 0,0

[0056] and b 2,0 are the same group of geomagnetic sensors, and reasonably plan the deployment spacing of the sensors.

[0057] Next, the geomagnetic detection algorithm is used to detect the vehicle-reported data and transmit it to the data center.

[0058] Step 1a: Geomagnetic sensors A1, A2, …, An respectively collect the magnetic field data at their locations. By processing the magnetic field data, the discrete magnetic field perturbation data caused by the passing of vehicles at the sensor deployment points is obtained. The vehicle detection algorithm is used to detect whether a vehicle enters and leaves the detection range of the geomagnetic sensors. Here, an important parameter, the change amount of the magnetic field intensity at adjacent moments, is used. Let F i (k) represent the magnetic field intensity value on the coordinate axis i at the kth moment, and the change amount of the magnetic field intensity at adjacent moments is D i (k) = F i (k) - F i (k - 1). From the calculation method of the first-order difference signal, an important property of this signal can be obtained: when no vehicle passes by, the original magnetic field is stable, and the change amount of the magnetic field intensity at adjacent moments is small, that is, the absolute value of D i (k) is small, and the overall first-order difference signal will be stable near the value of 0; when a vehicle passes by, the magnetic field intensity changes violently, D i (k) is large, and the overall first-order difference signal shows large fluctuations. In other words, when a vehicle passes by, the amplitude of the first-order difference signal should be large, and when no vehicle passes by, in the absence of other interferences, the three-axis magnetic field is horizontally stable, and the signal will return to near the value of 0.

[0059] Step 2a: The geomagnetic sensors transmit the vehicle magnetic field characteristic data of the passing vehicles and the corresponding timestamps to the base station through wireless connection. The base station, as an intermediate medium for data transmission, receives the timestamp information and vehicle magnetic field characteristic information detected by each geomagnetic sensor, and saves the vehicle information such as the timestamp data of the passing vehicles and the vehicle magnetic field characteristics sent by each geomagnetic sensor;

[0060] Step 3a: The base station parses the time data uploaded by the geomagnetic sensors during vehicle detection, tags the timestamp data and vehicle magnetic field characteristics uploaded by the geomagnetic sensors with geomagnetic sensor information labels (including information such as sensor deployment location and number), and transmits the data to the data center;

[0061] Furthermore, the data uploaded to the data center is processed, and operations such as data association are performed on the new data.

[0062] Step 1b: After the data reaches the data center, it needs to be preprocessed first. There is no fixed pattern for data preprocessing, and it should be carried out according to the actual road conditions.

[0063] Since geomagnetic data can be interfered by adjacent lane vehicles, oncoming vehicles and clutter, data preprocessing should try to eliminate abnormal data. The preprocessing method is to retain the geomagnetic sensor upload data M within a period of time, and when the new data m new arrives, judge whether there are the following abnormal situations: 1. Uploading duplicate data: directly discard the current data; 2. Data arriving too late: set a network fluctuation time t fluctuation , when the new data m new arrives, compare its detection time t new with the latest update time t update , if t update -t new >t fluctuation s, since the real-time performance of the system needs to be ensured, directly discard the current data. 3. Rollback data: when the measurement time of the new data m new is less than the current system detection time t update , roll back all the data with detection time in the interval [t new ,t update , and add it to the associated data list L data .

[0064] Step 2b, sort the data in the associated data list according to the driving direction, and sequentially associate the data at each geomagnetic sensor with the existing vehicle trajectory clusters. data Figure

[0065] Figure 5 is the flow chart of trajectory clustering provided by the embodiment of the present invention. Please refer to Figure 5 , define the data of the j-th sensor in the associated data list L data as L j , and the i-th cluster in the system is defined as the following measurement data sequence: where represents k data of the i-th cluster, calculate the distance and direction similarity between the new data point L j and the existing cluster center; since the influence of each eigenvalue of the data on the association result is different, it is necessary to dynamically adjust the weights of each eigenvalue.

[0066] Step 2b.1, normalize the time and position data using the maximum-minimum normalization method. When the vehicle is driving in the lane, the detection probability of the geomagnetic sensor should be the same, and the geomagnetic sensors are deployed at equal intervals. For data such as time that always increases upward, incremental normalization is used, that is, as each batch of data arrives, the normalization parameters are gradually updated, rather than waiting for all the data to arrive before processing.

[0067] First, initialize the required parameters (such as minimum value, maximum value, mean, standard deviation, etc.) based on historical data, and store these parameters for each feature dimension. Second, for each new data point, first preprocess it, and then update the maximum and minimum values according to the current data point. Finally, pass the normalized data to the subsequent processing module or model, and use the incremental maximum-minimum normalization method for online data.

[0068] For each batch of data, process a batch of new data points each time.

[0069] x min,new = min(x min , x i )

[0070] x max,new = min(x max , x i )

[0071] For the new data point x i :

[0072]

[0073] Among them, x min,new is the updated minimum value of the feature dimension, and x max,new is the updated maximum value of the feature dimension. is the normalized data, and x i is the original data;

[0074] Step 2b.2, Association score calculation. The association score is related to the directionality of the cluster and the distance between the data and the cluster.

[0075] Calculate the weighted distance between the new data point L j and the cluster center point C i of the cluster v i :

[0076]

[0077] Among them, w k is the weight of the k-th feature, reflecting the influence of this feature on the association result. Set a distance threshold rad. If then it is determined that the data point L j and the cluster v i cannot be associated, and skip this cluster.

[0078] Calculate the direction similarity between the new data point L j and the cluster v i :

[0079]

[0080] Among them, is the direction vector of cluster v i , is the direction vector from the data point L j to the cluster center point C i of cluster v i . Set a direction similarity threshold T dir . If , it is determined that the data point L j has no possible association with cluster v i , and this cluster is skipped.

[0081] Calculation of the association score between the new data point L j and cluster v i (combining distance and directionality):

[0082]

[0083] Among them, S score (L j , v i ) represents the association score between the new data point L j and cluster v i . α is the attenuation coefficient used to control the influence weight of distance on the association score. represents the weighted distance between the data point L j and the cluster center point C i of cluster v i . represents the direction similarity between the data point l j and cluster v i .

[0084] Step 2b.3, data assignment.

[0085] Figure 6 is the schematic diagram of data assignment in the data association process provided by the embodiment of the present invention. Please refer to Figure 6 . After all associations between data points and clusters are completed, there may be an overlap in the association scores between multiple new data points and multiple clusters. To ensure the rationality of the assignment and global optimization, the system adopts an optimization assignment method based on the Hungarian algorithm. The specific steps are as follows:

[0086] 1. Construct an association score matrix:

[0087] According to the association score formula, construct an association score matrix S. The rows of the matrix represent the data points l j , and the columns represent the existing clusters v i . The element S[i, j] in the matrix represents the association score between the data point L j and the existing cluster v i .

[0088] 2. Convert to the minimum-cost problem

[0089] Since the Hungarian algorithm aims to solve the task assignment problem with the minimum cost, to adapt to the algorithm, the score matrix S is converted into the cost matrix C. The specific conversion method is as follows:

[0090] C[i, j] = 1 - S[i, j]

[0091] where the smaller C[i, j] is, the more suitable the data point L j is for assignment to the cluster v i .

[0092] 3. Use the Hungarian algorithm for assignment

[0093] Input the cost matrix C into the Hungarian algorithm. The Hungarian algorithm adjusts the edge weights by modifying the cost matrix, searches for a feasible matching path, and will find a globally optimal task assignment scheme, making the overall cost of the new data point L j and the cluster v i minimized, while each data point is assigned to only one cluster and each cluster also receives only one data point.

[0094] Step 3b, cluster update. Cluster update requires updating information such as the position, time, and magnetic field of the cluster, and also requires updating the direction and center of the cluster; information such as the position, time, and magnetic field of the cluster is obtained through the Kalman filter; the update of the cluster direction is to update the cluster direction using the α-β filter.

[0095] Cluster direction update formula:

[0096]

[0097] where d new is a unit vector calculated based on the direction from the cluster center to the position of the new sample, which reflects the movement direction of the current sample.

[0098] Cluster center update formula:

[0099] C updated = (1 - η)·C i + η·(x i - C i )

[0100] where x i - C i represents the offset between the new sample and the current cluster center, η is the weight controlling the speed at which the cluster center moves towards the new sample.

[0101] Furthermore, the gradient descent method updates the weight information. When using the gradient descent method to update the weights of information such as position and time, it is necessary to construct an objective function to represent the quality of the current cluster. The objective function is a loss function that needs to be minimized.

[0102] 1. Construction of the objective function: The vehicle trajectory itself is a curve. It is not appropriate to use the mean squared error, distance between points, etc. to evaluate or calculate the loss function because these metrics are difficult to effectively describe the differences and clustering effects of straight trajectories. In view of this situation, the loss function can be designed from the perspectives of the directionality, consistency, and dynamic changes of the trajectory.

[0103] Directional consistency: For trajectory v i , the direction vector formed by every two consecutive points is represented as:

[0104] d i = x i+1 - x i

[0105] For each trajectory, calculate the cosine similarity of all direction vectors

[0106]

[0107] Take the mean of the directional consistency within each cluster and use it as part of the loss function:

[0108]

[0109] Overlap degree of trajectory shapes: For straight trajectories, the degree of shape overlap of the trajectories in space can be considered. If the trajectories within the cluster overlap with each other to a high degree, the clustering effect is better. When fitting a straight line, a point x in the set of trajectory points is represented as an n-dimensional vector (x1, x2, x3, ··· x n ), and fit a weighted straight line / hyperplane:

[0110] (a1, a2, a3, ··· a n )(x1, x2, x3, ··· x n ) T + c = 0

[0111] The goal is to find the coefficients (a1, a2, a3, ··· a n ) such that the sum of the squared residuals of the weighted points to the straight line is minimized. The loss function defines the residual as the weighted distance from the trajectory point to the hyperplane:

[0112] r i = w(a1, a2, a3, ··· a n )(x1, x2, x3, ··· x n ) T + c

[0113] The loss function is the weighted sum of the squared residuals of all points

[0114]

[0115] Converted into matrix form, define matrix X as the trajectory point data, weight matrix W as a diagonal matrix, and coefficient vector as A:

[0116] L shape (ω) = ‖WXA‖ 2

[0117] Solve the least squares problem directly through matrix operations.

[0118] Composite loss function:

[0119] L(ω) = α·L dir (ω) + β·L shape (ω)

[0120] 2. Perform gradient descent on the loss function L(ω) to update the weights.

[0121]

[0122] 3. Cutoff condition

[0123] When the change in the objective function value in each iteration is less than the predetermined threshold δ, it can be considered that the algorithm has converged and can be stopped.

[0124] |L(ω k+1 ) - L(ω k )| < δ

[0125] where ω k represents the parameter of the k-th iteration, and L(ω) is the objective function.

[0126] Finally, the data center outputs the vehicle trajectory information.

[0127] The data center generates the original vehicle trajectory set through calculation, sets the life cycle to process the possible clutter data, and ensures the final output of credible vehicle trajectory information. This information will be transmitted in real time to the traffic management platform or other data centers that have established a communication relationship with the data center for subsequent traffic monitoring and management.

[0128] As can be seen from the above embodiments, the beneficial effects of the present invention are as follows:

[0129] (1) Traditional GPS positioning systems are limited by signal interference or loss. Especially in places such as tunnels, underground parking lots, and areas with dense high-rise buildings, GPS signals are prone to interruption or failure, resulting in the absence or inaccuracy of vehicle trajectory data. The present invention utilizes a geomagnetic sensor for vehicle position tracking. By measuring the interaction between the vehicle and the geomagnetic field, the geomagnetic sensor can still provide stable and accurate position data in an environment where GPS is unavailable, significantly improving the accuracy of trajectory tracking. Therefore, the present invention is particularly suitable for areas with insufficient GPS signal coverage, such as tunnels, underground parking lots, and high-rise building dense areas. Through the fusion processing of real-time data captured by the geomagnetic sensor and other sensor information, seamless trajectory tracking services can be provided in these areas, avoiding the loss of vehicle trajectories when GPS positioning fails.

[0130] (2) Existing GPS positioning systems are sensitive to external interference factors such as weather, environment, and building reflections, resulting in a significant decrease in positioning accuracy. The geomagnetic sensor has strong anti-interference ability against these interferences and can effectively filter the influence brought by external environmental changes. Through the trajectory clustering and data fusion algorithm of the present invention, the stability and reliability of the system can be further improved, and high-quality trajectory data can still be provided in a complex environment.

[0131] (3) The present invention introduces a micro-cluster clustering algorithm to cluster vehicle trajectories, which can effectively divide the motion data of vehicles into multiple clusters and track and predict according to the motion trajectories of each cluster. This algorithm not only improves the efficiency of data processing but also enhances the adaptability of the system to real-time data streams, ensuring efficient calculation and processing under a large amount of data input.

[0132] (4) The system architecture of the present invention has strong robustness and can cope with emergencies or environmental changes to ensure continuous tracking and monitoring of vehicle trajectories. The characteristics of the geomagnetic sensor enable it to work stably in various environments. Even when the GPS signal is lost or interfered, the trajectory tracking of the geomagnetic sensor can still provide reliable data support for the system.

[0133] In the description of the present invention, the description referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification.

[0134] The above content is a further detailed description of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is only limited to these descriptions. For those of ordinary skill in the technical field to which the present invention pertains, without departing from the concept of the present invention, several simple deductions or substitutions can still be made, and all should be regarded as belonging to the protection scope of the present invention.

Claims

1. A vehicle trajectory clustering and tracking system in a real-time data stream environment, characterized in that: include: Geomagnetic sensors are used to collect real-time changes in the magnetic field generated by vehicles passing on the road and obtain magnetic field data; A data transmission module, used for sending the magnetic field data to a data processing module via a wireless communication protocol; A data processing module, used to receive and analyze the magnetic field data to obtain a vehicle analysis result, wherein the vehicle analysis result includes at least a vehicle's driving trajectory, location information, driving speed, and driving status; An alarm module is used to trigger an alarm according to the vehicle analysis result.

2. The vehicle trajectory clustering and tracking system in a real-time data stream environment according to claim 1, characterized in that: The data transmission module is specifically used to send the magnetic field data to the data processing module through the LoRa communication protocol.

3. The vehicle trajectory clustering and tracking system in a real-time data stream environment according to claim 1, characterized in that: The alarm module is specifically used to trigger an audible alarm or a visual alarm according to preset rules when abnormal behavior of the vehicle is detected.

4. A vehicle trajectory clustering and tracking method in a real-time data stream environment, characterized in that: The system applied to any one of claims 1 to 3 comprises: Acquiring magnetic field data, where the magnetic field data is collected by at least one geomagnetic sensor pre-deployed on both sides of the road; Analyzing the magnetic field data to obtain a vehicle analysis result, wherein the vehicle analysis result at least includes a driving track, location information, driving speed, and driving status of the vehicle; Based on the vehicle analysis results, the driving trajectories of the vehicles are clustered, and the vehicle trajectories are tracked according to the clustering.

5. The vehicle trajectory clustering and tracking method in a real-time data stream environment according to claim 4 is characterized in that: The step of clustering the driving trajectories of the vehicles based on the vehicle analysis results and tracking the vehicle trajectories according to the clustering includes: Obtaining a driving trajectory from the vehicle analysis result; The driving trajectories are divided into multiple clusters according to similarity using a micro-cluster clustering algorithm.