Truck transportation risk behavior real-time monitoring method based on GPS and double-flow deep learning

Through a lightweight architecture based on GPS and dual-stream deep learning, combined with Kalman filtering and CNN-Transformer network, abnormal behaviors in truck transportation are identified, and problems of low monitoring coverage, high cost and low efficiency in the existing technology are solved, and real-time risk warning is achieved with low cost and high efficiency.

CN120562864APending Publication Date: 2025-08-29BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510662731.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The existing truck transportation monitoring technology has problems such as low coverage, low efficiency, high cost and inability to warn in real time, especially the difficulty in monitoring cargo safety risks is difficult to achieve efficient and low-cost real-time risk warning and pre-intervention.

Method used

Using a lightweight architecture based on GPS and dual-stream deep learning, trajectory denoising is performed through Kalman filtering, combined with the CNN-Transformer network to extract trajectory features, and using machine learning clustering algorithm to identify abnormal behaviors to achieve low-cost and high-efficiency risk monitoring.

Benefits of technology

It realizes low-cost and real-time truck transportation risk monitoring, reduces hardware costs, improves monitoring accuracy and early warning capabilities, reduces false alarm rates, and supports rapid large-scale deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120562864A_ABST
    Figure CN120562864A_ABST
Patent Text Reader

Abstract

The invention discloses a truck transportation risk behavior real-time monitoring method based on GPS and double-flow deep learning, and the method comprises the steps: firstly carrying out the real-time track denoising of a preprocessing layer based on a Kalman filtering method, eliminating track noise points caused by non-reselling and non-stealing behaviors, and carrying out the real-time monitoring of the real-time monitoring of the truck transportation risk behavior based on GPS and double-flow deep learning; meanwhile, abnormal staying points and bypassing path behavior characteristics are reserved; then extracting a local abnormal region from the time sequence through a deep learning convolutional neural network, carrying out risk monitoring, capturing and extracting a high-frequency abnormal mode in a local trajectory fragment by using 1D-CNN through a CNN-Transform double-flow network architecture, and modeling a long-period behavior rule of a vehicle in combination with a self-attention mechanism of Transform; and finally, identifying the track segment of the high-risk reselling and stealing risk behavior through a clustering algorithm of machine learning. Through the design of lightweight data and a lightweight algorithm, low-cost and high-efficiency abnormal behavior detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Based on machine learning and deep learning technologies, the present invention proposes a method for monitoring truck drivers' risk behaviors of reselling and stealing goods based on real-time GPS trajectory data. The present invention belongs to the field of transportation, and specifically relates to technical fields such as machine learning and deep learning. Background Art

[0002] With the rapid development of the logistics industry, the scale of truck transportation has continued to expand, but the resulting cargo safety risks have also become increasingly prominent. For example, drivers resell or steal goods by taking detours, deviating from the scheduled route, making abnormal stops, etc., which seriously threatens the interests of cargo owners and industry trust. Research on "technology for monitoring the resale and theft risk behaviors of truck drivers based on GPS real-time trajectory data" is of great practical significance and urgency.

[0003] Existing monitoring infrastructure can be categorized into two types: manual spot checks and post-event tracing. Manual spot checks rely on limited human resources for random checks, resulting in low coverage, inefficiency, and subjectivity. They cannot cover the vast number of transport vehicles in real time, and abnormal behavior can easily be missed due to blind spots in spot checks. While post-event tracing can analyze abnormal events by replaying historical trajectories, it suffers from significant lags and can only passively assess accountability after cargo losses occur, failing to provide risk warnings or proactive intervention. In recent years, the rapid development of deep learning has yielded new advances in monitoring this behavior. These methods combine multi-source data, such as GPS trajectories, camera images, and ultrasonic sensors, using deep learning models to extract features and perform correlation analysis. However, these methods rely on multi-sensor data, which carries high costs for sensor installation, calibration, and maintenance, and involve sensitive data such as driver facial recognition and cockpit monitoring.

[0004] Through the dual streamlined design of "lightweight data + lightweight algorithm", this invention significantly reduces the enterprise deployment threshold and operating costs while ensuring monitoring accuracy. It is particularly suitable for the logistics industry, which is cost-sensitive and requires rapid large-scale implementation, and provides a cost-effective universal solution for cargo safety risk prevention and control. Summary of the Invention

[0005] Aiming at the need for risk behavior monitoring based on GPS real-time trajectory data in truck transportation scenarios, this paper proposes a dual-stream network architecture that integrates Kalman filtering and deep learning. Through the "lightweight data + lightweight algorithm" design, low-cost and high-efficiency abnormal behavior detection is achieved.

[0006] The technical solution adopted in the present invention is a real-time monitoring method for truck transportation risk behaviors based on GPS and dual-stream deep learning. First, real-time trajectory denoising is performed in the preprocessing layer based on methods such as Kalman filtering to eliminate trajectory noise points caused by non-scalping and theft behaviors, while retaining the behavioral characteristics of abnormal stop points and detour paths; then, local abnormal areas are extracted from the time series through the deep learning convolutional neural network to monitor risks, and through the CNN-Transformer dual-stream network architecture, 1D-CNN is used to capture high-frequency abnormal patterns in local trajectory segments, and the long-term behavior laws of vehicles are modeled in combination with the self-attention mechanism of Transformer; finally, the trajectory segments of high-risk resale and theft risk behaviors are identified through the machine learning clustering algorithm.

[0007] The risk behavior monitoring of truck drivers is modeled as a spatiotemporal trajectory anomaly detection problem. The goal is to identify three typical risk patterns in real time using single-source GPS trajectory data:

[0008] Risk mode 1: Abnormal stay: the stay time exceeds the threshold (e.g. >30 minutes) and deviates from the preset loading and unloading points;

[0009] Risk mode 2: Detour path deviation: The Hausdorff distance between the actual path and the planned path exceeds the limit;

[0010] Risk Mode 3: Periodicity disruption: Abnormal fluctuations in the driving cycle of a fixed route;

[0011] The specific implementation steps are as follows:

[0012] In the preprocessing layer, trajectory denoising and feature enhancement are performed based on the improved Kalman filter; in the deep feature extraction layer, a CNN-Transformer dual-stream network architecture is constructed; in the risk decision layer, trajectory segments with high-risk reselling and theft risk behaviors are identified through the fusion of spatiotemporal clustering and anomaly scoring.

[0013] Step 1, preprocessing layer: trajectory denoising and feature enhancement of improved Kalman filter;

[0014] The preprocessing layer uses an improved Kalman filter algorithm to remove noise interference from the original trajectory data while retaining the key behavioral features in the effective signal.

[0015] The "position-velocity-heading angle" state transition model is constructed based on the vehicle kinematic equations. The observation noise covariance matrix is ​​dynamically adjusted according to the differentiated parameters of urban and highway scenarios, and instantaneous accelerations > 5m / s are filtered. 2Sensor hardware noise at abnormal points. Setting a dwell time threshold of >30 minutes and incorporating geofencing distinguishes legitimate loading and unloading points from abnormal dwell events, ensuring that critical risk signals are not accidentally deleted. Trajectory breakpoints are repaired through linear interpolation, motion features are extracted, and trajectory data and a collection of abnormal dwell points are output, laying a reliable data foundation for subsequent analysis.

[0016] Step 2, deep feature extraction layer: CNN-Transformer two-stream network architecture;

[0017] The deep feature extraction layer, based on the principle of local-global feature coupling, uses a two-stream parallel network to achieve complementary mining of spatiotemporal anomaly patterns. The 1D-CNN captures features in the time series dimension of trajectory data and identifies short-term, high-frequency anomaly patterns by sliding the convolution kernel along the time axis.

[0018] An expanded convolutional network is designed for speed sequences, and the trajectory coordinate sequence is analyzed through a multi-head self-attention mechanism to model the long-term behavior patterns of vehicles. Based on the characteristics of CNN focusing on detailed anomalies and Transformer focusing on macroscopic regularities, the dual-stream output features are dynamically weighted to generate a 128-dimensional feature vector that integrates spatiotemporal semantics, providing multi-dimensional information support for risk decision-making.

[0019] Step 3, risk decision layer: fusion of spatiotemporal clustering and anomaly scoring;

[0020] The risk decision layer defines spatiotemporal distance metrics: spatial Haversine distance accounts for 70% and time interval accounts for 30%. The core distance threshold is adaptively adjusted based on historical trajectory density to identify hidden anomalies such as multiple small-scale detours over short periods of time. The risk score Risk_score is generated by combining the local anomaly probability of 1D-CNN with the global deviation of the clustering results, and early warnings are triggered in a graded manner. Through the progressive architecture of "data cleaning-feature mining-joint decision-making", while ensuring real-time performance, it supports pure GPS lightweight deployment, providing a cost-effective solution for logistics risk prevention and control.

[0021] Compared with the prior art, the present invention has the following obvious advantages and beneficial effects:

[0022] (1) Data and hardware costs are significantly reduced

[0023] Existing technologies require the installation of multiple sensors, such as cameras for driver behavior recognition and ultrasonic sensors for container status detection. This results in high hardware costs and the need for regular calibration and data synchronization of these multiple sensors, increasing operational complexity. However, our new approach relies solely on GPS trajectory data, eliminating the need for multi-source data collection, such as cameras, ultrasonic sensors, and cockpit monitoring equipment. This significantly reduces hardware deployment costs. Furthermore, we enhance GPS data quality through an improved Kalman filter algorithm to address the limitations of single-source data. We also utilize a CNN-Transformer dual-stream network to extract multidimensional features from trajectory data, reducing reliance on auxiliary sensors.

[0024] (2) Breakthrough in real-time monitoring and early warning capabilities

[0025] Most existing methods are offline analysis, with risk event discovery delayed by more than 6 hours, and manual spot checks rely on random sampling, with a coverage rate of less than 20%, and are unable to intercept high-risk behaviors in real time. The present invention supports real-time processing of 1Hz high-frequency GPS data streams, with an end-to-end delay of <800ms; the sliding window uses a window size of 5 minutes and a step length of 1 minute to achieve continuous monitoring and avoid the lag of batch processing. The present invention also adopts graded warnings and real-time feedback. For high risk (score ≥ 0.85), the vehicle electronic lock is automatically triggered to freeze, and the response time is less than 1 second; for medium risk (0.7 ≤ score < 0.85), the warning is pushed to the dispatch center in real time via SMS / App; for low risk (score < 0.7), the log is recorded for subsequent analysis.

[0026] (3) Optimization of detection accuracy and false alarm rate

[0027] Existing methods rely on a single criterion, are susceptible to noise, and use static threshold settings that are unsuitable for complex scenarios. This paper, however, employs a dual-stream CNN-Transformer network architecture. The 1D-CNN stream uses dilated convolutions (dilation = 2, 4, 6) to capture high-frequency anomalies such as sudden acceleration and sudden stops, achieving an F1-score of 0.91 for local anomaly detection (compared to 0.68 for traditional sliding window methods). The Transformer stream utilizes a self-attention mechanism to model vehicle cyclical path preferences, reducing the MAE for long-term regularity prediction by 28%.

[0028] (4) Lightweight deployment and high scalability

[0029] Multi-sensor solutions require complex data fusion and synchronization logic, resulting in poor scalability. Traditional monolithic architectures like LSTM models struggle to support high-concurrency scenarios, increasing server costs exponentially. However, the proposed single-node server supports concurrent processing of 500 vehicles, with CPU utilization <65% and memory usage <8GB. Its modular algorithm design (preprocessing - feature extraction - decision making) supports horizontal scalability. Modules such as the Kalman filter, two-stream network, and OPTICS clustering are independently packaged. Adding new risk models requires only expanding the feature extraction module, eliminating the need to restructure the overall architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the overall implementation process of the method of the present invention. DETAILED DESCRIPTION

[0031] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0032] Aiming at the need for risk behavior monitoring based on GPS real-time trajectory data in truck transportation scenarios, the present invention proposes a dual-stream network architecture that integrates Kalman filtering and deep learning. Through the "lightweight data + lightweight algorithm" design, low-cost and high-efficiency abnormal behavior detection is achieved. First, in the pre-processing layer, real-time trajectory denoising is performed based on methods such as Kalman filtering to eliminate trajectory noise points caused by non-resale and theft behaviors, while retaining behavioral features such as abnormal stop points and detour paths; then, local abnormal areas are extracted from the time series through a deep learning convolutional neural network to monitor risks, and through the CNN-Transformer dual-stream network architecture, 1D-CNN is used to capture high-frequency abnormal patterns in local trajectory segments, and the long-term behavior patterns of vehicles are modeled in combination with the self-attention mechanism of Transformer; finally, a machine learning clustering algorithm is used to identify trajectory segments with high-risk resale and theft behaviors.

[0033] The risk behavior monitoring of truck drivers is modeled as a spatiotemporal trajectory anomaly detection problem. The goal is to identify three typical risk patterns in real time using single-source GPS trajectory data:

[0034] ① Abnormal stay: The stay time exceeds the threshold (such as >30 minutes) and deviates from the preset loading and unloading point

[0035] ② Detour path deviation: The Hausdorff distance between the actual path and the planned path exceeds the limit

[0036] ③ Periodic regularity disruption: Abnormal fluctuations in the driving cycle of a fixed route

[0037] In the preprocessing layer, trajectory denoising and feature enhancement are performed based on the improved Kalman filter; in the deep feature extraction layer, a CNN-Transformer dual-stream network architecture is constructed; in the risk decision layer, the trajectory segments of high-risk reselling and theft risk behaviors are identified through the fusion of spatiotemporal clustering and anomaly scoring, as shown in the attached figure. Figure 1 (1) Preprocessing layer: trajectory denoising and feature enhancement of improved Kalman filter

[0038] The preprocessing layer primarily focuses on the quality of the raw trajectory data, specifically how to effectively remove noise while preserving the key behavioral features of the valid signal. This goal is achieved using a modified Kalman filter. The Kalman filter is a recursive least squares algorithm based on a state-space model. It can estimate noisy observation data to obtain state information that is closer to the true value. This invention improves this algorithm to better suit the characteristics and processing requirements of trajectory data.

[0039] The "position-velocity-heading angle" state transition model is constructed based on the vehicle kinematic equations. The observation noise covariance matrix is ​​dynamically adjusted according to the differentiated parameters of urban and highway scenarios to accurately filter instantaneous accelerations > 5m / s. 2 Sensor hardware noise, such as abnormal points, is eliminated to reduce invalid data interference. A dwell time threshold (>30 minutes) is set and combined with geo-fencing technology to distinguish between legitimate loading and unloading points and abnormal dwell events, ensuring that key risk signals are not accidentally deleted. Trajectory breakpoints are repaired through linear interpolation, and 14-dimensional motion features such as acceleration and curvature are extracted to output high-quality trajectory data and a collection of abnormal dwell points, laying a reliable data foundation for subsequent analysis.

[0040] (2) Deep feature extraction layer: CNN-Transformer two-stream network architecture

[0041] This layer, based on the principle of local-global feature coupling, uses a two-stream parallel network to achieve complementary mining of spatiotemporal anomaly patterns. 1D-CNN effectively captures features in the time series dimension of trajectory data. By sliding the convolution kernel along the time axis, it identifies short-term, high-frequency anomaly patterns. The Transformer architecture has powerful modeling capabilities when processing long-sequence data. Its self-attention mechanism can capture the correlation between different positions in the sequence, regardless of their distance. This helps model long-term behavioral patterns in trajectory data.

[0042] Therefore, the present invention designs an expanded convolutional network (dilation = 2, 4, 6) for speed sequences to capture short-term high-frequency anomalies and address the problem of insufficient sensitivity of traditional sliding window methods to transient events. The trajectory coordinate sequence is analyzed through a multi-head self-attention mechanism to model the long-term behavior pattern of the vehicle. Based on the characteristics of CNN focusing on detailed anomalies and Transformer focusing on macroscopic laws, the dual-stream output features are dynamically weighted to generate a 128-dimensional feature vector that integrates spatiotemporal semantics, providing multi-dimensional information support for risk decision-making.

[0043] (3) Risk decision-making layer: spatiotemporal clustering and anomaly scoring fusion

[0044] This layer overcomes the limitations of a single criterion through a density-sensitive, multi-dimensional joint decision-making mechanism. It defines a spatiotemporal distance metric: spatial Haversine distance accounts for 70% and time interval accounts for 30%. The core distance threshold is adaptively adjusted based on historical trajectory density to identify hidden anomalies such as multiple small-scale detours over short periods of time. A risk score (Risk_score) is generated by combining the local anomaly probability of 1D-CNN with the global deviation of clustering results, triggering graded warnings. Through a progressive architecture of "data cleaning-feature mining-joint decision-making," this ensures real-time performance while supporting lightweight deployment of pure GPS, providing a cost-effective solution for logistics risk prevention and control.

[0045] Based on the above description, the following is a specific implementation process, but the scope of protection of this patent is not limited to this implementation process:

[0046] Step 1: Preprocessing layer;

[0047] Step 1.1: State space modeling and Kalman filter iteration;

[0048] Step 1.1.1: State vector definition;

[0049] Assume that the state vector of the vehicle at time t is: X t =[x t y t v t θ t ] T .x t ,y t is the longitude and latitude in the WGS-84 coordinate system; v t is the instantaneous speed (m / s); θ t is the heading angle relative to true north. Step 1.1.2: State transfer equation;

[0050] Based on the vehicle kinematic model, the state prediction equation is: X t|t-1 =F t X t-1 +Wt , where the state transfer matrix F t :

[0051]

[0052] The state transfer matrix is ​​derived based on the uniform motion assumption and the coupling relationship between the heading angle change rate and the velocity (lateral motion component), where Δt is the GPS sampling interval.

[0053] Filtering noise Step 1.1.3: Observation equation;

[0054] The GPS observation value is: t =Hx t +v t . Observation matrix H = I4, directly observe position, velocity, and heading angle; observe noise Urban roads have the characteristics of frequent start and stop, and low speed precision R city =diag(5 2 ,5 2 ,0.3 2 ), the highway has the characteristics of high speed and stable heading, P highway =diag(10 2 ,10 2 ,0.5 2 ).

[0055] Step 1.2: Dual-threshold noise filtering mechanism;

[0056] Step 1.2.1: First threshold - hardware noise filtering;

[0057] Eliminate abnormal points caused by GPS sensor errors or communication interference, detect acceleration mutations, and calculate instantaneous acceleration If |a t |>5m / s 2 , determined as noise points and removed.

[0058] Step 1.2.1: Second threshold—behavioral feature retention;

[0059] Retain potential abnormal stay events such as illegal unloading. Perform DBSCAN clustering on continuous trajectory points. If the stay time t of a trajectory point in a cluster is stay If the stop is longer than 30 minutes, it will be marked as an abnormal stop. If the stop is located in the preset loading and unloading area, it will be considered a legal stop; otherwise, it will be retained as an abnormal event.

[0060] Step 1.3: trajectory repair and feature enhancement;

[0061] Step 1.3.1: Fill in missing data;

[0062] For trajectory breakpoints caused by noise filtering, linear interpolation is used:

[0063] (i=1,2,…,k), where k is the number of consecutive missing points, and the limit is k<=5. If it exceeds the limit, it is considered as a trajectory interruption. Step 1.3.2: Motion feature extraction;

[0064] Extract 14-dimensional feature vectors from the repaired trajectory, including:

[0065] Instantaneous motion characteristic acceleration: Heading angle change rate: Δθ t =θ t -θ t-1 , curvature: Statistical features include speed standard deviation, acceleration extreme value, and curvature mean. Spatiotemporal context features include Haversine distance to the nearest road network node and current time period (daytime / nighttime) encoding.

[0066] Step 1.4: Output and verification;

[0067] Step 1.4.1: Output the results;

[0068] Denoising trajectory T' = {x' t |t=1,2,…,N}, abnormal stay set

[0069]

[0070] Step 2: Deep feature extraction layer;

[0071] Step 2.1: Local anomaly capture flow (1D-CNN);

[0072] Step 2.1.1: Input preprocessing;

[0073] For the velocity sequence w t = {V1, V2, ..., V n}Perform Z-score standardization:

[0074]

[0075] Step 2.1.2: dilated convolution operation;

[0076] Assume that the expansion rate is d, the convolution kernel size is K=3, and the output features of the first layer are:

[0077]

[0078] in are learnable weights, The expansion rate is set to three layers: the first layer d = 2, capturing the velocity changes within the nearest 2 seconds; the second layer d = 4, expanding to a 4-second window; the third layer d = 6, covering the 6-second long-range dependence.

[0079] Step 2.1.3: Grid structure;

[0080] The layer configuration is dilated convolution layer, output channel 64-ReLU activation-max pooling, pooling size = 2, stride = 2. Repeat the above structure 3 times to gradually expand the receptive field (total receptive field = 2+4+6 = 12 seconds). Output feature F CNN ∈R n / 8×64 , n is the length of the input sequence.

[0081] Step 2.1.4: Derivation of key formulas;

[0082] Equivalent receptive field of dilated convolution: the dilation rate of the lth layer is d l , then the total receptive field In the case of covering a 25-second window, L=3, k i =3,d i =2, 4, 6, so R=1+(2+4+6)*2=25.

[0083] Step 2.2: Global regularity modeling flow (Transformer);

[0084] Step 2.2.1: Input embedding and position encoding;

[0085] Convert WGS-84 longitude and latitude (x t ,y t ) is converted to plane coordinates to eliminate the influence of the earth's curvature.

[0086] For the coordinate sequence P = {(x1, y1), ..., (x n ,y n )} for linear embedding:

[0087] E t =w e ·[(x t ,y t )]+b e (W e ∈R 128×2 , b e ∈R 128 )

[0088] Add sinusoidal position encoding to preserve timing information:

[0089]

[0090] Final input: zt =E t +PE t

[0091] Step 2.2.2: Multi-head self-attention mechanism;

[0092] For the input sequence z∈R n×128 , generate query Q, key K, value V matrix:

[0093] Q=zw Q , K=zw k , V=zw v , where w Q , w k , w V ∈R 128×16

[0094] Single-head attention output: d k =16

[0095] The 8-head attention output is concatenated and linearly transformed:

[0096] MultiHead(Q,k,v)=Concat(head1,...head8)w0,w0∈R 128×128

[0097] Step 2.2.3: Transformer encoder layer;

[0098] Each encoder layer consists of multi-head self-attention, LayerNorm, residual connections, and two fully connected layers, with a hidden layer dimension of 512 ReLU activations. It gradually abstracts high-level semantic features.

[0099] Step 2.2.4: Output features;

[0100] Global regularity characteristics: F Trans ∈R n×64 (Dimensionality reduction via linear projection)

[0101] Step 2.3: Gated feature fusion mechanism;

[0102] Step 2.3.1: Gating weight generation;

[0103] Calculate the gating weights for the two-stream features separately:

[0104] g CNN =δ(w g ·F CNN +b g ), g Trans =1-g CNN , where w g ∈R 64×64, δ is the simoid function.

[0105] Step 2.3.2: Feature fusion;

[0106] Weighted fusion of two-stream features: F fused =g CNN ΘF CNN +g Trans ΘF Trans , Θ represents element-wise multiplication.

[0107] Output fusion feature: F Fused ∈R n×128

[0108] Step 2.4: Training and validation;

[0109] Step 2.4.1: Parameter initialization;

[0110] The CNN convolution kernel weights are initialized with He to adapt to ReLU activation. The Transformer attention matrix weights are initialized with Xavier.

[0111] Step 2.4.2: Loss function;

[0112] Multi-task joint loss: in is the binary cross entropy loss (abnormal fragment classification), is the mean square error (periodic path reconstruction).

[0113] Step 2.4.3: Experimental verification;

[0114] The test set F1-score is 0.91, the recall rate of sudden acceleration events is improved by 35%, the MAE of periodic path prediction is 0.43, and the long-period deviation detection delay is less than 5 minutes.

[0115] Step 3: Risk decision layer;

[0116] Step 3.1: Improve the OPTICS clustering algorithm;

[0117] Step 3.1.1: Spatiotemporal distance measurement;

[0118] For two trajectory points P i =(x i ,y i ,t i ) and P j =(x j ,y j ,t j ), and its space-time distance is:

[0119]

[0120] Use the Haversine formula to calculate the geographic interval:

[0121]

[0122] Where R = 6371 km is the radius of the earth, Δφ = φ j -φ i , Δλ=λ j -λ i .

[0123] Step 3.1.2: Adaptive core distance;

[0124] In the OPTICS algorithm, the core distance ∈ determines the neighborhood range. The traditional method fixes ∈, while the present invention dynamically adjusts based on historical trajectories: ∈ = μ hist +3δ hist , μ hist is the mean value of the historical trajectory point density, δ hist is the standard deviation of the historical trajectory point density, and μ is recalculated every 24 hours based on the latest trajectory data. hist and δ hist Step 3.1.2: Clustering process optimization;

[0125] For the trajectory point P i , which reaches the cluster core point P j The reachable distance is defined as:

[0126] ReachDist(P i ,P j )=max(CoreDist(P j ),D(P i ,P j )), where CoreDist(P j ) is P j core distance.

[0127] If the reachable distance of a point is always greater than ∈, it is determined to be a noise point and removed.

[0128] Step 3.2: Anomaly score fusion mechanism;

[0129] Step 3.2.1: local anomaly score (CNN_score);

[0130] The feature vector F output by 1D-CNN CNN ∈R n×64 , mapped to abnormal probability after Sigmoid activation: W C ∈R 1 ×64 is the learnable weight, b Cis the bias term, δ is the Sigmoid function, which compresses the score to the [0,1] interval.

[0131] Step 3.2.2: Global deviation score;

[0132] The Gaussian mixture model (GMM) is trained by historical trajectories to obtain the normal trajectory distribution P normal , for the trajectory segment r in the current clustering result j , calculate its distribution P cluster The larger the JSD value of Jensen-Shannon divergence, the more significant the difference between the trajectory segment and the normal pattern.

[0133] Step 3.2.3: Risk score fusion;

[0134] Cross-validation results show that local anomaly scores are highly sensitive to transient events, global deviation scores are more effective in destroying long-term regularities, and a weight of 6:4 achieves the best balance.

[0135] Step 3.3: Hierarchical early warning mechanism;

[0136] Step 3.3.1: Threshold setting;

[0137] (1) High risk:

[0138] Behavioral characteristics: abnormally long stays or serious route deviations (such as Haversine distance > 5km).

[0139] Response measures: Automatically trigger the freezing of the vehicle's electronic locks and push an alarm to the security center.

[0140] (2) Medium risk:

[0141] Behavioral characteristics: moderate route deviation or short abnormal stops.

[0142] Response measures: SMS notification to dispatcher for manual verification.

[0143] (3) Low risk:

[0144] Behavioral characteristics: slight trajectory fluctuations.

[0145] Response: Log the message and do not trigger a real-time alert.

[0146] Step 3.3.2: Dynamic weight adjustment;

[0147] For urban delivery, the weight will be increased to 0.5, and frequent detours require attention to global rules; for long-distance transportation, the weight will be increased to 0.7, and transient anomalies are more critical.

[0148] Step 3.4: Verification and effect;

[0149] The improved OPTICS has an anomaly detection rate of 92% and a false alarm rate of 4.3%. The fusion score (6:4) has a high-risk detection rate of 89%. When processing 1Hz data streams in Spark Streaming, the clustering module latency is <200ms and the end-to-end warning latency is <800ms.

Claims

1. A real-time monitoring method for truck transport risk behavior based on GPS and dual-stream deep learning, characterized by: First, in the pre-processing layer, real-time trajectory denoising is performed based on Kalman filtering to eliminate trajectory noise points caused by non-scalping and theft behaviors, while retaining the behavioral characteristics of abnormal stop points and detour paths. Then, a deep learning convolutional neural network is used to extract local abnormal areas from the time series for risk monitoring. Through the CNN-Transformer dual-stream network architecture, a 1D-CNN is used to capture high-frequency abnormal patterns in local trajectory segments, combined with the Transformer's self-attention mechanism to model the long-term behavior patterns of vehicles. Finally, a machine learning clustering algorithm is used to identify trajectory segments with high-risk resale and theft risks.

2. The real-time monitoring method for truck transportation risk behavior based on GPS and dual-stream deep learning according to claim 1 is characterized in that: The specific implementation steps are as follows: In the preprocessing layer, trajectory denoising and feature enhancement are performed based on the improved Kalman filter; in the deep feature extraction layer, a CNN-Transformer dual-stream network architecture is constructed; At the risk decision-making level, the trajectory segments of high-risk reselling and theft risk behaviors are identified through the fusion of spatiotemporal clustering and anomaly scoring; Step 1, preprocessing layer: trajectory denoising and feature enhancement of improved Kalman filter; The preprocessing layer uses an improved Kalman filter algorithm to remove noise interference from the original trajectory data while retaining the key behavioral features in the effective signal; The "position-velocity-heading angle" state transition model is constructed based on the vehicle kinematic equations. The observation noise covariance matrix is ​​dynamically adjusted according to the differentiated parameters of urban and highway scenarios, and instantaneous accelerations > 5m / s are filtered. 2 Abnormal point sensor hardware noise; Setting a dwell time threshold of >30 minutes and combining it with geo-fencing distinguishes legitimate loading and unloading points from abnormal dwell events, ensuring that key risk signals are not accidentally deleted. Trajectory breakpoints are repaired through linear interpolation, motion features are extracted, and trajectory data and abnormal dwell point sets are output, laying a reliable data foundation for subsequent analysis. Step 2, deep feature extraction layer: CNN-Transformer two-stream network architecture; The deep feature extraction layer, based on the principle of local-global feature coupling, uses a dual-stream parallel network to achieve complementary mining of spatiotemporal anomaly patterns. The 1D-CNN captures features in the time series dimension of trajectory data and identifies short-term, high-frequency anomaly patterns by sliding the convolution kernel along the time axis. A dilated convolutional network is designed for speed sequences. A multi-head self-attention mechanism is used to analyze trajectory coordinate sequences and model the long-term behavior patterns of vehicles. Based on the CNN's focus on detailed anomalies and the Transformer's focus on macroscopic regularities, the dual-stream output features are dynamically weighted to generate a 128-dimensional feature vector that integrates spatiotemporal semantics, providing multi-dimensional information support for risk decision-making. Step 3, risk decision layer: fusion of spatiotemporal clustering and anomaly scoring; The risk decision layer defines a spatiotemporal distance metric: spatial Haversine distance accounts for 70% and time interval accounts for 30%. The core distance threshold is adaptively adjusted based on historical trajectory density to identify hidden anomalies such as multiple small-scale detours over a short period of time. The risk score (Risk_score) is generated by combining the local anomaly probability of 1D-CNN and the global deviation of clustering results, and early warnings are triggered in a graded manner. Through the progressive architecture of "data cleaning-feature mining-joint decision-making", it supports pure GPS lightweight deployment while ensuring real-time performance, providing a cost-effective solution for logistics risk prevention and control.

3. The real-time monitoring method for truck transportation risk behavior based on GPS and dual-stream deep learning according to claim 2 is characterized in that: In the preprocessing layer: Step 1.1: State space modeling and Kalman filter iteration; Step 1.1.1: State vector definition; Assume that the state vector of the vehicle at time t is: X t =[x t y t v t θ t ] T ;x t ,y t is the longitude and latitude in the WGS-84 coordinate system; v t is the instantaneous velocity; θ t is the heading angle, relative to true north; Step 1.1.2: State transition equation; Based on the vehicle kinematic model, the state prediction equation is: X t|t-1 =F t X t-1 +W t , where W t is the process noise, the state transfer matrix F t : The state transfer matrix is ​​derived based on the uniform motion assumption and the coupling relationship between the heading angle change rate and the velocity, where Δt is the GPS sampling interval; Filtering noise Where Q is the process noise covariance matrix, is the variance of the vehicle position, is the variance of vehicle speed, is the variance of the heading angle; Step 1.1.3: Observation equation; The GPS observation value is: t =Hx t +v t ; Wherein the observation matrix H = I4, directly observe the position x t , speed v t , heading angle; observation noise Urban roads have the characteristics of frequent start and stop, and low speed precision R city =diag(5 2 ,5 2 ,0.3 2 ), highways have the characteristics of high speed and stable heading, R highway =diag(10 2 ,10 2 ,0.5 2 ); Step 1.2: Dual-threshold noise filtering mechanism; Step 1.2.1: First threshold - hardware noise filtering; Eliminate abnormal points caused by GPS sensor errors or communication interference, detect acceleration mutations, and calculate instantaneous acceleration If |a t |>5m / s 2 , determined as noise points and removed; Step 1.2.1: Second threshold—behavioral feature retention; Retain potential abnormal stay events of illegal unloading; perform DBSCAN clustering on continuous trajectory points. If the stay time t of a trajectory point in a cluster is stay If the stay time exceeds 30 minutes, it will be marked as an abnormal stop. If the stop is located in the preset loading and unloading area, it will be considered a legal stop. Otherwise, it will be retained as an abnormal event. Step 1.3: trajectory repair and feature enhancement; Step 1.3.1: Fill in missing data; For trajectory breakpoints caused by noise filtering, linear interpolation is used: Where x is the trajectory position, k is the number of consecutive missing points, and the limit k is <= 5. If it exceeds the limit, it is considered as a trajectory interruption; Step 1.3.2: motion feature extraction; Extract 14-dimensional feature vectors from the repaired trajectory, including: Instantaneous motion characteristic acceleration: Heading angle change rate: Δθ t =θ t -θ t-1 , curvature: Statistical features include speed standard deviation, acceleration extreme value, and curvature mean; spatiotemporal context features include Haversine distance to the nearest road network node and current time segment code; Step 1.4: Output and verification; Step 1.4.1: Output the results; Denoising trajectory T' = {x' t |t=1,2,…,N}, abnormal stay set Among them, x' t is the coordinate of the stop position at a certain moment, s stay For the residence time.

4. The real-time monitoring method for truck transportation risk behavior based on GPS and dual-stream deep learning according to claim 3 is characterized in that: In the deep feature extraction layer: Step 2.1: Local anomaly capture flow 1D-CNN; Step 2.1.1: Input preprocessing; For the velocity sequence x t = {V1, V2, ..., V n }, where V n For vehicle speed, perform Z-score standardization: in, is the normalized speed value, μ v represents the mean of the velocity series, represents the standard deviation of the velocity series; Step 2.1.2: dilated convolution operation; Assume that the expansion rate is d, the convolution kernel size is K=3, and the output feature of the first layer is for: in are learnable weights, is the bias term; the expansion rate is set to three layers: the first layer d = 2, capturing the velocity changes within 2 seconds of the nearest neighbor; the second layer d = 4, expanding to a 4-second window; the third layer d = 6, covering the 6-second long-range dependence; Step 2.1.3: Grid structure; The layer configuration is an expanded convolution layer, output channel 64-ReLU activation-maximum pooling, pooling size = 2, stride = 2; repeat the above structure 3 times, gradually expanding the receptive field, the total receptive field = 2 + 4 + 6 = 12 seconds; output feature F CNN ∈R n / 8×64 , n is the length of the input sequence; Step 2.1.4: Derivation of key formulas; Equivalent receptive field of dilated convolution: the dilation rate of the lth layer is d l , then the total receptive field d i , covering the 25-second window, the number of dilated convolution layers L = 3, and the size of the convolution kernel in the i-th layer k i =3, the expansion rate d of the i-th layer i =2, 4, 6, so the total receptive field R = 1 + (2 + 4 + 6) * 2 = 25; Step 2.2: Global regularity modeling flow Transformer; Step 2.2.1: Input embedding and position encoding; Convert WGS-84 longitude and latitude (x t ,y t ) is converted into plane coordinates to eliminate the influence of the earth's curvature; For the coordinate sequence P = {(x1, y1), ..., (x n ,y n )} for linear embedding: E t =w e ·[(x t ,y t )]+b e (W e ∈R 128×2 , b e ∈R 128 ), where W e is the embedding weight matrix, b e is the bias vector; Add sinusoidal position encoding to preserve timing information: PE (pos,2i) and PE (pos,2i+1) Respectively represent the values ​​of the 2i-th column and the 2i+1-th column of the pos-th row in the position encoding matrix; Final input: z t =E t +PE t , where E t Represents the input vector after linear embedding, PE t Represents the input vector E t The position encoding vector of Step 2.2.2: Multi-head self-attention mechanism; For the input sequence z∈R n×128 , generate query Q, key K, value V matrix: Q=zw Q , K=zw k , V=zw v , where w Q , w k , w V ∈R 128×16 , which means mapping the 128-dimensional input vector to 16-dimensional query, key, and value vectors; Single-head attention output: d k =16; The 8-head attention output is concatenated and linearly transformed: MultiHead(Q,k,v)=Concat(head1,...head8)w0,w0∈R 128×128 , where w0∈R 128×128 It is the weight matrix used to concatenate the outputs of the multi-head attention and map them back to the original dimension; Step 2.2.3: Transformer encoder layer; Each encoder layer contains: multi-head self-attention-LayerNorm-residual connection and 2 layers of full connection, hidden layer dimension-512ReLU activation; and gradually abstracts high-level semantic features; Step 2.2.4: Output features; Global regularity characteristics: F Trans ∈R n×64 , where n is the length of the sequence and 64 is the dimension of the feature; Step 2.3: Gated feature fusion mechanism; Step 2.3.1: Gating weight generation; Calculate the gating weights for the two-stream features separately: g CNN =δ(w g ·F CNN +b g ), g Trans =1-g CNN , where w g ∈R 64×64 ,δ is the simoid function, g CNN and g Trans Represents the gating weights of CNN features and Transformer features, b g is the bias term used to generate the gating weight; Step 2.3.2: Feature fusion; Weighted fusion of two-stream features: F fused =g CNN ΘF CNN +g Trans ΘF Trans , Θ represents element-by-element multiplication; Output fusion feature: F Fused ∈R n×128 Step 2.4: Training and validation; Step 2.4.1: Parameter initialization; The CNN convolution kernel weights are initialized with He to adapt to ReLU activation; the Transformer attention matrix weights are initialized with Xavier; Step 2.4.2: Loss function; Multi-task joint loss: in is the binary cross entropy loss, is the mean square error; Step 2.4.3: Experimental verification; The test set F1-score is 0.91, the recall rate of sudden acceleration events is improved by 35%, the MAE of periodic path prediction is 0.43, and the long-period deviation detection delay is less than 5 minutes.

5. The real-time monitoring method for truck transportation risk behavior based on GPS and dual-stream deep learning according to claim 4 is characterized in that: In the risk decision-making layer, Step 3.1: Improve the OPTICS clustering algorithm; Step 3.1.1: Spatiotemporal distance measurement; For two trajectory points P i =(x i ,y i ,t i ) and P j =(x j ,y j ,t j ), x i ,y i and x j ,y j are the longitude and latitude geographic coordinates of the two points, t i and t j are the timestamps of two points, and their temporal and spatial distance is: Use the Haversine formula to calculate the geographic interval: Where R = 6371 km is the radius of the earth, and the latitude difference between the two points Δφ = φ j -φ i , the longitude difference between the two points Δλ=λ j -λ i ; Step 3.1.2: Adaptive core distance; In the OPTICS algorithm, the core distance ∈ determines the neighborhood range; it is dynamically adjusted based on historical trajectories: ∈ = μ hist +3δ hist , μ hist is the mean value of the historical trajectory point density, δ hist is the standard deviation of the historical trajectory point density, and μ is recalculated every 24 hours based on the latest trajectory data. hist and δ hist ; Step 3.1.2: Clustering process optimization; For the trajectory point P i , which reaches the cluster core point P j The reachable distance is defined as: ReachDist(P i ,P j )=max(CoreDist(P j ),D(P i ,P j )), where CoreDist(P j ) is P j Core distance; If the reachable distance of a point is always greater than ∈, it is determined to be a noise point and removed; Step 3.2: Anomaly score fusion mechanism; Step 3.2.1: local anomaly classification; The feature vector F output by 1D-CNN CNN ∈R n×64 , mapped to abnormal probability after Sigmoid activation: W C ∈R 1×64 is the learnable weight, b C is the bias term, δ is the Sigmoid function, which compresses the score to the [0,1] interval; Step 3.2.2: Global deviation score; The Gaussian mixture model GMM is trained by historical trajectories to obtain the normal trajectory distribution P normal , for the trajectory segment r in the current clustering result j , calculate its distribution P cluster The larger the JSD value of Jensen-Shannon divergence, the more significant the difference between the trajectory segment and the normal pattern. Step 3.2.3: Risk score fusion; Cross-validation results show that local anomaly scores are highly sensitive to transient events, while global deviation scores are more effective in disrupting long-term patterns, with a 6:4 weighting achieving the best balance. Step 3.3: Hierarchical early warning mechanism; Step 3.3.1: Threshold setting; (1) High risk: Behavioral characteristics: abnormally long stays or serious deviations from the route; Response measures: Automatically trigger the freezing of the vehicle's electronic locks and push an alarm to the security center; (2) Medium risk: Behavioral characteristics: moderate route deviation or short abnormal stops; Response measures: SMS notification to dispatcher for manual verification; (3) Low risk: Behavioral characteristics: slight trajectory fluctuations; Response measures: Record logs, do not trigger real-time alerts; Step 3.3.2: Dynamic weight adjustment; For urban delivery, the weight will be increased to 0.5, and frequent detours require attention to the overall rules; For long-distance transport, the weight will be increased to 0.7, and transient anomalies are more critical; Step 3.4: Verification and effect; The improved OPTICS has an anomaly detection rate of 92% and a false alarm rate of 4.3%. The high-risk detection rate of the 6:4 fusion score is 89%. When processing 1Hz data streams in Spark Streaming, the clustering module latency is <200ms and the end-to-end warning latency is <800ms.