Safety detection early warning method and system based on vehicle OBD data and medium
By constructing a spatiotemporally aligned multidimensional dataset, and utilizing a combination of tensor decomposition, recurrent neural networks, and graph convolutional networks, the lack of spatiotemporal environmental factors and dynamic adaptability issues in OBD safety detection and early warning technology were addressed, achieving high-precision risk warning and improved timeliness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing OBD safety detection and warning technologies lack consideration of spatiotemporal environmental factors, cannot capture the deep correlation between multidimensional parameters, and lack dynamic adaptability, resulting in inconsistent warning accuracy and a high false alarm rate, especially in complex driving scenarios.
By collecting vehicle OBD, GPS, and environmental data, a spatiotemporally aligned multidimensional dataset is constructed. Tensor decomposition technology is used to extract three-dimensional correlation features. Combined with recurrent neural networks, risk mapping relationships in driving scenarios are learned, a spatiotemporal semantic association graph is constructed, and high-risk areas are identified through graph convolutional networks, thereby achieving dynamic weighted fusion of OBD data and environmental information.
It achieves accurate prediction of route and location-related risks, reduces the false alarm rate of early warnings, improves the accuracy and timeliness of risk warnings, and provides professional safety assurance for operating vehicles.
Smart Images

Figure CN121768205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle safety monitoring technology, and more specifically, to a safety detection and early warning method, system, and medium based on vehicle OBD data. Background Technology
[0002] With the rapid development of intelligent transportation and vehicle-to-everything (V2X) technologies, vehicle safety detection and early warning technologies have become an important means of ensuring driving safety. On-Board Diagnostics (OBD) systems can monitor various operating parameters of a vehicle in real time, providing a rich data foundation for assessing vehicle safety conditions.
[0003] Existing OBD safety detection and warning technologies primarily rely on analysis of a single data source, typically employing fixed thresholds or simple statistical methods to monitor vehicle parameters and identify anomalies. These methods suffer from the following main problems: First, they lack consideration of spatiotemporal environmental factors, leading to inconsistent warning accuracy across different driving scenarios; second, data analysis remains at a superficial feature extraction level, failing to capture the deep correlations between multidimensional parameters; third, warning strategies lack dynamic adaptability, making it difficult to adjust risk assessment standards according to actual driving situations, resulting in a high false alarm rate; and fourth, they cannot effectively correlate OBD data with geographical location, lacking the ability to predict potential risks on specific road sections.
[0004] The aforementioned problems seriously affect the practicality and reliability of the OBD safety detection and warning system, especially in complex scenarios such as frequent short-distance driving in urban areas.
[0005] Therefore, there is an urgent need for a security detection and early warning method that can integrate multi-source data and has spatiotemporal context adaptability to improve the accuracy and timeliness of early warning. Summary of the Invention
[0006] This invention provides a safety detection and early warning method, system, and medium based on vehicle OBD data, which solves the technical problems of ignoring spatiotemporal environmental factors, lacking dynamic adaptability, and being difficult to accurately identify risks in specific road sections in related technologies.
[0007] This invention provides a safety detection and early warning method based on vehicle OBD data, comprising: Collect real-time vehicle OBD data, GPS positioning trajectory data, and environmental data, and preprocess them to form a spatiotemporally aligned multidimensional dataset; Based on a spatiotemporally aligned multidimensional dataset, tensor decomposition technology is used to extract three-dimensional correlation features of OBD time location, and driving mode feature fingerprints are constructed by combining driving behavior features. By utilizing a spatiotemporally aligned multidimensional dataset and driving mode feature fingerprints, a recurrent neural network is used to model and learn the mapping relationship between OBD parameter change patterns and safety risks under different driving scenarios. By combining the mapping relationship between OBD parameter change patterns and safety risks, a spatiotemporal semantic association graph is constructed to associate OBD anomaly patterns with geographic location information, and high-risk areas are identified through graph convolutional networks. By integrating multidimensional datasets, driving mode feature fingerprints, mapping relationships between OBD parameter change patterns and safety risks, and graph convolutional network outputs, the system dynamically weights and fuses OBD data with environmental information based on the current driving context to generate tiered early warning information.
[0008] Furthermore, the step of collecting real-time vehicle OBD data, GPS positioning trajectory data, and environmental data, and performing preprocessing, includes: Collect real-time vehicle OBD data, including engine speed, fuel consumption, temperature, emission parameters, and fault codes; Collect vehicle GPS positioning trajectory data, including location coordinates, driving speed, direction angle, and timestamp; Collect environmental data, including road conditions, traffic congestion, and weather conditions; The collected raw data is time-synchronized, noise-filtered, outlier-handled, and standardized to form a spatiotemporally aligned multidimensional dataset.
[0009] Furthermore, the step of extracting the three-dimensional correlation features of OBD time location using tensor decomposition technology includes: Reconstruct the spatiotemporally aligned cube into a three-dimensional tensor of OBD parameter temporal location; The CP decomposition method is used to decompose the three-dimensional tensor and extract the three-dimensional correlation features of OBD time location; Based on OBD and GPS data, driving behavior features are extracted, including acceleration features, turning features, shift frequency and braking mode. The correlation features obtained from tensor decomposition are fused with driving behavior features to construct a driving mode feature fingerprint.
[0010] Furthermore, the modeling step based on recurrent neural networks includes: Construct OBD and GPS sequence data that include temporal relationships; An improved gated loop unit network is constructed, which integrates OBD and GPS information through a gating mechanism; An integrated attention model captures the differences in the importance of different OBD parameters in different driving scenarios; Based on historically tagged security event data, a mapping model between OBD parameter change patterns and security risks is trained.
[0011] Furthermore, the improved gated recurrent unit network has: Multimodal input adaptation enables joint learning of multi-source data by expanding the input dimensions; A hierarchical feature extraction structure is adopted, which uses a two-layer structure to process OBD and GPS time-series features separately and perform comprehensive analysis. Residual connections alleviate the vanishing gradient problem during deep network training; Skip connections directly pass important OBD parameters to the upper-layer network, preserving key features of the original signal.
[0012] Furthermore, the step of constructing the spatiotemporal semantic association graph includes: The urban road network is modeled as a graph structure, where nodes represent road intersections or road segmentation points, and edges represent road connection relationships. Assign a risk feature vector to each node, which contains risk features and environmental features extracted from historical OBD data for that location; Construct graph convolutional networks for high-risk region identification; Incorporating the time dimension to analyze OBD anomaly patterns; Based on the risk score level, a dynamic risk heat map is generated to identify potentially high-risk road sections.
[0013] Furthermore, the steps for achieving dynamic weighted fusion of OBD data and environmental information include: Based on the vehicle's OBD data, GPS trajectory, and environmental data, determine the current driving situation; Based on the determined driving scenario, calculate the dynamic weights of OBD parameters and environmental factors; The OBD data and environmental information are dynamically weighted and integrated to calculate a comprehensive risk score; Based on the integrated risk score and preset safety thresholds, a graded early warning information is generated, which includes fault type judgment and handling suggestions.
[0014] Furthermore, the tiered early warning information includes: A mild warning is issued when the fusion risk score is above the first threshold but below the second threshold. A moderate warning is issued when the fusion risk score is above the second threshold but below the third threshold. A severe warning is issued when the fusion risk score exceeds the third threshold.
[0015] This invention provides a safety detection and early warning system based on vehicle OBD data, used to execute the aforementioned safety detection and early warning method based on vehicle OBD data, comprising: The data acquisition and preprocessing module is used to acquire and process real-time vehicle OBD data, GPS positioning trajectory data and environmental data to form a spatiotemporally aligned multidimensional dataset. The feature extraction and analysis module is used to extract three-dimensional associated features and construct driving mode feature fingerprints through tensor decomposition technology; The sequence modeling module is used to learn the mapping relationship between OBD parameter changes and safety risks using recurrent neural networks; The spatiotemporal correlation analysis module is used to construct semantic correlation graphs and identify high-risk areas; The risk assessment and early warning module is used to dynamically integrate multi-source data based on driving scenarios and generate graded early warning information.
[0016] The present invention provides a computer storage medium, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement the above-described safety detection and early warning method based on vehicle OBD data.
[0017] The beneficial effects of this invention are as follows: by integrating vehicle OBD data, GPS trajectory data and environmental data, a safety detection and early warning method based on spatiotemporal correlation features is constructed, providing a risk assessment method with context adaptability. By extracting three-dimensional correlation features through tensor decomposition technology, the complex interaction between parameters is effectively captured, and the expressive power of risk features is improved. It achieves accurate prediction of route and location-related risks. By using spatiotemporal semantic association graphs and graph convolutional networks, it associates OBD anomaly patterns with geographic location information, providing a scientific basis for vehicle route planning and risk avoidance. A dynamic risk assessment mechanism for different driving scenarios was established. Through a multi-factor dynamic weighted fusion algorithm, the importance of each factor is adaptively adjusted according to the current situation, thereby reducing the false alarm rate of warnings. It improves the accuracy and timeliness of risk warnings, increases the advance warning time, and provides more professional safety protection for operating vehicles such as taxis and logistics delivery vehicles. Attached Figure Description
[0018] Figure 1 This is a flowchart of a safety detection and early warning method based on vehicle OBD data in this invention; Figure 2 It is the curve showing the change in OBD parameter sequence and network-predicted risk probability; Figure 3 It is a dynamic risk heat map of the urban road network; Figure 4 This is a dynamic weight distribution diagram of OBD parameters under different driving scenarios; Figure 5It is a time series decomposition diagram of multi-factor integrated risk score; Figure 6 This is a time-series heatmap of the attention weights in a GRU network; Figure 7 This is a comparison chart of early warning performance - accuracy and false alarm rate. Detailed Implementation
[0019] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0020] At least one embodiment of the present invention discloses a safety detection and early warning method based on vehicle OBD data, such as Figure 1 As shown, it includes: Step 1: Collect real-time vehicle OBD data, GPS positioning trajectory data, and environmental data, and preprocess them to form a spatiotemporally aligned multidimensional dataset; This step involves collecting and preprocessing vehicle OBD data, GPS trajectory data, and environmental data to create a spatiotemporally aligned multidimensional dataset. Specifically, it includes the following sub-steps: Step 1.1, Multi-source data acquisition; Collect the following three types of data: Real-time vehicle OBD data includes internal vehicle status data such as engine speed, fuel consumption, temperature, emission parameters, and fault codes. GPS positioning trajectory data includes spatiotemporal information such as vehicle position coordinates, driving speed, direction angle, and timestamp; Environmental data includes external environmental information such as road conditions, traffic congestion, and weather conditions.
[0021] Step 1.2, Data Preprocessing; The collected raw data is processed as follows: Time synchronization: Aligning data from different sources by timestamp to form the same sampling frequency; Noise removal: Median filtering and sliding window averaging are used to remove noise and outliers from OBD data; Outlier handling: Identify and replace or remove data points that significantly deviate from the normal range; Data standardization: Converting data of different dimensions to a unified scale to facilitate subsequent analysis.
[0022] Step 1.3, Construction of spatiotemporally aligned cube; Preprocessed OBD data, GPS data, and environmental data are aligned and integrated in both time and space to construct a spatiotemporally aligned multidimensional dataset containing vehicle interior status, geographic location, and environmental information. This dataset is in the following format: ; in Represents a spatiotemporally aligned cube. Indicates time The OBD parameter vector, Indicates time GPS location information, Indicates time Environmental status information, This represents the total length of the time series.
[0023] Step 2: Based on the spatiotemporally aligned multidimensional dataset, extract the three-dimensional correlation features of OBD time location using tensor decomposition technology, and construct the driving mode feature fingerprint by combining driving behavior features; This step uses the spatiotemporally aligned multidimensional dataset formed in step 1 as input. Through tensor decomposition and driving behavior feature extraction, it identifies the correlation patterns between OBD data, time, and location. These extracted features will serve as key inputs for subsequent risk modeling, characterizing the intrinsic relationship between vehicle state and the driving environment. Specifically, it includes the following sub-steps: Step 2.1, 3D tensor construction; The spatiotemporally aligned cube is reconstructed into a three-dimensional tensor of OBD parameters-time-location, represented as: ; in Representing a three-dimensional tensor, Represents the real number field. Indicates the dimension of OBD parameters. Indicates the time dimension. Represents the positional dimension. Elements in a tensor Indicates the first OBD parameters in time and location The observed values.
[0024] Step 2.2, Tensor Decomposition Feature Extraction; The 3D tensor is decomposed using the CP decomposition (CANDECOMP / PARAFAC decomposition) method to extract the OBD-time-location 3D correlation features: ; in Representing a three-dimensional tensor, This means approximately equal to, Represents the cross product of vectors. For the rank of the decomposition, , , They represent the first The feature vectors of each component in the three dimensions of OBD parameters, time, and location.
[0025] The eigenvectors are solved by minimizing the error between the original tensor and the reconstructed tensor. ; in This represents all eigenvectors , , Find the minimum value. This represents the Frobenius norm, used to measure the size of a matrix or tensor.
[0026] Step 2.3, Driving behavior feature extraction; Based on OBD and GPS data, the following driving behavior characteristics are extracted: Acceleration characteristics: Acceleration and deceleration distributions are calculated by differentiating velocity data; Turning characteristics: Calculate the turning radius and steering angle by combining GPS trajectory data; Shift frequency: Identify shift points and frequencies from engine speed and vehicle speed data; Braking mode: The braking mode is identified based on the brake pedal position and vehicle speed changes.
[0027] Step 2.4, Construction of driving mode feature fingerprint; The correlation features obtained from tensor decomposition are fused with driving behavior features to construct a driving pattern feature fingerprint: ; in Fingerprint indicating driving mode characteristics Indicates the characteristics of tensor decomposition. Indicates characteristics of driving behavior; This indicates the concatenation of feature vectors.
[0028] This unique fingerprint can uniquely characterize the vehicle's operating status in a specific driving scenario.
[0029] Step 3: Using the spatiotemporally aligned multidimensional dataset and driving mode feature fingerprint, model based on recurrent neural network to learn the mapping relationship between OBD parameter change patterns and safety risks under different driving scenarios; This step receives the spatiotemporally aligned cube from step 1 and the features extracted in step 2. It then uses an improved Gated Recurrent Unit (GRU) network to model the OBD and GPS sequence data, learning the mapping relationship between OBD parameter variation patterns and safety risks under different driving scenarios. This step captures parameter variation trends through sequence modeling, extending static features into a dynamic risk assessment model. Specifically, it includes the following sub-steps: Step 3.1, Sequence data construction; Construct OBD and GPS sequence data with temporal relationships, where each time step includes: OBD parameter sequence: ; in This represents the OBD parameter sequence from time tw to time t; , , Representing time respectively ,time ,time OBD parameters; This indicates the size of the sliding window, used to capture time context information.
[0030] GPS track sequence: ; in This represents the GPS trajectory sequence from time tw to time t; , , Representing time respectively ,time ,time GPS track; This indicates the size of the sliding window, used to capture time context information.
[0031] Step 3.2, Improve the construction of the gated recurrent unit network; An improved GRU network is constructed, which fuses OBD and GPS information through gating. Its core computing unit is defined as: ; ; ; ; in for The hidden state at any given moment. To update the gate, it is determined how much information from the previous moment should be retained. To reset the door, determine how much information from the previous moment to ignore. This is a candidate hidden state. This represents the Hadamard product (element-by-element product). This represents the sigmoid activation function. , , Let represent the weight matrices for the update gate, reset gate, and candidate hidden states, respectively. , , Let represent the bias vectors for the update gate, reset gate, and candidate hidden state, respectively. This indicates that the hidden state of the previous moment will be removed. With the current input Connect them into a vector. Represents the hyperbolic tangent activation function; The fused OBD and GPS input features are represented as follows: ; in and These represent the OBD parameters and GPS trajectory at time t, respectively.
[0032] The improved GRU network in this embodiment has the following key features: Multimodal input adaptability: Compared to the standard GRU, this scheme has better input characteristics. It integrates OBD parameters and GPS trajectory data, and achieves joint learning of multi-source data by expanding the input dimensions; Hierarchical feature extraction structure: The network adopts a two-layer GRU structure. The first layer processes the temporal features of OBD and GPS respectively, and the second layer fuses the two features for comprehensive analysis. Residual connections: Adding residual connections between layers alleviates the gradient vanishing problem during deep network training and speeds up model convergence. Skip connections: For some important OBD parameters, skip connections are added to directly pass them to the upper-layer network, preserving the key features of the original signal.
[0033] In scenarios where taxis frequently travel short distances, the network demonstrates a high recognition rate for high-risk driving behaviors such as rapid acceleration, sudden braking, and abnormal idling.
[0034] Step 3.3, Attention Model Integration; To capture the differences in the importance of different OBD parameters in different driving scenarios, an attention model is integrated: ; ; ; in Indicates the first Attention weights for each hidden state. It is the unnormalized attention score. This represents the transpose of the attention vector. and These are the learnable parameters of the attention model. Indicates the first A hidden state. The context vector incorporates weighted hidden state information. This represents the number of hidden states. This represents the natural exponential function. Represents all values from 1 to n Perform summation.
[0035] Step 3.4, Risk mapping model training; Based on historically tagged security event data, train a mapping model between OBD parameter change patterns and security risks: ; in To predict the probability of security risks, This represents the hidden state at the last time step of the sequence. For the corresponding context vector, and These represent the weights and biases of the output layer, respectively. It is the sigmoid activation function. This means concatenating the hidden state of the last time step with the corresponding context vector into a single vector.
[0036] Optimize network parameters by minimizing the cross-entropy loss between predicted risk and actual label: ; in Represents the loss function. The risk probability predicted by the model. Marking actual risks, For the sample size, Represents the natural logarithm function. This indicates that the loss is averaged over all samples. Indicates the range from 1 to All samples Perform summation.
[0037] Step 4: Combine the mapping relationship between OBD parameter change patterns and safety risks to construct a spatiotemporal semantic association graph, associate OBD anomaly patterns with geographical location information, and identify high-risk areas through graph convolutional networks; This step, based on the GPS trajectory data collected in step 1, combines the spatiotemporal features extracted in step 2 and the parameter change patterns learned in step 3 to construct a spatiotemporal semantic association graph. This graph associates OBD anomaly patterns with geographic location information and uses a graph convolutional network to identify high-risk areas, generating a dynamic risk heatmap. This step achieves a deep fusion analysis of the vehicle's internal state and the external geographical environment. Specifically, it includes the following sub-steps: Step 4.1, Construction of the spatiotemporal semantic association graph; Model the urban road network as a graph structure: ; in Representing the graph structure, Represents a set of nodes. Represents an edge set.
[0038] Node set Each node Includes position attributes ; Edge set Each edge Connecting nodes and Includes distance attribute and road type attributes .
[0039] For each node Assign risk feature vector The feature vector consists of two parts: ; in This indicates the risk characteristics extracted from historical OBD data for this location. Indicates environmental characteristics.
[0040] Step 4.2, Graph Convolutional Network Construction; Construct a graph convolutional network for high-risk region identification. ; in For the first Layer node feature matrix, Indicates the first Layer node feature matrix For the number of nodes, For the first Layer feature dimension; For the first The weight matrix of the layer, It is the sigmoid activation function. Degree matrix The negative one-half power is used for normalization; An adjacency matrix with added self-connections is represented as: ; in This is the original adjacency matrix. for An identity matrix of order 1; The graph convolutional network in this embodiment consists of the following components: Input layer: Receives the feature vector of each road node. It includes historical OBD data features and environmental features; Graph Convolutional Layer: Contains 3 graph convolutional layers, with output feature dimensions of 64, 32 and 16 for each layer, respectively, and ReLU is used as the activation function; Attention layer: Add a graph attention layer after the second graph convolution to learn the importance weights between different nodes; Pooling layer: Differential pooling is used to compress the graph structure while retaining information about important nodes; Fully connected layer: Finally, two fully connected layers are used to output the risk score of each node. The number of neurons in the fully connected layers are 16 and 1, respectively.
[0041] This graph convolutional network performs exceptionally well in complex urban environments, accurately identifying high-risk road sections associated with OBD anomalies. For example, in mountainous road scenarios with steep slopes and frequent curves, the network successfully identified 95% of high-risk areas for engine overheating, while traditional rule-based methods could only identify 65%.
[0042] The network consists of multiple graph convolutional layers and fully connected layers, which process the input features of the nodes. Mapped to risk score : ; in This represents a graph convolutional network function. For nodes eigenvectors, For the entire graph structure. The output is a risk score.
[0043] Step 4.3, Time-Aware Anomaly Pattern Analysis; Based on the graph structure, the time dimension is incorporated to analyze OBD anomaly patterns: Construct statistical characteristics of historical OBD data within a time window; Calculate the degree of deviation between the current OBD parameters and historical statistical characteristics; Define anomaly score: ; in Indicates that the vehicle is at the node At any time Abnormal scores, Indicates time The OBD parameter values, and Representing nodes respectively First Historical mean and standard deviation of each OBD parameter For the first The weighting coefficients of each OBD parameter. This represents the absolute value operation. This indicates all OBD parameters Perform summation.
[0044] Step 4.4: Generation of dynamic risk heatmap; Based on the output of the graph convolutional network and the time-aware anomaly pattern analysis results, a dynamic risk heatmap is generated: For each node Based on its risk score and abnormal scores Calculate the overall risk score: ; in To balance the weighting coefficients of the two, the values range from [0, 1]. Represents a node At any moment The overall risk score, This represents the node risk score output by the graph convolutional network. Indicates time Abnormal scores; Using spatial interpolation methods, the risk scores of discrete nodes are extended to continuous geographic space: ; in Representing coordinates At any moment Risk score, This is a kernel function used for space smoothing. Use the distance function to calculate the coordinates of the points. With node position The distance between them This indicates that for all nodes Summation, Represents a node At any moment The overall risk score, Represents a node Geographical coordinates; Based on the risk score level, heat maps of different colors are generated to identify potentially high-risk road sections, forming a visualized dynamic risk heat map.
[0045] Step 5: Integrate the multidimensional dataset, driving mode feature fingerprint, mapping relationship between OBD parameter change patterns and safety risks, and graph convolutional network output results. Based on the current driving situation, realize dynamic weighted fusion of OBD data and environmental information to generate hierarchical warning information. This step comprehensively utilizes the analysis results of the previous four steps, dynamically fusing the raw data obtained in step 1, the feature fingerprints extracted in step 2, the risk mapping relationships learned in step 3, and the high-risk area information identified in step 4. Based on the current driving context, it adaptively weights the OBD data and environmental information, and generates tiered warning information based on the fused risk score. This step is the decision output stage of the entire method, transforming the analysis results of multi-source heterogeneous data into actionable warning information. Specifically, it includes the following sub-steps: Step 5.1, Determine the driving scenario; Based on the current vehicle's OBD data, GPS trajectory, and environmental data, determine the current driving situation: ; in The context category indicating the judgment includes typical scenarios such as: urban congestion, smooth urban traffic, highways, mountain roads, and severe weather. Represents the classifier function. This indicates that the current OBD data will be displayed. GPS data and environmental data The concatenated feature vectors.
[0046] The judgment method uses a multi-class classifier, such as random forest or support vector machine, to determine the context category based on the extracted features.
[0047] The specific implementation of the driving scenario judgment model in this embodiment is as follows: Feature engineering: Extract 83 key features from raw OBD, GPS and environmental data, including speed statistics features, acceleration distribution features, engine load features, road gradient features, weather features, etc. Feature selection: The Recursive Feature Elimination (RFE) algorithm is applied to select the 32 most discriminative features; Classifier structure: An ensemble learning method is used, specifically a random forest classifier, which contains 100 decision trees, each with a maximum depth of 10. Scenario Categories: Driving scenarios are divided into 8 categories (urban congestion, urban smooth traffic, highway stability, highway speed change, mountain road uphill, mountain road downhill, and severe rain / snow weather).
[0048] In practical applications of logistics and delivery vehicles, appropriately adjusting risk assessment strategies for different scenarios plays a crucial role. For example, in a "city congestion" scenario, the weight of the OBD temperature parameter is automatically increased, while in a "mountain road uphill" scenario, the weights of engine load and braking system parameters are increased.
[0049] Step 5.2, Calculation of dynamic weighting coefficients; Based on the determined driving situation Calculate the dynamic weights of OBD parameters and environmental factors: ; ; in Representing the context Next The weights of each OBD parameter, Representing the context Next The weight of each environmental factor and Representing the context respectively Next The and the first The importance score of each OBD parameter and Representing the context respectively Next The and the first The importance score of each environmental factor This represents the natural exponential function. and These represent summations of all OBD parameters and environmental factors, respectively.
[0050] Step 5.3, Calculation of multi-factor fusion risk score; The OBD data and environmental information are dynamically weighted and integrated to calculate a comprehensive risk score. ; in This represents the overall risk score. Indicates the first Normalized risk values for each OBD parameter. Indicates the first Normalized risk values for each environmental factor. and Each is a scenario Dynamic weighting of OBD parameters and environmental factors. and These represent weighted summations of all OBD parameters and environmental factors. This dynamic weighting method adjusts the importance of each factor according to different driving scenarios, improving the accuracy of risk assessment.
[0051] Step 5.4, Early Warning Information Generation; Based on fusion risk scoring and preset security thresholds Generate tiered early warning information: when When the system determines the situation to be normal, no warning will be issued. when At that time, the system issues a mild warning to alert the driver to potential risks; when At that time, the system issued a moderate warning and advised the driver to take preventive measures; when At that moment, the system issued a serious warning, requiring the driver to take immediate safety measures.
[0052] in , and These are preset safety thresholds, corresponding to normal, mild warning, and severe warning, respectively. The warning message includes possible fault type identification and handling suggestions, such as: Fault type determination: Based on abnormal OBD parameter patterns and historical fault database, infer possible fault types; Recommended solutions: Based on the type and severity of the malfunction, we will provide corresponding recommendations, such as reducing speed, changing the route, or stopping immediately for inspection.
[0053] Furthermore, during the tensor decomposition process in step 2, the rank of the CP decomposition... The value of is between 5 and 20, with a preferred value of 10. The selection of this parameter is based on testing the reconstruction error of different rank values on the training dataset using cross-validation. At that time, the reconstruction error was reduced to 8.3% of the original error, and the computational complexity was moderate. The rank value is too small (e.g., This can lead to insufficient feature extraction and reconstruction errors exceeding 15%; excessively large rank values (such as...) This would introduce the risk of overfitting and increase the computation time by more than 3 times.
[0054] Furthermore, in the improved gated recurrent unit network of step 3, the hidden state dimension The value range is 64 to 256, with a preferred value of 128. This parameter is chosen based on the following: On an experimental dataset of short-distance urban driving scenarios, when the hidden state dimension is 128, the model achieves a prediction accuracy of 91.7% on the validation set, an improvement of 5.2 percentage points compared to dimension 64, and a 47% increase in computational efficiency with only a 0.8 percentage point decrease in accuracy compared to dimension 256. (Sliding window size) The value ranges from 10 to 60 time steps, with a preferred value of 30 time steps. At a sampling frequency of 1Hz, a 30-second time window can capture the complete process characteristics of vehicle start-up, acceleration, driving, and deceleration, covering the travel time of typical urban intersections.
[0055] Furthermore, during the training of the improved gated recurrent unit network in step 3, the learning rate... An exponential decay strategy is employed, with an initial learning rate of 0.001. The learning rate decreases to 0.9 times its initial value every 10 training epochs, with a minimum learning rate of 0.0001. This strategy is based on the following principles: an initial learning rate of 0.001 ensures rapid model convergence, typically reducing the loss function to 35% of its initial value within the first 5 epochs; the exponential decay strategy allows for fine-tuning of parameters in later training phases, preventing oscillations around the optimal solution. The batch size is set to 32, and the number of training epochs is 50. An early stopping strategy is used, stopping training when the validation set loss does not decrease for 5 consecutive epochs.
[0056] Furthermore, in the attention model of step 3, the attention vector The dimension is 64, and the attention weight matrix is... The dimension is The parameter configuration, where 128 represents the hidden state dimension, enables the attention mechanism to effectively capture the importance differences between different time steps in the sequence. In the braking system anomaly detection task, the variance of the attention weights reached 0.42, indicating that the model successfully identified key moments. Compared with the model without the attention mechanism, the false alarm rate was reduced by 18.3%.
[0057] Furthermore, in the graph convolutional network of step 4, the feature dimensions of the graph convolutional layers are 64, 32, and 16 respectively. This decreasing design allows the network to compress and abstract feature representations layer by layer. The number of neurons in the fully connected layers is 16 and 1. The first layer uses the ReLU activation function, and the output layer uses the Sigmoid activation function to map the risk score to the [0,1] interval. The learning rate of the graph convolutional network is set to 0.0005, the number of training epochs is set to 100, and the dropout ratio is set to 0.3 to prevent overfitting. Adjacency matrix The construction is based on the physical connection relationship of the road network. For adjacent road nodes, the corresponding element of the adjacency matrix is set to 1, otherwise it is 0.
[0058] Furthermore, in the time-aware anomaly pattern analysis in step 4, the OBD parameter weighting coefficients... The weighting of each parameter was determined based on its correlation with safety events. Specifically, engine temperature was weighted at 0.25, braking system parameters at 0.20, engine speed at 0.15, fuel consumption at 0.10, emissions at 0.10, and the total weight of other parameters was 0.20. This weighting was based on the analysis of data from 500 real safety events, which showed that abnormal OBD parameters had significantly higher correlation coefficients with braking system malfunctions (0.73 and 0.68 respectively) than other parameters.
[0059] Furthermore, in the generation of the dynamic risk heatmap in step 4, the balancing weight coefficients... The value ranges from 0.4 to 0.8, with a preferred value of 0.6. This parameter controls the risk score of the graph convolutional network. With real-time anomaly score The relative importance of the graph convolutional score is set to 0.6, indicating that the graph convolutional score accounts for 60% of the weight and real-time anomalies account for 40%. This configuration is based on the following: graph convolutional networks, learning risk patterns from historical data, are highly robust but respond slowly to sudden anomalies; real-time anomaly scores can quickly reflect the current state but are susceptible to noise interference. Different weight configurations were tested on the validation set. The system has the best overall performance, with an early warning accuracy rate of 89.4% and an average early warning lead time of 23.7 seconds.
[0060] Furthermore, in the spatial interpolation method of step 4, the kernel function Using the Gaussian radial basis function (RBF), its expression is: ,in For distance, The bandwidth parameter ranges from 50 to 200 meters, with a preferred value of 100 meters. This parameter is chosen because the average spacing between urban road nodes is 150 to 250 meters, and a bandwidth of 100 meters allows for a smooth transition of risk information between adjacent nodes, generating a continuous risk heatmap. At a certain time, the heat map shows an overly discrete, patchy distribution; when... When the distance is measured in meters, the boundaries between different risk areas are too blurry, reducing the spatial positioning accuracy of early warning.
[0061] Furthermore, in the driving scenario judgment step 5, the random forest classifier contains 100 decision trees, each with a maximum depth of 10, a minimum number of split samples of 20, and a minimum number of leaf node samples of 10. This parameter configuration allows the classifier to maintain high discriminative ability while avoiding overfitting. In the feature extraction stage, 32 key features are selected from the 83 features extracted from the original data after recursive feature elimination. The termination condition for feature selection is that the classification accuracy decreases by no more than 1%. On the test dataset of logistics delivery vehicles, this scenario judgment model achieves an average classification accuracy of 94.3% for 8 driving scenarios, with recognition accuracies of 97.2% and 96.8% for the two typical scenarios of "urban congestion" and "high-speed stability," respectively.
[0062] Furthermore, in the dynamic weighting coefficient calculation in step 5, the importance score of OBD parameters under different driving scenarios is... Importance score of environmental factors The importance score was determined based on expert knowledge and historical data statistics. Taking the "urban congestion" scenario as an example, the importance score for engine temperature parameters was 2.8, braking system parameters were 2.5, engine speed parameters were 2.0, traffic congestion level environmental factors were 3.2, and weather conditions environmental factors were 1.5. In the "uphill mountain road" scenario, the importance score for engine load parameters increased to 3.5, braking system parameters increased to 3.0, and road gradient environmental factors were 3.8. These scores were converted into weight coefficients after softmax normalization to ensure that the sum of all weights was 1.
[0063] Furthermore, in the warning threshold setting in step 5, the safety threshold... , , The values were 0.35, 0.60, and 0.80, respectively. This threshold was determined based on receiver operating characteristic (ROC) curve analysis on a labeled dataset containing 500 real safety events and 5000 normal driving instances. At that time, the system was able to detect 87.6% of potential risks while maintaining a low false alarm rate (12.3%); when At that time, the accuracy rate for moderate risk reached 82.1%; when At that time, the false negative rate for serious risks was reduced to 4.7%, ensuring reliable early warning in high-risk situations. The threshold can be fine-tuned under different driving scenarios. In the "high-speed stable" scenario, the threshold is increased by 0.05 overall to reduce the sensitivity of early warning when driving at high speeds; in the "severe weather - snow" scenario, the threshold is decreased by 0.08 overall to improve the sensitivity of early warning in complex environments.
[0064] Furthermore, in the data preprocessing stage, the median filter uses a window size of 5 sampling points, while the sliding window averaging method uses a window size of 3 sampling points. Outlier identification is based on a 3... The criterion is that a data point deviating from the mean by more than three standard deviations is considered an outlier and replaced using linear interpolation. Data standardization uses Z-score standardization, transforming the data into a distribution with a mean of 0 and a standard deviation of 1. The calculation formula is... ,in The original data, The mean, The standard deviation is given. The alignment accuracy for time synchronization is required to be no less than 100 milliseconds. For data sources with inconsistent sampling frequencies, a linear interpolation method is used to unify the sampling frequency to 1Hz.
[0065] Furthermore, in the risk mapping model training in step 3, the Adam optimizer is used to optimize the cross-entropy loss function, and its hyperparameters are set as follows: , , The regularization method uses L2 regularization, and the regularization coefficient is... A value of 0.001 is used to prevent model overfitting. During training, the loss value of the validation set is monitored, and an early stopping mechanism is triggered when the validation set loss does not decrease for five consecutive epochs. The final performance evaluation of the model uses 5-fold cross-validation, and the reported accuracy, recall, and F1 score are the average of the 5-fold results. On the test set for short-distance urban driving scenarios, the model achieved a risk prediction accuracy of 91.7%, a recall of 89.3%, and an F1 score of 90.5%.
[0066] A safety detection and early warning system based on vehicle OBD data, used to execute the aforementioned safety detection and early warning method based on vehicle OBD data, includes: The data acquisition and preprocessing module is used to acquire and process real-time vehicle OBD data, GPS positioning trajectory data, and environmental data to form a spatiotemporally aligned multidimensional dataset; an implementation example. The feature extraction and analysis module is used to extract three-dimensional associated features and construct driving mode feature fingerprints through tensor decomposition technology; The sequence modeling module is used to learn the mapping relationship between OBD parameter changes and safety risks using recurrent neural networks; The spatiotemporal correlation analysis module is used to construct semantic correlation graphs and identify high-risk areas; The risk assessment and early warning module is used to dynamically integrate multi-source data based on driving scenarios and generate graded early warning information.
[0067] A computer storage medium includes a memory and one or more processors, wherein executable code is stored in the memory, and when the one or more processors execute the executable code, it is used to implement the above-described safety detection and early warning method based on vehicle OBD data.
[0068] Here, the present invention provides an implementation example, such as Figure 2-7 As shown This implementation method has been practically verified in a city's logistics and delivery fleet. The fleet consists of 50 light delivery vehicles, which mainly carry out short-distance, multi-point delivery tasks in the city center area. The average daily mileage is about 120 kilometers, and each vehicle delivers to an average of 20-30 locations per day. The vehicles frequently start and stop, and the driving routes are complex and changeable.
[0069] Vehicle safety monitoring faces challenges due to complex road conditions, weather variations, and differences in driver operating habits, especially during peak delivery periods. Vehicle breakdowns leading to downtime can severely impact delivery efficiency and corporate reputation. Traditional OBD monitoring systems fail to effectively integrate environmental factors and vehicle driving patterns, resulting in a false alarm rate as high as 40%, significantly affecting the system's usability and reliability.
[0070] The fleet is equipped with the following hardware facilities to support the implementation of this method: OBD data acquisition unit: Connects to the vehicle's OBD-II interface to collect data such as engine speed, coolant temperature, fuel consumption, and emission parameters in real time; GPS positioning terminal: collects information such as location, speed, and direction, with a sampling frequency of 1Hz; Environmental data interface: Access data from the city's meteorological bureau and transportation department via API to obtain real-time weather and road condition information; Edge computing unit: Installed on the vehicle, it preprocesses the collected data and performs preliminary analysis; Cloud servers: perform deep data analysis, model training, and risk prediction tasks.
[0071] In practical application, we collected and preprocessed the fleet's operational data over six months. The basic details of the data collection are shown in Table 1. Table 1: Overview of Multi-Source Data Acquisition
[0072] After preprocessing the collected raw data, a multidimensional dataset with time and space alignment was constructed, including OBD parameters such as engine speed, coolant temperature, and vehicle speed, as well as location information, road type, traffic conditions, and weather information.
[0073] From the preprocessed multidimensional dataset, we constructed a 3D tensor of OBD parameters-time-location and applied CP decomposition for associated feature extraction. The parameter configuration and results of tensor decomposition are shown in Table 2. Table 2: Tensor Decomposition Parameter Configuration and Effects
[0074] Based on the tensor decomposition results, we extracted various driving behavior features and constructed driving mode feature fingerprints. Typical feature fingerprint examples for different driving behavior types are shown in Table 3: Table 3: Examples of fingerprint features for typical driving modes
[0075] Based on preprocessed OBD and GPS sequence data, we constructed an improved GRU network for sequence pattern learning. Key parameters for neural network construction and training are shown in Table 4. Table 4: Improved GRU Network Parameter Configuration
[0076] After being trained on a large amount of historical data, the network can effectively learn the mapping relationship between OBD parameter change patterns and safety risks in different driving scenarios. Figure 1 The OBD parameter sequence and the risk probability change curve predicted by the network are shown before a certain braking system failure (the graph is not shown here due to space limitations).
[0077] We modeled the urban road network as a graph structure and constructed a spatiotemporal semantic association graph based on historical OBD anomaly data and environmental information. In practical applications, based on the graph structure analysis results and driving scenario judgments, we dynamically weighted and fused OBD data and environmental information to generate tiered warning information. Examples of weight coefficients under different driving scenarios are shown in Table 5: Table 5: Examples of Dynamic Weighting Coefficients under Different Driving Scenarios
[0078] The system generates tiered early warning information that includes fault type identification and handling suggestions based on the integrated risk score and preset safety thresholds. Depending on the severity of the risk, the system notifies the driver via APP push, SMS or telephone.
[0079] After this implementation method was applied to a logistics delivery fleet for 6 months, the accuracy of the early warning system was significantly improved. The comparison results of the early warning accuracy are shown in Table 6: Table 6: Comparison of Early Warning Accuracy
[0080] The early warning accuracy rate is defined as the number of correct early warnings divided by the total number of early warnings; the false alarm rate is the number of incorrect early warnings divided by the total number of early warnings; the recall rate is the number of faults successfully warned of divided by the total number of actual faults; the precision rate is the number of actual fault warnings divided by the total number of early warnings; and the early warning time is the average time interval between the issuance of the early warning and the actual occurrence of the fault.
[0081] The application of this implementation method significantly improved fleet operation efficiency. A comparison of key operational indicators before and after implementation is shown in Table 7: Table 7: Comparison of Fleet Operation Efficiency
[0082] These data show that this implementation method not only significantly improves the accuracy of vehicle safety risk warnings, but also effectively reduces failure rates and maintenance costs, improves fleet operating efficiency and vehicle lifespan, and brings significant economic benefits to logistics companies.
[0083] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A safety detection and early warning method based on vehicle OBD data, characterized in that, The application relates to a vehicle OBD real-time data collection method and system. The application comprises the following steps: Collecting vehicle OBD real-time data, GPS positioning trajectory data and environmental data, and preprocessing to form a spatiotemporally aligned multidimensional data set; Based on the spatiotemporally aligned multidimensional data set, OBD time-position three-dimensional correlation features are extracted through tensor decomposition technology, and driving mode feature fingerprints are constructed in combination with driving behavior features; Using the spatiotemporally aligned multidimensional data set and the driving mode feature fingerprints, a model is established based on a recurrent neural network to learn the mapping relationship between OBD parameter change patterns and safety risks in different driving scenarios; In combination with the mapping relationship between OBD parameter change patterns and safety risks, a spatiotemporal semantic association graph is constructed to associate OBD abnormal patterns with geographic location information, and a graph convolution network is used for high-risk area identification; 2. The safety detection and early warning method based on vehicle OBD data according to claim 1, characterized in that, The multidimensional data set, the driving mode feature fingerprints, the mapping relationship between OBD parameter change patterns and safety risks and the graph convolution network output result are integrated, and according to the current driving situation, dynamic weighted fusion of OBD data and environmental information is realized to generate graded warning information. The step of collecting vehicle OBD real-time data, GPS positioning trajectory data and environmental data, and preprocessing comprises the following steps: Collecting vehicle OBD real-time data, including engine speed, fuel consumption, temperature, emission parameters and fault codes; Collecting vehicle GPS positioning trajectory data, including position coordinates, driving speed, direction angle and time stamp; Collecting environmental data, including road conditions, traffic congestion and weather conditions; 3. The safety detection and early warning method based on vehicle OBD data according to claim 1, characterized in that, The collected original data is subjected to time synchronization, noise filtering, abnormal value processing and data standardization to form a spatiotemporally aligned multidimensional data set. The step of extracting OBD time-position three-dimensional correlation features through tensor decomposition technology comprises the following steps: The spatiotemporally aligned multidimensional data set is reconstructed into an OBD parameter time-position three-dimensional tensor; The three-dimensional tensor is decomposed by using a CP decomposition method to extract OBD time-position three-dimensional correlation features; Based on OBD data and GPS data, driving behavior features are extracted, including acceleration features, turning features, gear shifting frequency and braking mode; 4. The safety detection and early warning method based on vehicle OBD data according to claim 1, characterized in that, The correlation features obtained by tensor decomposition are fused with the driving behavior features to construct driving mode feature fingerprints. The step of modeling based on a recurrent neural network comprises the following steps: An OBD and GPS sequence data containing time relationship is constructed; An improved gated recurrent unit network is constructed to fuse OBD and GPS information through a gating mechanism; An attention model is integrated to capture the importance difference of different OBD parameters in different driving scenarios; 5. The safety detection and early warning method based on vehicle OBD data according to claim 4, characterized in that, Based on historical marked safety event data, a mapping model of OBD parameter change patterns and safety risks is trained. The improved gated recurrent unit network has the following characteristics: Multi-modal input adaptability, which realizes joint learning of multi-source data by expanding input dimensions; A hierarchical feature extraction structure adopts a two-layer structure to process OBD and GPS time sequence features and perform comprehensive analysis; Residual connection, which alleviates the gradient vanishing problem in the training process of a deep network; 6. The safety detection and early warning method based on vehicle OBD data according to claim 1, characterized in that, Skip connection, which directly transmits important OBD parameters to an upper layer network to retain key features of original signals. The step of constructing a spatiotemporal semantic association graph comprises the following steps: Modeling the urban road network as a graph structure, where nodes represent road intersections or road segment points, and edges represent road connection relationships; Assigning a risk feature vector to each node, containing risk features and environmental features extracted from historical OBD data at that location; Building a graph convolutional network for high-risk area identification; Integrating the time dimension to analyze OBD abnormal patterns; According to the risk score level, generate a dynamic risk heat map to identify potential high-risk road segments.
7. The safety detection and early warning method based on vehicle OBD data according to claim 1, characterized in that, The step of implementing dynamic weighted fusion of OBD data and environmental information includes: Based on the OBD data, GPS trajectory and environmental data of the vehicle, determine the current driving situation; According to the determined driving situation, calculate the dynamic weights of OBD parameters and environmental factors; Dynamically weight the OBD data and environmental information, and calculate the comprehensive risk score; Based on the fusion risk score and the preset safety threshold, generate hierarchical warning information containing fault type judgment and handling suggestions.
8. The safety detection and early warning method based on vehicle OBD data according to claim 7, characterized in that, The hierarchical warning information includes: Mild warning, issued when the fusion risk score is above the first threshold and below the second threshold; Moderate warning, issued when the fusion risk score is above the second threshold and below the third threshold; Severe warning, issued when the fusion risk score is above the third threshold.
9. A safety detection and early warning system based on vehicle OBD data, characterized in that, A safety detection and warning method based on vehicle OBD data for performing any one of claims 1-8, comprising: A data acquisition and preprocessing module for acquiring and processing vehicle OBD real-time data, GPS positioning trajectory data and environmental data to form a spatio-temporal aligned multi-dimensional data set; A feature extraction and analysis module for extracting three-dimensional correlation features and constructing driving mode feature fingerprints through tensor decomposition technology; A sequence modeling module for learning the mapping relationship between OBD parameter changes and safety risks using recurrent neural networks; A spatio-temporal correlation analysis module for constructing a semantic correlation graph and identifying high-risk areas; A risk assessment and warning module for dynamically fusing multi-source data according to the driving situation and generating hierarchical warning information.
10. A computer storage medium, characterized in that, A memory and one or more processors, the memory having stored executable code, the one or more processors executing the executable code to implement a safety detection and warning method based on vehicle OBD data according to any one of claims 1-8.
Citation Information
Cited By
Vehicle positioning and intelligent risk control analysis method and readable storage medium
CN122065011A