Automobile instruction abnormality detection method and device
By processing and training historical vehicle status data and combining it with neural network models and fine-tuning for specific vehicle models, the problems of excessive reliance on abnormal sample data and limited generalization capabilities in existing technologies are resolved, achieving efficient anomaly detection on different vehicle models.
Patent Information
- Application Number
- CN202311118057.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-08-31
AI Technical Summary
Existing vehicle command anomaly detection methods rely too heavily on abnormal sample data, have limited generalization capabilities, and are unable to effectively handle the differences between different vehicle models, resulting in poor results in complex and diverse vehicle driving modes.
By acquiring historical vehicle status data, processing and training it, we obtain the target training model. Combining the neural network model with fine-tuning for specific vehicle models, we can determine abnormalities in vehicle instructions. We use the neural network model to train the historical log key sequence, adjust the model according to the vehicle model, and use the log key sequence of a specific vehicle model for fine-tuning to determine abnormalities in log keys and parameter vectors.
It improves the accuracy of anomaly detection on specific vehicle models, can adapt to the differences between different vehicle models, and improves the detection effect in complex and diverse driving modes.
Smart Images

Figure CN117077062B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method and device for detecting abnormality in automobile instructions. Background Art
[0002] With the continuous development of intelligent vehicle technology, data-driven driving behavior monitoring, driving safety warnings, and remote control have become hot research topics. However, due to the diverse vehicle models and complex driving patterns in the automotive industry, conventional anomaly detection algorithms struggle to cope with this complexity. Traditional anomaly detection methods rely primarily on setting thresholds or using statistical methods. While these methods may be effective in simple scenarios, they often struggle in complex and changing real-world environments. This is primarily due to the fact that these methods require a large amount of anomaly sample data, which is not readily available in practice.
[0003] Recently, machine learning and deep learning technologies have demonstrated superior performance in the field of anomaly detection. Currently, the closest implementation to the present invention may be the use of deep learning networks for anomaly detection. This type of method first uses a large amount of normal data to train the network, and then uses the trained network to detect new data. If there is a significant difference between the new data and the training data, the data is considered to be anomaly. Although this method can achieve good results in some scenarios, it is global and fails to take into account the differences between different vehicle models. Therefore, it may not be ideal when dealing with complex and diverse vehicle driving patterns. If you try to train an anomaly detection model for a specific vehicle model alone, you will face the problem of insufficient data and an inability to cover all behavioral patterns.
[0004] The existing technology has the following main shortcomings:
[0005] (a) Over-reliance on abnormal sample data: Training and adjusting models often require a large amount of abnormal sample data. However, in actual operations, such data is not easy to obtain.
[0006] (b) Limited generalization ability: Since the training data is mainly collected based on specific models or specific scenarios, the trained model may not work well in other models or scenarios.
[0007] (c) Insufficient handling of differences among various vehicle models: Traditional global model methods do not fully consider the differences between different vehicle models, resulting in poor performance in handling complex and diverse vehicle driving patterns. Summary of the Invention
[0008] The purpose of the embodiments of the present invention is to provide a method for detecting abnormality in automobile instructions to solve the problems existing in the prior art.
[0009] In a first aspect, the present invention provides a method for detecting abnormal vehicle instructions, the method comprising:
[0010] Acquire historical vehicle status data; the historical vehicle status data includes vehicle models;
[0011] Processing the historical vehicle status data to obtain a historical time series log; the historical time series log includes a historical log key sequence and a historical parameter vector sequence for each historical log key; the historical log key sequence includes multiple historical log keys;
[0012] Training the historical log key sequence through a neural network model to obtain an original training model;
[0013] According to the vehicle model, the original training model is adjusted to obtain a target training model;
[0014] Train the historical parameter vector sequence of each historical log key to obtain the network model of each historical parameter vector;
[0015] Obtain the vehicle status data at time t-1, and process it to obtain the log key sequence at time t-1 and the parameter vector sequence of each log key in the log key sequence at time t-1;
[0016] Input the log key sequence of step size h at time t-1 into the target training model to determine whether the log key at time t is normal;
[0017] When the log key at time t is abnormal, the first abnormal result is output;
[0018] When the log key at time t is normal, the parameter vector of each log key in the log key sequence with a step size of h is input into the corresponding network model to determine whether the parameter vector of each log key is normal;
[0019] When abnormal, the second abnormal result is output.
[0020] In a possible implementation, processing the historical vehicle status data to obtain a historical time series log specifically includes:
[0021] sorting the collected vehicle status data in the vehicle status data set according to the timestamps of collecting the vehicle status data;
[0022] Performing state change screening on the vehicle state data, and retaining vehicle state data with state changes at consecutive time points;
[0023] Converting the retained vehicle state data into action data;
[0024] For each action data, convert the action data into a time series log;
[0025] Parse the time series log to obtain the log key and parameter vector.
[0026] In a possible implementation, adjusting the original training model according to the vehicle model to obtain the target training model specifically includes:
[0027] Remove the original fully connected layer, activation layer, Dropout layer and the last LSTM layer in the original training model;
[0028] Freeze the other layers of the original trained model;
[0029] Add new LSTM layers, Dropout layers, fully connected layers, and activation layers to the original trained model;
[0030] The target training model is obtained by updating the weights of the newly added LSTM layer, Dropout layer, fully connected layer, and activation layer.
[0031] In a possible implementation, training the historical parameter vector sequence of each historical log key to obtain a network model for each historical parameter vector specifically includes:
[0032] Input the parameter vector sequence into the network model to be trained to obtain the predicted parameter vector;
[0033] The error between the predicted parameter vector and the actual parameter vector is calculated using the squared error loss function;
[0034] When the error is within a preset range, it is determined that the network model to be trained is the network model of the historical parameter vector sequence.
[0035] In a possible implementation, inputting the log key sequence of step size h at time t-1 into the target training model and determining whether the log key at time t is normal specifically includes:
[0036] Divide the log key sequence at time t-1 into multiple log key sequences with a step length of h.
[0037] Input the log key sequence of the first step length h into the target training model, and predict the conditional probability that the log key after the first step length h is k under the condition w at time t;
[0038] When the conditional probability is not in the first C, the log key at time t is determined to be abnormal; where C is the set parameter threshold.
[0039] In a second aspect, the present invention provides a device for detecting abnormal vehicle instructions, the device comprising:
[0040] A historical vehicle status acquisition unit, the historical vehicle status acquisition unit is used to acquire historical vehicle status data; the historical vehicle status data includes vehicle models;
[0041] a processing unit, the processing unit being configured to process the historical vehicle status data to obtain a historical time series log; the historical time series log comprising a historical log key sequence and a historical parameter vector sequence for each historical log key; the historical log key sequence comprising a plurality of historical log keys;
[0042] A log key training unit, configured to train the historical log key sequence using a neural network model to obtain an original training model;
[0043] A model adjustment unit, configured to adjust the original training model according to the vehicle model to obtain a target training model;
[0044] A parameter vector training unit, wherein the parameter vector training unit is used to train a historical parameter vector sequence for each historical log key to obtain a network model for each historical parameter vector;
[0045] A current vehicle state acquisition unit, the current vehicle state acquisition unit is used to acquire vehicle state data at time t-1, and process to obtain a log key sequence at time t-1 and a parameter vector sequence of each log key in the log key sequence at time t-1;
[0046] a log key abnormality judgment unit, configured to input the log key sequence of step length h at time t-1 into the target training model and judge whether the log key at time t is normal;
[0047] a log key exception output unit, configured to output a first exception result when the log key at time t is abnormal;
[0048] A parameter vector abnormality judgment unit is used to input the parameter vector of each log key in the log key sequence with a step size of h into the corresponding network model when the log key at time t is normal, and judge whether the parameter vector of each log key is normal;
[0049] The parameter vector abnormality output unit is used to output a second abnormality result when an abnormality occurs.
[0050] In a possible implementation, the model adjustment unit adjusts the original training model to obtain the target training model, specifically including:
[0051] Remove the original fully connected layer, activation layer, Dropout layer and the last LSTM layer in the original training model;
[0052] Freeze the other layers of the original trained model;
[0053] Add new LSTM layers, Dropout layers, fully connected layers, and activation layers to the original trained model;
[0054] The target training model is obtained by updating the weights of the newly added LSTM layer, Dropout layer, fully connected layer, and activation layer.
[0055] In a third aspect, the present invention provides a computer server comprising: a memory, a processor, and a transceiver;
[0056] The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the method for detecting abnormal vehicle instructions according to any one of the first aspects;
[0057] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0058] In a fourth aspect, the present invention provides a chip system comprising a processor coupled to a memory, wherein the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the vehicle instruction anomaly detection method described in any one of the first aspects is implemented.
[0059] In a fifth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the vehicle instruction anomaly detection method described in any one of the first aspects.
[0060] By applying the vehicle command anomaly detection method provided by the embodiments of the present invention, a pre-trained model is trained using command data from a large dataset of normal driving, creating a general model capable of understanding and recognizing normal vehicle usage patterns. Furthermore, fine-tuning is performed based on specific vehicle models, thereby improving the accuracy of anomaly detection for those specific models. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic flow chart of a method for detecting abnormal vehicle instructions provided in the first embodiment of the present invention;
[0062] Figure 2 for Figure 1 Flowchart of step 120;
[0063] Figure 3 Flowchart for training log key sequence;
[0064] Figure 4 This is a schematic diagram of the structure of a vehicle instruction anomaly detection device provided in the second embodiment of the present invention;
[0065] Figure 5 A schematic diagram of the computer server structure provided in the third embodiment of the present invention;
[0066] Figure 6 A schematic diagram of the chip system structure provided in the fourth embodiment of the present invention;
[0067] Figure 7 This is a schematic diagram of the chip system structure provided in Example 5 of the present invention. DETAILED DESCRIPTION
[0068] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0069] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0070] Example 1
[0071] The first embodiment of the present invention provides a method for detecting abnormal vehicle instructions. The execution subject of this application is a server or a processor of the vehicle itself, such as a processor of an autonomous driving vehicle or other device with computing and processing functions, such as Figure 1 As shown, the method includes the following steps:
[0072] Step 110, obtaining historical vehicle status data; the historical vehicle status data includes vehicle models;
[0073] Specifically, the vehicle status data refers to the status of components on the vehicle. The vehicle status data can be collected by collecting information from various sensors on vehicles of different models, such as speed sensors, temperature sensors, etc., or vehicle controllers, body controllers, and steering systems. For example, status data such as turning on the air conditioner, stepping on the brake pedal, and opening the driver's door can be collected.
[0074] Historical vehicle status data refers to vehicle status data collected before the current state. To distinguish between the model pre-training process and anomaly detection using a trained model, the vehicle status data during the pre-training process is referred to as historical vehicle status data.
[0075] Step 120: Process the historical vehicle status data to obtain a historical time series log; the historical time series log includes a historical log key sequence and a historical parameter vector sequence for each historical log key; the historical log key sequence includes multiple historical log keys;
[0076] For details, see Figure 2 Step 120, including steps 1201 through 1205, processes historical vehicle status data to generate time series logs. To distinguish between the pre-training process and the model application process, the time series logs from the pre-training process are referred to as historical time series logs. Steps 1201 through 1205 are described in detail below.
[0077] Step 1201, sorting the collected vehicle status data in the vehicle status data set according to the timestamp of collecting the vehicle status data;
[0078] Specifically, the car status data is sorted according to the timestamp to ensure the time series consistency of the data. The collected car status data set is shown in Table 1:
[0079] time Battery temperature Tire pressure Braking range 08:00:00 40 200 0 08:00:05 50 200 0 08:00:10 50 198 0 08:00:15 50 198 20 08:00:20 50 198 30 08:00:25 40 200 35
[0080] Table 1
[0081] Step 1202: Screen the vehicle status data for status changes, and retain the vehicle status data that have status changes at consecutive time points.
[0082] Wherein, step 1202 includes:
[0083] Cleaning the vehicle status dataset;
[0084] For the cleaned car status data set, determine whether the car status data of two adjacent time nodes have changed according to the time node. If there is a change, retain the car status data of the two adjacent time nodes;
[0085] When no change occurs, the fields of the vehicle status data at two adjacent time nodes are set to null values.
[0086] Specifically, vehicle status data consists of multiple fields, each with a value. Each field's values are normalized and cleaned, deleting useless status records, such as null values. Status change filtering is then performed. Specifically, the sorted vehicle status dataset is traversed and the vehicle status data at each time point is checked. If a field in the vehicle status data changes at consecutive time points, it is retained; otherwise, it is set to null. This preserves data in the vehicle status dataset that has undergone status changes.
[0087] For example, referring to Table 1, the battery temperature detected at 08:00:00 is 40°C, the battery temperature at 08:00:05 is 50°C, the battery temperatures at 08:00:10, 08:00:15, and 08:00:20 are all 50°C, and the battery temperature at 08:00:25 is 40°C. This indicates that the battery temperature changed between 08:00:00 and 08:00:05 and 08:00:20 and 08:00:25. In this case, the battery temperatures from 08:00:00 to 08:00:05 and 08:00:20 to 08:00:25 are retained, and the battery temperatures at 08:00:10 and 08:00:15 are deleted.
[0088] Step 1203, converting the retained vehicle state data into action data;
[0089] Specifically, dense vehicle state data is converted into sparse action data. This abstracts changes in vehicle state data into specific actions. This action data includes a time and a specific state change action. The action data within a time period can be represented by an action curve that changes over time. For example, referring to Table 1, the converted action data is "battery temperature rises from 08:00:00 to 08:00:05" and "battery temperature decreases from 08:00:20 to 08:00:25." For tire pressure, the action data is "tire pressure decreases from 08:00:05 to 08:00:10" and "tire pressure increases from 08:00:20 to 08:00:25." For braking range, the action data is "brake range increases from 08:00:05 to 08:00:20" and "brake range increases from 08:00:20 to 08:00:25."
[0090] Step 1204 , for each action data, convert the action data into a time series log;
[0091] Specifically, for the case where each time node has more than one action data, for example, referring to Table 1, at 08:00:05, the action data includes battery temperature and tire pressure. For each action data, each action data can be reorganized into a one-dimensional time series log. The generated one-dimensional time series log is as follows:
[0092] 08:00:05 The battery temperature increased to 50°C;
[0093] 08:00:10 Tire pressure dropped to 198 kPa;
[0094] 08:00:15 Press the brake pedal 20 degrees;
[0095] 08:00:20 Press the brake pedal 30 degrees;
[0096] For multiple action data at the same time node, for example, at 08:00:25, there are three action data: battery temperature, tire pressure, and brake pedal. Multiple time series logs can be sorted according to the preset field priority. For example, if the preset field priority is battery temperature, tire pressure, and brake pedal in descending order, the time series log at 08:00:25 will be as follows:
[0097] 08:00:25 The battery temperature dropped to 40°C;
[0098] 08:00:25 Tire pressure increased to 200 kPa;
[0099] 08:00:25 The brake pedal was pressed 35 degrees;
[0100] After traversing all action data, a time series log is generated. This time series log fully preserves abnormal changes. For example, a time series log may show that the brake pedal is pressed 20 degrees in the first second, 30 degrees in the second second, and 35 degrees in the third second.
[0101] This application can obtain a total time series log of a preset duration based on the time series log of each action.
[0102] Specifically, each action data corresponds to a time series log. Within a preset time period, since there is at least one action, the time series logs within the time period can be aggregated to obtain a total time series log.
[0103] Specifically, each action corresponds to a time series log. Within a preset time period, since there is at least one action, the time series logs within the time period can be aggregated to obtain a time series log of the preset time period.
[0104] Step 1205: parse the time series log to obtain the log key and parameter vector;
[0105] The above-mentioned time series logs can be stored in the form of data tables in the database. For the convenience of storage and processing, the time series logs can be parsed to obtain log keys and parameter vectors. The log key represents the specific action performed, and the parameter vector represents the execution time and execution intensity of the action. The two parts of the time series log are convenient for subsequent anomaly detection.
[0106] Specifically, as shown in Table 2, the parameter vector consists of a timestamp and a parameter value, and the parameter value can be empty.
[0107]
[0108] Table 2
[0109] Step 130: training the historical log key sequence using a neural network model to obtain an original training model;
[0110] Specifically, the log key set is a finite set of all log key types. The current log key in the log key sequence is strongly dependent on the most recent log key that appeared before it. Based on the dependencies between adjacent log keys, historical log key sequences can be trained to generate a pre-trained model.
[0111] Specifically, a neural network model can be used to learn historical log key sequences to extract behavioral patterns. The neural network model can be a Long Short-Term Memory (LSTM) network. The number of LSTM layers depends on the size and complexity of the pre-trained log key sequence. The larger the log key sequence, the richer the features, and the more LSTM layers are needed.
[0112] First, the input log key sequence is processed through a one-dimensional convolutional layer to extract local features in the sequence. These extracted features are then sent to the LSTM layer for processing, because LSTM has the ability to learn and remember long-term dependencies in the log key sequence. Next, a custom attention layer is used to assign different weights to the output of the LSTM, which can emphasize more important information. Finally, this weighted information is sent to the fully connected layer for classification. The neural network structure is as follows Figure 3 shown.
[0113] When training the pre-trained model, the log key sequence is based on offline vehicle status data of various models. The training set contains thousands of field data records for dozens of vehicles over the past month.
[0114] Step 140: adjusting the original training model according to the vehicle model to obtain a target training model;
[0115] Specifically, while different types of vehicles share similar driving patterns, they differ significantly in specific driving details. For example, sedans and trucks may have significant differences in driving pattern logs, such as steering and braking commands. Suppose a pre-trained model has been trained using 100 commercially available vehicle models during the pre-training phase. However, when a new vehicle model is released, directly applying the pre-trained model to the new model will result in poor performance due to differences in the data fields recorded by its sensors and the potential for new driving patterns. Training a dedicated model for the new model will result in insufficient data and insufficient data to cover all abnormal scenarios. Therefore, the pre-trained model can be fine-tuned to accurately adapt to specific driving patterns and environments.
[0116] The specific fine-tuning steps include:
[0117] First, remove the layers.
[0118] Specifically, the original fully connected layer, activation layer, Dropout layer and the last LSTM layer are removed from the original training model.
[0119] Next, freeze the model layer.
[0120] Specifically, in order to retain the knowledge learned in the pre-training stage, the other layers of the original training model are frozen, that is, the weights of the frozen layers will not be updated in the subsequent training process.
[0121] Next, add a new layer.
[0122] Specifically, new LSTM layers, Dropout layers, fully connected layers, and activation layers are added to the pre-trained model. The initial values of the weights of these newly added layers are random and will be updated during the subsequent fine-tuning process.
[0123] Finally, fine-tune the log key sequence using the specific car model.
[0124] Specifically, the newly added network layers are fine-tuned using the log key sequence of a specific vehicle model. This process is similar to the training process of the pre-trained model. Since most of the layers of the pre-trained model have been frozen, only the weights of the newly added layers are updated, ensuring that the trained target training model is more adapted to the driving mode and environment of the specific vehicle model.
[0125] Step 150 , training the historical parameter vector sequence of each historical log key to obtain a network model for each historical parameter vector;
[0126] Specifically, certain abnormal situations can cause parameter vector anomalies. For example, in a high-temperature cabin, remotely turning on the air conditioning and heating mode. While "turning on the air conditioning" is a log key and clearly presents no anomalies, the corresponding parameter vector "heating" is. These anomalies arise from the sequence of parameter vectors associated with different log keys, rather than the log keys themselves, making them crucial for performance monitoring and anomaly detection.
[0127] This application can regard the parameter vector corresponding to each log key as a multidimensional time series, so the problem can be simplified to multidimensional time series anomaly detection. For example, for a log key, such as temperature adjustment, the feature vector can be the temperature data at each moment, so that an independent neural network model is constructed for the parameter vector sequence of each log key. In this neural network model, the input is a sequence of parameter value vectors corresponding to a certain log key, and the values in the vector are normalized using the mean and standard deviation of all values of the same parameter vector in the training data. Among them, normalization is performed on each parameter vector in the parameter vector sequence. Specifically, the mean value of the parameter vector at the corresponding position in the training data is subtracted from each parameter vector, and divided by its standard deviation, so as to achieve the purpose of normalization.
[0128] The output of the neural network model for a parameter vector sequence is a real-valued vector. The next parameter vector is predicted based on the historical parameter vector sequence of the most recent sliding window size. The training objective is to minimize the error between the predicted parameter vector and the actual parameter vector. For multidimensional time series data, the neural network model is evaluated using a squared loss function. When the error between the actual parameter vector and the predicted parameter vector output by the neural network model is within a preset range, the neural network model is considered trained and used as the network model for the parameter vector sequence. During the anomaly detection phase after training, the error is measured by calculating the difference between the predicted and actual parameter vectors, rather than using a set threshold for anomaly detection. The error between the predicted and actual parameter vectors follows a Gaussian distribution. Therefore, if the error between the predicted and observed value vectors is within the high confidence interval of the Gaussian distribution, the parameter vector for the input log key is considered normal; otherwise, it is considered anomaly.
[0129] The actual parameter vector typically refers to the parameter vector actually recorded by the vehicle. The predicted parameter vector is the output predicted by the neural network model based on the input parameter vector sequence. Therefore, if the neural network model's predicted parameter vector differs significantly from the actual parameter vector, this indicates an anomaly in the actual parameter vector. This is because, after extensive training, the neural network model has developed high-accuracy prediction capabilities. For example, if the input parameter vector sequence is the vehicle interior temperature {22°C, 21°C, 23°C, 20°C, 22°C}, the neural network model predicts a temperature of 22°C at the next time point, but the actual temperature recorded by the vehicle's sensors at that time is 30°C. This significant deviation is clearly an anomaly, likely caused by a sensor failure. In this case, the difference between the predicted and actual parameter vectors can be used to determine if the parameter vector is abnormal.
[0130] Step 160 , obtaining the vehicle state data at time t-1, and processing the data to obtain the log key sequence at time t-1 and the parameter vector sequence of each log key in the log key sequence at time t-1;
[0131] Specifically, in step 160, the obtained vehicle status data is processed as in step 120 to obtain a corresponding log key sequence and a parameter vector sequence for each log key. The specific processing is similar to step 120 and will not be repeated here.
[0132] Step 170: Input the log key sequence of step length h at time t-1 into the target training model to determine whether the log key at time t is normal;
[0133] Specifically, step 170 includes:
[0134] Divide the log key sequence at time t-1 into multiple log key sequences with a step length of h.
[0135] Input the log key sequence of the first step length h into the target training model, and predict the conditional probability that the log key after the first step length h is k under the condition w at time t;
[0136] When the conditional probability is not in the first C, the log key at time t is determined to be abnormal; where C is the set parameter threshold.
[0137] When the log key at time t is abnormal, execute step 180 ; when the parameter key at time t is normal, execute step 190 .
[0138] Step 180: When the log key at time t is abnormal, output a first abnormal result;
[0139] Specifically, the first abnormal result may be a log key outputting the abnormality, or a reminder message.
[0140] Step 190: When the log key at time t is normal, the parameter vector of each log key in the log key sequence with a step size of h is input into the corresponding network model to determine whether the parameter vector of each log key is normal.
[0141] Specifically, the parameter vector sequence is input into the trained network model corresponding to the parameter vector sequence of the log key, and then a determination is made as to whether the parameter vector sequence is normal. If the parameter vector sequence is normal, the determination is continued for the next log key of h steps, until the determination is complete. If the parameter vector sequence is abnormal, step 200 is executed.
[0142] Step 200: When an abnormality occurs, output a second abnormal result.
[0143] Specifically, the second abnormal result can be information indicating an abnormality, such as: the log key is normal, but the parameter vector is abnormal. The second abnormal result can also include: the location of the abnormality, the abnormal data, the predicted data, etc. Subsequently, the test at the next time point will be continued.
[0144] By applying the vehicle command anomaly detection method provided by the embodiments of the present invention, a pre-trained model is trained using command data from a large dataset of normal driving, creating a general model capable of understanding and recognizing normal vehicle usage patterns. Furthermore, fine-tuning is performed based on specific vehicle models, thereby improving the accuracy of anomaly detection for those specific models.
[0145] Example 2
[0146] The second embodiment of the present invention provides a vehicle instruction abnormality detection device, such as Figure 4 As shown, the device includes: a historical vehicle state acquisition unit 400, a processing unit 410, a log key training unit 420, a model adjustment unit 430, a parameter vector training unit 440, a current vehicle state acquisition unit 450, a log key abnormality judgment unit 460, a log key abnormality output unit 470, a parameter vector abnormality judgment unit 480, and a parameter vector abnormality output unit 490.
[0147] The historical vehicle status acquisition unit 400 is used to acquire historical vehicle status data; the historical vehicle status data includes vehicle models;
[0148] The processing unit 410 is used to process the historical vehicle status data to obtain a historical time series log; the historical time series log includes a historical log key sequence and a historical parameter vector sequence for each historical log key; the historical log key sequence includes multiple historical log keys;
[0149] The log key training unit 420 is used to train the historical log key sequence through a neural network model to obtain an original training model;
[0150] The model adjustment unit 430 is used to adjust the original training model according to the vehicle model to obtain a target training model;
[0151] The parameter vector training unit 440 is used to train the historical parameter vector sequence of each historical log key to obtain a network model for each historical parameter vector;
[0152] The current vehicle state acquisition unit 450 is used to acquire vehicle state data at time t-1, and process to obtain a log key sequence at time t-1 and a parameter vector sequence of each log key in the log key sequence at time t-1;
[0153] The log key abnormality judgment unit 460 is used to input the log key sequence of step length h at time t-1 into the target training model to judge whether the log key at time t is normal;
[0154] The log key exception output unit 470 is used to output a first exception result when the log key at time t is abnormal;
[0155] The parameter vector abnormality judgment unit 480 is used to input the parameter vector of each log key in the log key sequence with a step size of h into the corresponding network model when the log key at time t is normal, and judge whether the parameter vector of each log key is normal;
[0156] The parameter vector abnormality output unit 490 is configured to output a second abnormality result when an abnormality occurs.
[0157] Furthermore, the processing unit 410 processes the historical vehicle status data to obtain a historical time series log, specifically including: sorting the collected vehicle status data in the vehicle status data set according to the timestamp of collecting the vehicle status data; filtering the vehicle status data for status changes, and retaining the vehicle status data with status changes at consecutive time points; converting the retained vehicle status data into action data; for each action data, converting the action data into a time series log; and parsing the time series log to obtain a log key and a parameter vector.
[0158] Furthermore, the model adjustment unit 430 adjusts the original training model according to the vehicle model to obtain the target training model, which specifically includes: removing the original fully connected layer, activation layer, Dropout layer and the last LSTM layer in the original training model; freezing the other layers of the original training model; adding new LSTM layers, Dropout layers, fully connected layers and activation layers to the original training model; and updating the weights of the newly added LSTM layers, Dropout layers, fully connected layers and activation layers to obtain the target training model.
[0159] Furthermore, the parameter vector training unit 440 trains the historical parameter vector sequence of each historical log key to obtain a network model for each historical parameter vector, specifically including:
[0160] The parameter vector sequence is input into the network model to be trained to obtain a predicted parameter vector; the error between the predicted parameter vector and the actual parameter vector is calculated by the square error loss function; when the error is within a preset range, the network model to be trained is determined to be the network model of the historical parameter vector sequence.
[0161] Furthermore, the log key abnormality judgment unit 460 inputs the log key sequence of step length h at time t-1 into the target training model, and judges whether the log key at time t is normal, specifically including:
[0162] The log key sequence at time t-1 is divided into multiple log key sequences with a step length of h. The log key sequence with the first step length h is input into the target training model to predict the conditional probability that the log key after the first step length h is k under the condition w at time t. If the conditional probability is not in the first C, the log key at time t is determined to be abnormal. C is the set parameter threshold.
[0163] Example 3
[0164] The third embodiment of the present invention provides a computer server, such as Figure 5 As shown, it includes: a memory, a processor and a transceiver;
[0165] The processor is configured to be coupled to the memory, read and execute instructions in the memory, and implement any one of the vehicle instruction anomaly detection methods provided in the first embodiment above;
[0166] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0167] Example 4
[0168] The fourth embodiment of the present invention provides a chip system, such as Figure 6 As shown, it includes a processor, a coupling between the processor and a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, any one of the vehicle instruction anomaly detection methods provided in Example 1 is implemented.
[0169] Example 5
[0170] A fifth embodiment of the present invention provides a computer-readable storage medium, such as Figure 7 As shown, it includes a program or instruction. When the program or instruction is run on a computer, any one of the vehicle instruction anomaly detection methods provided in Example 1 is implemented.
[0171] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0172] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0173] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting abnormal vehicle instructions, characterized in that: The method comprises: Obtaining historical vehicle status data; the historical vehicle status data includes vehicle models; different vehicle models have different data fields and driving modes; Processing the historical vehicle status data to obtain a historical time series log; the historical time series log includes a historical log key sequence and a historical parameter vector sequence for each historical log key; The history log key sequence includes a plurality of history log keys; Training the historical log key sequence through a neural network model to obtain an original training model; According to the vehicle model, the original training model is adjusted to obtain a target training model; Train the historical parameter vector sequence of each historical log key to obtain the network model of each historical parameter vector; Obtain the vehicle status data at time t-1, and process it to obtain the log key sequence at time t-1 and the parameter vector sequence of each log key in the log key sequence at time t-1; Input the log key sequence of step size h at time t-1 into the target training model to determine whether the log key at time t is normal; When the log key at time t is abnormal, the first abnormal result is output; When the log key at time t is normal, the parameter vector of each log key in the log key sequence with a step size of h is input into the corresponding network model to determine whether the parameter vector of each log key is normal; When an exception occurs, the second exception result is output; The adjusting of the original training model according to the vehicle model to obtain the target training model specifically includes: Remove the original fully connected layer, activation layer, Dropout layer and the last LSTM layer in the original training model; Freeze the other layers of the original trained model; Add new LSTM layers, Dropout layers, fully connected layers, and activation layers to the original trained model; The weights of the newly added LSTM layer, Dropout layer, fully connected layer, and activation layer are updated. The weights of the frozen layers are not updated. The target training model is obtained by fine-tuning using the log key sequence of the specific vehicle model. The processing of the historical vehicle status data to obtain a historical time series log specifically includes: Sort the vehicle status data in the collected vehicle status data set according to the timestamp of collecting the vehicle status data; Performing state change screening on the vehicle state data, and retaining vehicle state data with state changes at consecutive time points; Converting the retained vehicle state data into action data; For each action data, convert the action data into a time series log; Parse the time series log to obtain the log key and parameter vector; The step of filtering the vehicle status data for status changes and retaining the vehicle status data having status changes at consecutive time points specifically includes: Cleaning the vehicle status dataset; For the cleaned car status data set, based on the time nodes, determine whether the car status data of two adjacent time nodes have changed. If there is a change, the car status data of the two adjacent time nodes will be retained; if there is no change, the fields of the car status data of the two adjacent time nodes will be set to null values; The step of inputting the log key sequence of step size h at time t-1 into the target training model and determining whether the log key at time t is normal specifically includes: Divide the log key sequence at time t-1 into multiple log key sequences with a step length of h. Input the log key sequence of the first step length h into the target training model, and predict the conditional probability that the log key after the first step length h is k under the condition w at time t; When the conditional probability is not in the first C, the log key at time t is determined to be abnormal; where C is the set parameter threshold.
2. The method according to claim 1, characterized in that The training of the historical parameter vector sequence of each historical log key to obtain the network model of each historical parameter vector specifically includes: Input the parameter vector sequence into the network model to be trained to obtain the predicted parameter vector; The error between the predicted parameter vector and the actual parameter vector is calculated using the squared error loss function; When the error is within a preset range, it is determined that the network model to be trained is the network model of the historical parameter vector sequence.
3. A vehicle instruction abnormality detection device, characterized in that: The device comprises: A historical vehicle status acquisition unit, the historical vehicle status acquisition unit is used to acquire historical vehicle status data; the historical vehicle status data includes vehicle models; different vehicle models have different data fields and driving modes; a processing unit, the processing unit being configured to process the historical vehicle status data to obtain a historical time series log; the historical time series log comprising a historical log key sequence and a historical parameter vector sequence for each historical log key; the historical log key sequence comprising a plurality of historical log keys; The processing of the historical vehicle status data to obtain a historical time series log specifically includes: Sort the vehicle status data in the collected vehicle status data set according to the timestamp of collecting the vehicle status data; Performing state change screening on the vehicle state data, and retaining vehicle state data with state changes at consecutive time points; Converting the retained vehicle state data into action data; For each action data, convert the action data into a time series log; Parse the time series log to obtain the log key and parameter vector; The step of filtering the vehicle status data for status changes and retaining the vehicle status data having status changes at consecutive time points specifically includes: Cleaning the vehicle status dataset; For the cleaned car status data set, determine whether the car status data of two adjacent time nodes have changed according to the time node. If there is a change, retain the car status data of the two adjacent time nodes; When no change occurs, the fields of the car status data at two adjacent time nodes are set to null values; A log key training unit, configured to train the historical log key sequence using a neural network model to obtain an original training model; A model adjustment unit, configured to adjust the original training model according to the vehicle model to obtain a target training model; A parameter vector training unit, wherein the parameter vector training unit is used to train a historical parameter vector sequence for each historical log key to obtain a network model for each historical parameter vector; A current vehicle state acquisition unit, the current vehicle state acquisition unit is used to acquire vehicle state data at time t-1, and process to obtain a log key sequence at time t-1 and a parameter vector sequence of each log key in the log key sequence at time t-1; a log key abnormality judgment unit, configured to input the log key sequence of step length h at time t-1 into the target training model and judge whether the log key at time t is normal; The step of inputting the log key sequence of step size h at time t-1 into the target training model and determining whether the log key at time t is normal specifically includes: Divide the log key sequence at time t-1 into multiple log key sequences with a step length of h. Input the log key sequence of the first step length h into the target training model, and predict the conditional probability that the log key after the first step length h is k under the condition w at time t; When the conditional probability is not in the first C, the log key at time t is determined to be abnormal; where C is the set parameter threshold; a log key exception output unit, configured to output a first exception result when the log key at time t is abnormal; A parameter vector abnormality judgment unit is used to input the parameter vector of each log key in the log key sequence with a step size of h into the corresponding network model when the log key at time t is normal, and judge whether the parameter vector of each log key is normal; A parameter vector abnormality output unit, wherein the parameter vector abnormality output unit is configured to output a second abnormality result when an abnormality occurs; The model adjustment unit adjusts the original training model according to the vehicle model to obtain the target training model, specifically including: Remove the original fully connected layer, activation layer, Dropout layer and the last LSTM layer in the original training model; Freeze the other layers of the original trained model; Add new LSTM layers, Dropout layers, fully connected layers, and activation layers to the original trained model; The target training model is obtained by updating the weights of the newly added LSTM layer, Dropout layer, fully connected layer, and activation layer. The weights of the frozen layers are not updated. The log key sequence of the specific vehicle model is used for fine-tuning.
4. A computer server, characterized in that: include: memory, processors, and transceivers; The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the vehicle instruction anomaly detection method according to any one of claims 1 to 2; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
5. A chip system, characterized in that: The invention comprises a processor coupled to a memory, wherein the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the vehicle instruction abnormality detection method according to any one of claims 1 to 2 is implemented.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the vehicle instruction anomaly detection method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Log anomaly detection model training method, device and equipment
CN115269304A
Remote log diagnosis method and device, electronic equipment and storage medium
CN116030548A