Photovoltaic array fault diagnosis method and device based on artificial intelligence

Through the photovoltaic array fault diagnosis method that combines KPCA and CNN, the Crowned Porcupine optimization algorithm is used to optimize the CNN model, which solves the problem of difficulty in classifying and detecting composite faults with existing technology, and achieves high-precision photovoltaic array fault diagnosis.

CN118606748AActive Publication Date: 2024-09-06HOHAI UNIV

Patent Information

Application Number
CN202410661353.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-06
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

Existing photovoltaic array fault diagnosis methods are difficult to effectively classify fault types and cannot detect aging faults and composite faults. They also have high equipment costs and rely on accurate simulation models and large amounts of fault data sets.

Method used

Using the photovoltaic array fault diagnosis method based on artificial intelligence, through kernel principal component analysis (KPCA) dimensionality reduction and convolutional neural network (CNN) combined with the crowned porcupine optimization algorithm, the characteristic principal components of the photovoltaic array fault diagnosis model are extracted, and the super performance of the CNN model is optimized. parameters to improve fault diagnosis accuracy.

Benefits of technology

It achieves accurate diagnosis of multiple single and compound faults of photovoltaic arrays, improves the classification accuracy of fault diagnosis, reduces the feature dimension, and solves the problems of slow convergence speed, low search efficiency and inability to diagnose multiple compound faults of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606748A
    Figure CN118606748A
Patent Text Reader

Abstract

The invention discloses a photovoltaic array fault diagnosis method and device based on artificial intelligence. The method comprises the following steps: S1, acquiring electrical parameters, irradiance and temperature of a photovoltaic array in a normal operation state and a fault operation state; s2, performing KPCA dimensionality reduction and normalization processing on the acquired data, and taking the processed data as a training set; s3, constructing a CNN photovoltaic array fault diagnosis model, optimizing CNN hyper-parameters by using a crown porcupine optimization algorithm CPO, taking the training set as input, training the optimized CNN fault diagnosis model, and taking a normal state or a fault operation state as output to obtain a CPO-CNN fault diagnosis model; and S4, obtaining photovoltaic array fault to-be-diagnosed data, performing dimension reduction and normalization by using KPCA, inputting the data into the trained CPO-CNN fault diagnosis model, and outputting a photovoltaic array fault type. According to the method, the classification precision of fault diagnosis can be improved, and the problems of low convergence speed, low search efficiency, long training time and incapability of diagnosing multiple composite faults of a traditional method are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a photovoltaic array fault diagnosis method and device based on artificial intelligence, belonging to the field of photovoltaic power generation fault diagnosis. Background Art

[0002] Photovoltaic power generation technology aims to convert solar energy into clean renewable energy, with the advantages of unlimited geographical location, flexible scale and environmental protection. However, since photovoltaic modules work in a complex outdoor environment, they are prone to various faults, such as short circuit, open circuit, abnormal aging, and shading caused by trees or buildings, and even compound faults. These faults not only lead to reduced power generation, but may also cause damage to photovoltaic modules, thereby affecting the performance of the entire system and increasing maintenance costs and safety risks. Therefore, timely detection of photovoltaic array faults, accurate identification of fault types, and taking appropriate measures to restore their normal operation are crucial to improving the reliability and stability of photovoltaic power generation systems.

[0003] At present, domestic and foreign scholars have divided the research on fault diagnosis of photovoltaic arrays into physical detection method, power loss method, IV curve method, and timing voltage and current method. The physical detection method is to study and analyze the physical characteristics of the faulty components through physical means such as thermal imaging, power-on, irradiation, and ultrasound. It does not require contact and can quickly detect the existence of faults, but it is difficult to effectively classify faults. The detection equipment is expensive, the maintenance cost is high, and it is affected by the environment, so it is difficult to apply on a large scale. The power loss method is to calculate the difference between the theoretical and actual values ​​of the output voltage, current, and power as the input data of the diagnostic algorithm to realize fault diagnosis. It has high detection sensitivity and can detect faults in real time, but the equipment is strictly installed and is very dependent on the accuracy of the simulation model. The simulation model must be continuously updated to adapt to the aging of photovoltaic equipment. The IV curve method is to calculate the difference between the internal and external characteristic parameters in the IV curve of the photovoltaic array, and then realize fault diagnosis through an intelligent algorithm. It can identify many types of faults and can also identify the degree of dust accumulation in the array, but it depends on the accuracy of the algorithm and requires a large number of fault data sets. The time series voltage and current method realizes fault feature extraction through algorithms such as signal decomposition or self-encoding, and then realizes fault diagnosis by setting thresholds or intelligent algorithms. It can effectively classify faults and detect the operation of the photovoltaic array in real time, but it cannot detect aging faults and high-resistance faults, and it is difficult to detect composite faults. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a photovoltaic array fault diagnosis method and device based on artificial intelligence. Through the nonlinear dimensionality reduction method based on kernel function of kernel principal component analysis (KPCA), the fault samples are first mapped to a high-dimensional space, and then a linear dimensionality reduction method is used in the high-dimensional space to extract the principal components of sample characteristics input into the photovoltaic array fault diagnosis model; the Crested Porcupine Optimizer (CPO) algorithm can optimize the hyperparameters of the convolutional neural network (CNN) and improve the accuracy of the fault diagnosis CNN model.

[0005] The technical solution of the present invention is as follows:

[0006] A photovoltaic array fault diagnosis method based on artificial intelligence comprises the following steps:

[0007] Step S1, obtaining electrical parameters, irradiance and temperature of the photovoltaic array in normal operation and fault operation;

[0008] Step S2, performing KPCA dimensionality reduction and normalization processing on the data obtained in the above step S1, and using the processed data as a training set;

[0009] Step S3, constructing a CNN photovoltaic array fault diagnosis model, using the crown porcupine optimization algorithm CPO to optimize the CNN hyperparameters, and taking the training set in step S2 as input, training the optimized CNN fault diagnosis model, taking the normal state or faulty operation state as output, and obtaining a CPO-CNN fault diagnosis model;

[0010] Step S4, obtaining the PV array fault data to be diagnosed, reducing the dimension by KPCA and normalizing the data, and inputting the data into the trained CPO-CNN fault diagnosis model in step S3, and outputting the PV array fault type.

[0011] Preferably, the electrical parameters in the above step S1 include: maximum power point voltage, maximum power point current, maximum power, open circuit voltage, short circuit current, and fill factor.

[0012] Preferably, the above step S2 includes the following steps:

[0013] (3-1) The principle of KPCA dimensionality reduction is to transform X = (x1, x2, ..., x n ) T Mapped into a high-dimensional feature space. The kernel matrix K is:

[0014] K=(k ij ) n×n (1)

[0015] Among them, the kernel function k ij =[(xi T ·x j )+r] p

[0016] In the formula, r is the translation parameter, which is a constant term; p is the order of the polynomial, which is an integer between 1 and 10; x i and x j is the data sequence; n is the data dimension.

[0017] (3-2) Centralized core matrix for:

[0018]

[0019] in,

[0020] Where L is the n×n identity matrix.

[0021] (3-3) Then calculate the eigenvalues ​​λ1,λ2,...λ of the centralized kernel matrix n and the corresponding eigenvectors v1,v2,...v n , sort the eigenvalues ​​in descending order, and select the m largest eigenvalues ​​and their corresponding eigenvectors according to the set dimension m after dimensionality reduction, denoted as V m =(v1,v2,...v m ), using the centralized kernel matrix and V m Multiply them together to get the reduced-dimensional data matrix X':

[0022]

[0023] In the formula, It is a mapping from low dimension to high dimension.

[0024] (3-4) The obtained dimensionality reduction data is subjected to maximum and minimum normalization processing using a normalization formula, and all are mapped to [0, 1]. The normalization formula is:

[0025]

[0026] In the formula, x * is the normalized data; x is the original data; x min 、x max are the minimum and maximum values ​​of the sample data respectively.

[0027] Preferably, in the above step S3, a one-dimensional convolutional neural network (1D-CNN) is used, which is mainly composed of an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. The convolution layer is used to extract data features, the pooling layer reduces the number of parameters and the amount of calculation, and the activation function Softmax is used for classification, and the output layer outputs the classification result;

[0028] The Softmax classifier is located after the fully connected layer. The Softmax function can convert the output values ​​of multiple classifications into a probability distribution in the range of [0,1] and with a sum of 1. The final model obtains the classification corresponding to each sample. The one with the highest probability is the fault type finally classified by the sample. The expression is:

[0029]

[0030] In the formula, z i is the output value of the i-th node; C is the number of output nodes, that is, the number of classification categories; i = 1, 2, ..., C;

[0031] The steps of the porcupine optimization algorithm are as follows:

[0032] Step S301: Initialize CPO (Porcupine Optimization) algorithm parameters and CNN hyperparameter optimization range and randomly generate porcupine populations;

[0033] Step S302: Initialize the porcupine positions, where the position of each porcupine is composed of corresponding CNN hyperparameters;

[0034] Step S303: inputting the hyperparameters into the CNN, and training it using the training data set to calculate the fitness value corresponding to each porcupine;

[0035] Step S304: sorting the porcupines according to their fitness values ​​and obtaining the current optimal crested porcupine position;

[0036] Step S305: Continuously updating and calculating the fitness values ​​and optimal positions of the porcupines and reordering them;

[0037] Step S306: After each iteration, the population size is updated using the cyclic population reduction technique (CPR); when the population iteration number reaches the maximum iteration number or the fitness reaches the requirement, the parameter corresponding to the optimal position of the porcupine is output as the optimal value of the CNN hyperparameter;

[0038] Step S307: Establish a model using the optimal solution of CNN hyperparameters to obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model.

[0039] Preferably, the above CNN hyperparameters include batch size, learning rate, regularization coefficient, and kernel size and number of two convolutional layers.

[0040] Using the classification error rate of the training set as the fitness function, the fitness value corresponding to each porcupine is calculated according to the following formula:

[0041]

[0042] In the formula, train right is the number of correct diagnoses in the training set, train total is the total number of training sets.

[0043] Preferably, the specific steps of the above porcupine optimization algorithm are:

[0044] (7-1) Initialize the CPO algorithm parameters including population size N, maximum number of iterations T max , the number of independent variables m, the upper limit of independent variables Lower limit of independent variable Objective function f, number of loops T, convergence speed a, trade-off percentage T between the third defense mechanism and the fourth defense mechanism f ; The position information of each porcupine represents a set of CNN hyperparameter setting methods, and the position of each porcupine in the population is randomly generated using formula (7):

[0045]

[0046] In the formula, is the location information of the i-th porcupine; is the lower limit of the independent variable; is the upper limit of the independent variable; A random number in [0,1].

[0047] After initializing the population, calculate the fitness function of each individual in the population And store the global optimal solution and Then, the search begins in the search space. The search mechanism includes two stages: exploration and development.

[0048] (7-2) Exploration phase: The exploration phase reflects the exploratory behavior of porcupines. During this phase, the population will have two defense strategies: visual and acoustic;

[0049] For the visual defense strategy, when the porcupine becomes aware of the predator, it starts to raise and fan its quills, giving the impression of a deeper presence. Therefore, the predator has two choices, either to move towards it or away from it. These options are simulated mathematically using a normal distribution to generate random values. If these random values ​​are less than 1 or greater than -1, it is encouraged to move towards the CP. Otherwise, the predator will move away from the CP. The mathematical expression is:

[0050]

[0051]

[0052] In the formula, is the position information of the i-th porcupine at the t+1th iteration; is the vector generated between the current porcupine and a randomly selected porcupine from the population, indicating the position of the predator at iteration t; τ1 is a random number based on normal distribution; τ2 is a random number in the interval [0,1]; t is the current iteration number; r is a random number between [1, N];

[0053] For the vocal defense strategy, in this strategy, the porcupine uses vocal methods to make noise and threaten predators. When the predator approaches the porcupine, the porcupine's voice will become louder. The mathematical expression is:

[0054]

[0055] In the formula, r1 and r2 are two random integers between [1, N]; τ3 is a random number in the interval [0, 1]. represents the position of the predator, To simulate three effects of sound on the distance between predators and porcupines;

[0056] (7-3) Exploitation stage. The exploitation stage reflects the exploitative behavior of porcupines. During this stage, the population will have two defense strategies: scent and physical attack;

[0057] For the smell defense strategy, the porcupine will secrete a foul odor and spread it around the area to prevent predators from approaching it. The mathematical expression is:

[0058]

[0059] Where τ3 is a random value in the interval [0,1], r3 is a random number between [1,N], is the position information of the i-th porcupine at the t-th iteration, δ, γ t , They are the parameters controlling the search direction, the defense factor, and the odor diffusion factor. The calculation formula is as follows:

[0060]

[0061] In the formula, is the objective function value of the i-th porcupine at the t-th iteration, and ε is a small value that avoids division by zero; is a vector of randomly generated values ​​between [0,1]; rand is a variable randomly generated between [0,1]; Used to simulate three situations that occur in this strategy:

[0062] (a) When If it is equal to 0, the porcupine will stop spreading its scent because the predator will stop moving because of fear of the porcupine, so the distance between the predator and the porcupine remains unchanged;

[0063] (b) When When it is equal to 1, the porcupine will emit a significant amount of scent due to the presence of a predator nearby;

[0064] (c) When It is a combination of 0 and 1, the predator keeps a safe distance from the porcupine, so there is no need to release its scent widely;

[0065] The defense strategy for physical attacks is physical attack. When the predator is very close to it and attacks it with short and thick feathers, the porcupine will take physical attack. During the physical attack, the two objects merge strongly, representing a one-dimensional inelastic collision, and the mathematical expression is:

[0066]

[0067] Where τ4 and τ5 are random values ​​in the interval [0,1]; α is the convergence speed factor; is the average force of the porcupine affecting the i-th predator; m i is the mass of the i-th individual (predator) at iteration t; is the initial velocity of the i-th porcupine at iteration t, is the final velocity of the i-th porcupine at the next iteration t+1, calculated as follows:

[0068]

[0069] Preferably, the above-mentioned cyclic population reduction technique (CPR) can maintain population diversity in addition to accelerating the convergence speed. This strategy simulates that not all porcupines activate the defense mechanism, but only those porcupines that are threatened activate the defense mechanism. The mathematical model is as follows:

[0070]

[0071] In the formula, T is the loop variable to determine the number of times the process is executed during the optimization process; T max is the maximum number of iterations, t is the current number of iterations, N min is the minimum number of individuals in the newly generated population.

[0072] The present invention also provides a photovoltaic array fault diagnosis device based on artificial intelligence, comprising:

[0073] Feature extraction module: used for KPCA algorithm to extract nonlinear feature principal components of photovoltaic array fault data set under open circuit, short circuit and other faults;

[0074] Model building module: used to build a CNN photovoltaic array fault diagnosis model and use the CPO algorithm to optimize the hyperparameters of the CNN model to form a CPO-CNN fault diagnosis model;

[0075] Model training module: used to train the constructed CPO-CNN fault diagnosis model using the data set after the nonlinear feature principal component is extracted by KPCA as the training set, and obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model;

[0076] Fault diagnosis module: used to input the photovoltaic array fault data to be diagnosed after KPCA extraction into the trained CPO-CNN fault diagnosis model, and output the photovoltaic array fault type.

[0077] The present invention also provides a photovoltaic array fault diagnosis device based on artificial intelligence, comprising a processor and a memory, wherein the memory is used to store a computer program, and is characterized in that the processor is used to execute the computer program to perform the above method.

[0078] The beneficial effects of the present invention are:

[0079] The present invention aims at photovoltaic array multi-classification fault data, adopts KPCA to extract its nonlinear feature principal component, reduces redundant data, and reduces feature dimension; constructs a CNN fault diagnosis model, and introduces the crested porcupine algorithm on the basis of the CNN model to optimize its hyperparameters. The optimized CNN model can not only effectively identify various single fault states of photovoltaic arrays, but also identify multiple composite fault states, realize photovoltaic array multi-classification fault diagnosis, improve the classification accuracy of fault diagnosis, and solve the problems of slow convergence speed, low search efficiency, long training time and inability to diagnose multiple composite faults in traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 It is a schematic diagram of the process of the present invention;

[0081] Figure 2 Detailed construction flow diagram of the KPCA-CPO-CNN fault diagnosis model in an embodiment of the present invention;

[0082] Figure 3 It is the output characteristic curve of photovoltaic array under different working conditions;

[0083] Figure 4 It is the output characteristic diagram of photovoltaic modules under different light intensities;

[0084] Figure 5Test set prediction result graph;

[0085] Figure 6 It is the confusion matrix diagram of the test set. DETAILED DESCRIPTION

[0086] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0087] CNN is a supervised learning model and related deep learning algorithm for analyzing data, especially for classification and pattern recognition tasks. This method learns the feature representation of data by constructing a deep convolutional neural network to perform classification or regression tasks. CNN can effectively solve problems such as image classification, target detection, face recognition, etc., and has the characteristics of automatic feature extraction, adaptation to complex pattern recognition, and high-dimensional data processing. Crested Porcupine Optimizer (CPO) is a new meta-heuristic algorithm (intelligent optimization algorithm) inspired by the four defensive behaviors of crested porcupines, with the characteristics of fast convergence speed, high search efficiency and few operating parameters. The purpose of KPCA is to map high-dimensional data to a lower-dimensional space through linear transformation to reduce the dimension of the data, remove redundant information and noise, and retain as much original data information as possible.

[0088] The present invention takes into account the characteristics of multi-classification faults of photovoltaic arrays, constructs a CNN fault diagnosis model, and introduces the porcupine algorithm on the basis of the CNN model to optimize its hyperparameters. It can not only effectively identify various single fault states of photovoltaic arrays, but also effectively identify multiple composite fault states, realize multi-classification fault diagnosis of photovoltaic arrays, and improve the classification accuracy of fault diagnosis, solving the problems of slow convergence speed, low search efficiency, long running time and inability to diagnose multiple composite faults of traditional methods.

[0089] like Figure 1 As shown, a photovoltaic array fault diagnosis method based on artificial intelligence includes the following steps:

[0090] Step S1, obtaining electrical parameters, irradiance and temperature of the photovoltaic array in normal operation and fault operation;

[0091] Step S2, performing KPCA dimensionality reduction and normalization processing on the data obtained in the above step S1, and using the processed data as a training set;

[0092] Step S3, constructing a CNN photovoltaic array fault diagnosis model, using the crown porcupine optimization algorithm CPO to optimize the CNN hyperparameters, and taking the training set in step S2 as input, training the optimized CNN fault diagnosis model, taking the normal state or faulty operation state as output, and obtaining a CPO-CNN fault diagnosis model;

[0093] Step S4, obtaining the PV array fault data to be diagnosed, reducing the dimension by KPCA and normalizing the data, and inputting the data into the trained CPO-CNN fault diagnosis model in step S3, and outputting the PV array fault type.

[0094] Preferably, the electrical parameters in the above step S1 include: maximum power point voltage, maximum power point current, maximum power, open circuit voltage, short circuit current, and fill factor.

[0095] Preferably, the above step S2 includes the following steps:

[0096] (3-1) The principle of KPCA dimensionality reduction is to transform X = (x1, x2, ..., x n ) T Mapped into a high-dimensional feature space. The kernel matrix K is:

[0097] K=(k ij ) n×n (1)

[0098] Among them, the kernel function k ij =[(x i T ·x j )+r] p

[0099] In the formula, r is the translation parameter, which is a constant term; p is the order of the polynomial, which is an integer between 1 and 10; x i and x j is the data sequence; n is the data dimension.

[0100] (3-2) Centralized core matrix for:

[0101]

[0102] in,

[0103] Where L is the n×n identity matrix.

[0104] (3-3) Then calculate the eigenvalues ​​λ1,λ2,...λ of the centralized kernel matrix n and the corresponding eigenvectors v1,v2,...v n, sort the eigenvalues ​​in descending order, and select the m largest eigenvalues ​​and their corresponding eigenvectors according to the set dimension m after dimensionality reduction, denoted as V m =(v1,v2,...v m ), using the centralized kernel matrix and V m Multiply them together to get the reduced-dimensional data matrix X':

[0105]

[0106] In the formula, It is a mapping from low dimension to high dimension.

[0107] (3-4) The obtained dimensionality reduction data is subjected to maximum and minimum normalization processing using a normalization formula, and all are mapped to [0, 1]. The normalization formula is:

[0108]

[0109] In the formula, x * is the normalized data; x is the original data; x min 、x max are the minimum and maximum values ​​of the sample data respectively.

[0110] Preferably, in the above step S3, a one-dimensional convolutional neural network (1D-CNN) is used, which is mainly composed of an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer. The convolution layer is used to extract data features, the pooling layer reduces the number of parameters and the amount of calculation, and the activation function Softmax is used for classification, and the output layer outputs the classification result;

[0111] The Softmax classifier is located after the fully connected layer. The Softmax function can convert the output values ​​of multiple classifications into a probability distribution in the range of [0,1] and with a sum of 1. The final model obtains the classification corresponding to each sample. The one with the highest probability is the fault type finally classified by the sample. The expression is:

[0112]

[0113] In the formula, z i is the output value of the i-th node; C is the number of output nodes, that is, the number of classification categories; i = 1, 2, ..., C;

[0114] The steps of the porcupine optimization algorithm are as follows:

[0115] Step S301: Initialize CPO (Porcupine Optimization) algorithm parameters and CNN hyperparameter optimization range and randomly generate porcupine populations;

[0116] Step S302: Initialize the porcupine positions, where the position of each porcupine is composed of corresponding CNN hyperparameters;

[0117] Step S303: inputting the hyperparameters into the CNN, and training it using the training data set to calculate the fitness value corresponding to each porcupine;

[0118] Step S304: sorting the porcupines according to their fitness values ​​and obtaining the current optimal crested porcupine position;

[0119] Step S305: Continuously updating and calculating the fitness values ​​and optimal positions of the porcupines and reordering them;

[0120] Step S306: After each iteration, the population size is updated using the cyclic population reduction technique (CPR); when the population iteration number reaches the maximum iteration number or the fitness reaches the requirement, the parameter corresponding to the optimal position of the porcupine is output as the optimal value of the CNN hyperparameter;

[0121] Step S307: Establish a model using the optimal solution of CNN hyperparameters to obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model.

[0122] Preferably, the above CNN hyperparameters include batch size, learning rate, regularization coefficient, and kernel size and number of two convolutional layers.

[0123] Using the training set classification error rate as the fitness function, the fitness value corresponding to each porcupine is calculated according to the following formula:

[0124]

[0125] In the formula, train right is the number of correct diagnoses in the training set, train total is the total number of training sets.

[0126] Preferably, the specific steps of the above porcupine optimization algorithm are:

[0127] (7-1) Initialize the CPO algorithm parameters including population size N, maximum number of iterations T max , the number of independent variables m, the upper limit of independent variables Lower limit of independent variable Objective function f, number of loops T, convergence speed a, trade-off percentage T between the third defense mechanism and the fourth defense mechanism f ; The position information of each porcupine represents a set of CNN hyperparameter setting methods, and the position of each porcupine in the population is randomly generated using formula (7):

[0128]

[0129] In the formula, is the location information of the i-th porcupine; is the lower limit of the independent variable; is the upper limit of the independent variable; A random number in [0,1].

[0130] After initializing the population, calculate the fitness function of each individual in the population And store the global optimal solution and Then, the search begins in the search space. The search mechanism includes two stages: exploration and development.

[0131] (7-2) Exploration phase: The exploration phase reflects the exploratory behavior of porcupines. During this phase, the population will have two defense strategies: visual and acoustic;

[0132] For the visual defense strategy, when the porcupine becomes aware of the predator, it starts to raise and fan its quills, giving the impression of a deeper presence. Therefore, the predator has two choices, either to move towards it or away from it. These options are simulated mathematically using a normal distribution to generate random values. If these random values ​​are less than 1 or greater than -1, it is encouraged to move towards the CP. Otherwise, the predator will move away from the CP. The mathematical expression is:

[0133]

[0134]

[0135] In the formula, is the position information of the i-th porcupine at the t+1th iteration; is the vector generated between the current porcupine and a randomly selected porcupine from the population, indicating the position of the predator at iteration t; τ1 is a random number based on normal distribution; τ2 is a random number in the interval [0,1]; t is the current iteration number; r is a random number between [1, N];

[0136] For the vocal defense strategy, in this strategy, the porcupine uses vocal methods to make noise and threaten predators. When the predator approaches the porcupine, the porcupine's voice will become louder. The mathematical expression is:

[0137]

[0138] In the formula, r1 and r2 are two random integers between [1, N]; τ3 is a random number in the interval [0, 1]. represents the position of the predator, To simulate three effects of sound on the distance between predators and porcupines;

[0139] (7-3) Exploitation stage. The exploitation stage reflects the exploitative behavior of porcupines. During this stage, the population will have two defense strategies: scent and physical attack;

[0140] For the smell defense strategy, the porcupine will secrete a foul odor and spread it around the area to prevent predators from approaching it. The mathematical expression is:

[0141]

[0142] Where τ3 is a random value in the interval [0,1], r3 is a random number between [1,N], is the position information of the i-th porcupine at the t-th iteration, δ, γ t , They are the parameters controlling the search direction, the defense factor, and the odor diffusion factor. The calculation formula is as follows:

[0143]

[0144] In the formula, is the objective function value of the i-th porcupine at the t-th iteration, and ε is a small value that avoids division by zero; is a vector of randomly generated values ​​between [0,1]; rand is a variable randomly generated between [0,1]; Used to simulate three situations that occur in this strategy:

[0145] (a) When If it is equal to 0, the porcupine will stop spreading its scent because the predator will stop moving because of fear of the porcupine, so the distance between the predator and the porcupine remains unchanged;

[0146] (b) When When it is equal to 1, the porcupine will emit a significant amount of scent due to the presence of a predator nearby;

[0147] (c) When It is a combination of 0 and 1, the predator keeps a safe distance from the porcupine, so there is no need to release its scent widely;

[0148] The defense strategy for physical attacks is physical attack. When the predator is very close to it and attacks it with short and thick feathers, the porcupine will take physical attack. During the physical attack, the two objects merge strongly, representing a one-dimensional inelastic collision, and the mathematical expression is:

[0149]

[0150] Where τ4 and τ5 are random values ​​in the interval [0,1]; α is the convergence speed factor; is the average force of the porcupine affecting the i-th predator; m iis the mass of the i-th individual (predator) at iteration t; is the initial velocity of the i-th porcupine at iteration t, is the final velocity of the i-th porcupine at the next iteration t+1, calculated as follows:

[0151]

[0152] Preferably, the above-mentioned cyclic population reduction technique (CPR) can maintain population diversity in addition to accelerating the convergence speed. This strategy simulates that not all porcupines activate the defense mechanism, but only those porcupines that are threatened activate the defense mechanism. The mathematical model is as follows:

[0153]

[0154] In the formula, T is the loop variable to determine the number of times the process is executed during the optimization process; T max is the maximum number of iterations, t is the current number of iterations, N min is the minimum number of individuals in the newly generated population.

[0155] The present invention also provides a photovoltaic array fault diagnosis device based on artificial intelligence, comprising:

[0156] Feature extraction module: used for KPCA algorithm to extract nonlinear feature principal components of photovoltaic array fault data set under open circuit, short circuit and other faults;

[0157] Model building module: used to build a CNN photovoltaic array fault diagnosis model and use the CPO algorithm to optimize the hyperparameters of the CNN model to form a CPO-CNN fault diagnosis model;

[0158] Model training module: used to train the constructed CPO-CNN fault diagnosis model using the data set after the nonlinear feature principal component is extracted by KPCA as the training set, and obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model;

[0159] Fault diagnosis module: used to input the photovoltaic array fault data to be diagnosed after KPCA extraction into the trained CPO-CNN fault diagnosis model, and output the photovoltaic array fault type.

[0160] The present invention also provides a photovoltaic array fault diagnosis device based on artificial intelligence, comprising a processor and a memory, wherein the memory is used to store a computer program, and is characterized in that the processor is used to execute the computer program to perform the above method.

[0161] Example:

[0162] like Figure 2As shown in Figure 1, in order to verify the effectiveness of the KPCA-CPO-CNN artificial intelligence fault diagnosis model of the present invention, a 3-row and 3-column series-parallel photovoltaic array is built using Matlab / Simulink simulation software. The component model is: DXM5-72P 180W, and its main parameters are shown in Table 1. Eleven situations such as normal, open circuit, short circuit and composite fault in the actual operation of the photovoltaic array are simulated respectively to obtain the corresponding IV curves, as shown in Figure 1. Figure 3 As shown. When the light intensity is [100,1000]W / m 2 , step size 10 and temperature [15,55]℃, step size 1 for value selection, a total of 3300 sets of data were collected, including 3000 sets of samples of fault state labels (labels 2 to 10) and 300 sets of normal state label data (label 1). The sample data were divided into training set and test set in a ratio of 8:2 according to the label category. KPCA was used to extract the nonlinear feature principal component of the data set and normalized it. The CPO algorithm was used to optimize the CNN hyperparameters, which were batch size, learning rate, regularization coefficient, and the kernel size and number of the two convolutional layers. The unoptimized CNN hyperparameters were set to the default values. After diagnosis, the accuracy of the model on the test set was 92.27%. It can be seen that the unoptimized CNN model is not effective in photovoltaic array fault diagnosis, and the classification effect of the data is general, which needs further optimization.

[0163] Table 1 Main parameters of components

[0164]

[0165] Figure 4 When the temperature of the photovoltaic module is 25℃, the irradiance is 600W / m 2 、800W / m 2 , 1000W / m 2 The output characteristic curve of the photovoltaic module is compared with the curve provided in the manufacturer's manual, which shows that the constructed module model can simulate the actual photovoltaic module well and can be used for scientific experiments and related research.

[0166] This embodiment sets a total of 11 working states of the photovoltaic array, namely normal (label 1), different degrees of aging (label 2), different degrees of shading (label 3), two groups of strings open circuit (label 4), component short circuit (5-7), shadow + short circuit (label 8), one group of strings open circuit + two components short circuit (label 9), one component short circuit + slight aging (label 10), one component short circuit + severe aging (label 12). Aging fault is simulated by connecting a resistor in series in the branch. Slight aging is connected in series with a resistor with a resistance of 3Ω, and severe aging is connected in series with a resistor with a resistance of 10Ω; shading fault is simulated by changing the irradiance of the shaded component; open circuit fault is simulated by disconnecting the wires between the faulty photovoltaic string and its adjacent photovoltaic string; short circuit fault is simulated by connecting a resistor with a resistance of 1×10 -6 Ω resistance is used to simulate, and other composite faults are simulated by combining the above single faults. Using the above method of this embodiment, when constructing a multi-classification fault diagnosis model for photovoltaic arrays, the CPO algorithm is used to optimize the kernel size and number, learning rate, regularization coefficient and batch size of the two convolutional layers in the CNN model, and the initial population size N of the porcupine algorithm is set to 10, and the maximum number of iterations T is set to 10. max = 10, variable number of cycles T = 2, convergence rate a = 0.2, trade-off percentage between the third defense mechanism and the fourth defense mechanism T f =0.8, the CNN hyperparameter optimization range and the optimization results after iteration are shown in Table 2.

[0167] Table 2 CNN hyperparameter optimization results

[0168]

[0169] Figure 5 , Figure 6 The fault diagnosis accuracy and confusion matrix of the present invention. Through the analysis of the diagnostic results, it can be seen that the fault diagnosis accuracy of the test set using KPCA to extract the nonlinear feature principal component and using the CPO algorithm to optimize the CNN model is 98.33%. That is, in the diagnosis of photovoltaic array faults, the KPCA-CPO-CNN artificial intelligence fault diagnosis model proposed by the present invention is more reliable than the unoptimized CNN model.

[0170] In order to further verify the effectiveness and accuracy of the KPCA-CPO-CNN artificial intelligence fault diagnosis model proposed in the present invention, the model was compared with LSTM, CNN, KPCA-CNN, and CPO-CNN models, and the same data set was used for experiments. The accuracy, precision, recall, and F1-score were used as evaluation indicators of the model. The accuracy rate represented the proportion of the number of samples correctly predicted by the model to the total number of samples, the precision rate represented the proportion of the number of samples correctly predicted by the model to the number of all predicted positive samples, and the recall rate represented the proportion of the number of samples correctly predicted by the model to the number of all true positive samples. F1-score is the harmonic mean of precision and recall, and its value range is 0 to 1.

[0171] From the results in Table 3, we can see that the accuracy of the CNN model is 5.75% higher than that of the LSTM model, indicating that the CNN model has a strong nonlinear relationship mapping ability in the fault diagnosis of photovoltaic arrays, and the fault diagnosis is more accurate. The accuracy of the KPCA-CNN and CPO-CNN models is improved by 1.21% and 5.76% respectively on the basis of the basic CNN model, and the accuracy of the KPCA-CPO-CNN model is improved by 0.3% on the CPO-CNN model. At the same time, the model training time is reduced by 42.05%.

[0172] Table 3 Comparison results of different fault diagnosis models

[0173]

[0174] It can be seen from this that the KPCA-CPO-CNN artificial intelligence fault diagnosis model proposed in this application has better effect, and compared with the CPO-CNN model, the model training time of the present invention is shorter and the fault diagnosis accuracy is higher.

[0175] Aiming at the diagnosis of photovoltaic array fault types, this paper proposes a CPO-CNN artificial intelligence model based on the KPCA algorithm to extract the principal component of data nonlinear features. The accuracy and efficiency of the model are verified by examples, and the following conclusions are drawn:

[0176] The large dimension of photovoltaic array fault diagnosis dataset affects the efficiency of model training

[0177] In order to solve the problem of the influence of the nonlinear feature, the present invention adopts the KPCA algorithm to extract the principal component of the nonlinear feature of the data set, maps the fault sample data to the high-dimensional space, eliminates the spatial correlation, filters the noise and redundant data, and ensures the accuracy of fault diagnosis. In addition, the model training time is reduced by 42.05%, indicating that the extraction of nonlinear feature principal components is feasible and the KPCA algorithm is effective.

[0178] It is difficult to construct the optimal network by selecting CNN hyperparameters based on manual experience.

[0179] The present invention adopts the CPO algorithm to optimize the learning rate, regularization coefficient, batch size, and convolution kernel size and number in CNN. Experimental results show that the KPCA-CPO-CNN model has stronger global search capability and higher fault diagnosis accuracy.

[0180] The present invention proposes a photovoltaic array fault diagnosis model based on artificial intelligence

[0181] The accuracy of the proposed model can reach 98.33%. Compared with the LSTM, CNN, and KPCA-CNN models, the accuracy is increased by 11.81%, 6.06%, and 4.85%, respectively; compared with the CPO-CNN model, the accuracy is increased by 0.3%, and the model training time is reduced by 42.05%, indicating that the proposed model is effective, efficient, and accurate in identifying the fault types of photovoltaic arrays, and has a reference significance for operation and maintenance personnel to identify the current status of photovoltaic arrays.

[0182] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A photovoltaic array fault diagnosis method based on artificial intelligence, characterized in that The steps include: Step S1, obtaining electrical parameters, irradiance and temperature of the photovoltaic array in normal operation and fault operation; Step S2, performing KPCA dimensionality reduction and normalization processing on the data obtained in the above step S1, and using the processed data as a training set; Step S3, constructing a CNN photovoltaic array fault diagnosis model, using the crown porcupine optimization algorithm CPO to optimize the CNN hyperparameters, and taking the training set in step S2 as input, training the optimized CNN fault diagnosis model, taking the normal state or faulty operation state as output, and obtaining a CPO-CNN fault diagnosis model; Step S4, obtaining the PV array fault data to be diagnosed, reducing the dimension by KPCA and normalizing the data, and inputting the data into the trained CPO-CNN fault diagnosis model in step S3, and outputting the PV array fault type.

2. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1 is characterized in that: The electrical parameters in step S1 include: maximum power point voltage, maximum power point current, maximum power, open circuit voltage, short circuit current, and fill factor.

3. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1 is characterized in that: The step S2 comprises the following steps: (3-1) The principle of KPCA dimensionality reduction is to transform X = (x1, x2, ..., x n ) T Mapped into a high-dimensional feature space. The kernel matrix K is: K=(k ij ) n×n (1) Among them, the kernel function k ij =[(x i T ·x j )+r] p In the formula, r is the translation parameter, which is a constant term; p is the order of the polynomial, which is an integer between 1 and 10; x i and x j is the data sequence; n is the data dimension. (3-2) Centralized core matrix for: in, Where L is the n×n identity matrix. (3-3) Then calculate the eigenvalues ​​λ1,λ2,...λ of the centralized kernel matrix n and the corresponding eigenvectors v1,v2,...v n , sort the eigenvalues ​​in descending order, and select the m largest eigenvalues ​​and their corresponding eigenvectors according to the set dimension m after dimensionality reduction, denoted as V m =(v1,v2,...v m ), using the centralized kernel matrix and V m Multiply them together to get the reduced-dimensional data matrix X': In the formula, It is a mapping from low dimension to high dimension. (3-4) The obtained dimensionality reduction data is subjected to maximum and minimum normalization processing using a normalization formula, and all are mapped to [0, 1]. The normalization formula is: In the formula, x * is the normalized data; x is the original data; x min 、x max are the minimum and maximum values ​​of the sample data respectively.

4. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1 is characterized in that: In the step S3, a one-dimensional convolutional neural network (1D-CNN) is used, which is mainly composed of an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer. The convolutional layer is used to extract data features, the pooling layer reduces the number of parameters and the amount of calculation, and classification is performed through the activation function Softmax, and the output layer outputs the classification result; The Softmax classifier is located after the fully connected layer. The Softmax function can convert the output values ​​of multiple classifications into a probability distribution in the range of [0,1] and with a sum of 1. The final model obtains the classification corresponding to each sample. The one with the highest probability is the fault type finally classified by the sample. The expression is: In the formula, z i is the output value of the i-th node; C is the number of output nodes, that is, the number of classification categories; i = 1, 2, ..., C; The steps of the porcupine optimization algorithm are as follows: Step S301: Initialize the porcupine optimization algorithm parameters and the CNN hyperparameter optimization range and randomly generate a porcupine population; Step S302: Initialize the porcupine positions, where the position of each porcupine is composed of the corresponding CNN hyperparameters; Step S303: inputting the hyperparameters into the CNN, and training it using the training data set to calculate the fitness value corresponding to each porcupine; Step S304: Sort the porcupines according to their fitness values ​​and obtain the current optimal crown porcupine position; Step S305: Continuously updating and calculating the fitness values ​​and optimal positions of the porcupines and reordering them; Step S306: After each iteration, the population size is updated using a cyclic population reduction technique; when the population iteration number reaches the maximum iteration number or the fitness reaches the requirement, the parameter corresponding to the optimal position of the porcupine is output as the optimal value of the CNN hyperparameter; Step S307: Establish a model using the optimal solution of CNN hyperparameters to obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model.

5. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 4 is characterized in that: The CNN hyperparameters include batch size, learning rate, regularization coefficient, and the kernel size and number of two convolutional layers.

6. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 4 is characterized in that: Using the classification error rate of the training set as the fitness function, the fitness value corresponding to each porcupine is calculated according to the following formula: In the formula, train right is the number of correct diagnoses in the training set, train total is the total number of training sets.

7. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 4 is characterized in that: The specific steps of the porcupine optimization algorithm are: (7-1) Initialize the parameters of the porcupine optimization algorithm, including the population size N, the maximum number of iterations T max , the number of independent variables m, the upper limit of independent variables Lower limit of independent variable Objective function f, number of loops T, convergence speed a, trade-off percentage T between the third defense mechanism and the fourth defense mechanism f ; The position information of each porcupine represents a set of CNN hyperparameter setting methods, and the position of each porcupine in the population is randomly generated using formula (7): In the formula, is the location information of the i-th porcupine; is the lower limit of the independent variable; is the upper limit of the independent variable; A random number in [0,1]. After initializing the population, calculate the fitness function of each individual in the population And store the global optimal solution and Then, the search begins in the search space. The search mechanism includes two stages: exploration and development. (7-2) Exploration phase: The exploration phase reflects the exploratory behavior of porcupines. During this phase, the population will have two defense strategies: visual and acoustic; For the visual defense strategy, a normal distribution is used to generate random values ​​to simulate these options mathematically. If these random values ​​are less than 1 or greater than -1, it is encouraged to approach the CP. Otherwise, the predator will stay away from the CP. The mathematical expression is: In the formula, is the position information of the i-th porcupine at the t+1th iteration; is the vector generated between the current porcupine and a randomly selected porcupine from the population, indicating the position of the predator at iteration t; τ1 is a random number based on normal distribution; τ2 is a random number in the interval [0,1]; t is the current iteration number; r is a random number between [1, N]; For the sound defense strategy, the mathematical expression is: In the formula, r1 and r2 are two random integers between [1, N]; τ3 is a random number in the interval [0, 1]. represents the position of the predator, To simulate three effects of sound on the distance between predators and porcupines; (7-3) Exploitation stage. The exploitation stage reflects the exploitative behavior of porcupines. During this stage, the population will have two defense strategies: scent and physical attack; For the odor defense strategy, the mathematical expression is: Where τ3 is a random value in the interval [0,1], r3 is a random number between [1,N], is the position information of the i-th porcupine at the t-th iteration, δ, γ t , They are the parameters controlling the search direction, the defense factor, and the odor diffusion factor. The calculation formula is as follows: In the formula, is the objective function value of the i-th porcupine at the t-th iteration, and ε is a small value that avoids division by zero; is a vector of randomly generated values ​​between [0,1]; rand is a variable randomly generated between [0,1]; Used to simulate three situations that occur in this strategy: (a) When If it is equal to 0, the porcupine will stop spreading its scent because the predator will stop moving because of fear of the porcupine, so the distance between the predator and the porcupine remains unchanged; (b) When When it is equal to 1, the porcupine will emit a significant amount of scent due to the presence of a predator nearby; (c) When It is a combination of 0 and 1, the predator keeps a safe distance from the porcupine, so there is no need to release its scent widely; The defense strategy for physical attack is physical attack. During the physical attack, two objects merge strongly, representing a one-dimensional inelastic collision. The mathematical expression is: Where τ4 and τ5 are random values ​​in the interval [0,1]; α is the convergence speed factor; is the average force of the porcupine affecting the i-th predator; m i is the mass of the i-th individual at iteration t; is the initial velocity of the i-th porcupine at iteration t, is the final velocity of the i-th porcupine at the next iteration t+1, calculated as follows:

8. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 4 is characterized in that: The mathematical model of the cyclic population reduction technique is as follows: In the formula, T is the loop variable to determine the number of times the process is executed during the optimization process; T max is the maximum number of iterations, t is the current number of iterations, N min is the minimum number of individuals in the newly generated population.

9. A photovoltaic array fault diagnosis device based on artificial intelligence, characterized in that: include: Feature extraction module: used for KPCA algorithm to extract nonlinear feature principal components of photovoltaic array fault data set under open circuit, short circuit and other faults; Model building module: used to build a CNN photovoltaic array fault diagnosis model and use the CPO algorithm to optimize the hyperparameters of the CNN model to form a CPO-CNN fault diagnosis model; Model training module: used to train the constructed CPO-CNN fault diagnosis model using the data set after the nonlinear feature principal component is extracted by KPCA as the training set, and obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model; Fault diagnosis module: used to input the photovoltaic array fault data to be diagnosed after KPCA extraction into the trained CPO-CNN fault diagnosis model, and output the photovoltaic array fault type.

10. A photovoltaic array fault diagnosis device based on artificial intelligence, comprising a processor and a memory, wherein the memory is used to store a computer program, characterized in that: The processor is used to execute the computer program to perform the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Photovoltaic array fault diagnosis method based on KPCA-TCN-Attention

    CN117290716A

  • Photovoltaic array fault diagnosis method and device based on GOA-SVM model

    CN117332325A

Cited By

  • Voiceprint diagnosis method for loose fault of transformer iron core

    CN119106338A

  • Photovoltaic power generation equipment fault diagnosis method and system based on artificial intelligence

    CN119253624A

  • Dry-type reactor fault detection method and system based on CPO-LSSVM

    CN119471091A

  • Medical image segmentation method and system based on improved deep learning model

    CN119672343A

  • A medical image segmentation method and system based on improved deep learning model

    CN119672343B