Electric Vehicle Relay Lifetime Prediction Model Using the Improving Fireworks Algorithm–Grey Neural Network Model

: The relay reliability has an impact on the reliability of the entire electric vehicle system. This paper contributes to propose the improving ﬁreworks algorithm optimizing the grey neural network model to predict the relay lifetime. This paper shows how the mutation operation and mapping operation in the ﬁreworks algorithm are used to improve the convergence ability and running speed; the convergence performance and running speed of improved ﬁreworks algorithm are tested with standard test function and compared with ﬁreworks algorithm; and the grey neural network model–improved ﬁreworks algorithm is used to predict the relay life and compared with grey model, grey neural network, and grey neural network model–ﬁreworks algorithm. The results show that the convergence accuracy of the improved ﬁreworks algorithm is better than the ﬁreworks algorithm. The running time of improved ﬁreworks algorithm is the shortest; the improved ﬁreworks algorithm–grey neural network model has the best prediction e ﬀ ect and the root mean square error value is 6.75% smaller than the ﬁreworks algorithm–grey neural network model.


Introduction
The problem of energy consumption is becoming increasingly serious with the development of science and technology. New energy systems have been applied in all facets of society to achieve the development goal of green energy-saving [1]. In the new energy industry, industries such as solar energy, wind power, and new energy vehicles are rapidly developing [2,3]. The relay is the core component in the control circuit, which can achieve remote switch control. The safe and reliable operation of the relay is an important basis for the development of the new energy industry. The electric vehicles' reliability is an important guarantee for the safe operation. The relay is a part of the automatic control system. The relay lifetime value directly affects the safe and reliable operation of the entire system. In new energy vehicles, the line of charging and discharging is protected by using the relay to save the maintenance cost. At present, different prediction methods of relays mainly depend on various performance parameters that can affect the relay life. Common forecasting methods include neural network, grey theory, etc. The main problem is the parameter setting of the prediction model.
Previous research suggested some methods to improve relay reliability. Kagra et al. [4] proposed contact resistance to improve the reliability of the relay and developed an online automated measurement system. However, the complexity of working environment of relay has not been fully considered. In the aspect of model establishment, the grey neural network (GNN) model is established by combining the grey model (GM) with the neural network [5][6][7]. Uygur et al. [8] used artificial neural network to predict the fatigue lifetime of various metal matrix composites at different temperatures. Liu et al. [9] proposed an improved GNN model for traffic disruption prediction. The method uses a metabolic model in the grey modeling process to constantly eliminate old information and embed new information. The improved GM determines the optimal dimension of the neural network to improve the accuracy of the model.
Relay life is an important index for relay reliability evaluation. If the failed relay is not discovered in time, the failed relay affects the electric vehicles' reliability entire system. By predicting the life of the relay, the impending failure of the relay is discovered in time, which improves the reliability of the entire system and the safety of system operation. At present, the reliability analysis method of relay mainly includes two parts. One is to determine the predictive variables. The other is to establish the prediction model. The predictive variables include the static contact resistance, the super-path time, and the pick-up time. The common methods include neural networks, expert systems, fuzzy methods, time series regression methods, cloud models, and GM [10][11][12][13]. Liu et al. [14] proposed a prediction model based on Fick diffusion and the Larson-Miller methods and used least squares to fit the sample data. Sun et al. [15] used a novel method to predict relay life. Principal component analysis is used to extract key performance parameters. The back propagation neural network is used to establish the prediction model. Wang et al. [16] used regression theory to establish prediction model. The wavelet transform is used to preprocess data, which can improve the prediction accuracy. A method based on particle filter to predict the remaining storage lifetime of electromagnetic relays was proposed to be effective [17].
In addition, prior studies have established the relay life prediction model based on the physical state information. The life of the relay with better performance information at the initial stage of its life is long through the analysis of the life data of the relay. Li et al. [18] extracted state performance parameters based on rough set theory and established life decision rules to predict relay life. Zhao et al. [19] established a relay life prediction model based on two physical state parameters of relay, namely super-path time and pick-up time, and identified the parameters of the model. The validity of this method is proved by experiments. Sun et al. [20] analyzed the failure mechanism of the relay and the correlation between the physical parameters of the relay. Finally, the prediction model was established based on the selected physical parameters. Prior studies have improved the prediction model or used the combined model for reliability analysis since the single model is not comprehensive enough. For instance, these improved models make up for the shortcomings of the single model to some extent. Liu et al. [21] predicted the remaining service lifetime by extreme learning machine, which could better reflect the degradation process of Rolling Bearings. Cheng et al. [22] predicted the remaining lifetime of lithium-ion batteries based on functional principal component analysis and Bayesian method. In sum, the analytical results show that their prediction had higher accuracy. This paper proposes improved fireworks algorithm-grey neural network (IFWA-GNN) model to predict the relay lifetime. The IFWA enhances local search. By adding an improved Gauss transform operator to the traditional fireworks algorithm (FWA), the diversity of fireworks is enhanced and the convergence performance of the algorithm is improved. Secondly, ten sparks with better fitness are selected and each spark is divided into p-dimension variables. The mean value and standard deviation of each dimension variable are calculated. The distribution of the variable is determined. If the standard deviation is small, the local search should be strengthened. If the standard deviation is large, the position of the optimal solution cannot be determined. The explosion radius should be expanded to carry out the global search. The q dimensions with better fitness are selected from p-dimension variables to enhance local search by comparing the standard deviation of each dimension variable. In the traditional FWA, the search and mutation are often performed on the whole sparks, which may lead to insufficient local search ability. The main purpose of this paper is to improve the security and reliability of relay operation by enhancing the prediction accuracy. The experimental results show the IFWA-GNN model has better prediction accuracy on the relay lifetime and can meet the requirements of practical engineering applications. Hence, the objections of this paper are as follows: • establish GM (1,5) (2) The IFWA-GNN model is proposed to predict the relay life. (3) The electric vehicle reliability is improved by improving the prediction effect of the model. The rest of this paper is structured as follows. Section 2 presents FWA and IFWA. Section 3 introduces the relay experiment and parameter analysis. Section 4 introduces the experiment and a detailed analysis of the experimental results. Section 5 presents the conclusions, contributions, limitations, and future studies.

Fireworks Algorithm and Improved Fireworks Algorithm
The FWA is a new swarm intelligent algorithm, which originates from the phenomenon of fireworks explosion [23]. In the solution process, the firework is treated as a feasible solution of the optimization problem. The process of searching for the neighborhood union of the feasible solution is the fireworks explosion, which generates a certain number of sparks. The local search and global search are accomplished by controlling the number of sparks generated from each fireworks explosion. In the feasible solutions, the fireworks with poor fitness have larger explosion radius, which leads to greater exploration abilities. Conversely, the fireworks with better fitness have smaller explosion radius, which leads to more excavation capacity around the position. The Gaussian mutation is applied to the original sparks for increasing the diversity of the population.
(1) For the optimization problem, the initial fireworks are N, which are randomly generated in the feasible solution space Ω.
(2) The fitness of each firework is evaluated. The radius of each firework R i and the number S i of sparks generated from the explosion are calculated. R i and S i are expressed as follows.
where f (x i ) is the fitness function of the optimized problem. y min and y max are the best and the worst solution of the fitness in the current fireworks population. R c and u are the constants, which are used to adjust the size of the explosion radius and the number of explosion sparks. ε is the smallest amount for the machine, which is used to avoid zero denominator.
(3) To further seek the optimal solution and avoid the coincidence of the explosion spark position, fireworks with better fitness should explode in a small range. The fireworks with worse fitness should explode in a large range to achieve better global search. Equation (3) is used to limit the number of explosion sparks as follows.
where a and b are constants. round is rounding function.
(4) If all sparks are generated from fireworks explosion, the spark population is too simple. Thus, the Gaussian mutation is applied to generate new sparks. The generating process of mutation sparks is as follows. A firework x i is randomly generated from the fireworks population. A certain number of sparks selected randomly are carried out Gaussian mutation operation. The sparks with k dimensions are chosen from the fireworks x i . Gaussian mutation operation is expressed as follows.
where e ∼ N(1, 1), N(1, 1) is the Gaussian distribution;x ik is the -dimensional value of the Gaussian spark; x ik is the k dimensional value of the explosion; and e is generated randomly. The range of sparks is expanding in the explosion process as the sparks are generated from the fireworks explosion. It is necessary to limit the spark position, because it may go beyond the boundaries of the viable domain Ω. Equation (5) is used to map the spark x i , which is beyond the dimension.
where x UpB,k and x LowB, k are the upper and lower bounds of the solution space on the dimension k.
(5) If the new spark generated from the explosion and mutation cannot meet the termination condition, then N sparks are selected from the fireworks. The sparks and the mutation sparks are selected as the fireworks of next generation explosion. The unselected fireworks disappear. This paper assumes the total number of fireworks, explosions sparks, and mutation sparks is M. The size of fireworks is N. The spark with best fitness should be chosen as the next generation firework. Then, N − 1 sparks are chosen from the remaining M − 1 fireworks by using the roulette method. The probability of the candidate sparks chosen as the next explosion fireworks is as follows.
When the selection strategy is used, the fewer sparks there are around is an individual, the greater the probability that the spark is selected as the next explosion fireworks. The explosion and selection processes are repeated until the termination conditions are met.
The original mapping rules of the FWA algorithm cause the algorithm to converge slowly. In view of the deficiencies of the traditional fireworks algorithm, this paper proposes a new improved fireworks algorithm. The best position is at or near the origin. For the solution that is out of bounds in the FWA, according to the mapping rule of Equation (5), the value of one of the firework positions in one dimension is mapped to a position close to the origin. The optimal solution of optimization problems is at the origin, which can accelerate the convergence process of the algorithm to a certain extent. To avoid the illusion of the premature convergence, a new mapping rule is applied, which is expressed as follows.x Appl. Sci. 2020, 10, 1940 5 of 20 where U(0, 1) represents a random number of uniform distribution on the interval [0,1]. Gaussian mutation is applied to generate new sparks in the FWA to avoid the fireworks population of the explosion being too simple, which is shown in Equation (4). This Gaussian mutation has flaws. For example, when the e is close to 0, the position of the Gaussian mutation fireworks is close to 0. The optimal solutions are close to the origin in optimization problems, which may converge to the optimal point after a small number of iteration times. The traditional Gauss mutation method not only enlarges the diversity of fireworks, but also reduces the convergence speed of the algorithm. To solve this problem, the optimal fireworks explosion position is introduced into the improved fireworks, which makes the fireworks ensure the diversity and accelerate the algorithm convergence speed. A new Gaussian mutation sparkx ik equation is proposed to solve this problem, which is expressed as follows.
where e ∼ N(0, 1); N(0, 1) represents a Gaussian distribution whose mean value and variance is 0 and 1. x Bk is the position of the fireworks with the best fitness of the current fireworks population in the k th dimension. The traditional FWA controls the radius and the number of sparks generated from fireworks explosion using Equations (1) and (2). The better the original fireworks fitness is, the smaller the spark radius is. The poorer the fitness is, the larger the spark radius is. A better solution is obtained by expanding the search scope. The entire fireworks are treated variates during the fireworks explosion. Because of the randomness of the explosion, the dimension change in the fireworks may explode in the direction of deviation from the optimal solution, which may result that the local search cannot be completed. An improved method is proposed to enhance the local search. The specific process is as follows.
(1) Ten sparks with better fitness are chosen. Suppose that each spark x i is divided into p-dimensional variates c i1 , c i2 , · · · , c ip . The mean value c p and standard deviation S p of each dimension variate are calculated. The equations are expressed as follows.
If the standard deviation of one demission variate in the spark is small, the variate with better fitness is more concentrated. The spark should be strengthened searching in the vicinity of the mean value. Conversely, if the standard deviation of one demission variate in the spark is large, the optimal solution position cannot be determined. Thus, the radius of the explosion should be expanded to complete the global search. The q-dimensional variate is chosen from p-dimensional variate with better fitness to enhance local search by comparing the standard deviation of each dimension variate.
(2) The best fitness spark is chosen from the first explosion sparks, mutation sparks, and the original fireworks. Then, remaining sparks are selected randomly. Before the fireworks explosion, the q-dimensional variate is screened to determine whether a dimension variate is in the interval [c p − S p , c p + S p ]. If the dimension variate is in the interval, this dimension variate is in the optimal solution range. The next explosion range is defined in the interval [c i − S i , c i + S i ], which can strength local search ability. For variates that are out of [c p − S p , c p + S p ] and unselected p − q dimension variates are exploded by the original way.
(3) Ten sparks with better fitness are chosen.
(4) Judge whether the results satisfy the termination condition. If the condition is not satisfied, the explosion and selection steps are repeated until the condition is satisfied.

Multi-dimensional Grey Model and Grey Neural Network Model
Grey model (GM) is to set up grey differential equations through a small amount of discontinuous information. The basic idea of grey model is to use the original data to form the original sequence, which can weaken the randomness of the original data and reflect the continuous change process of internal things. The multi-dimensional grey dynamic prediction model is GM (1 , n ) model, which is order 1 and n represents independent variables. The modeling process of GM (1, n ) model is as follows [5].

Multi-dimensional Grey Model and Grey Neural Network Model
Grey model (GM) is to set up grey differential equations through a small amount of discontinuous information. The basic idea of grey model is to use the original data to form the original sequence, which can weaken the randomness of the original data and reflect the continuous change process of internal things. The multi-dimensional grey dynamic prediction model is GM (1,n) model, which is order 1 and n represents independent variables. The modeling process of GM (1,n) model is as follows [5].
Suppose that the original sequence has n variates and each variate corresponds to the sequence of m datasets [29,30].
The original sequence x The mean value generation sequence with consecutive neighbors of x The data matrix B and the vector matrix y n is expressed as follows.
The parameter identification array p n is expressed as follows.
The predictive model is expressed as follows.
The relative error of the model is expressed as follows.
The characters of grey model (GM) are small sample size and simple model structure. However, the self-learning ability of the grey prediction model is insufficient. The processing capacity of GM is relatively weak for more complex nonlinear systems [6]. Back propagation neural network has high mapping ability for the nonlinear function and can approximate any functions with any accuracy. The prediction accuracy is improved by combining the lower data modeling of the grey system theory with the nonlinear mapping of the neural network. The modeling process of grey neural network (GNN) is as follows [9].
The original sequence t is expressed as y(t) and the prediction result x * (1) t is expressed as z(t). The differential equation of the GNN model with n parameters are expressed as follows.
where y 2 , · · · , y n are the input parameters of the system; y 1 is the output parameter of the system; and a, b 1 , b 2 , · · · , b n−1 are the coefficients of differential equations. The time response of Equation (7) is expressed as follows.
After transformation, Equation (20) is mapped to an extended back propagation neural network. The GNN model with n input parameters and 1 output parameter is established. The topology is shown in Figure 2. where n y y , , 2  are the input parameters of the system; 1 y is the output parameter of the system; are the coefficients of differential equations.
The time response of Equation (7) is expressed as follows.
and Equation (19) is transformed as follows.
In this paper, the number of L3 neurons is determined according to Equation (22).
where input n is the number of model input variables. output n is the number of output variables.

Improved Fireworks Algorithm Optimization Grey Neural Network
The weights and thresholds of GNN are determined randomly. If the weights and thresholds are not selected properly, the GNN model easily falls into local optimum. The six variates a, b 1 , b 2 , b 3 , b 4

The Relay Experiment
When the relay is energized, the contacts are closed. The mechanical collision of dynamic and static contacts causes the vibration and bounce of the contacts, which indicates that the stable state of the contacts cannot be reached immediately. The contacts have a process of bounce. The dynamic contact and static contact have different dynamic contact characteristics. There are faults in electromagnetic relay and different kinds of failure mode. However, the failures caused by contact of relay account for more than 80% of relay failures.
Thirteen HH52P small relays (Shanghai People Electric Co., Ltd, Shanghai, China) were used for life test. The performance parameters of the relay are shown in Table 1. The relays are divided into three groups to simulate the actual working conditions due to the certain difference in the working environment of the relay. The reliability tests are carried out at temperatures of -20, 20, and 55 • C in the incubator. A constant current of 5 A is applied to the relay to obtain a large dynamic contact voltage drop peak and a static contact pressure drop since the contact resistance between the contacts is small and difficult to measure.
The bounce time of the contact, the duration of the dynamic contact resistance, the peak of the dynamic contact pressure drop, and the static contact pressure drop are tested. The measurement is performed every same time and the values of each parameter at different temperatures are recorded separately. The number of intermediate intervals is set to 10,000 times. If the measured values differ more or are unstable in a certain period, the number of measurements is appropriately increased. The test interval should be shortened and the number of test groups increased at the beginning of life since the relay life prediction is based on its vital state information. The life of the relay used in the test is generally about one million times. The test data of the first 10,000 times are used as the basis for judging the initial state of life.

Parameter Analysis
Parameters describe the performance of a relay contact. The bounce time and contact resistance are commonly used. The bounce time includes the bounce time of the contact and the steady time of the contact in the dynamic process of closure. The contact causes grain fatigue on the contact surface and mechanical wear. The bounce time is changed by the wear of contact surface, thus the condition of contact wear is reflected by the bounce time.
In the applied process of the relay, the contact resistance value also changes constantly owing to the phenomena of oxidation, electrochemical reaction, and wear. The contact failure occurs when the contact resistance value exceeds the limit. The dynamic contact resistance and static contact resistance are two important parameters of the performance of relay. However, it is not easy to measure the contact resistance directly. The contact resistance is expressed by measuring the contact voltage drop indirectly. The contact voltage drop is also divided into the dynamic contact voltage drop and static contact voltage drop. The dynamic contact voltage drop is the voltage drop from just touching the steady state of the intermediate process, which is always reflected by the dynamic contact voltage drop peak. The static contact voltage drop is the voltage drop after steady contact.
The working environment of relay is complicated. The reliability of relay is related to the external environment. Temperature is an important parameter. High temperature causes the coil resistance to increase and accelerate the deformation of the insulating material. If the sealing is poor, the low temperature leads to the formation of frost between the contacts. Thus, temperature is a parameter that must be considered in the lifetime experiment of relay.
The HH52P relay is taken as an example. The four parameters are taken as the measuring indexes which contain contact bounce time t T , duration of dynamic contact resistance t D , dynamic contact voltage drop peak, and static contact voltage drop V C . Thirteen groups relay are taken to conduct lifetime experiment at −20 • C, 20 • C and 55 • C. The experimental results are shown in Tables 2-4. Table 2. Experimental results of relay at −20 • C.  Table 3. Experimental results of relay at 20 • C.  Table 4. Experimental results of relay at 55 • C. The static contact voltage drop and the dynamic contact voltage drop peak are taken as examples, which can reflect the change law of different parameters with the increase of the number of lifetime experiment at different temperatures. The line graphs are as follows.

Times (Ten Thousands Times) t T (ms) t D (ms) V m (V) V C (V)
There are some sharp points from the experimental data in Figures 3 and 4, which are due to the influence of the experimental environment and the material itself. To imitate the operating state of the relay under real conditions, these sharp points are retained in this paper.

IFWA Performance Analysis
Three standard test functions are used to analyze the IFWA convergence performance and compare it with FWA. The standard test functions are shown in Table 5 [31,32].  The parameter settings of FWA and IFWAs are shown in Table 6.

IFWA Performance Analysis
Three standard test functions are used to analyze the IFWA convergence performance and compare it with FWA. The standard test functions are shown in Table 5 [31,32].  The parameter settings of FWA and IFWAs are shown in Table 6.

IFWA Performance Analysis
Three standard test functions are used to analyze the IFWA convergence performance and compare it with FWA. The standard test functions are shown in Table 5 [31,32].  12, 5.12] The parameter settings of FWA and IFWAs are shown in Table 6.   Table 6 presents that the maximum number of iterations is set to 2000 and the test dimension is 100. Seed N is the number of fireworks. Son N is the number of sparks. Muta N is the number of variant sparks.
The three optimization algorithms are tested repeatedly for 15 times using three standard test functions. The test results are shown in Table 7.  Table 7 presents the optimal values of the three standard test functions are all 0. It is found that the optimal convergence, the worst convergence, and the average convergence of the IFWA in Table 7 are the closest to 0. The 15 tests of IFWA for function Y 3 converge to the optimal value of 0. Compared with the traditional FWA, the convergence accuracy of IFWA has been obviously improved. The average running time of IFWA is the shortest after 15 repeated tests of the three algorithms. Through comparison, the results show that the convergence accuracy and running speed of IFWA are improved compared with FWA.

Simulation Test Data and Evaluation Index
The relay lifetime prediction is based on multi-dimensional GM, GNN model, FWA-GNN model, and the IFWA-GNN model. The corresponding performance parameters and the final lifetime of each relay are recorded at different temperatures. The GM, GNN, FWA-GNN, and IFWA-GNN models were trained with the data in Tables 2-4. The four models were tested with the data in Table 8. Table 8. The initial performance parameters of relay and its lifetime.

Lifetime (Ten Thousands Times)
Temperature The average deviation (AD) and root mean square error (RMSE) are used as the evaluation index of model prediction error. The decision coefficient (R2) is used as the evaluation index of model fitting effect.
where m is the number of samples; v is the actual value of the sample; and v* is the prediction value of the sample. The range of decision coefficient R2 is between 0 and 1. When the decision coefficient R2 is closer to 1, the input and output of the model are better fitted.

The Relay Lifetime Prediction Based on Multi-Dimensional GM
The GM (1, 5) model is established to predict relay life. The GM (1, 5) model includes the parameters of the final lifetime, the temperature, the dynamic contact voltage drop peak, the static contact voltage drop, the duration of the dynamic contact resistance, and the contact bounce time. Among them, the final lifetime is the dependent variate and others are the independent variates.
The original data are transformed to eliminate the errors caused by different magnitude between the variates. The transformation equation is expressed as follows: The parameter identification array p n of the GM is obtained by calculation: The final prediction equation is expressed as follows: The prediction result of GM (1, 5) model is shown in Figure 5.    e(i) = 3.01%. In sum, the lifetime value predicted by the multi-dimensional GM and the actual relay lifetime still has a larger error.

The Relay Lifetime Prediction Based on GNN Model
The relay lifetime experiment is long, so the number of samples is small. The relay lifetime belongs to the case of fewer data and poor information. Thus, the relay lifetime on the initial state is predicted with the GNN model. The process is as follows.
The original data are accumulated as network input and output parameters. The final output is lifetime and the input variates are the remaining five parameters.
The network parameters and the value of the parameters are initialized.
Error of L4 layer: δ = d − y 1 (t) Error of L3 layer: −ω 11 t )(ω 21 δ 1 + ω 22 δ 2 + · · · + ω 2n δ n ) Adjust the connection weights of L2 layer to L3 layer: Adjust the connection weights of L1 layer to L2 layer: ω 11 = ω 11 + atδ n+1 Adjust threshold: θ = (1 + e −ω 11 t )( ω 22 2 y 2 (t) + ω 23 2 y 3 (t) + · · · + ω 2n 2 y n (t) − y 1 (0)). The prediction result of GNN model is shown in Figure 6. The prediction result of GNN model is shown in Figure 6.    Figure 7 presents the convergence rate of the GNN model is fast and the error converges to the minimum at the 12th time. However, this study presents that the prediction results are not ideal. The prediction accuracy is lower than the multi-dimensional GM because the initial parameters of the GNN model are randomly generated and the premature convergence causes the network to jump into the local optimal solution. The GNN parameters are not optimal. The GNN parameters should be optimized to improve the prediction effect of GNN model.

The Relay Lifetime Prediction Based on the IFWA Optimizing GNN Model
The six variates compose a whole firework and five seed fireworks are randomly generated. The number of each next generation seed fireworks is 5; the maximum number of sparks generated by each seed fireworks explosion is 50; the minimum is 10; the coefficient u of the explosion sparks number i S is 160; the coefficient c R of the explosion radius i R is 0.5; the number of iteration is 600; and the sparks generated by Gaussian mutation is 5.  Figure 7 presents the convergence rate of the GNN model is fast and the error converges to the minimum at the 12th time. However, this study presents that the prediction results are not ideal. The prediction accuracy is lower than the multi-dimensional GM because the initial parameters of the GNN model are randomly generated and the premature convergence causes the network to jump into the local optimal solution. The GNN parameters are not optimal. The GNN parameters should be optimized to improve the prediction effect of GNN model.

The Relay Lifetime Prediction Based on the IFWA Optimizing GNN Model
The six variates a, b 1 , b 2 , b 3 , b 4 , b 5 compose a whole firework and five seed fireworks are randomly generated. The number of each next generation seed fireworks is 5; the maximum number of sparks generated by each seed fireworks explosion is 50; the minimum is 10; the coefficient u of the explosion sparks number S i is 160; the coefficient R c of the explosion radius R i is 0.5; the number of iteration is 600; and the sparks generated by Gaussian mutation is 5.
Ten sparks with better fitness are selected from the sparks generated from the initial fireworks explosion, Gaussian mutation sparks, and the original sparks. The mean value and standard deviation of each dimension variate are calculated. The two-dimensional variates with the smallest standard deviation are chosen to deeply local search. Taking the first explosion for example, the standard deviation and the mean value of each dimension variate of the ten sparks are calculated. Therefore, the local search of b 2 and b 3 whose standard deviation are smaller should be strengthened in next explosion. The radius of variate b 2 with the range [0.3780, 0.4530] and variate b 3 with the range [0.4161, 0.4675] should be limited in next explosion. The standard deviation and mean value of each dimension variates are shown in Table 9. The one spark with best fitness and four other sparks selected randomly are regarded as the original fireworks of the next explosion. After the explosion is completed, the standard deviation and mean value of the ten best fitness sparks are calculated. Then, the two-dimensional variates and the scope of explosion are reconfirmed. The process is repeated until the termination condition is satisfied. There is certain randomness of the optimization results due to the randomness of the initial coefficient selection and the uncertainty of the explosion. The traditional FWA optimization model and the IFWA optimization model were run ten times. The relative errors between prediction value and the actual value are shown in Table 10. The relative error of the IFWA is smaller compared with the traditional FWA and the calculation result is more stable. The improved fireworks algorithm (IFWA) optimization model and fireworks algorithm (FWA) optimization model were run five times. Ten sets of fitness iteration curves were obtained. The curve comparison is shown in Figure 8. 18 The one spark with best fitness and four other sparks selected randomly are regarded as the original fireworks of the next explosion. After the explosion is completed, the standard deviation and mean value of the ten best fitness sparks are calculated. Then, the two-dimensional variates and the scope of explosion are reconfirmed. The process is repeated until the termination condition is satisfied. There is certain randomness of the optimization results due to the randomness of the initial coefficient selection and the uncertainty of the explosion. The traditional FWA optimization model and the IFWA optimization model were run ten times. The relative errors between prediction value and the actual value are shown in Table 10. The relative error of the IFWA is smaller compared with the traditional FWA and the calculation result is more stable. The improved fireworks algorithm (IFWA) optimization model and fireworks algorithm (FWA) optimization model were run five times. Ten sets of fitness iteration curves were obtained. The curve comparison is shown in Figure 8.   Figure 8 shows that the convergence rate of the grey neural network model-improved fireworks algorithm (IFWA-GNN) model is faster than the traditional grey neural network model-fireworks algorithm (FWA-GNN) model. The improved fireworks algorithm (IFWA) fitness is lower than that of fireworks algorithm (FWA), which proves that the error of the IFWA is smaller and the fitness is better. The best results of the IFWA optimizing model and the traditional FWA optimizing model are compared. The average relative error of traditional FWA optimization model is e 1 = 2.31%, while that of the IFWA optimization model is e 2 = 1.96%.
The prediction results of FWA optimization model and the IFWA optimization model are shown in Figure 9.

Prediction Effect Evaluation of Each Model
Three evaluation indices of AD, RMSE, and R2 are used to evaluate the prediction effect of the three models. The evaluation results are shown in Table 11.  Table 11 presents that the AD and RMSE values in GNN model are the largest of the four prediction models, indicating that the prediction error of the GNN model is larger. Similarly, the decision coefficient R2 of the GNN model is 0.81 and is the smallest of the four models, indicating the input and output fits of the GNN model are worse. The AD and RMSE values of FWA and IFWA are obviously better than the GNN model. The FWA-GNN and IFWA-GNN have the highest coefficient R2 of determination. The fitting effect is better than the GNN model. The prediction error of the model is reduced by optimizing the parameters of the GNN model.
The analysis shows that fitting effect of IFWA-GNN model and FWA-GNN model are better than the other two models. The AD value of IFWA-GNN model is 14.73% smaller than the AD value of FWA-GNN model; the RMSE value of IFWA-GNN model is 6.75% smaller than the RMSE value of FWA-GNN model. Hence, the prediction effect of the IFWA-GNN model is better than the other three models.

Concluding Remarks
The relay is widely used in industrial production and daily life as a core device and in all aspects of the new energy industry. If a relay failure in an electric vehicle is not found, it may cause a greater safety accident. The reliability of relay is a significant guarantee for reliable operation of electric vehicles. The multi-dimensional GNN model was established, and the relay lifetime was predicted by the IFWA-GNN model. The purpose of this paper is to improve the safety and stability of the electric vehicles by improving the prediction accuracy of the model. The main conclusions of this paper are as follows.
(1) The temperature is an important factor affecting the performance parameters of relay, and the parameters are various with the different temperatures. A multi-dimensional grey model is applied to predict the relay lifetime. The five parameters of temperature, contact bounce time t T , dynamic contact resistance duration t D , dynamic contact voltage drop peak V m , and static contact voltage drop V C are used as initial performance parameters. (2) IFWA and FWA are tested by three standard test functions. The test results show that the convergence performance of IFWA is better than FWA. IFWA has the shortest running time. For the three standard test functions, the total average run time of the IFWA is 22.04% faster than the FWA. The relay lifetime is predicted by the model. However, there are shortcomings in the relay lifetime prediction by using the initial performance parameters. For example, the five parameters selected are deficient. The other performance parameters related to the final lifetime are not considered such as the air humidity, atmospheric pressure, etc. The redundant parameters are effectively removed from a large number of parameters, which needs to be solved in future studies.