Disclosure of Invention
The invention aims to provide a method, a device and a storage medium for analyzing the driving behavior of a fuel cell automobile, aiming at solving the problem that no method specially analyzes the influence of the driving behavior on a fuel cell stack and cannot distinguish and classify the driving behavior at present.
The technical scheme of the invention is as follows: a fuel cell automobile driving behavior analysis method specifically comprises the following steps:
acquiring a driving behavior data set in the running process of an automobile;
preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector;
inputting the training set input vector into a CNN-BilSTM network for training to obtain a trained network model;
and inputting the test set input vector into a trained network model for testing to obtain a classification result of the driving behavior of the fuel cell vehicle.
The method for analyzing the driving behavior of the fuel cell automobile comprises the steps of acquiring driving behavior data in the running process of the automobile, and collecting the driving behavior data in the running process of the fuel cell automobile through a state monitoring sensor arranged on the fuel cell automobile.
The method for analyzing the driving behavior of the fuel cell vehicle comprises the following steps of preprocessing a driving behavior data set in the running process of the vehicle to obtain a training set input vector and a test set input vector:
s 21: cleaning the driving behavior data set in the running process of the automobile;
s 22: carrying out data standardization processing on the cleaned driving behavior data set in the running process of the automobile;
s 23: and dividing the driving behavior data set in the automobile running process after the standardization treatment into a training set and a testing set according to a certain proportion to obtain a training set input vector and a testing set input vector.
The method for analyzing the driving behavior of the fuel cell vehicle comprises the following steps in s 21: deleting abnormal data which are not in the preset data value range according to the preset data value range; deleting data which have no influence on data mining and have no preset value in driving behavior data set occupation ratio in the running process of the automobile; and deleting the unique data identification which is irrelevant to the final classification result in the driving behavior data set in the automobile running process.
The method for analyzing the driving behavior of the fuel cell vehicle comprises the steps of carrying out data standardization processing on the cleaned driving behavior data set in the running process of the vehicle, and carrying out maximum and minimum value normalization processing on the cleaned driving behavior data set in the running process of the vehicle.
The fuel cell automobile driving behavior analysis method comprises the following steps of inputting the training set input vector into a CNN-BilSTM network for training to obtain a trained network model:
s 31: constructing a CNN-BilSTM network;
s 32: and inputting the training set input vector into the constructed CNN-BilSTM network for training to obtain a trained model.
The fuel cell automobile driving behavior analysis method comprises the following steps of:
s 31-1: constructing a convolutional neural network;
s 31-2: building two layers of BilSTM networks on the basis of the convolutional neural network;
s 31-3: and building a softmax layer on the basis of the convolutional neural network and the two-layer BilsTM network.
The fuel cell automobile driving behavior analysis method is characterized in that a dropout layer is added in a CNN-BilSTM network.
A fuel cell automobile driving behavior analysis device, comprising:
the driving behavior data set acquisition module is used for acquiring a driving behavior data set in the running process of the automobile;
the data set preprocessing module is used for preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector;
the CNN-BilSTM network training module inputs the training set input vector into a CNN-BilSTM network for training to obtain a trained network model;
and the fuel cell automobile driving behavior classification module inputs the test set input vector into a trained network model for testing to obtain a classification result of the fuel cell automobile driving behavior.
A storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform any of the methods described above.
The invention has the beneficial effects that: the invention provides a fuel cell automobile driving behavior analysis method, a device and a storage medium, which are used for collecting actual data such as speed, current and voltage of a motor, current and voltage of a fuel cell group and the like collected on a proton exchange membrane fuel cell automobile and processing the data by utilizing a combination algorithm of a convolutional neural network and a bidirectional LSTM network; the method utilizes the full connection layer and the Softmax layer to analyze and mine driving data, utilizes the data to classify fuel automobile galvanic pile causing harm behaviors such as frequent start-stop, overload, idle speed and continuous variable load, classifies whether the current driving behavior state is harmful to the galvanic pile and which kind of the galvanic pile belongs to the current driving behavior state to obtain a classification result, and utilizes the classification result to supervise and remind a driver in real time.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, a method for analyzing driving behavior of a fuel cell vehicle specifically includes the following steps:
s1: and acquiring a driving behavior data set in the running process of the automobile.
In the running process of the fuel cell automobile, a large number of state monitoring sensors arranged on the fuel cell automobile are used for collecting driving behavior data in the running process of the fuel cell automobile, and the collected driving behavior data in the running process of the fuel cell automobile is sent to a system database by a terminal data collector (namely, the state monitoring sensors) for storage, so that when the driving behavior of the automobile is analyzed, the driving behavior data can be inquired from the system database and directly exported as required.
S2: preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector: because the data characteristics collected by the original data set are many and there are missing values and abnormal data beyond the normal range, the data set is firstly preprocessed, and the method specifically comprises the following steps:
2.1. and cleaning the driving behavior data set in the running process of the automobile.
(1) According to the knowledge of the existing fuel cell vehicle, an approximate value range of data is preset, and abnormal data obviously not in the range is eliminated.
(2) Some data category fields in the data set are null, for the null fields, firstly, the null fields are selected, firstly, whether the data have influence on the data mining effect is judged (the effect can be realized by presetting some threshold values), secondly, the proportion of the null fields in the total data is also considered, and if the null fields have little practical significance and the proportion is not high, the data can be cleaned.
(3) The data set also has data unique Identification (for example, Vehicle VIN (Vehicle Identification Number), license plate information, etc.), and categories irrelevant to the final classification result, and the data of the categories are deleted.
Through data deletion operation, the efficiency of the algorithm can be improved, the running time is shortened, and adverse effects of abnormal data on data mining can be avoided.
The driving behavior data set in the running process of the automobile is cleaned, and the obtained data set types are shown in table 1:
traceTime
|
time of data acquisition
|
totalCurrent(A)
|
Total current of power battery (A)
|
totalVoltage(V)
|
Power battery assemblyVoltage (V)
|
Soc(%)
|
Power battery SOC (%)
|
fuelBatteryCurrent(A)
|
Fuel cell current (A)
|
fuelBatteryVoltage(V)
|
Voltage (V) of fuel cell
|
fuelBatteryPower(kW)
|
Fuel cell power (kW)
|
hydrogenMaxPressure(MPa)
|
Highest pressure of hydrogen (MPa)
|
hydrogenSystemMaxTemperature(℃)
|
Maximum temperature in Hydrogen System (. degree. C.)
|
vehicleSpeed(KM/H)
|
Vehicle speed (KM/H)
|
Mileage(KM)
|
Mileage displayed by watch (KM)
|
motorStatus
|
State of the electric machine
|
motorVoltage(V)
|
Driving machine voltage (V)
|
motorBusCurrent(A)
|
DC bus current of motor controller (A) |
TABLE 1 data set feature classes retained after cleaning
2.2. And carrying out data standardization processing on the cleaned driving behavior data set in the running process of the automobile.
And (3) obtaining the cleaned data set, and then carrying out standardization processing (realized through normalization processing) on the data, wherein the specific values in the data are different in dimension and have large size difference, if the data are directly input into a deep learning network, the data values with higher values occupy large weight in comprehensive analysis, the effect of indexes with low data values is weakened, and the data mining result is greatly influenced. Therefore, in order to ensure the reliability of the result, the original data needs to be normalized, the acquired data is scaled in proportion, and the data is put into a small undetermined interval, so that the unit limitation of the data can be removed, and the data is converted into a dimensionless pure numerical value, which is convenient for the comparison and weighting of indexes of different units or orders.
According to the technical scheme, the cleaned data of the driving behavior data set in the running process of the automobile is preprocessed by using the maximum and minimum normalization, the data in the data set needs to be normalized to the range of [ -1,1], and the principle of a maximum and minimum normalization formula is as follows:
for sequences (sequence is data of one of the data set feature classes retained after washing in index 1)
,
……,
And performing transformation, wherein the transformation formula is as follows:
novel sequences
[-1, 1]And no dimension exists, the scheme performs Min-Max normalization processing on the data;
is the current value at a certain point in time in the sequence,
is the average of the data in the sequence,
the maximum value of the data in the sequence,
is the minimum of the data in the sequence. Such as normalizing the vehicle speed in the input data,
is the vehicle speed at a point in time in the sequence,
is the average value of the vehicle speed,
is the maximum value of the vehicle speed,
is the minimum value of the vehicle speed, and the normalization result at the moment can be obtained after the processing of the formula
。
After the data cleaning operation, the data in the data set is normalized, so that the data value falls in the range of [ -1,1 ]. And the convergence speed of the normalized lifting model is utilized to eliminate the influence caused by different dimensions.
2.3. And dividing the driving behavior data set in the running process of the automobile after normalization processing into a training set and a testing set according to a certain proportion to obtain a training set input vector and a testing set input vector. In the technical scheme, the driving behavior data set in the running process of the automobile after normalization processing is according to the following steps of 8: the scale of 2 is divided into a training set and a test set.
In the deep learning network of the scheme, the input vector needs to be a tensor, so a fixed sliding window is adopted to sample in a training data set and a testing data set: in the scheme, the input of the deep network is a matrix of [5 multiplied by n ], and 5 is a time step (timestamp). The fuel cell vehicle data set is sampled every 10 seconds, 50 seconds are selected as the length of a sliding window, and the width of the sliding window is the input data characteristic number n.
S3: and inputting the training set input vector into a deep learning network (namely a CNN-BilSTM network) for training to obtain a trained model.
3.1. And constructing a CNN-BilSTM network framework.
The CNN-BilSTM network framework is composed of a CNN network (convolutional neural network) and a bidirectional LSTM network together:
3.1.1. the Convolutional Neural Network (CNN) is a feedforward neural network with a deep structure, and can excellently complete the work of feature extraction. The underlying CNN consists of three structures, convolution (convolution), activation (activation) and pooling (displacement). The input features in the CNN network layer are 13-dimensional data in table 1 except for the acquisition time tracetime, so the input data matrix is [5 × 13 ].
Where CNN performs a layer-by-layer convolution and pooling operation on the input data, where the number of convolution kernels is set to 16, and the operation is called unilateral inhibition with a relu (rectified Linear unit) function (the relu function is a piecewise Linear function with all negative values changed to 0 and positive values unchanged, i.e. where the input is negative, the output is 0, and the neuron is not activated), as an activation function, the relu functionIn the form of a number
Derivative (meaning derivative of relu function) at x>0 is 1, x<0 is 0 at 0. The process of convolution can be expressed as follows:
in this formula f is a non-linear activation function,
the symbol indicates that convolution operation is carried out, b is a bias term, W is a weight vector of a convolution kernel, C is the characteristic of convolution output, and X is input data; in the scheme, the method comprises the following steps of,
in the scheme, the data after data preprocessing is put into the convolutional layer for processing to extract features, and the input multidimensional data (i.e. 13-dimensional data except the acquisition time in table 1) is X. After convolution operation, the dimension of the characteristic matrix is continuously reduced through a pooling layer, main characteristics are reserved, the number of parameters is reduced, overfitting is prevented, and the operation speed can be increased; the pooling process formula is as follows:
in which P represents the pooled output characteristic,
denotes the rules of pooling, and C is the output of the convolutional layer.
3.1.2. After a convolutional neural network layer is constructed, two layers of BilSTM (Bi-directional Long Short-Term Memory) networks are built, the Bi-directional Long Short-Term Memory networks are formed by combining forward LSTM (Long Short-Term Memory) networks and backward LSTM networks, the forward LSTM and the backward LSTM networks are combined into a BilSTM network, and the number of the two layers of network units is set to be 128.
The long and short time memory network LSTM is a special Recurrent Neural Network (RNN), and its appearance can solve the problem of long time sequence transmission information loss, and its internal structure diagram is shown in fig. 2.
The LSTM network adds a three-gate structure to the RNN network (recurrent neural network), as shown in FIG. 2
Is the state of the cell at the last moment,
is the output of the hidden layer at the last moment,
is the state of the cell after the renewal,
is the output of the current hidden layer(s),
is the input to the LSTM unit at the current time. The three gates of the LSTM unit are a forgetting gate, an input gate and an output gate, respectively, and the calculation formula used in the LSTM network is as follows:
in the above-mentioned formula,
respectively the bias terms for the individual gating cells and cell units,
is a sigmoid function (a sigmoid function commonly found in biology, also called sigmoid growth curve),
,
,
,
weight matrices respectively representing the input gate, the forgetting gate, the output gate and the cell state, which indicates the multiplication of two corresponding elements of the vector, tanh is the hyperbolic tangent activation function.
The bidirectional LSTM network (i.e. BiLSTM) comprises an LSTM network in a forward direction and a backward direction, a first layer calculates sequence information of a current time point, a second layer reads the same sequence in a backward direction and adds the information in the backward direction, the forward LSTM network and the backward LSTM network both have outputs in a training sequence, so that complete past and future information can be provided for one point in an input sequence, and the network weight is updated by a forward and backward propagation algorithm during training, wherein the structure diagram is shown in figure 3. In FIG. 3
And
is the input at the last time and the output of the hidden layer,
and
is the current time input and the hidden layer output,
and
is the input and hidden layer output at a future time.
The driving data is a time sequence, and four driving conditions (namely start-stop working condition, overload, idling and continuous variable load) causing the performance reduction of the electric pile are not conditions at a certain moment but continuous driving states, and the network needs to input continuous data such as current, voltage, vehicle speed and SOC of the fuel cell to judge which driving state endangers the electric pile. The bidirectional LSTM network can well train the network by utilizing forward and reverse sequences to obtain an optimal result.
3.1.3. After two layers of the BilSTM network are constructed, the last layer is an output softmax (logistic regression model) layer which comprises 5 units and represents 5 types of driving behaviors to be classified (namely normal load running state, frequent start and stop, overload, open/idle speed and continuous variable load). The Softmax function (normalized exponential function) can map any output to the range between [ 0 and 1], the sum of all the outputs is 1, the probability of various driving conditions is calculated through the Softmax function, and the category with the maximum probability is selected as the output.
In order to prevent the overfitting phenomenon, a dropout layer is added in a network structure, in the deep learning training process, a neural network training unit is removed from a network according to a certain probability, and the probability of dropout is set to be 0.3.
3.2. And inputting the training set input vector into a constructed CNN-BilSTM network framework for training to obtain a trained model.
And putting the input vector of the training set into a CNN-BilSTM network for training, wherein an adam (adaptive motion) gradient descent method is adopted in the model training process, and the loss function (loss function) selected by training is a cross entropy function (coordinated _ cross entropy). The cross entropy function is defined as follows:
where Loss is the Loss value in the equation,
is a label to be attached to the body,
is a preset label.
The input vector of the training set is placed into a CNN-BilSTM network for training, a label is output during each training, the output label is compared with a preset label, then the input vector of the training set is input for training, the output label is optimized, the output label is compared with the preset label, the output label is continuously optimized, and finally a trained CNN-BilSTM network model is obtained.
In the scheme, the optimizer used for training is an Adam optimizer, the training learning rate is set to be 0.001, and the batch size is set to be 72.
The labels refer to classification results of different driving behaviors, and the labels have 5 types (namely, normal load operation state, frequent start and stop, overload, open circuit/idle speed and continuous variable load), wherein 1 type in the classification results of the 5 types of driving behaviors is a normal driving condition, and the other 4 types are driving conditions causing damage to the galvanic pile, and the 4 types of driving conditions and the damage specific conditions caused by the 4 types of driving conditions to the galvanic pile are introduced as follows:
(1) starting and stopping working conditions:
this kind of condition shows as the continuous start-stop of fuel cell car in the driving process, and the influence that can cause fuel cell does: during the starting and stopping process of the PEMFC, air exists in the anode gas chamber, and a moving hydrogen-oxygen interface is formed along with the injection and consumption of hydrogen. The hydrogen side is mixed with air, which causes severe carbon corrosion, and further destroys the carbon structure of the diffusion layer catalyst layer. After the PEMFC is repeatedly started and stopped, the loss of Pt catalyst (platinum catalyst) particles and the corrosion of the carbon support occur at the cathode, which causes the cathode catalyst layer to become thin, and the performance of the PEMFC is degraded. High potentials at start-up and shut-down also have a large effect on catalyst degradation.
(2) Overload:
this situation is manifested in that the fuel cell vehicle suddenly increases the fuel cell current during traveling, or the vehicle is still accelerating when soc (State of charge, which reflects the remaining capacity of the battery) is below a lower limit value, and the vehicle is overloaded. The effects on the fuel cell are: the water production increase under the heavy current leads to the flooding fault, and local hot spots are easy to generate to melt the membrane. The high current density discharge of the PEMFC implies a rapid electrochemical reaction rate, where the electrochemical reaction includes not only the normal electrochemical reactions of hydrogen oxidation and oxygen reduction, but also other reactions that attenuate the performance of the fuel cell, such as an increase in the generation rate of hydroxyl radicals, ultimately resulting in an increase in the decay rate of the proton exchange membrane.
(3) Idling:
in this driving state, the voltage of each cell in the PEMFC stack is close to an open circuit, and the influence on the fuel cell is: the high potential state for a long time can cause little consumption of reactants in the high potential state, and reaction gas penetrates through the proton exchange membrane to reach the other electrode to generate peroxide free radicals, so that the chemical degradation of the proton exchange membrane is initiated, the proton exchange membrane is thinned, the hydrogen leakage current is increased, and the performance of the PEMFC pile can be reduced.
(4) Continuously changing load:
the driving state is represented by continuous load change of the fuel cell vehicle in the driving process and continuous and large change of current, the situation mainly has large influence on the recession of the catalyst, and the continuous swelling and shrinkage of the proton exchange membrane can be caused by the thermal cycle humidity circulation under different currents to generate fatigue cracks.
Before putting the labels into the network training, one-hot unique encoding (also called one-bit effective encoding, which is a method of using an N-bit status register to encode N states, each state is processed by its independent register bit and only one bit is effective at any time) needs to be performed on all the labels.
S4: and inputting the test set input vector into a trained model for testing to obtain a classification prediction result of the driving behavior of the fuel cell vehicle.
Obtaining the best model parameters after training, carrying out classification prediction on the test set data by using the trained model to obtain a classification prediction result, and judging which driving behavior the current moment belongs to according to the classification prediction result; and comparing the classification result with a preset classification label to obtain the classification accuracy serving as an accuracy index for judging the trained model.
In this scheme, it is considered that the driving data is classified into 5 types. The normal load operation state is the first category, and 4 driving behaviors (including frequent start and stop, overload, open circuit/idle speed and continuous variable load) which are harmful to the fuel cell vehicle stack are considered. And classifying the new driving behavior data by the trained network model, and judging which type the new driving behavior belongs to.
As shown in fig. 4, a fuel cell automobile driving behavior analysis device includes:
the driving behavior data set acquisition module 101 is used for acquiring a driving behavior data set in the running process of the automobile;
the data set preprocessing module 102 is used for preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector;
the CNN-BilSTM network training module 103 is used for inputting the training set input vector into a CNN-BilSTM network for training to obtain a trained network model;
and the fuel cell automobile driving behavior classification module 104 inputs the test set input vector into the trained network model for testing to obtain a classification result of the fuel cell automobile driving behavior.
Referring to fig. 5, an embodiment of the present invention further provides a terminal. As shown, the terminal 300 includes a processor 301 and a memory 302. The processor 301 is electrically connected to the memory 302. The processor 301 is a control center of the terminal 300, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by running or calling a computer program stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the terminal 300.
In this embodiment, the processor 301 in the terminal 300 loads instructions corresponding to one or more processes of the computer program into the memory 302 according to the following steps, and the processor 301 runs the computer program stored in the memory 302, so as to implement various functions: acquiring a driving behavior data set in the running process of an automobile; preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector; inputting the training set input vector into a CNN-BilSTM network for training to obtain a trained network model; and inputting the test set input vector into a trained network model for testing to obtain a classification result of the driving behavior of the fuel cell vehicle.
Memory 302 may be used to store computer programs and data. The memory 302 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 301 executes various functional applications and data processing by calling a computer program stored in the memory 302.
An embodiment of the present application provides a storage medium, and when being executed by a processor, the computer program performs a method in any optional implementation manner of the foregoing embodiment to implement the following functions: acquiring a driving behavior data set in the running process of an automobile; preprocessing the driving behavior data set in the running process of the automobile to obtain a training set input vector and a testing set input vector; inputting the training set input vector into a CNN-BilSTM network for training to obtain a trained network model; and inputting the test set input vector into a trained network model for testing to obtain a classification result of the driving behavior of the fuel cell vehicle. The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.