Disclosure of Invention
An object of the embodiments of the present application is to provide a method for predicting remaining mileage of a fuel cell vehicle based on a charging-hydrogen mode, which has an advantage of accurately predicting the remaining mileage of the fuel cell vehicle according to different work patterns.
In a first aspect, an embodiment of the present application provides a method for predicting remaining mileage of a fuel cell vehicle based on a charge-hydrogen mode, which is used for predicting remaining mileage of the fuel cell vehicle, and the technical solution is as follows:
the method comprises the following steps:
acquiring historical data of a fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or the related data capable of calculating the power of the fuel cell and the power of the power battery, and the gas pressure data and the gas temperature data in the hydrogen bottle;
dividing the historical data of the fuel cell vehicle according to the working mode of the fuel cell vehicle, and calculating to obtain the average speed in the corresponding working mode;
calculating the data divided according to the working mode to obtain the mass of the residual hydrogen;
and calculating the remaining mileage according to the remaining hydrogen mass and the average speed in the current working mode.
Further, in the embodiment of the present application, the operation mode of the fuel cell vehicle is divided according to the output power of the power battery and the output power of the fuel cell, and includes:
a first type of operating mode, wherein the power battery power is positive and the fuel battery power is zero;
in a second type of working mode, the power battery power is zero, and the fuel battery power is positive;
in a third type of working mode, the power of the power battery is positive, and the power of the fuel battery is positive;
and in a fourth working mode, the power battery power is negative, and the fuel battery power is positive.
Further, in the embodiment of the present application, the step of dividing the history data of the fuel cell vehicle according to the operation mode of the fuel cell vehicle includes:
cleaning historical data of the fuel cell automobile;
the cleaning step at least comprises the following steps:
deleting or assigning the data with missing values;
deleting the repeated data;
deleting or assigning data with abnormal data values;
and deleting the irrelevant data.
Further, in the embodiment of the present application, before inputting the data divided according to the operation mode into the neural network so as to output the data to obtain the remaining hydrogen quality, the method further includes the following steps:
and carrying out standardization processing or normalization processing on the data divided according to the working mode.
Further, in this embodiment of the present application, the step of calculating the remaining hydrogen mass according to the data divided by the operation mode includes:
inputting the data divided according to the working mode into a neural network so as to output the data to obtain the residual hydrogen quality;
the method at least comprises the following steps:
dividing the data after the normalization processing into a training set and a test set;
inputting the training set into a neural network for training;
inputting the test set into a trained neural network so as to output the residual hydrogen quality.
Further, in the embodiment of the present application, the division ratio of the training set to the test set is 7: 3.
Further, in the embodiment of the present application, the neural network is an LSTM neural network.
Further, the present application provides an apparatus for predicting remaining mileage, including:
the first acquisition module is used for acquiring historical data of the fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or the related data capable of calculating the power of the fuel cell and the power of the power battery, and the gas pressure data and the gas temperature data in the hydrogen bottle;
the first processing module is used for dividing the historical data of the fuel cell automobile according to the working mode of the fuel cell automobile and calculating to obtain the average speed in the corresponding working mode;
the second processing module is used for calculating the data divided according to the working mode to obtain the mass of the residual hydrogen;
and the third processing module is used for calculating the remaining mileage according to the remaining hydrogen mass and the average speed in the current working mode.
Further, the present application also provides an electronic device, which includes a processor and a memory, where the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, perform the steps of the method as described above.
Further, the present application also provides a storage medium having a computer program stored thereon, which, when being executed by a processor, performs the steps of the method as described above.
As can be seen from the above, the method, the device, the electronic device and the storage medium for predicting the remaining mileage of the fuel cell vehicle based on the hydrogen charging-using mode provided by the embodiments of the present application acquire historical data of the fuel cell vehicle; cleaning historical data of the fuel cell vehicle; dividing the cleaned data according to the working mode of the fuel cell vehicle, and calculating to obtain the average speed in the corresponding working mode; inputting the data divided according to the working mode into a neural network so as to output the data to obtain the residual hydrogen quality; and calculating the remaining mileage according to the mass of the remaining hydrogen and the average speed in the current working mode, and having the beneficial effect of accurately predicting the remaining mileage of the fuel cell automobile according to different work models.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
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.
Referring to fig. 1, a method for predicting remaining mileage of a fuel cell vehicle based on a charge-hydrogen mode is used for predicting remaining mileage of a fuel cell vehicle, and the technical solution specifically includes:
s110, acquiring historical data of the fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or related data capable of calculating the power of the fuel cell and the power of the power battery, such as voltage data, current data, gas pressure data and gas temperature data in a hydrogen bottle;
s120, dividing historical data of the fuel cell automobile according to the working mode of the fuel cell automobile, and calculating to obtain the average speed in the corresponding working mode; wherein the data is washed before being divided.
S130, inputting and calculating the data divided according to the working mode to obtain the mass of the residual hydrogen; the mode of calculating the residual hydrogen mass can adopt a mode of neural network calculation.
And S140, calculating the remaining mileage according to the remaining hydrogen mass and the average speed in the current working mode.
Through the technical scheme, the historical data of the fuel cell automobile is collected, then the historical data is cleaned, a new data set is obtained after cleaning, and in some specific embodiments, the characteristics of the cleaned new data set are shown in the following table:
traceTime
|
time of data acquisition
|
totalCurrent
|
Total current of power battery (A)
|
totalVoltage
|
Total voltage of power battery (V)
|
Soc
|
Power battery SOC (%)
|
vehicle Status
|
Vehicle state
|
fuelBatteryCurrent
|
Fuel cell current (A)
|
fuelBatteryVoltage
|
Voltage (V) of fuel cell
|
fuelBatteryPower
|
Fuel cell power (kW)
|
hydrogenMaxPressure
|
Highest pressure of hydrogen (MPa)
|
hydrogenSystemMaxTemperature
|
Maximum temperature in Hydrogen System (. degree. C.)
|
vehicleSpeed
|
Vehicle speed (KM/H)
|
Mileage
|
Mileage displayed by watch (KM)
|
motorStatus
|
State of the electric machine
|
motorVoltage
|
Driving machine voltage (V)
|
motorBusCurrent
|
DC bus current of motor controller (A) |
The above table shows the features that remain after data cleansing. And after the data washing is finished, recombining and dividing the washed data according to the working modes, and calculating the average speed of the automobile in each working mode. Combining the gas pressure P and the gas temperature T in the hydrogen storage bottle, the known capacity V of the hydrogen storage bottle of the fuel cell automobile is a fixed value known in advance, the molar mass MH2 of hydrogen and an ideal gas constant R, the mass M1 of the hydrogen left in the hydrogen storage bottle is calculated according to the formula M1-PVMH 2/RT, and the mass of the hydrogen left is used as a new characteristic column of a data set. The dimensions of the data set of the table above are now expanded from 15 to 16 dimensions. And finally, inputting the data set into a neural network to predict a residual hydrogen mass curve, and calculating the time when the residual hydrogen quantity in the hydrogen storage tank of the fuel cell automobile is reduced to a threshold value insufficient for providing automobile power according to the predicted residual hydrogen mass curve. The remaining mileage is predicted by multiplying this time by the average speed of the current operation mode.
Referring to fig. 5, in some embodiments, the operation modes of the fuel cell vehicle are divided according to the output power of the power battery and the fuel cell, and include:
the first kind of working mode, the power of the power battery is positive, the power of the fuel cell is zero;
in the second type of working mode, the power of the power battery is zero, and the power of the fuel battery is positive;
in a third working mode, the power of the power battery is positive, and the power of the fuel battery is positive;
in the fourth type of operation, the power battery power is negative and the fuel cell power is positive.
And then dividing the cleaned data according to a first class working mode, a second class working mode, a third class working mode and a fourth class working mode.
According to the technical scheme, the cleaned data set is divided into four types according to the charging-hydrogen using working mode of the fuel cell automobile, the average speed of the automobile under the first type of working mode, the second type of working mode, the third type of working mode and the fourth type of working mode is calculated, and because the state of the fuel cell is constantly changed and is in an unstable state in the actual running process of the automobile, and meanwhile, the road condition of the running automobile with the consumption of hydrogen quality is closely related, the working modes are divided according to the output power of the automobile power cell and the fuel cell, the consumption condition of the hydrogen quality of the automobile can be more accurately reflected, and the accuracy of the subsequent remaining mileage prediction is improved.
In some of these embodiments, the step of cleansing the historical data of the fuel cell vehicle includes at least:
deleting or assigning the data with missing values;
deleting the repeated data;
deleting or assigning data with abnormal data values;
and deleting the irrelevant data.
Through the technical scheme, in the process of acquiring data, the data acquired by the sensor on the fuel cell automobile is not very stable and accurate data, sometimes fluctuation or even wrong data exists, and in order to reduce the influence of abnormal data, the data needs to be cleaned. The method specifically comprises the following steps:
the data item is missing. There may be missing values in a piece of data, possibly due to sensor failure or transmission errors, etc. If the missing items have no effect on the data, the data may be deleted or appropriate values may be assigned to the missing items. In some embodiments, the assignment may be a specified value assigned to a preset.
The data item repeats. Some data may be the same, repeated data items may cause the efficiency of the algorithm to be reduced, and for repeated data, unnecessary data items may be deleted as required.
The data value is abnormal. Some data values may have obvious abnormality, for example, the power of the fuel cell suddenly jumps to a large value and then suddenly drops to a normal value, the abnormal data can have adverse effect on the subsequent algorithm, and the abnormal data can be deleted or assigned with a normal value according to the previous and subsequent data. In some embodiments, the assignment may be based on an average of previous and subsequent data.
An unrelated data item. The sensors will also collect some data items that are not related to the algorithm during the data collection process. Such as a unique identification of the vehicle, license plate number, latitude and longitude, etc. For these irrelevant data, deletion may be performed in order to speed up the algorithm.
The reasonable data cleaning operation can enable the data set to be more accurate, and adverse effects of abnormal data on a later algorithm are avoided. And after the irrelevant data items are deleted and the data dimensionality is reduced, the operation efficiency of the algorithm can be improved, the operation time is reduced, and the remaining mileage can be predicted more timely.
In some embodiments, before inputting the data divided according to the operation mode into the neural network so as to output the data to obtain the residual hydrogen quality, the method further comprises the following steps:
and carrying out standardization processing or normalization processing on the data divided according to the working mode.
According to the technical scheme, after the cleaned data are divided according to the working mode, standardization processing or normalization processing is carried out, and after the working mode is divided, when the dimensions of the characteristics of the original data on different dimensions are not consistent, the data need to be preprocessed in a standardization step. Because different dimension scales can cause imbalance of data weight in the algorithm, the data with larger dimension can occupy larger weight to cause adverse effect. Therefore, the raw data needs to be normalized, the data with abnormal values and excessive noise is generally normalized, the output result has a range requirement, or the data is relatively stable and is normalized when no extreme maximum or minimum value exists, and under comprehensive consideration, the data is preferably preprocessed by normalization.
In some embodiments, min-max normalization is used, and the formula is as follows:
after normalization, the data are distributed in a [0, 1] interval, x is original data, max is the maximum value in the original data, min is the minimum value in the original data, and x1 is the value after normalization, and data dimension is balanced through a min-max normalization operation.
In some embodiments, the step of inputting the data divided according to the operation mode into the neural network so as to output the remaining hydrogen quality comprises:
dividing the data after the normalization processing or normalization processing into a training set and a test set according to the proportion of 7: 3;
inputting the training set into a neural network for training;
inputting the test set into the trained neural network so as to output the residual hydrogen quality.
Wherein, the neural network is an LSTM neural network.
By the technical scheme, the LSTM is an improved recurrent neural network, and the problem that the RNN cannot process long-term dependence can be solved. The hidden layer of the original RNN has only one state, h, which is very sensitive to short-term input. A further state, c, is added to allow it to be stored for a long period of time, called the cellular state.
Referring to FIG. 4, at time t, there are three inputs to the LSTM: input values of the network at the present moment
Last time LSTM output value
And the state of the cell at the previous time
(ii) a The output of the LSTM is two: current time LSTM output value
And the cell state at the current time
。
The key to LSTM is the cell state c, which requires three gates to protect and control.
The first is a forgetting gate, and the formula is:
the door will read
And
a number between 0 and 1 is output.
The second is the input gate, with the formula:
and
the old cell state is updated after passing the input gate,
is updated to
. The formula is as follows:
the third is an output gate, and the formula is:
output of
As input to the LSTM unit at the next instant.
In the above formula
Denotes a sigmoid function, b denotes an offset, W denotes a corresponding weight matrix, and tanh denotes a tanh activation function.
I.e. the data that we have entered,
initializing the LSTM network for the output values we need
And
inputting the first sample in the data set, and controlling the amount of the first sample in the data set through the forgetting gate and the input gate
And information input of, in conjunction with
Is updated to
Then will be
Output through an output gate
。
And
as input to the next LSTM unit, the second sample in the data set is combined
To obtain an updated value
And
and so on.
The invention divides the normalized data set into a training set test setThe training set is
Inputting an LSTM network for training, inputting a test set after the network is trained to obtain the residual hydrogen quality of an output value, drawing a residual hydrogen quality curve, and calculating the time for reducing the residual hydrogen amount in a hydrogen storage tank of the fuel cell automobile to a threshold value insufficient for providing automobile power. The remaining mileage is predicted by multiplying this time by the average speed of the current operation mode.
Specifically, in some embodiments, a training set is input into the LSTM network, the input data is a tensor, a sliding window is used for data sampling, the time step of the network is set to 10, that is, the length of the sliding window is 10, the data set is a data set with dimensions expanded from 15 to 16 dimensions, wherein the acquisition time traceTime is not used as a feature, the residual hydrogen mass M1 is used as a label to calculate the LSTM network loss so as to achieve a better effect of training the network, and in addition, the data set has 14-dimensional features, so that the width of the sliding window is 14, that is, the input matrix is 10 × 14, the learning rate is set to 0.01, the batch size is set to 64, and the optimizer is Adam, and the loss function is mse, thereby training the LSTM network.
And inputting the test set into a matrix of 10 x 14 according to the same sliding window method of the training set, inputting the trained LSTM network, and predicting a residual hydrogen quality curve.
In some embodiments, the automobile is provided with a navigation system, road traffic conditions between the current location and the destination are predicted according to the navigation system, a driving mode of the automobile from the current location to the destination is predicted according to the road traffic conditions, and the remaining mileage of the automobile can be predicted and calculated according to the predicted driving mode of the automobile and the average speed in each mode and the current remaining hydrogen quality. The navigation system is a conventional navigation system on the market at present.
Further, referring to fig. 2, the present application further provides an apparatus for predicting remaining mileage, including:
a first acquisition module 210 for acquiring historical data of the fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or the related data capable of calculating the power of the fuel cell and the power of the power battery, and the gas pressure data and the gas temperature data in the hydrogen bottle;
the first processing module 220 is configured to divide historical data of the fuel cell vehicle according to a working mode of the fuel cell vehicle, and calculate an average speed in the corresponding working mode; wherein the data is washed before being divided.
The second processing module 230 is configured to calculate data divided according to the working mode to obtain the remaining hydrogen mass; the mode of calculating the residual hydrogen mass can adopt a mode of neural network calculation.
A third processing module 240, configured to calculate a remaining mileage according to the remaining hydrogen mass and an average speed in a current operating mode
Through the above technical solution, the first obtaining module 210 is used to collect historical data of the fuel cell vehicle, and then the first processing module 220 cleans the historical data to obtain a new data set, where in some specific embodiments, characteristics of the cleaned new data set are as shown in the following table:
traceTime
|
time of data acquisition
|
totalCurrent
|
Total current of power battery (A)
|
totalVoltage
|
Total voltage of power battery (V)
|
Soc
|
Power battery SOC (%)
|
vehicle Status
|
Vehicle state
|
fuelBatteryCurrent
|
Fuel cell current (A)
|
fuelBatteryVoltage
|
Voltage (V) of fuel cell
|
fuelBatteryPower
|
Fuel cell power (kW)
|
hydrogenMaxPressure
|
Highest pressure of hydrogen (MPa)
|
hydrogenSystemMaxTemperature
|
Maximum temperature in Hydrogen System (. degree. C.)
|
vehicleSpeed
|
Vehicle speed (KM/H)
|
Mileage
|
Mileage displayed by watch (KM)
|
motorStatus
|
State of the electric machine
|
motorVoltage
|
Driving machine voltage (V)
|
motorBusCurrent
|
DC bus current of motor controller (A) |
The above table shows the features that remain after data cleansing. And after the data washing is finished, recombining and dividing the washed data according to the working modes, and calculating the average speed of the automobile in each working mode. According to the combination of the gas pressure P and the gas temperature T in the hydrogen storage bottle, the known volume V of the hydrogen storage bottle of the fuel cell automobile, the molar mass MH2 of hydrogen and an ideal gas constant R, the mass M1 of the hydrogen left in the hydrogen storage bottle is calculated according to the formula M1-PVMH 2/RT, and the mass of the left hydrogen is used as a new characteristic list of a data set. The dimensions of the data set of the table above are now expanded from 15 to 16 dimensions. And inputting the data set into a neural network to predict a residual hydrogen mass curve, and calculating the time when the residual hydrogen quantity in the hydrogen storage tank of the fuel cell automobile is reduced to a threshold value insufficient for providing automobile power according to the predicted residual hydrogen mass curve. The remaining mileage is predicted by multiplying this time by the average speed of the current operation mode.
Further, the first processing module 220 divides the data according to the operation mode of the fuel cell vehicle, which is divided according to the output power of the power battery and the output power of the fuel cell, and includes:
the first kind of working mode, the power of the power battery is positive, the power of the fuel cell is zero;
in the second type of working mode, the power of the power battery is zero, and the power of the fuel battery is positive;
in a third working mode, the power of the power battery is positive, and the power of the fuel battery is positive;
in the fourth type of operation, the power battery power is negative and the fuel cell power is positive.
Further, the step of the first processing module 220 cleaning the history data of the fuel cell vehicle includes:
deleting or assigning the data with missing values;
deleting the repeated data;
deleting or assigning data with abnormal data values;
and deleting the irrelevant data.
Further, before the second processing module 230 inputs the data divided according to the operation mode into the neural network so as to output the data to obtain the remaining hydrogen quality, the method further includes:
the second processing module 230 performs normalization processing or normalization processing on the data divided according to the operation mode.
Further, the inputting, by the second processing module 230, the data divided according to the operation mode into the neural network so as to output the remaining hydrogen quality includes:
dividing the data after the normalization processing or normalization processing into a training set and a test set according to the proportion of 7: 3;
inputting the training set into a neural network for training;
inputting the test set into the trained neural network so as to output the residual hydrogen quality.
Further, referring to fig. 3, the present application also provides an electronic device 300, which includes a processor 310 and a memory 320, wherein the memory 320 stores computer-readable instructions, and the computer-readable instructions, when executed by the processor 310, perform the steps of the above-mentioned method.
By the above technical solution, the processor 310 and the memory 320 are interconnected and communicate with each other through a communication bus and/or other form of connection mechanism (not shown), and the memory 320 stores a computer program executable by the processor 310, and when the computing device runs, the processor 310 executes the computer program to execute the method in any optional implementation manner of the foregoing embodiment to implement the following functions: acquiring historical data of a fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or the related data capable of calculating the power of the fuel cell and the power of the power battery; cleaning historical data of the fuel cell vehicle; dividing the cleaned data according to the working mode of the fuel cell vehicle, and calculating to obtain the average speed in the corresponding working mode; inputting the data divided according to the working mode into a neural network so as to output the data to obtain the residual hydrogen quality; and calculating the remaining mileage according to the remaining hydrogen mass and the average speed in the current working mode.
Further, the present application also provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to execute the steps of the above method.
Through the technical scheme, when being executed by a processor, the computer program executes the method in any optional implementation manner of the embodiment to realize the following functions: acquiring historical data of a fuel cell vehicle; the historical data of the fuel cell automobile at least comprises the power of the fuel cell, the power of the power battery or the related data capable of calculating the power of the fuel cell and the power of the power battery; cleaning historical data of the fuel cell vehicle; dividing the cleaned data according to the working mode of the fuel cell vehicle, and calculating to obtain the average speed in the corresponding working mode; inputting the data divided according to the working mode into a neural network so as to output the data to obtain the residual hydrogen quality; and calculating the remaining mileage according to the remaining hydrogen mass and the average speed in the current working mode. 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.
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.