Method, equipment and medium for identifying and handling abnormalities of all-terrain vehicles and roll cages thereof

By constructing an autoencoder anomaly detection model and using the inertial navigation module to automatically release the seat belt, the problem of the lack of real-time monitoring and automatic response in the all-terrain vehicle safety system in the existing technology is solved, and the escape ability and safety performance in emergency situations are improved.

CN118597019BActive Publication Date: 2024-10-01MAGNESIA MATERIAL TECHNOLOGY (DONGGUAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411044616.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-01
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

The existing all-terrain vehicle safety system relies on manual inspection and traditional mechanical design. It lacks real-time monitoring and automatic response functions and cannot effectively detect the abnormal state of the roll cage, making it difficult for the driver to escape in an emergency.

Method used

By acquiring the strain data of the roll cage, an anomaly detection model is constructed, an autoencoder network is used to identify abnormal patterns, and the seat belt is automatically released when an abnormality is detected, and the inertial navigation module and vehicle controller are used to trigger the automatic release function of the seat belt.

Benefits of technology

It realizes real-time detection and automatic response to the status of the roll cage, improves the ability to respond to emergencies, and enhances safety performance and intelligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118597019B_ABST
    Figure CN118597019B_ABST
Patent Text Reader

Abstract

The present application discloses an all-terrain vehicle and a roll cage abnormality identification and processing method, device and medium thereof, which relate to the field of electronic digital data processing. The method comprises: inputting strain data into a roll cage abnormality detection model to obtain an abnormality detection result; when the abnormality detection result is that the roll cage is in an abnormal state, obtaining the three-axis acceleration data of the all-terrain vehicle according to a set time window to determine the speed variance; when the speed variance is less than the state threshold, determining that the all-terrain vehicle is in a stationary state or a uniform speed driving state; obtaining a standard vector based on the vector of gravity acceleration in the world coordinate system and a rotation matrix; when the acceleration vector is equal to the standard vector, determining that the all-terrain vehicle is in a stationary state, triggering the automatic release function of the seat belt; the automatic release function of the seat belt is executed by the vehicle controller of the all-terrain vehicle. The present application can detect the state of the roll cage in real time, and when the roll cage is abnormal, the seat belt can be automatically released.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic digital data processing, and in particular to an abnormality identification and processing method, device and medium for an all-terrain vehicle and its roll cage. Background Art

[0002] Roll cages are usually designed to provide additional protection when an All Terrain Vehicle (ATV) is in a serious rollover or overturn accident. When an ATV is in a serious accident, such as a rollover or overturn, the driver is trapped inside the ATV. At this time, triggering the safety system can avoid further danger.

[0003] Most existing ATV safety systems rely mainly on manual inspection or traditional mechanical design, lacking real-time monitoring and automatic response functions. Specifically, the existing methods of triggering safety systems have the following technical problems:

[0004] 1) Reliance on manual inspection: Traditional safety systems require manual inspection of the status of the roll cage, which is not real-time and can be easily overlooked.

[0005] 2) Lack of real-time monitoring: Existing systems usually lack real-time monitoring capabilities and are unable to detect abnormal conditions of the roll cage in a timely manner.

[0006] 3) Lack of automatic response: When an abnormality is detected in the roll cage or in an emergency, the existing safety system often requires passengers to manually release the seat belts and lacks an automatic release function.

[0007] 4) Low technical level: The technical level of traditional security systems is relatively low and cannot meet today's requirements for safety performance and intelligence. Summary of the invention

[0008] The purpose of the present application is to provide an all-terrain vehicle and a roll cage abnormality identification and processing method, device and medium, which can detect the status of the roll cage in real time. When there is an abnormality in the roll cage, the seat belt can be automatically released so that the driver can escape from the all-terrain vehicle more easily, thereby meeting today's requirements for safety performance and intelligence.

[0009] To achieve the above objectives, this application provides the following solutions:

[0010] In a first aspect, the present application provides a method for identifying and handling abnormalities of an all-terrain vehicle roll cage, comprising:

[0011] Obtain strain data for an all-terrain vehicle roll cage;

[0012] Build a roll cage anomaly detection model;

[0013] After inputting the strain data into the roll cage abnormality detection model, an abnormality detection result is obtained;

[0014] When the abnormal detection result is that the roll cage is in an abnormal state, acquiring three-axis acceleration data of the all-terrain vehicle according to a set time window;

[0015] determining velocity variance based on three-axis acceleration data of the ATV;

[0016] When the speed variance is less than the state threshold, determining that the all-terrain vehicle is in a stationary state or a uniform speed driving state;

[0017] Based on the three-axis acceleration data of the all-terrain vehicle, the acceleration vector in the IMU coordinate system of the all-terrain vehicle is obtained;

[0018] The standard vector is obtained based on the vector of gravity acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system;

[0019] When the acceleration vector is equal to the standard vector, it is determined that the all-terrain vehicle is in a stationary state, and a seat belt automatic release function is triggered; the seat belt automatic release function is executed by a vehicle controller of the all-terrain vehicle;

[0020] When the abnormal detection result is that the roll cage is in a normal state, the speed variance is greater than or equal to a state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

[0021] Optionally, a roll cage anomaly detection model is constructed, specifically including:

[0022] Construct the autoencoder network structure;

[0023] Obtain a historical strain dataset of the roll cage, and obtain a training dataset based on a dataset configuration file;

[0024] Using the training process configuration file to train the autoencoder network structure based on the training data set until a set condition is met, thereby obtaining a trained autoencoder network structure;

[0025] The trained autoencoder network structure is used as the roll cage anomaly detection model.

[0026] Optionally, the process of constructing the autoencoder network structure includes:

[0027] Set the number of input features, the number of neurons in each hidden layer of the encoder and decoder, and the dropout rate;

[0028] Create dimension information of the layer structure of the encoder and the decoder; the dimension information of the layer structure of the encoder and the decoder is a list for defining the number of neurons of the encoder and each layer of the encoder;

[0029] Initialize the encoder and decoder as a sequence model based on the dimension information of the layer structure of the encoder and decoder;

[0030] Traverse each layer of the encoder, get the index of the layer, and get the number of neurons in the current layer;

[0031] Add a linear layer to the encoder, the parameters of the linear layer are the number of neurons in the current layer and the number of neurons in the next layer;

[0032] According to the name of the activation function used, add the activation function after each activation layer of the encoder after adding the linear layer;

[0033] According to the dropout rate, a dropout layer is added after each layer of the encoder after adding the activation function to obtain the final encoder;

[0034] Traverse each layer of the initialized decoder, get the index of the layer, and get the number of neurons in the current layer;

[0035] Add a linear layer to the decoder. The parameters of the added linear layer are the number of neurons in the current layer and the number of neurons in the next layer.

[0036] According to the name of the activation function used, add the activation function after each activation layer of the decoder after adding the linear layer;

[0037] Determine whether the current layer is the last layer of the decoder. If the current layer is not the last layer of the decoder, add a dropout layer after the current layer according to the dropout rate to obtain the final decoder;

[0038] The final encoder and the final decoder are cascaded to obtain the autoencoder network structure.

[0039] Optionally, a historical strain dataset of the roll cage is obtained, and a training dataset is obtained based on a dataset configuration file, specifically including:

[0040] Build a data loader for PyTorch based on a class called PyODDataset;

[0041] Acquiring data set attributes based on the historical strain data set; the data set attributes include: a feature matrix of the data set and a label of the data set;

[0042] The number of samples is obtained based on the number of rows of the feature matrix of the data set;

[0043] Get sample index based on the label of the dataset;

[0044] Check whether the sample index is a tensor of the PyTorch data loader. If not, do nothing. If yes, convert the sample index into a list and get the corresponding sample from the feature matrix of the dataset according to the sample index.

[0045] Check whether the obtained samples have mean and standard deviation. If not, no processing is performed. If yes, the obtained samples are standardized, and the standardized samples and the index corresponding to the samples are saved to generate a training data set.

[0046] Optionally, training the autoencoder network structure based on the training data set using a training process configuration file specifically includes:

[0047] Determine the mean and standard deviation of the input data in the training data set, and initialize the PyODDataset object using the mean and standard deviation of the input data;

[0048] Pass the initialized PyODDataset object to the PyTorch data loader to batch load the training data in the training data set;

[0049] Call the _train_autoencoder method to train the autoencoder network structure using the batch loaded training data, and use the autoencoder network structure corresponding to the autoencoder network structure parameters with the lowest loss as the trained autoencoder network structure.

[0050] Optionally, call the _train_autoencoder method to train the autoencoder network structure using batch loaded training data, including:

[0051] Create an array of all zeros to store the anomaly scores;

[0052] Traverse the training data loaded by the PyTorch data loader and process each batch of training data;

[0053] Passing the processed training data to the autoencoder network structure to obtain a model output;

[0054] Determine the Euclidean distance between the input data and the model output in the training data, and use the Euclidean distance as an anomaly score;

[0055] Storing the anomaly score in the all-zero array to obtain an anomaly score array;

[0056] When the anomaly score is higher than three times the standard deviation of the anomaly score array, the model output corresponding to the anomaly score is marked as 1;

[0057] When the anomaly score is less than or equal to three times the standard deviation of the anomaly score array, the model output corresponding to the anomaly score is marked as 0.

[0058] In a second aspect, the present application provides an all-terrain vehicle, wherein the all-terrain vehicle is equipped with a roll cage; the all-terrain vehicle further comprises: an on-board computer, an inertial navigation module, a vehicle controller and a plurality of strain sensors;

[0059] A plurality of the strain sensors are installed at set points of the roll cage; the plurality of strain sensors, the inertial navigation module and the vehicle controller are all connected to the onboard computer;

[0060] The plurality of strain sensors are used to obtain strain data of the roll cage; the on-board computer is used to construct an abnormality detection model for the roll cage, and after inputting the strain data into the abnormality detection model for the roll cage, obtain an abnormality detection result; the inertial navigation module is used to obtain the three-axis acceleration data of the all-terrain vehicle according to a set time window when the abnormality detection result indicates that the roll cage is in an abnormal state; the on-board computer is also used to perform the following operations:

[0061] determining velocity variance based on three-axis acceleration data of the ATV;

[0062] When the speed variance is less than the state threshold, determining that the all-terrain vehicle is in a stationary state or a uniform speed driving state;

[0063] Based on the three-axis acceleration data of the all-terrain vehicle, the acceleration vector in the IMU coordinate system of the all-terrain vehicle is obtained;

[0064] The standard vector is obtained based on the vector of gravity acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system;

[0065] When the acceleration vector is equal to the standard vector, it is determined that the all-terrain vehicle is in a stationary state, and a seat belt automatic release function is triggered; the seat belt automatic release function is executed by a vehicle controller of the all-terrain vehicle;

[0066] When the abnormal detection result is that the roll cage is in a normal state, the speed variance is greater than or equal to a state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

[0067] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-mentioned methods for identifying and processing abnormalities of an all-terrain vehicle roll cage.

[0068] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned methods for identifying and processing abnormalities of an all-terrain vehicle roll cage.

[0069] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0070] The present application provides an all-terrain vehicle and its roll cage abnormality identification and processing method, device and medium. By inputting strain data into a roll cage abnormality detection model to obtain an abnormality detection result, compared with the traditional safety system detection method, it can more effectively capture abnormal patterns in the data and improve the accuracy, real-time and reliability of detection; compared with the form of manually releasing the seat belt, the present application triggers the automatic release function of the seat belt, which can automatically release the seat belt lock when the roll cage abnormal state is detected and the all-terrain vehicle is stationary, thereby improving the vehicle's emergency response capability so that the driver can more easily escape from the all-terrain vehicle, thereby meeting today's requirements for safety performance and intelligence. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0072] Figure 1 A schematic flow chart of an abnormality identification and processing method for an all-terrain vehicle roll cage provided in one embodiment of the present application;

[0073] Figure 2 A schematic diagram of the structure of a roll cage anomaly detection model provided in an embodiment of the present application;

[0074] Figure 3 A flowchart of an implementation of roll cage abnormality identification and automatic release of seat belts for an ATV provided in an embodiment of the present application;

[0075] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0076] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0077] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0078] In an exemplary embodiment, Figure 1 As shown, a method for identifying and handling abnormal roll cages of all-terrain vehicles is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to a server as an example for explanation, and includes the following steps 100 to 109. Among them:

[0079] Step 100: Obtain strain data of the roll cage of the all-terrain vehicle.

[0080] Step 101: Build a roll cage anomaly detection model.

[0081] Step 102: After the strain data is input into the roll cage anomaly detection model, an anomaly detection result is obtained.

[0082] Step 103: When the abnormal detection result is that the roll cage is in an abnormal state, three-axis acceleration data of the all-terrain vehicle is obtained according to a set time window.

[0083] Step 104: Determine the velocity variance based on the three-axis acceleration data of the all-terrain vehicle.

[0084] Step 105: When the speed variance is less than the state threshold, it is determined that the all-terrain vehicle is in a stationary state or a uniformly moving state.

[0085] Step 106: Obtain an acceleration vector in the IMU coordinate system of the all-terrain vehicle based on the three-axis acceleration data of the all-terrain vehicle.

[0086] Step 107: Obtain a standard vector based on the vector of gravity acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system.

[0087] Step 108: When the acceleration vector is equal to the standard vector, it is determined that the ATV is in a stationary state, and the seat belt automatic release function is triggered. The seat belt automatic release function is executed by the vehicle controller of the ATV.

[0088] Step 109: When the abnormal detection result is that the roll cage is in a normal state, the speed variance is greater than or equal to the state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

[0089] By implementing the above steps 100 to 109, the present application can more effectively capture abnormal patterns in the data and improve the accuracy, real-time performance and reliability of the detection. Compared with the manual release of the seat belt, the present application can automatically release the seat belt lock when the abnormal state of the roll cage and the all-terrain vehicle are detected and the all-terrain vehicle is stationary by triggering the automatic release function of the seat belt, thereby improving the vehicle's emergency response capability so that the driver can escape the all-terrain vehicle more easily, thereby meeting today's requirements for safety performance and intelligence.

[0090] In another exemplary embodiment of the present application, in order to more effectively capture abnormal patterns in data and improve the accuracy and reliability of detection, this embodiment uses an autoencoder for anomaly detection. The advantage of this part comes from the step of training the autoencoder. By learning from normal data, the autoencoder can identify abnormal patterns in data. Then the above step 101 is replaced by the following steps 200 to 203:

[0091] Step 200: Construct an autoencoder network structure.

[0092] Step 201: Obtain a historical strain dataset of the roll cage, and obtain a training dataset based on a dataset configuration file. For example, the shape of the dataset X_train is (m, n), where m is the number of time points and n is the number of strain data.

[0093] X_train can be expressed as a set of strain sensor data measured at each time point t, X_train=[S_1, S_2,…, S_m].

[0094] For each time point (i.e., time window) t, the corresponding data S_t contains the strain data of n points, and S_t=[x1_t,x2_t,…,x8_t].

[0095] Step 202: Using the training process configuration file to train the autoencoder network structure based on the training data set until the set conditions are met, thereby obtaining a trained autoencoder network structure.

[0096] Step 203: Use the trained autoencoder network structure as a roll cage anomaly detection model. The specific structure of the roll cage anomaly detection model constructed in this embodiment is as follows: Figure 2 shown.

[0097] In another exemplary embodiment of the present application, the process of constructing the autoencoder network structure given in the above step 200 of the present application is described by taking the implementation process of a computer as an example. Specifically:

[0098] Step 300: Set the number of input features, the number of neurons in each hidden layer of the encoder and decoder, and the dropout rate.

[0099] Step 301: Create the dimension information of the layer structure of the encoder and decoder. The dimension information of the layer structure of the encoder and decoder is a list used to define the number of neurons in the encoder and each layer of the encoder. The first element of this list is the number of neurons in the input layer (i.e., the number of features of the input data), and the following elements are the number of neurons in each layer of the hidden layer.

[0100] By reversing the encoder's neuron number list, we get the decoder's neuron number list. The decoder's structure is mirrored to the encoder to achieve reconstruction of the input data.

[0101] Step 302: Initialize the encoder and decoder as a sequence model based on the dimension information of the layer structure of the encoder and decoder.

[0102] Step 303: traverse each layer of the encoder, obtain the index of the layer, and obtain the number of neurons in the current layer.

[0103] Step 304: Add a linear layer to the encoder, where the parameters of the linear layer are the number of neurons in the current layer and the number of neurons in the next layer.

[0104] After this step, if the batch normalization parameter batch_norm is True, you also need to add a batch normalization layer after each layer.

[0105] Step 305: according to the name of the activation function used, add an activation function after each activation layer of the encoder after the linear layer is added. The name of the activation function can be manually specified.

[0106] Step 306: According to the dropout rate, a dropout layer is added after each layer of the encoder after adding the activation function to obtain the final encoder.

[0107] At this time, the data X is input into the encoder to obtain the encoded representation.

[0108] Step 307: traverse each layer of the initialized decoder, obtain the index of the layer, and obtain the number of neurons in the current layer.

[0109] Step 308: Add a linear layer to the decoder, and the parameters of the added linear layer are the number of neurons in the current layer and the number of neurons in the next layer.

[0110] After this step, if the batch normalization parameter batch_norm is True and the current layer is not the last layer of the decoder, a batch normalization layer is added after the current layer.

[0111] Step 309: according to the name of the activation function used, add an activation function after each activation layer of the decoder after the linear layer is added. The name of the activation function can be manually specified.

[0112] Step 310: Determine whether the current layer is the last layer of the decoder. If the current layer is not the last layer of the decoder, add a dropout layer after the current layer according to the dropout rate to obtain the final decoder.

[0113] Step 311: Cascade the final encoder and the final decoder to obtain an autoencoder network structure.

[0114] At this point, the encoded data is input into the decoder to obtain the reconstructed output.

[0115] Furthermore, in the actual application process, before performing step 300, it is necessary to define a class named InnerAutoencoder, which inherits from the nn.Module class of PyTorch. This class is a neural network module. Call the constructor super().__init__() of the parent class nn.Module, and use the constructor super().__init__() to initialize the model. Among them, the class named InnerAutoencoder initializes the neural network model by inheriting nn.Module and calling the constructor super().__init__(), and defines the encoder and decoder inside it, realizing a simple autoencoder architecture.

[0116] Define the number of input features. Define the number of neurons in each hidden layer of the encoder and decoder. Define the dropout rate, which is used to control the complexity of the model and prevent overfitting. Define the batch normalization parameter batch_norm, a boolean value, whether to apply batch normalization after each hidden layer. Define the activation function, which is used for the hidden layer.

[0117] In another exemplary embodiment of the present application, the process of obtaining a training data set based on a data set configuration file given in step 201 of the present application is described by taking the implementation process of a computer as an example. Specifically:

[0118] Step 400: Define a class named PyODDataset, which is a dataset class for PyTorch, and build a PyTorch data loader based on the class named PyODDataset.

[0119] Step 401: Define a function to initialize the various attributes of the data set and the mean and standard deviation of the data set features for data standardization. Then, the data set attributes are obtained based on the historical strain data set. The data set attributes include: the feature matrix of the data set and the label of the data set. Among them, the feature matrix of the data set is the sample feature. The label of the data set is an optional parameter. If it exists, it means that there is a supervised learning task.

[0120] Step 402: define a method for obtaining the length of a data set, that is, obtaining the number of samples based on the number of rows of a feature matrix of the data set.

[0121] Step 403: Define a method for obtaining a single sample in a dataset by index: After defining the sample index, obtain the sample index based on the label of the dataset. Check whether the sample index is a tensor of the PyTorch data loader. If not, do not process it. If yes, convert the sample index into a list and obtain the corresponding sample from the feature matrix of the dataset according to the sample index. Check whether the obtained sample has a mean and standard deviation. If not, do not process it. If yes, normalize the obtained sample, save the normalized sample and the index corresponding to the sample, and generate a training dataset.

[0122] In another exemplary embodiment of the present application, the process of training the autoencoder network structure based on the training data set using the training process configuration file given in the above step 202 of the present application is described by taking the implementation process of a computer as an example. Specifically:

[0123] Step 500: Define the forward propagation function of the model and accept input data.

[0124] Step 501: The input data is first passed through the encoder and then through the decoder to obtain a reconstructed output, which is a prediction matrix of the same size as the feature matrix of the input data set.

[0125] Based on the above description, we need to define a class called AutoEncoder in advance. Define the number of hidden neurons in each layer of the encoder and decoder. Define the type of activation function for the hidden layer. Define batch_norm: a Boolean value indicating whether batch normalization is used after the hidden layer. Define the learning rate to control the speed of model parameter update. Define the number of training iterations. Define the number of samples in each training batch. Define the discard rate of the Dropout layer to prevent overfitting. Define the parameters of weight decay (L2 regularization) to control the complexity of the model. Define the loss function. Define the fit method to train the anomaly detection model.

[0126] Step 502: Based on the parameters defined above, receive data X as input data in a training data set.

[0127] Step 503: Determine the mean and standard deviation of the input data in the training data set, and use the mean and standard deviation of the input data to initialize the PyODDataset object.

[0128] Step 504: Data loader initialization: pass the initialized PyODDataset object to the PyTorch data loader for batch loading of training data, set the number of samples for each training batch, and shuffle the data order.

[0129] Step 505: Create a model instance of the InnerAutoencoder defined above. Call the _train_autoencoder method to train the autoencoder network structure using the batch loaded training data, and use the autoencoder network structure corresponding to the autoencoder network structure parameter with the lowest loss as the trained autoencoder network structure.

[0130] In actual application, after calling the _train_autoencoder method to train the autoencoder model, the training data loader is passed in to load the best model state. The best model state is loaded using the saved dictionary of the best model parameters with the lowest loss. Then, the decision_function method is called to calculate the decision score of the input data, which is used to determine whether the sample is abnormal, and then the trained model instance file is saved.

[0131] Among them, the construction process of the optimal model parameter dictionary can be described as:

[0132] (1) Optimizer initialization: Use the Adam optimizer to optimize the model parameters.

[0133] (2) Initial optimal loss and model parameter dictionary.

[0134] (3) Training loop: For each iteration, initialize an empty list to store the loss of each batch. For each batch in the training data loader, perform the following operations:

[0135] 1) Use the model for forward propagation and calculate the reconstruction loss.

[0136] 2) Clear the gradient of the model to zero.

[0137] 3) Back propagation calculates the gradient.

[0138] 4) Use the optimizer to update the model parameters.

[0139] 5) Add the loss value of the current batch to the list.

[0140] (4) After each iteration, print the average training loss of that iteration.

[0141] (5) Track the best model: Check whether the average training loss of the current iteration is lower than the best loss recorded previously. If so, update and record the current best loss value and the best model parameter dictionary respectively.

[0142] The updating process is as follows: (1) Record the current best loss value: After each iteration, calculate the average training loss of the current iteration. Then, compare it with the best loss value recorded previously. (2) Update the best loss value: If the average training loss of the current iteration is lower than the best loss value recorded previously, update the best loss value to the current loss value. In this way, the best model performance so far can be tracked. (3) Save the current model parameters: If the average training loss of the current iteration is lower than the best loss value recorded previously, the parameters of the current model are usually saved. These parameters will serve as the state of the current best model.

[0143] In another exemplary embodiment of the present application, the process of calling the _train_autoencoder method and using batch loaded training data to train the autoencoder network structure can be described as:

[0144] Step 600: Create an all-zero array to store the anomaly score. The shape of the all-zero array is (M), where M is the number of input samples.

[0145] Step 601: traverse the training data loaded by the PyTorch data loader and process each batch of training data.

[0146] Step 602: Pass the processed training data to the autoencoder network structure to obtain a model output, wherein the model output is a prediction matrix of the same size as the feature matrix of the input data.

[0147] Step 603: Determine the Euclidean distance between the input data and the model output in the training data, and use the Euclidean distance as the anomaly score.

[0148] Step 604: Store the anomaly score into an all-zero array to obtain an anomaly score array, that is, store the calculated anomaly score into a corresponding index position of the all-zero array.

[0149] Step 605: Return the calculated anomaly score array. When the anomaly score is higher than three times the standard deviation of the anomaly score array, mark the model output corresponding to the anomaly score as 1. When the anomaly score is lower than or equal to three times the standard deviation of the anomaly score array, mark the model output corresponding to the anomaly score as 0.

[0150] Based on the same inventive concept, the embodiment of the present application also provides an all-terrain vehicle for implementing the above-mentioned method for identifying and handling abnormal roll cages of all-terrain vehicles. The implementation scheme for solving the problem provided by the all-terrain vehicle is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more all-terrain vehicle embodiments provided below can refer to the limitations of the above-mentioned method for identifying and handling abnormal roll cages of all-terrain vehicles, and will not be repeated here.

[0151] In an exemplary embodiment, the all-terrain vehicle provided in the present application and equipped with a roll cage includes: an on-board computer (Electronic Control Unit, ECU), an inertial navigation module (Inertial measurement uni, IMU), a vehicle controller (Microcontroller Unit, MCU) and a plurality of strain sensors.

[0152] Multiple strain sensors are installed at set points on the roll cage. Multiple strain sensors, inertial navigation module and vehicle controller are connected to the on-board computer.

[0153] Multiple strain sensors are used to obtain the strain data of the roll cage. The onboard computer is used to build a roll cage anomaly detection model, and after inputting the strain data into the roll cage anomaly detection model, obtain the anomaly detection result. The inertial navigation module is used to obtain the three-axis acceleration data a_x, a_y and a_z of the all-terrain vehicle according to the set time window when the anomaly detection result is that the roll cage is in an abnormal state, and the collected three-axis acceleration data is rolled collected with a time window of t to obtain the arrays mid_x, mid_y, mid_z. The onboard computer is also used to perform the following operations:

[0154] (1)Determine the velocity variance based on the three-axis acceleration data of the all-terrain vehicle. For example, calculate the variances of the arrays mid_x, mid_y, mid_z, denoted as variance_x, variance_y, variance_z respectively. Calculate the total variance V = variance_x + variance_y + variance_z. Take the total variance as the velocity variance.

[0155] (2)When the velocity variance is less than the state threshold (i.e., V < K), determine that the all-terrain vehicle is in a stationary state or a uniform motion state. Here, K is the state threshold.

[0156] (3)Obtain the acceleration vector in the IMU coordinate system of the all-terrain vehicle based on the three-axis acceleration data of the all-terrain vehicle. Here, the acceleration vector in the IMU coordinate system is denoted as a_imu, and a_imu = [a_x, a_y, a_z]^T. T represents matrix transpose.

[0157] (4)Obtain the standard vector based on the vector of gravitational acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system. Here, define the vector of gravitational acceleration in the world coordinate system as g, g = [0, 0, g']^T, where g' represents gravitational acceleration. Denote the rotation matrix for converting the vector in the world coordinate system to the vector in the IMU coordinate system as R. Based on this, the standard vector is denoted as R∙g.

[0158] (5)When the acceleration vector is equal to the standard vector (i.e., a_imu = R∙g), determine that the all-terrain vehicle is in a stationary state and trigger the automatic seatbelt release function. The automatic seatbelt release function is executed by the vehicle controller of the all-terrain vehicle. At this time, the motion stationary state information of the vehicle IMU inertial navigation module is synchronized to the vehicle controller MCU.

[0159] In the actual application process, a relay device is used to achieve the automatic release of the seatbelt. When the state judgment logic meets the trigger condition, the MCU controls the relay to act to release the seatbelt lock.

[0160] (6)When the abnormal detection result shows that the roll cage is in a normal state, the velocity variance is less than the state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

[0161] As an alternative implementation, the strain data at different points of the roll cage measured by 8 strain sensors installed on the roll cage of the all-terrain vehicle are collected in real time. For each time point t, the corresponding measurement data W_t includes the measurement data of the strain sensors at 8 points, and W_t = [y1_t, y2_t, …, y8_t].

[0162] As an optional implementation, load the ATV roll cage strain sensor dataset X_train and create an anomaly detector object using the AutoEncoder class created above.

[0163] Set the hyperparameters of the autoencoder: Set the number of hidden neurons in each layer of the encoder and decoder to [128,64]. Set the type of hidden layer activation function to 'relu'. Set batch_norm to indicate whether to use batch normalization after the hidden layer to True. Set the learning rate to 1e-3. Set the number of training iterations to 10000. Set the number of samples in each training batch to 32. Set the dropout rate of the Dropout layer to 0.2 to prevent overfitting. Set the parameter of weight decay (L2 regularization) to 1e-5 to control the complexity of the model. Set the loss function to MSELoss, that is, mean square error loss. Call the decision_function method, pass the training set X_train to the model, and train the autoencoder. Get the trained model, use the joblib tool to convert the model to a .joblib file, and save it. Deploy the .joblib file of the model to the ECU.

[0164] Load the model .joblib file, and the model receives each frame of measurement data in real time to obtain the model output. If the model output is 0, the data frame data is normal. If the model output is 1, the data frame data is abnormal, the roll cage enters an abnormal state, and the abnormal state information is synchronized with the MCU. If the roll cage state is abnormal, the vehicle IMU is enabled.

[0165] Based on the above description, the implementation process of the ATV provided by the present application for abnormal roll cage identification and automatic release of the seat belt is as follows: Figure 3 shown.

[0166] Based on the above description, compared with the prior art, this system has the following advantages:

[0167] 1. Autoencoder for roll cage anomaly recognition: Using autoencoder for anomaly detection, compared with traditional rule-based or threshold-based methods, this application can more effectively capture abnormal patterns in data and improve the accuracy and reliability of detection. This part of the advantage comes from the training step of the autoencoder. By learning from normal data, the autoencoder can identify abnormal patterns in the data.

[0168] 2. Real-time performance: Compared with abnormality detection through the server cloud, this application can receive data from the roll cage sensor in real time and perform abnormality detection and processing at almost real-time speed. This real-time performance enables the system to respond to abnormal conditions of the roll cage in a timely manner and trigger corresponding safety measures, thereby improving vehicle driving safety.

[0169] 3. Automated safety measures: Compared with the manual release of seat belts in ordinary off-road vehicles, this application triggers the automatic release function of the seat belt. When the system detects an abnormal state of the roll cage and the vehicle's IMU inertial navigation module confirms that the vehicle is stationary, it can automatically release the seat belt lock, thereby improving the vehicle's ability to respond to emergencies. This part of the advantage comes from the design and implementation of the state judgment and the triggering of the automatic release function of the seat belt.

[0170] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store roll cage abnormality detection data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for identifying and processing abnormalities of an all-terrain vehicle roll cage is implemented.

[0171] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0172] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0173] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0176] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0178] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for identifying and handling abnormalities of an all-terrain vehicle roll cage, characterized in that: The method for identifying and handling abnormalities of an all-terrain vehicle roll cage includes: Obtain strain data for an all-terrain vehicle roll cage; Build a roll cage anomaly detection model; After inputting the strain data into the roll cage abnormality detection model, an abnormality detection result is obtained; When the abnormal detection result is that the roll cage is in an abnormal state, acquiring three-axis acceleration data of the all-terrain vehicle according to a set time window; determining velocity variance based on three-axis acceleration data of the ATV; When the speed variance is less than the state threshold, determining that the all-terrain vehicle is in a stationary state or a uniform speed driving state; Based on the three-axis acceleration data of the all-terrain vehicle, the acceleration vector in the IMU coordinate system of the all-terrain vehicle is obtained; The standard vector is obtained based on the vector of gravity acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system; When the acceleration vector is equal to the standard vector, it is determined that the all-terrain vehicle is in a stationary state, and a seat belt automatic release function is triggered; the seat belt automatic release function is executed by a vehicle controller of the all-terrain vehicle; When the abnormal detection result is that the roll cage is in a normal state, the speed variance is greater than or equal to a state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

2. The method for identifying and handling abnormalities of an all-terrain vehicle roll cage according to claim 1, characterized in that: Construct a roll cage anomaly detection model, including: Construct the autoencoder network structure; Obtain a historical strain dataset of the roll cage, and obtain a training dataset based on a dataset configuration file; Using the training process configuration file to train the autoencoder network structure based on the training data set until a set condition is met, thereby obtaining a trained autoencoder network structure; The trained autoencoder network structure is used as the roll cage anomaly detection model.

3. The method for identifying and handling abnormalities of an all-terrain vehicle roll cage according to claim 2, characterized in that: The process of building the autoencoder network structure includes: Set the number of input features, the number of neurons in each hidden layer of the encoder and decoder, and the dropout rate; Create dimension information of the layer structure of the encoder and the decoder; the dimension information of the layer structure of the encoder and the decoder is a list for defining the number of neurons of the encoder and each layer of the encoder; Initialize the encoder and decoder as a sequence model based on the dimension information of the layer structure of the encoder and decoder; Traverse each layer of the encoder, get the index of the layer, and get the number of neurons in the current layer; Add a linear layer to the encoder, the parameters of the linear layer are the number of neurons in the current layer and the number of neurons in the next layer; According to the name of the activation function used, add the activation function after each activation layer of the encoder after adding the linear layer; According to the dropout rate, a dropout layer is added after each layer of the encoder after adding the activation function to obtain the final encoder; Traverse each layer of the initialized decoder, get the index of the layer, and get the number of neurons in the current layer; Add a linear layer to the decoder. The parameters of the added linear layer are the number of neurons in the current layer and the number of neurons in the next layer. According to the name of the activation function used, add the activation function after each activation layer of the decoder after adding the linear layer; Determine whether the current layer is the last layer of the decoder. If the current layer is not the last layer of the decoder, add a dropout layer after the current layer according to the dropout rate to obtain the final decoder; The final encoder and the final decoder are cascaded to obtain the autoencoder network structure.

4. The method for identifying and handling abnormalities of an all-terrain vehicle roll cage according to claim 2, characterized in that: Obtain the historical strain dataset of the roll cage and obtain the training dataset based on the dataset configuration file, including: Build a data loader for PyTorch based on a class called PyODDataset; Acquiring data set attributes based on the historical strain data set; the data set attributes include: a feature matrix of the data set and a label of the data set; The number of samples is obtained based on the number of rows of the feature matrix of the data set; Get sample index based on dataset label; Check whether the sample index is a tensor of the PyTorch data loader. If not, do nothing. If yes, convert the sample index into a list and get the corresponding sample from the feature matrix of the dataset according to the sample index. Check whether the obtained samples have mean and standard deviation. If not, no processing is performed. If yes, the obtained samples are standardized, and the standardized samples and the index corresponding to the samples are saved to generate a training data set.

5. The method for identifying and handling abnormalities of an all-terrain vehicle roll cage according to claim 4, characterized in that: The training process configuration file is used to train the autoencoder network structure based on the training data set, specifically including: Determine the mean and standard deviation of the input data in the training data set, and initialize the PyODDataset object using the mean and standard deviation of the input data; Pass the initialized PyODDataset object to the PyTorch data loader to batch load the training data in the training data set; Call the _train_autoencoder method to train the autoencoder network structure using the batch loaded training data, and use the autoencoder network structure corresponding to the autoencoder network structure parameters with the lowest loss as the trained autoencoder network structure.

6. The method for identifying and handling abnormalities of an all-terrain vehicle roll cage according to claim 5, characterized in that: Call the _train_autoencoder method to train the autoencoder network structure using batch loaded training data, including: Create an array of all zeros to store the anomaly scores; Traverse the training data loaded by the PyTorch data loader and process each batch of training data; Passing the processed training data to the autoencoder network structure to obtain a model output; Determine the Euclidean distance between the input data and the model output in the training data, and use the Euclidean distance as an anomaly score; Storing the anomaly score in the all-zero array to obtain an anomaly score array; When the anomaly score is higher than three times the standard deviation of the anomaly score array, the model output corresponding to the anomaly score is marked as 1; When the anomaly score is less than or equal to three times the standard deviation of the anomaly score array, the model output corresponding to the anomaly score is marked as 0.

7. An all-terrain vehicle, the all-terrain vehicle being equipped with a roll cage, characterized in that: The all-terrain vehicle includes: an on-board computer, an inertial navigation module, a vehicle controller and a plurality of strain sensors; A plurality of the strain sensors are installed at set points of the roll cage; the plurality of strain sensors, the inertial navigation module and the vehicle controller are all connected to the onboard computer; The plurality of strain sensors are used to obtain strain data of the roll cage; the on-board computer is used to construct an abnormality detection model for the roll cage, and after inputting the strain data into the abnormality detection model for the roll cage, obtain an abnormality detection result; the inertial navigation module is used to obtain the three-axis acceleration data of the all-terrain vehicle according to a set time window when the abnormality detection result indicates that the roll cage is in an abnormal state; the on-board computer is also used to perform the following operations: determining velocity variance based on three-axis acceleration data of the ATV; When the speed variance is less than the state threshold, determining that the all-terrain vehicle is in a stationary state or a uniform speed driving state; Based on the three-axis acceleration data of the all-terrain vehicle, the acceleration vector in the IMU coordinate system of the all-terrain vehicle is obtained; The standard vector is obtained based on the vector of gravity acceleration in the world coordinate system and the rotation matrix between the IMU coordinate system and the world coordinate system; When the acceleration vector is equal to the standard vector, it is determined that the all-terrain vehicle is in a stationary state, and a seat belt automatic release function is triggered; the seat belt automatic release function is executed by a vehicle controller of the all-terrain vehicle; When the abnormal detection result is that the roll cage is in a normal state, the speed variance is greater than or equal to a state threshold, or the acceleration vector is not equal to the standard vector, no processing is performed.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for identifying and processing abnormalities of an all-terrain vehicle roll cage as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying and processing abnormalities of an all-terrain vehicle roll cage according to any one of claims 1 to 6 is implemented.