Based on the battery SOC evaluation method for intersecting optimization neural network in length and breadth
Technical field
The present invention relates to the technical fields of battery, more particularly to based on the battery SOC for intersecting optimization neural network in length and breadth
Evaluation method.
Background technique
With the continuous development of human economic society, the energy increasingly become promote socio-economic development it is indispensable because
The development of element, economic society also exacerbates demand of the mankind to the energy.It is most of from change at present in the energy used in the mankind
Stone fuel.The use of fossil fuel promotes the improvement of people's living standards, while also bringing serious environmental problem.It is slow
Environmental problem brought by combustion of fossil fuel is solved, new-energy automobile is being greatly developed in the whole world.Power battery is as new energy
The energy storage device of source automobile is the core of new-energy automobile, is the maximum bottleneck in new-energy automobile technology and cost, is new energy
A most crucial ring in the Automotive Industry Chain of source.The power in energy storage device or new-energy automobile either in generation of electricity by new energy
Battery, battery all play crucial effect as energy storage equipment.And key technology of the power battery as electric car, to lotus
Electricity condition (state of charge, SOC) accurately estimated and monitored, from the point of view of safety and battery availability factor all
It is most important.
It accurately estimates battery SOC, the requirement of electric car is on the one hand derived from, from giving full play to cell potential and raising
Two angles of safety efficiently manage battery;On the other hand, the height that batteries of electric automobile shows in use
It is non-linear, make accurately to estimate that SOC has very big difficulty.Both sides combines, so that batteries of electric automobile SOC estimation method
It selects particularly important.
Existing battery SOC evaluation method mainly has: discharge test method, current integration method, open circuit voltage method, measurement internal resistance
Method, linear model method, neural network and Kalman filtering method.Wherein neural network is not only only capable of compared to other methods
Accurately battery SOC is estimated, and it is not influenced by battery types and battery status.Currently available technology research
In much battery SOC is estimated using neural network algorithm.This method is by the discharge current of battery, battery pack
The input as neural network such as voltage, environment temperature and discharge capacity, SOC is as its output, to carry out to battery SOC
Estimation, neural network to it regardless of that can carry out SOC estimation, and estimation precision in battery standing state or working condition
It is higher compared to other methods.But traditional neural network is easily trapped into local optimum in its algorithm operational process, in this way
Result in estimation inaccurate, error is larger.There are also in neural network method use optimization algorithm, but estimation precision according to
So be not it is very high, there is a certain error.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide a kind of based on intersection optimization neural network in length and breadth
Battery SOC evaluation method, by the global search of crossover algorithm in length and breadth is strong and the advantage of fast convergence rate and neural network compared with
Strong capability of fitting organically combines, and accelerates neural network convergence rate, and will not fall into local optimum, this method
Battery SOC can be carried out in real time and accurately be estimated, not influenced by battery types and battery status, compare existing electricity
The accuracy of pond SOC estimation method, the method is higher, and error is smaller.
The technical scheme of the present invention is realized as follows:
Based on the battery SOC evaluation method for intersecting optimization neural network in length and breadth, comprising the following steps:
S1: data sample is obtained, and carries out sample data normalized;
S2: the principal element of analyzing influence battery SOC constructs BP neural network structure;
S3: algorithm parameter initialization;
S4: the connection weight and every threshold value between the output valve and each layer of BP neural network are calculated;
S5: according to the input value and output valve of BP neural network, with the real output value of BP network and desired output
Fitness function of the mean square error as CSO calculates the adaptation value of each CSO particle, obtains the individual optimal value of particle and complete
Office's optimal value, then makes comparisons the optimal value of CSO individual with global optimum, takes adaptation value the superior as current optimal position
It sets;
S6: it is optimized using weight and threshold value of the crossover algorithm in length and breadth to BP neural network;
S7: step S5 and S6 are repeated, until meeting termination condition;
S8: the parameter that CSO algorithm optimization is obtained is as the initial weight of BP neural network and threshold value, and by initial weight
It substitutes into BP neural network algorithm and is trained with threshold value;If the output error value of BP neural network meets scheduled error essence
Degree then stops iteration, exports result;Otherwise, step S5 is returned to, Optimized Iterative is re-started, until meeting BP neural network calculation
Until the minimum allowable error of method.
Further, the analytic process in the step S2 is as follows:
S2-1: the relationship analysis of battery SOC and open-circuit voltage is carried out, the SOC of battery is estimated according to SOC-OCV curve;
S2-2: carrying out the relationship analysis of battery SOC and temperature, and in the case of obtaining different temperatures, the relationship of voltage and SOC are bent
Line;
S2-3: carrying out the relationship analysis of battery SOC and discharge current, obtains voltage and capacity relationship when different multiplying electric discharge
Curve.
Further, in the step S2, the discharge current I, battery voltage U and environment temperature T for choosing battery make
For the input vector of the input layer of BP neural network structure, and three impact factors are independent of one another, and the output vector of network is
Battery SOC carries out BP neural network Construction of A Model.
Further, the step S3 algorithm parameter initialization specifically: the topological structure of input BP neural network algorithm,
Minimum allowable error amount;Input CSO algorithm population scale, dimensionality of particle number, maximum number of iterations, lateral cross probability and
Crossed longitudinally probability.
Further, the step S4 calculates connection weight and items between the output valve and each layer of BP neural network
Detailed process is as follows for threshold value:
S4-1: k-th of input sample x (k) and corresponding desired output d are chosen0(k):
X (k)=(x1(k),x2(k),...,xn(k));
d0(k)=(d1(k),d2(k),...,dq(k));
S4-2: the input hi of hidden layer neuron is calculatedh(k) with output hoh(k) and the input of output layer neuron
yio(k) with output yoo(k):
hoh(k)=f (hih(k)) h=1,2 ..., p;
yoo(k)=f (yio(k)) o=1,2 ..., q;
S4-3: inputting according to output layer desired output and reality output and output layer, calculates function e to each mind of output layer
Partial derivative through member:
Error function
S4-4: according to the sensitivity δ o (k) of output layer, the input value of hidden layer connection weight w and output layer are calculated and are missed
Partial derivative of the difference function to each neuron of hidden layer:
S4-5: output layer connection weight is corrected using the partial derivative in step S4-3:
S4-6: hidden layer connection weight is corrected using the partial derivative in step S4-4:
Further, the step S5 calculate each CSO particle adaptation value formula it is as follows:
In formula, yoiIt (i) is the real output value of neural network;doiFor the desired output of neural network;E (i) is nerve
The mean square error of network real output value and desired output.
Further, the mapping between COS particle and the weight and threshold value of BP neural network is established in the step S6, i.e.,
The weight of neural network and threshold coding are indicated into the individual in population at real vector, the group of vector is randomly generated into;
Specific Optimization Steps are as follows:
S6-1: lateral operation is carried out to population:
Lateral cross is in a kind of arithmetic crossover carried out between the identical dimension of two Different Individual particles in population;Assuming that father
Lateral cross is carried out for the d dimension of individual particles X (i) and X (j), then the formula of their generation filial generations is as follows:
MShc(i, d)=r1×X(i,d)+(1-r1)×X(j,d)+c1×(X(i,d)-X(j,d));
MShc(j, d)=r2×X(j,d)+(1-r2)×X(i,d)+c2×(X(j,d)-X(i,d));
In formula: r1, r2For the random number between [0,1];c1, c2For the random number between [- 1,1];X (i, d), X (j, d)
The d of individual particles X (i) and X (j) is tieed up respectively in parent population;MShc(i, d) and MShc(j, d) is respectively X (i, d) and X
(j, d) ties up filial generation by the d that lateral cross generates;
The wherein r in first formula1× X (i, d) is the memory term of particle X (i), is the current optimal value of particle itself;
(1-r1) × X (j, d) is the group cognition item of particle X (i) and X (j), indicates that difference is interparticle and influences each other;This two logical
Cross inertia weight factor r1Preferably it is combined together;c1For Studying factors, Section 3 c1× (X (i, d)-X (j, d)) can increase
Search space, in edge optimizing;After the completion of lateral cross operation, obtained golden mean of the Confucian school solution MShc(i, d), MShc(j, d) must distinguish
Compare with the fitness of parent particle X (i), X (j), the only better golden mean of the Confucian school solution of fitness can just remain, and become and be dominant
Solve DShc, participate in next iteration;
S6-2: crossed longitudinally operation is carried out to population:
The one kind carried out between crossed longitudinally two different dimensions for a particle in population counts intersection;It is assumed that particle
The d of X (i)1Peacekeeping d2Dimension generates golden mean of the Confucian school solution MS to participate in always wanting to intersect, according to following formulavc(i,d1):
MSvc(i,d1)=rX (i, d1)+(1-r)·X(i,d2)
i∈N(1,M),d1,d2∈N(1,D)
In formula: i ∈ [0,1];MSvc(i,d1) be individual particles X (i) d1Peacekeeping d2Dimension passes through crossed longitudinally generation
D1Tie up offspring;First item is the d of particle X (i)1The memory term of dimension, Section 2 are the d of particle X (i)1Peacekeeping d2Dimension
It influences each other, is combined together by inertia weight factor r;Obtained golden mean of the Confucian school solution MSvc(i,d1) comprising parent particle X (i)
D1The information of dimension and certain probability contain the d of X (i)2Information is tieed up, and the d of X (i) will not be destroyed2Tie up information;The golden mean of the Confucian school
Solve MSvc(i,d1) fitness compared with parent particle X (i), it preferably remains and solves DS as being dominantvc, changed next time
Generation;
New population is generated by the contention operation of filial generation and parent;If new adaptive value is optimal better than current individual,
Replace current individual optimal with the adaptive value: if updated individual optimal value is better than current global optimum, with the individual
Optimal value replaces current global optimum, to complete the optimization to network items weight and threshold value.
Compared with prior art, this programme principle and advantage is as follows:
Classical neural network algorithm is optimized by crossover algorithm in length and breadth, by the global search of crossover algorithm in length and breadth
The advantages of sexuality is strong and fast convergence rate organically combines with the stronger capability of fitting of neural network, avoids neural network
Local optimum is fallen into, and improves its convergence rate.In addition, comparing existing battery SOC evaluation method, this programme is suitable for lithium
A series of common batteries such as battery, lead-acid battery, either battery are in standing or use state, can be in real time to electricity
Pond carries out SOC estimation, and accuracy is high, smaller compared to other methods error.
Detailed description of the invention
Fig. 1 is that the present invention is based on the flow charts for the battery SOC evaluation method for intersecting optimization neural network in length and breadth;
Fig. 2 is the relation curve schematic diagram of battery SOC and open-circuit voltage U;
Fig. 3 is the T relationship curve synoptic diagram of battery SOC and environment temperature;
Fig. 4 is the I relation curve schematic diagram of battery SOC and discharge current;
Fig. 5 is the BP neural network Construction of A Model figure of battery SOC estimation.
Specific embodiment
The present invention is further explained in the light of specific embodiments:
As shown in Figure 1, based on the battery SOC evaluation method for intersecting optimization neural network in length and breadth, comprising the following steps:
S1: all kinds of parameter monitorings of discharge test are carried out to battery pack by real-time monitoring system, obtain sample data, so
Sample data is normalized afterwards;
S2: the principal element of analyzing influence battery SOC constructs BP neural network structure, detailed process are as follows:
S2-1: the relationship analysis of battery SOC and open-circuit voltage is carried out:
The electromotive force of battery is the polarizing voltage three parts structure by the open-circuit voltage of battery, the ohm voltage drop of battery and battery
At.After battery is switched to static condition from charging and discharging state, the chemical reaction of inside battery tends towards stability, and battery is opened at this time
Road voltage (OCV) numerically with battery end voltage it is equal be battery electromotive force;It is bent according to SOC-OCV as shown in Figure 2
Line estimates the SOC of battery;
S2-2: the relationship analysis of battery SOC and temperature is carried out:
Temperature directly affects the actually available capacity of battery;When environment temperature is higher, the chemical reaction ratio of inside battery
More active, the active volume of battery is larger;And when the temperature of the surroundings is low, the utilization rate of active material is lower, and battery can be used
Capacity reduces;In the case of different temperatures, the relation curve of voltage and SOC are as shown in Figure 3;
S2-3: the relationship analysis of battery SOC and discharge current is carried out:
When one timing of temperature, discharge test is carried out with 1C, 3C current versus cell, different multiplying as shown in Figure 4 is obtained and puts
Voltage and capacity relationship curve when electric;
As shown in Figure 4, when discharge-rate increase when, battery discharge platform voltage is gradually reduced, when electric current is larger, battery from
When operating voltage is to discharge cut-off voltage, the electricity of releasing is less;Also, in battery charge state between 20% to 90%
When, the curvilinear trend of battery steady state voltage and battery SOC is relatively fixed, illustrates to have therebetween metastable non-linear
Relationship, discharge voltage can with SOC reduce and gradually decrease, especially electric discharge latter stage, cell discharge voltage with SOC change
Rate is larger;
By above-mentioned analysis, the discharge current I, battery voltage U and environment temperature T of battery are chosen as BP nerve net
The input vector of the input layer of network structure, and three impact factors are independent of one another, and the output vector of network is battery
SOC;BP neural network Construction of A Model is as shown in Figure 5.
S3: algorithm parameter initialization;The topological structure for inputting BP neural network algorithm is (including input number of layers, implicit
Number of layers and output number of layers), minimum allowable error amount;The population scale of CSO algorithm is inputted, dimensionality of particle number is maximum
The number of iterations, lateral cross probability and crossed longitudinally probability.
S4: the connection weight and every threshold value between the output valve and each layer of BP neural network are calculated, detailed process is such as
Under:
S4-1: k-th of input sample x (k) and corresponding desired output d are chosen0(k):
X (k)=(x1(k),x2(k),...,xn(k));
d0(k)=(d1(k),d2(k),...,dq(k));
S4-2: the input hi of hidden layer neuron is calculatedh(k) with output hoh(k) and the input of output layer neuron
yio(k) with output yoo(k):
hoh(k)=f (hih(k)) h=1,2 ..., p;
yoo(k)=f (yio(k)) o=1,2 ..., q;
S4-3: inputting according to output layer desired output and reality output and output layer, calculates function e to each mind of output layer
Partial derivative through member:
Error function
S4-4: according to the sensitivity δ o (k) of output layer, the input value of hidden layer connection weight w and output layer are calculated and are missed
Partial derivative of the difference function to each neuron of hidden layer:
S4-5: output layer connection weight is corrected using the partial derivative in step S4-3:
S4-6: hidden layer connection weight is corrected using the partial derivative in step S4-4:
S5: according to the input value and output valve of BP neural network, with the real output value of BP network and desired output
Fitness function of the mean square error as CSO calculates the adaptation value of each CSO particle according to following formula, obtains of particle
Then body optimal value and global optimum make comparisons the optimal value of CSO individual with global optimum, take adaptation value the superior's conduct
Current optimal location;
In formula, yoiIt (i) is the real output value of neural network;doiFor the desired output of neural network;E (i) is nerve
The mean square error of network real output value and desired output.
S6: it is optimized using weight and threshold value of the crossover algorithm in length and breadth to BP neural network;
The mapping between COS particle and the weight and threshold value of BP neural network is established, i.e., by the weight of neural network and threshold
Value is encoded into real vector to indicate the individual in population, and the group of these vectors is randomly generated into.Specific optimization object master
There is the connection weight of the input layer and hidden layer that calculate in step S4: wih, hidden layer and output layer connection weight: who, it is hidden
The threshold value of each neuron containing layer: bhAnd the threshold value of each neuron of output layer: bo, these weights and threshold value constitute CSO algorithm
Initial population;Specific Optimization Steps are as follows:
S6-1: lateral operation is carried out to population:
Lateral cross is in a kind of arithmetic crossover carried out between the identical dimension of two Different Individual particles in population;Assuming that father
Lateral cross is carried out for the d dimension of individual particles X (i) and X (j), then the formula of their generation filial generations is as follows:
MShc(i, d)=r1×X(i,d)+(1-r1)×X(j,d)+c1×(X(i,d)-X(j,d));
MShc(j, d)=r2×X(j,d)+(1-r2)×X(i,d)+c2×(X(j,d)-X(i,d));
In formula: r1, r2For the random number between [0,1];c1, c2For the random number between [- 1,1];X (i, d), X (j, d)
The d of individual particles X (i) and X (j) is tieed up respectively in parent population;MShc(i, d) and MShc(j, d) is respectively X (i, d) and X
(j, d) ties up filial generation by the d that lateral cross generates;
The wherein r in first formula1× X (i, d) is the memory term of particle X (i), is the current optimal value of particle itself;
(1-r1) × X (j, d) is the group cognition item of particle X (i) and X (j), indicates that difference is interparticle and influences each other;This two logical
Cross inertia weight factor r1Preferably it is combined together;c1For Studying factors, Section 3 c1× (X (i, d)-X (j, d)) can increase
Search space, in edge optimizing;After the completion of lateral cross operation, obtained golden mean of the Confucian school solution MShc(i, d), MShc(j, d) must distinguish
Compare with the fitness of parent particle X (i), X (j), the only better golden mean of the Confucian school solution of fitness can just remain, and become and be dominant
Solve DShc, participate in next iteration;
S6-2: crossed longitudinally operation is carried out to population:
The one kind carried out between crossed longitudinally two different dimensions for a particle in population counts intersection;It is assumed that particle
The d of X (i)1Peacekeeping d2Dimension generates golden mean of the Confucian school solution MS to participate in always wanting to intersect, according to following formulavc(i,d1):
MSvc(i,d1)=rX (i, d1)+(1-r)·X(i,d2)
i∈N(1,M),d1,d2∈N(1,D)
In formula: i ∈ [0,1];MSvc(i,d1) be individual particles X (i) d1Peacekeeping d2Dimension passes through crossed longitudinally generation
D1Tie up offspring;First item is the d of particle X (i)1The memory term of dimension, Section 2 are the d of particle X (i)1Peacekeeping d2Dimension
It influences each other, is combined together by inertia weight factor r;Obtained golden mean of the Confucian school solution MSvc(i,d1) comprising parent particle X (i)
D1The information of dimension and certain probability contain the d of X (i)2Information is tieed up, and the d of X (i) will not be destroyed2Tie up information;The golden mean of the Confucian school
Solve MSvc(i,d1) fitness compared with parent particle X (i), it preferably remains and solves DS as being dominantvc, changed next time
Generation;
Above-mentioned optimization operation, new population is generated by the contention operation of filial generation and parent;If new adaptive value is better than
Current individual is optimal, then replaces current individual optimal with the adaptive value: if updated individual optimal value is most better than the current overall situation
The figure of merit then replaces current global optimum with the individual optimal value, to complete the optimization to network items weight and threshold value.
S7: step S5 and S6 are repeated, until meeting termination condition;
S8: the parameter that CSO algorithm optimization is obtained is as the initial weight of BP neural network and threshold value, and by initial weight
It substitutes into BP neural network algorithm and is trained with threshold value;If the output error value of BP neural network meets scheduled error essence
Degree then stops iteration, exports result;Otherwise, step S5 is returned to, Optimized Iterative is re-started, until meeting BP neural network calculation
Until the minimum allowable error of method.
The present embodiment optimizes classical neural network algorithm by crossover algorithm in length and breadth, by crossover algorithm in length and breadth
The advantages of global search sexuality is strong and fast convergence rate organically combines with the stronger capability of fitting of neural network, avoids
Neural network falls into local optimum, and improves its convergence rate.In addition, comparing existing battery SOC evaluation method, this implementation
Example is suitable for a series of common batteries such as lithium battery, lead-acid battery, and either battery is in standing or use state, can
SOC estimation is carried out to battery in real time, and accuracy is high, it is smaller compared to other methods error.
The examples of implementation of the above are only the preferred embodiments of the invention, and implementation model of the invention is not limited with this
It encloses, therefore all shapes according to the present invention, changes made by principle, should all be included within the scope of protection of the present invention.