Photovoltaic array fault diagnosis method for optimizing LightGBM based on improved black-wing plinary algorithm
By improving the Black-winged Kite algorithm to optimize LightGBM, the complex problems of overfitting and parameter tuning in photovoltaic array fault diagnosis are solved, and efficient and accurate fault diagnosis is achieved, especially the accuracy of single and compound faults is improved.
Patent Information
- Application Number
- CN202510419119.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-25
AI Technical Summary
The existing LightGBM algorithm has problems such as high risk of overfitting and complex parameter tuning in photovoltaic array fault diagnosis, which leads to the need to improve diagnostic performance.
LightGBM is optimized by using the improved Black-winged Kite algorithm (IBKA). The global optimization ability and convergence speed of the Black-winged Kite algorithm are improved through lens imaging reverse learning strategy, cosine algorithm and adaptive T distribution perturbation strategy, and an IBKA-LightGBM model is constructed to optimize key parameters such as the number of leaf nodes, learning rate and tree depth.
The accuracy of photovoltaic array fault diagnosis is improved, especially the diagnosis effect of single faults and composite faults, with the overall accuracy reaching 99.17%, which is significantly better than other models.
Smart Images

Figure CN120372465A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic array fault diagnosis, and particularly relates to a photovoltaic array fault diagnosis method based on an improved black-winged kite algorithm for optimizing LightGBM. Background Art
[0002] As an important renewable energy source, in recent years, the photovoltaic power generation technology has been continuously progressing, the photovoltaic array has gradually achieved large-scale development, and the global photovoltaic power generation installed capacity has been continuously increasing. Since photovoltaic modules work outdoors for a long time, adverse weather is likely to cause photovoltaic faults such as open circuit, short circuit, aging, and partial shading, which will reduce the power generation efficiency of the photovoltaic array and affect its service life. Therefore, it is particularly important to achieve efficient and accurate fault diagnosis of the photovoltaic array.
[0003] With the continuous improvement of the intelligence level of photovoltaic systems, machine learning is currently widely used in the diagnostic research of photovoltaic faults. Such as decision trees, extreme learning machines, support vector machines, neural networks, etc. In intelligent diagnostic algorithms, the LightGBM algorithm has been widely used in various types of fault diagnoses due to its advantages of efficient parallel data processing, fast data training speed, and low memory occupancy. However, the LightGBM algorithm also has problems such as a relatively high risk of overfitting and complex parameter tuning, which makes the diagnostic performance to be improved. Summary of the Invention
[0004] To solve the above technical problems, the present invention proposes a photovoltaic array fault diagnosis method based on an improved black-winged kite algorithm for optimizing LightGBM. This method first improves the black-winged kite algorithm (BKA) with three strategies, which improves the global optimization ability and convergence speed of the BKA algorithm; secondly, a photovoltaic fault diagnosis model of IBKA-LightGBM is established, and the improved black-winged kite algorithm is used to optimize the parameters of the LightGBM model. By considering different types of photovoltaic array faults, a photovoltaic array simulation is built and experimental verification is carried out, and the accuracy rates are compared with those of LightGBM, LEA-LightGBM, BKA-LightGBM, and RF models. The results show that the IBKA-LightGBM model not only has a faster convergence and iteration speed, but also has a higher fault diagnosis accuracy rate, and can be effectively applied to the fault diagnosis of photovoltaic arrays.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A photovoltaic array fault diagnosis method based on an improved black-winged kite algorithm for optimizing LightGBM, comprising the following steps:
[0007] Step 1: Simulate the faults of the photovoltaic array, analyze the I-V and P-V curves, and extract the fault feature quantities.
[0008] Step 2: Collect and preprocess the extracted fault feature quantities, and divide them into a training set and a test set.
[0009] Step 3: Optimize and improve the traditional Black Kite Algorithm (BKA) by adopting the lens imaging reverse learning strategy, the sine-cosine algorithm strategy, and the adaptive T-distribution perturbation strategy, which improves the global optimization ability and convergence speed of the Black Kite Algorithm (BKA);
[0010] Step 4: Construct a photovoltaic array fault diagnosis model based on IBKA-LightGBM, and use the training set to train the photovoltaic array fault diagnosis model of IBKA-LightGBM;
[0011] Step 5: Verify the effectiveness of the photovoltaic array fault diagnosis model of IBKA-LightGBM through the test set, and conduct photovoltaic array fault detection.
[0012] In the above Step 1, to effectively reflect the fault information of the photovoltaic array and distinguish different types of faults, G, T, I sc , U oc , I m , U m , P m , and the inflection point number of the curve are selected as the key fault feature quantities, where G is irradiance, T is temperature, I sc is short-circuit current, U oc is open-circuit voltage, I m is maximum power current, U m is maximum power voltage, P m is maximum power;
[0013]
[0014] In the above formula, F1 to F4 are the proportional formulas between I sc , U oc , I m , U m ; F5 is the fill factor; F6 is the slope of the I-V curve.
[0015] In the above Step 1, G, T, I sc , U oc , I m , U m , P m, the inflection point of the curve, and F1 to F6 are used as fault characteristic quantities; eleven fault conditions, namely normal, open circuit, short circuit, aging, partial shadow, open circuit aging, short circuit aging, open circuit shadow, short circuit shadow, open circuit aging shadow, and short circuit aging shadow, are selected, where the normal state is regarded as a special fault.
[0016] In step 3, the black-winged kite algorithm includes:
[0017] 1) Population initialization:
[0018] In the initialization stage, a set of initial solutions is randomly generated to represent the initial positions of the black-winged kite population.
[0019] X i = lb + rand(ub - lb) (10);
[0020] In Equation (10), X i represents the initial position of the black-winged kite population; ub is the upper bound of the position of the i-th black-winged kite; lb is the corresponding lower bound; rand is a random number within [0, 1];
[0021] 2) Attack behavior:
[0022] During flight, the black-winged kite changes its wings and tail according to the wind speed. After hovering and locking the prey's position, it dives quickly and attacks. The specific motion formula is:
[0023]
[0024] n = 0.05×exp(-2×(t / T) 2 ) (12);
[0025] In the above formula, are the positions of the i-th black-winged kite in the j-th dimensional space at the (t + 1)-th and t-th iterations respectively; r is a random number within [0, 1]; T is the total number of iterations; t is the current iteration number; n represents a dynamic parameter related to the iteration and plays a role in calculations such as updating the individual position.
[0026] 3) Migration behavior:
[0027] During the migration of the bird flock, the evaluation mechanism of the population fitness plays a key role. By comparing the fitness value of the current population with the corresponding value of the random population, if it is less than the fitness value, it means that the leader is poor in leading the migration route and coping with environmental changes, etc., and will lose the leadership qualification and join the migrating population; otherwise, the leader will lead the population to the destination according to the established migration strategy to ensure the success of the migration. The specific motion formula is:
[0028]
[0029] m = 2×sin(r + π / 2) (14);
[0030] In the above formula, is the leader of the black-winged kite in the j-th dimension of the current t-th iteration; F i is the fitness value of any current individual; F ri is the fitness value of the random position of any black-winged kite in the j-th dimension during the t-th iteration; m is the correction factor; C(0,1) is the Cauchy mutation, defined as follows:
[0031]
[0032] In formula (15), f(x, δ, μ) represents the probability density function of the Cauchy distribution; x represents the independent variable, representing the value of the random variable, and the value range is all real numbers; δ represents the scale parameter, controlling the "fatness" of the distribution, that is, the degree of dispersion of the distribution; μ represents the location parameter, determining the central position of the Cauchy distribution probability density function;
[0033] When δ = 1 and μ = 0, the probability density function becomes the standard form, and the formula is as follows:
[0034]
[0035] In step 3, the lens imaging reverse learning strategy, sine-cosine algorithm, and adaptive T-distribution perturbation strategy are used to optimize and improve the traditional black-winged kite algorithm (BKA).
[0036] 1) Lens imaging reverse learning strategy:
[0037] The lens imaging reverse learning strategy is used to initialize the population, and the forward population and the reverse population are merged into a new population, which can enable the black-winged kite algorithm to explore a wider search space in the initial stage and increase the probability of finding the global optimal solution. The formula is as follows:
[0038]
[0039] In the above formula, x i represents the value of the i-th dimension of the individual in the population; λ is a parameter determined according to the comparison result of random numbers, used to calculate x i ; u i , l i are the upper and lower limits of the current dimension respectively; i represents the dimension index, used to identify different dimensions of the individual, and i corresponds to each dimension of the individual in turn from 1 to D; rand, r1, and r2 are all random numbers uniformly distributed between 0 and 1; D is the population dimension.
[0040] 2) Sine-cosine algorithm strategy:
[0041] In the attack behavior stage, the sine-cosine algorithm strategy is introduced, and the oscillation of the sine and cosine functions is used to expand the search range of individuals. The position update formula of the sine-cosine algorithm is as follows:
[0042]
[0043] In Equation (6), and are the positions of the i-th black-winged kite individual in the current iteration and the new position updated using the sine-cosine algorithm, respectively; is the position of the optimal individual in the current population; r1, rand, and r2 are all random numbers subject to a uniform distribution, r1 ∈ [0, 2π], rand ∈ [0, 2], r2 ∈ [0, 1]; p is the sine-cosine amplitude conversion factor, and the formula is:
[0044]
[0045] In Equation (7), a is a constant; t is the current iteration number; T max is the maximum iteration number.
[0046] 3) Adaptive T-distribution perturbation strategy:
[0047] To further enhance the balance ability of the black-winged kite algorithm between global exploration and local development, an adaptive T-distribution perturbation strategy is introduced. In the early stage of iteration, the degree of freedom is large and it is approximately a normal distribution, which is beneficial to the global search ability; in the later stage, the degree of freedom decreases and the tail becomes thicker, which is approximately a Cauchy mutation and can finely perturb the local area; the update method of the new position is as follows:
[0048] x(t + 1) = x(t) + x(t) × t(iter) (8);
[0049] In Equation (8), t(iter) is the T-distribution mutation perturbation with the iteration number iter as the degree of freedom; x(t) is the current solution; x(t + 1) is the updated solution.
[0050] In step 4, construct the LigthGBM model:
[0051] The LightGBM algorithm constructs multiple weak decision trees iteratively. In each iteration step, the integrated model composed of multiple weak decision trees that have been constructed first accurately calculates the residual situation of the current prediction, and then constructs a new decision tree with the goal of minimizing the loss function.
[0052] The objective function of the LightGBM model is expressed as:
[0053]
[0054] In Equation (17), is the loss function, f m is the complexity of the m-th tree, Ω(f m ) is the regularization term; y i represents the true label value of the i-th sample; represents the predicted value of the i-th sample; M represents the number of decision trees in the model;
[0055] After each round of iteration, the model calculates the loss value and then constructs a new tree. The goal of the new decision tree is to minimize the loss function, reduce the difference between the predicted value and the true value as much as possible, and continuously improve the performance.
[0056] Finally, the prediction results of each decision tree are cumulatively summarized to obtain the final predicted value. The prediction result is shown in formula (9):
[0057]
[0058] In formula (9), F(x) is the final weighted output; f n (x) is the output value of each decision tree;
[0059] In step 4, the improved black-winged kite algorithm is used to optimize the key parameters in the LigthGBM model. Specifically: three parameters are optimized:
[0060] 1) The number of leaf nodes: Increasing this value within a specific range can enhance the model's fitting ability to data and thus improve the model's prediction accuracy.
[0061] 2) The learning rate: This parameter is mainly used to control the step size of the model during each iterative update.
[0062] 3) The depth of the tree: Limiting the maximum depth of the decision tree can effectively simplify the structural complexity of the model.
[0063] The photovoltaic array fault diagnosis model of IBKA-LightGBM is built, including: formula (10) - formula (16), formula (4) - formula (8), formula (17), formula (9).
[0064] The fault feature quantity is used as the model input, and the fault category is used as the model output.
[0065] The technical effects of a photovoltaic array fault diagnosis method based on the improved black-winged kite algorithm to optimize LightGBM of the present invention are as follows:
[0066] 1) Through photovoltaic fault simulation and simulation, the present invention extracts fault feature quantities according to the volt-ampere characteristic curves of different faults, and uses sufficient feature quantity data to train the fault diagnosis model, which can effectively diagnose single faults such as open circuit and short circuit as well as multiple composite faults.
[0067] 2) The present invention optimizes the strategy based on the Black-winged Kite Algorithm (BKA) to obtain the Improved Black-winged Kite Algorithm (IBKA). The optimization ability of the Improved Black-winged Kite Algorithm (IBKA) exceeds that of the Cuckoo Search Algorithm (COA), Whale Optimization Algorithm (WOA), Catfish Optimization Algorithm (CPO) and Black-winged Kite Algorithm (BKA), showing the best performance. Through the comparison of BKA and IBKA in the function optimization results, the convergence speed of IBKA is significantly improved after strategy optimization, and the diversity of the black-winged kite population is increased, further improving the global optimization ability.
[0068] 3) The present invention uses the Improved Black-winged Kite Algorithm (IBKA) to optimize the key parameters in LightGBM, and constructs a photovoltaic array fault diagnosis model of IBKA-LightGBM. The fault characteristic quantity is used as the model input, and the fault category is used as the model output. Through the comparison with LightGBM, Random Forest (RF), BKA-LightGBM, IBKA-LightGBM and LEA-LightGBM, the diagnosis effect of this model on single faults and compound faults is better, and the overall accuracy rate reaches 99.17%, proving the accuracy and superiority of the method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The present invention will be further described below with reference to the drawings and embodiments:
[0070] Figure 1 It is a simulation diagram of the photovoltaic array structure.
[0071] Figure 2(a) is the I-V diagram under different irradiances;
[0072] Figure 2(b) is the I-V diagram under different temperatures.
[0073] Figure 3(a) is the I-V diagram of single fault;
[0074] Figure 3(b) is the P-V diagram of single fault;
[0075] Figure 3(c) is the I-V diagram of compound fault;
[0076] Figure 3(d) is the P-V diagram of compound fault.
[0077] Figure 4 It is the flowchart of the IBKA algorithm.
[0078] Figure 5(a) is the convergence curve of function f1;
[0079] Figure 5(b) is the convergence curve of function f1.
[0080] Figure 6 It is the overall flowchart of fault diagnosis. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0081] A photovoltaic array fault diagnosis method based on optimizing LightGBM with an improved black-winged kite algorithm, including the following analysis:
[0082] (1) Characteristic curve analysis:
[0083] A 3×5 photovoltaic array simulation is established in Matlab / Simulink, and its normal operation structure is as Figure 1 shown. There are various faults in the photovoltaic array. The common single faults mainly targeted by this invention include open circuit, short circuit, aging, and partial shading. For compound faults, due to the long-term existence of partial shading and aging faults under the influence of various complex factors, multiple faults of the photovoltaic array will occur simultaneously. Therefore, in combination with the actual situation, the single faults and compound faults mainly considered in this invention are described in Table 1 as follows.
[0084] Table 1 Fault types and labels
[0085]
[0086]
[0087] When the wire of a photovoltaic module forms a short-circuit fault due to poor contact, lightning strike damage to the wire insulation, or damage caused by friction during long-term use. The metal material at the connector joint of the photovoltaic module expands and contracts due to thermal expansion and contraction or improper operation during installation, resulting in a loose joint and forming an open-circuit fault. The photovoltaic module is exposed to the ultraviolet environment for a long time during power generation operations, resulting in a decrease in the current collection ability and forming an aging fault. When the photovoltaic module is blocked by clouds, leaves, etc. for a long time, the module changes from an energy storage element to a load form to consume energy, forming a shadow fault. Considering that in the actual scenario, most shadows block in a way along a certain corner or side of the photovoltaic array, based on this, this invention focuses on studying the local shadow situation.
[0088] The output characteristic curve of a photovoltaic module is generally represented by the I-V characteristic curve and the P-V characteristic curve. The two factors with greater influence in the external environment are the irradiance S and the temperature T. Figures 2(a) and 2(b) are the photovoltaic characteristic curves at different irradiances when the temperature is 25°C and the photovoltaic characteristic curves at different temperatures when the light intensity is 1000 W / m 2 ² respectively. It can be seen from Figures 2(a) and 2(b) that when the irradiance increases, the short-circuit current increases significantly; when the temperature increases, the open-circuit voltage increases relatively.
[0089] Two components in the photovoltaic string are short-circuited to simulate a short circuit; one branch in the photovoltaic array is disconnected to simulate an open circuit; a 10 Ω resistor is connected in series to simulate aging; for local shadow simulation, the irradiance of the first row is set to 0.4S, and the irradiance of the second row is set to 0.7S. The composite fault simulation is carried out by corresponding superposition on the single fault condition. According to the fault simulation, the I-V characteristic curves and P-V characteristic curves of 11 typical faults in the photovoltaic array under standard conditions can be obtained, as Figures 3(a) to 3(d) shown.
[0090] As can be seen from Fig. 3(a) and Fig. 3(b), when a short circuit occurs in the photovoltaic array, the open-circuit voltage will decrease significantly, the short-circuit current remains basically unchanged, and the maximum power point drops slightly. When an open circuit occurs, the maximum power current and the short-circuit current drop sharply, and the open-circuit voltage changes little. When aging occurs, the open-circuit voltage and the short-circuit current change little, and the maximum power drops slightly. When local shadow appears, the maximum operating point current and the maximum operating point power show a multi-peak phenomenon, and the open-circuit voltage and the short-circuit current change slightly. As can be seen from Fig. 3(c) and Fig. 3(d), when open-circuit aging and short-circuit aging faults occur, their characteristic curves are similar to those of open circuit and short circuit; there are multiple inflection points on the characteristic curves of other composite faults, so the number of curve inflection points can be introduced as a key characteristic quantity.
[0091] To effectively reflect the fault information of the photovoltaic array and distinguish different types of faults, according to the above analysis, G, T, I SC , U OC , I m , U m , P m , and the number of curve inflection points are selected as key fault characteristic quantities. To more fully explore the fault information and further enrich the fault characterization dimension, the present invention additionally selects the following fault characteristic quantities.
[0092]
[0093] In the above formula, F1 to F4 are the proportional formulas between I sc , U oc , I m , U m ; F5 is the fill factor; F6 is the slope of the I-V curve.
[0094] (2) Fault diagnosis model:
[0095] To improve the diagnostic accuracy of existing diagnostic methods for photovoltaic array faults, the present invention proposes a photovoltaic array fault diagnosis method based on the improved black-winged kite algorithm (IBKA) to optimize the lightweight gradient boosting machine (LightGBM). The traditional black-winged kite algorithm (BKA) is optimized and improved by adopting a lens imaging reverse learning strategy, a sine-cosine algorithm, and an adaptive T-distribution perturbation strategy to solve the problems that it is prone to falling into local optimal solutions and has a slow convergence speed in practical applications, and a photovoltaic array fault diagnosis model based on IBKA-LightGBM is constructed. The specific process is as Figure 4 shown.
[0096] 1) Lens imaging reverse learning strategy:
[0097] Since the black-winged kite algorithm initializes the population through a random function, the population diversity will decrease in the later stage of iteration, the similarity between individuals will increase continuously, and the population will fall into a local optimum. In view of this, the lens imaging reverse learning is adopted to initialize the population, and the forward population and the reverse population are merged into a new population, which can enable the algorithm to explore a wider search space in the initial stage and increase the probability of finding the global optimal solution, corresponding to optimization ①. The formula is as follows:
[0098]
[0099] In the above formula: x i represents the value of the i-th dimension of an individual in the population; λ represents a parameter determined according to the comparison result of random numbers and is used to calculate x i ; u i , l i are the upper and lower limits of the current dimension respectively; i represents the dimension index, which is used to identify different dimensions of an individual. i corresponds to each dimension of the individual in turn from 1 to D; rand, r1, and r2 are all random numbers uniformly distributed between 0 and 1; D is the population dimension.
[0100] 2) Sine-cosine algorithm strategy:
[0101] In the attack behavior stage, the sine-cosine algorithm strategy is introduced to utilize the oscillation of the sine-cosine function to expand the search range of individuals. In the early stage of the algorithm, a larger search step size is helpful for global search, enabling individuals to cross a larger area to find possible better solutions, making up for the deficiency of the global search ability of BKA; a smaller search step size in the later stage of the algorithm focuses more on local search, finely exploring the found potential areas, and enhancing the local search ability of BKA, corresponding to optimization ②. The position update formula of the sine-cosine algorithm is:
[0102]
[0103] In formula (6), and They are the position of the \(i\)-th black-winged kite individual in the current iteration and the new position updated using the sine-cosine algorithm, respectively; is the optimal individual position in the current population; \(r_1\), \(rand\), and \(r_2\) are all random numbers obeying the uniform distribution, \(r_1\in[0, 2\pi]\), \(rand\in[0, 2]\), \(r_2\in[0, 1]\); \(p\) is the sine-cosine amplitude conversion factor, and the formula is:
[0104]
[0105] In formula (7), \(a\) is a constant; \(t\) is the current iteration number; \(T\) max is the maximum iteration number.
[0106] 3) Adaptive T-distribution perturbation strategy:
[0107] In the migration behavior stage, the local search accuracy of the original strategy is insufficient, and it is difficult to accurately approximate the global optimal solution in the later stage. In order to further enhance the balance ability of the black-winged kite algorithm between global exploration and local development, an adaptive T-distribution perturbation strategy is introduced. In the early stage of iteration, the degree of freedom is large and it is approximately a normal distribution, which is beneficial to the global search ability; in the later stage, the degree of freedom decreases and the tail becomes thicker, which is approximately a Cauchy mutation, and the local area can be finely perturbed. By adjusting the degree of freedom with the iteration, the dynamic balance between global and local searches is achieved, and the adaptability of the algorithm to complex problems and the accuracy of the solution are improved, corresponding to optimization ③. The update method of the new position is as follows:
[0108] \(x(t + 1)=x(t)+x(t)\times t(iter)\) (8);
[0109] In formula (8), \(t(iter)\) is the T-distribution mutation perturbation with the iteration number \(iter\) as the degree of freedom; \(x(t)\) is the current solution; \(x(t + 1)\) is the updated solution.
[0110] (3) Performance evaluation of the IBKA algorithm:
[0111] In the present invention, comparative experiments are carried out through test functions. The comparative intelligent optimization algorithms include: whale optimization algorithm (WOA), coati optimization algorithm (COA), crested porcupine optimization (CPO), BKA, and the improved IBKA with multiple strategies. To verify the effectiveness of the improved algorithm and the adopted strategies in this paper. The population size of the 5 algorithms is set to 50, and the maximum iteration number is 1000. Two different benchmark test functions are selected, namely \(f1\) and \(f2\), and their standard test function definitions are shown in Table 2.
[0112] Table 2 Test Function
[0113]
[0114] To reduce the error influence of experimental results, after each group of experiments was independently run 30 times, as shown in Figure 5(a) and Figure 5(b), the average fitness iteration convergence curves of different algorithms were plotted. It can be seen from Figure 5(a) and Figure 5(b) that BKA is better than COA, WOA, and CPO in terms of fitness. However, as the number of convergence increases, the curve tends to be flat and shows a phenomenon of convergence stagnation. Among the five optimization algorithms, IBKA has the best fitness and iteration times on functions f1 and f2, can achieve convergence fastest, and has the smallest fitness value.
[0115] (4) Photovoltaic array fault diagnosis process:
[0116] The specific steps of the photovoltaic fault diagnosis method based on IBKA-LightGBM are as Figure 6 shown.
[0117] 1) Through the simulation of photovoltaic array faults and the analysis of I-V and P-V curves, the required photovoltaic fault characteristic quantities are extracted;
[0118] 2) Data collection and preprocessing of the characteristic quantities are carried out, and they are divided into a training set and a test set;
[0119] 3) The BKA algorithm is optimized to obtain IBKA, and the optimal solution of the output parameters is obtained. The specific steps are as Figure 4 shown.
[0120] 4) Use the training set to train the optimized IBKA-LightGBM to establish a photovoltaic array fault diagnosis model of IBKA-LightGBM.
[0121] 5) Verify the effectiveness of the model through the test set and conduct photovoltaic fault detection.
[0122] (5) Experimental verification:
[0123] Based on Figure 1 the photovoltaic array simulation model in, the irradiance of the photovoltaic module is set to 300 - 900 W / m 2 , and the temperature is 15 - 45 °C, and the values are taken at intervals of 10 W / m 2 and 6 °C respectively. The experiment includes a total of 11 working conditions. For each working condition, 366 groups of samples are obtained through fault simulation, with a total of 4026 groups. Each group of data includes 14 characteristic quantity data in the volt-ampere characteristic curve and the fault type label, and the training set and the test set are randomly allocated according to a ratio of 7:3.
[0124] To verify the feasibility of the LightGBM model and the effectiveness of the IBKA optimization algorithm, the selected 11 working condition test sets are input into the LightGBM, Random Forest (RF), BKA-LightGBM, IBKA-LightGBM, and LEA-LightGBM models trained with the training data for diagnostic classification. The maximum number of iterations of the algorithm is 50, and the population size is 20. To reduce random errors, each model is independently run 10 times and the average value is taken.
[0125] The experiment shows that the fault diagnosis accuracy of RF is only 87.65%, which is the lowest among the 5 fault diagnosis models. The misjudgment rates of faults 9 and 10 are relatively high, indicating that the diagnostic ability for compound faults is weak. Compared with the RF model, the diagnostic effect of the LightGBM model for compound faults has been improved. However, both models have relatively serious class confusion in fault categories 2 and 6. As can be seen in Figures 3(a) to 3(d) that the volt-ampere characteristic curves of short circuit and short circuit aging are relatively similar, so misdiagnosis is likely to occur.
[0126] The models optimized by adding the LEA and BKA algorithms have improved in terms of accuracy and reduced the misdiagnosis in fault categories 2 and 6. However, there is still room for improvement in the diagnostic effect. After optimizing the LightGBM model with the IBKA algorithm, its diagnostic effect is the best, and the accuracies of the training set and the test set reach 100% and 99.17% respectively. The misdiagnosis situation has been significantly improved, and the diagnostic accuracies of compound faults are all approximately 100%, higher than those of other diagnostic models.
[0127] (VI) Working principle:
[0128] (1) Construction of the LigthGBM model:
[0129] The LightGBM algorithm is a gradient boosting framework improved on the basis of the traditional gradient decision tree. It has significant advantages, including low memory occupancy and can operate efficiently in an environment with limited resources; fast training speed, which greatly shortens the model training time; and high prediction accuracy, which can provide accurate prediction results.
[0130] This algorithm addresses the problem of poor accuracy in the GBDT algorithm and the XGBoost algorithm when dealing with high-dimensional input features and massive data. It integrates the histogram algorithm, the leaf-wise growth strategy, the gradient-based one-side sampling (GOSS) algorithm, and the exclusive feature bundling (EFB) algorithm on the basis of GBDT. These improvements accelerate the calculation of split points in LightGBM, enabling the precise construction of decision trees and enhancing the calculation efficiency. The core operating principle of the LightGBM algorithm is to iteratively construct multiple weak decision trees. In each iteration, the model first accurately calculates the residual of the current prediction, and then constructs a new decision tree with the goal of minimizing the loss function.
[0131] Finally, the prediction results of each decision tree are cumulatively summarized to obtain the final prediction value. The prediction result is shown in formula (9).
[0132]
[0133] In formula (9), F(x) is the final weighted output; f n (x) is the output value of each decision tree;
[0134] (2) Black-winged kite algorithm:
[0135] The black-winged kite algorithm (BKA) is a new type of intelligent optimization algorithm inspired by the predation behavior of black-winged kites in nature, with excellent optimization performance. The algorithm mainly consists of three parts: initialization, attack behavior, and migration behavior.
[0136] 1) Population initialization:
[0137] In the initialization stage, a group of starting solutions is randomly generated to represent the initial positions of the black-winged kite population.
[0138] X i = lb + rand(ub - lb) (10);
[0139] In formula (10), X i represents the initial position of the black-winged kite population; ub is the upper bound of the position of the i-th black-winged kite; lb is the corresponding lower bound. rand is a random number within [0,1].
[0140] 2) Attack behavior:
[0141] During flight, the black-winged kite changes its wings and tail according to the wind speed. After hovering and locking the prey position, it quickly dives and attacks. The specific motion formula is:
[0142]
[0143] n = 0.05×exp(-2×(t / T) 2 ) (12);
[0144] In the above formula, are respectively the positions of the i-th black-winged kite in the (t + 1)-th and t-th iterations in the j-th dimension space; r is a random number within [0, 1]; T is the total number of iterations; t is the current iteration number; n is a dynamic parameter related to iteration and plays a role in calculations such as updating the individual position.
[0145] 3) Migration behavior:
[0146] During the migration process of the bird flock, the evaluation mechanism of the population fitness plays a key role. By comparing the fitness value of the current population with the corresponding value of the random population, if it is less than the fitness value, it indicates that the leader is poor in leading the migration route and coping with environmental changes, etc., and will lose the leadership qualification and join the migration population; otherwise, the leader will lead the population to the destination according to the established migration strategy to ensure the success of the migration. The specific action formula is:
[0147]
[0148] m = 2×sin(r + π / 2) (14);
[0149] In the above formula, is the leader of the black-winged kite in the j-th dimension of the current t-th iteration; F i is the fitness value of the current any individual; F ri is the fitness value of any black-winged kite at the random position in the j-th dimension in the t-th iteration; m is the correction factor; C(0, 1) is the Cauchy mutation, defined as follows:
[0150]
[0151] In formula (15), f(x, δ, μ) is the probability density function of the Cauchy distribution; x is the independent variable, representing the value of the random variable, and the value range is all real numbers; δ is the scale parameter, controlling the "fatness" of the distribution, that is, the dispersion degree of the distribution; μ is the position parameter, determining the central position of the Cauchy distribution probability density function.
[0152] When δ = 1 and μ = 0, the probability density function becomes the standard form, and the formula is as follows:
[0153]
[0154] (VII) The present invention has the following characteristics:
[0155] 1) Select G, T, I SC , U OC , I m , U m , P m , the number of inflection points, F1 to F6 as fault feature quantities, and select 11 kinds of fault conditions such as open circuit, short circuit, and aging; the normal state is regarded as a special fault; the data set is divided into a training set and a test set for training a photovoltaic fault model and performing fault type judgment.
[0156] 2) Compared with the traditional BKA algorithm, the present invention proposes the IBKA algorithm through optimization by a mirror imaging reverse learning strategy, a sine-cosine algorithm, and an adaptive T-distribution perturbation strategy, and verifies it by comparison with the SSA, WOA, LEA, and BKA algorithms. Through the convergence curves and convergence conditions of the test functions f1 and f2, it can be shown that the IBKA algorithm has a faster convergence speed and better global search ability.
[0157] 3) The present invention proposes a photovoltaic array fault diagnosis model of IBKA-LightGBM, which optimizes the problem that aging faults and short-circuit aging faults are easily confused in other models, and has excellent fault diagnosis rates for single faults and compound faults.
[0158] 4) The present invention uses 2 different benchmark test functions for the algorithm performance evaluation of IBKA, and gives the formula definition and value range of the functions. The population sizes and maximum iteration numbers of 5 algorithms are set to 50 and 1000 respectively. To reduce test errors, each group of experiments is carried out 30 times and the average value is taken.
[0159] 5) The present invention draws a simulation diagram of the photovoltaic array structure, and draws the I-V curve and P-V curve for each kind of photovoltaic fault; draws the specific algorithm flowcharts for the BKA algorithm and three optimization strategies; and explains the steps for each step of the overall fault diagnosis process.
Claims
1. A photovoltaic array fault diagnosis method based on optimizing LightGBM with an improved black-winged kite algorithm, characterized in that It includes the following steps: Step 1: Simulate the faults of the photovoltaic array, analyze the I-V and P-V curves, and extract the fault feature quantities; Step 2: Collect and preprocess the extracted fault feature quantities, and divide them into a training set and a test set; Step 3: Optimize and improve the Black Kite Algorithm (BKA) by using the lens imaging reverse learning strategy, the sine-cosine algorithm strategy, and the adaptive T-distribution perturbation strategy, which enhances the global optimization ability and convergence speed of the Black Kite Algorithm (BKA); Step 4: Construct a photovoltaic array fault diagnosis model based on IBKA-LightGBM, and use the training set to train the photovoltaic array fault diagnosis model; Step 5: Verify the effectiveness of the photovoltaic array fault diagnosis model of IBKA-LightGBM through the test set, and conduct photovoltaic array fault detection.
2. The photovoltaic array fault diagnosis method based on optimizing LightGBM by an improved black-winged kite algorithm according to claim 1, wherein: In the said step 1, to effectively reflect the fault information of the photovoltaic array and distinguish different types of faults, G, T, I sc , U oc , I m , U m , P m , and the inflection point number of the curve are selected as key fault characteristic quantities, where G is irradiance, T is temperature, I sc is short-circuit current, U oc is open-circuit voltage, I m is maximum power current, U m is maximum power voltage, P m is maximum power; In the above formula, F1 to F4 are the proportionality formulas between I sc , U oc , I m , U m ; F5 is the fill factor; F6 is the slope of the I-V curve.
3. The photovoltaic array fault diagnosis method based on optimizing LightGBM by the improved black-winged kite algorithm according to claim 2, wherein: Select G, T, I sc , U oc , I m , U m , P m , the number of inflection points of the curve, F1 to F6 as fault feature quantities; select 11 fault conditions including normal, open circuit, short circuit, aging, partial shadow, open circuit aging, short circuit aging, open circuit shadow, short circuit shadow, open circuit aging shadow, short circuit aging shadow 11, among which the normal state is regarded as a special fault.
4. The photovoltaic array fault diagnosis method based on optimizing LightGBM by the improved black-winged kite algorithm according to claim 1, wherein: In the said Step 3, the Black Kite Algorithm includes: 1) Population initialization: In the initialization stage, a group of starting solutions are randomly generated to represent the initial positions of the black kite population; X i = lb + rand(ub - lb) (10); In formula (10), X i represents the initial position of the black-winged kite population; ub is the upper bound of the position of the i-th black-winged kite; lb is the corresponding lower bound; rand is a random number within [0, 1]; 2) Attack behavior: During flight, the black kite changes its wings and tail according to the wind speed. After hovering and locking the prey position, it dives quickly and attacks. The specific motion formula is: n = 0.05×exp(-2×(t / T) 2 ) (12); In the above formula, are the positions of the i-th black-winged kite in the j-th dimensional space at the (t + 1)-th and t-th iterations, respectively; r is a random number within [0, 1]; T is the total number of iterations; t is the current iteration number; n represents a dynamic parameter related to the iteration; 3) Migration behavior: During the migration of the bird flock, the evaluation mechanism of the population fitness plays a key role; by comparing the fitness values of the current population with the corresponding values of the random population, if it is less than the fitness value, it means that the leader is poor in leading the migration route and coping with environmental changes, and will lose the leadership qualification and join the migration population; otherwise, the leader will lead the population to the destination according to the established migration strategy to ensure the success of the migration; the specific motion formula is: m = 2×sin(r + π / 2) (14); In the above formula, is the leader of the black-winged kite in the j-th dimension at the current t-th iteration; F i is the fitness value of any current individual; F ri is the fitness value of any black-winged kite at a random position in the j-th dimension at the t-th iteration; m is the correction factor; C(0,1) is the Cauchy mutation, defined as follows: In formula (15), f(x, δ, μ) represents the probability density function of the Cauchy distribution; x represents the independent variable, representing the value of the random variable, and the value range is all real numbers; δ represents the scale parameter, controlling the dispersion degree of the distribution; μ represents the position parameter, determining the central position of the Cauchy distribution probability density function; When δ = 1 and μ = 0, the probability density function becomes the standard form, and the formula is as follows:
5. The photovoltaic array fault diagnosis method based on optimizing LightGBM with an improved black-winged kite algorithm according to claim 4, wherein: Optimize and improve the Black Kite Algorithm (BKA) by using the lens imaging reverse learning strategy, the sine-cosine algorithm, and the adaptive T-distribution perturbation strategy; 1) Lens imaging reverse learning strategy: Use the lens imaging reverse learning strategy to initialize the population, and merge the forward population and the reverse population into a new population, which can enable the Black Kite Algorithm to explore a wider search space in the initial stage and increase the probability of finding the global optimal solution. The formula is as follows: In the above formula, x i represents the value of the i-th dimension of an individual in the population; λ represents a parameter determined according to the comparison result of random numbers and is used to calculate x i ; u i , l i are the upper and lower limits of the current dimension respectively; i represents the dimension index and is used to identify different dimensions of an individual. i corresponds to each dimension of the individual in sequence from 1 to D; rand, r1, and r2 are all random numbers uniformly distributed between 0 and 1; D is the population dimension; 2) Sine-cosine algorithm strategy: In the attack behavior stage, introduce the sine-cosine algorithm strategy, and use the oscillation of the sine-cosine function to expand the search range of individuals; the position update formula of the sine-cosine algorithm is: In formula (6), and are respectively the position of the i-th black-winged kite individual in the current iteration and the new position updated using the sine-cosine algorithm; is the optimal individual position in the current population; r1, rand, and r2 are all random numbers obeying the uniform distribution, r1 ∈ [0, 2π], rand ∈ [0, 2], r2 ∈ [0, 1]; p is the sine-cosine amplitude conversion factor, and the formula is: In formula (7), a is a constant; t is the current iteration number; T max is the maximum number of iterations; 3) Adaptive T-distribution perturbation strategy: To further enhance the balance ability of the Black-winged Kite algorithm between global exploration and local exploitation, an adaptive T-distribution perturbation strategy is introduced; at the early stage of iteration, the degree of freedom is large and it is approximately a normal distribution, which is beneficial to the global search ability; at the later stage, the degree of freedom decreases and the tail thickens, approximating Cauchy mutation, which can finely perturb the local area; the update method of the new position is as follows: x(t + 1) = x(t) + x(t) × t(iter) (8); In formula (8), t(iter) is the T-distribution mutation perturbation with the iteration number iter as the degree of freedom; x(t) is the current solution; x(t + 1) is the updated solution.
6. The photovoltaic array fault diagnosis method based on optimizing LightGBM by the improved black-winged kite algorithm according to claim 5, wherein: In step 4, a LigthGBM model is constructed: The LightGBM algorithm iteratively constructs multiple weak decision trees. In each iteration step, the ensemble model composed of multiple weak decision trees that have been constructed first accurately calculates the residual situation of the current prediction, and then constructs a new decision tree with the goal of minimizing the loss function. The objective function of the LightGBM model is expressed as: In formula (17), is the loss function, and f m is the complexity of the m-th tree, and Ω(f m ) is the regularization term; y i represents the true label value of the i-th sample; represents the predicted value of the i-th sample; M represents the number of decision trees in the model; Finally, the prediction results of each decision tree are cumulatively summarized to obtain the final prediction value; the prediction result is shown in formula (9): In formula (9), F(x) is the final weighted output; f n (x) is the output value of each decision tree.
7. The photovoltaic array fault diagnosis method based on optimizing LightGBM by an improved black-winged kite algorithm according to claim 6, wherein: The improved Black-winged Kite algorithm is used to optimize the key parameters in the LigthGBM model, and three parameters are optimized: 1) The number of leaf nodes: Increasing this value within a specific range can enhance the model's fitting ability to data, thereby improving the model's prediction accuracy; 2) Learning rate: This parameter is mainly used to control the step size of the model during each iteration update; 3) The depth of the tree: Limiting the maximum depth of the decision tree can effectively simplify the structural complexity of the model; The fault feature quantity is used as the model input, and the fault category is used as the model output.
Citation Information
Cited By
Photovoltaic array fault detection system and method based on enhanced neural network
CN121093105A
CNN-LSTM-based photovoltaic power prediction method and related equipment
CN121480788A
RFE-ICCO-BP-based equipment engine fault diagnosis method
CN121919676A