An artificial intelligence-based photovoltaic array fault diagnosis method and device
Patent Information
- Application Number
- CN202410661353.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-05-27
AI Technical Summary
物理检测法即通过热成像、通电、照射、超声波等物理手段,研究和分析故障组件的物理特性,无需接触,能快速侦测存在故障,但难以有效实现故障分类,检测设备昂贵,维护成本高,且受环境影响,因此难以大规模应用;功率损失法是通过计算输出电压、电流和功率理论值和实际值之间的差值,作为诊断算法的输入数据以实现故障诊断,检测灵敏度高,可实时检测故障,但设备安装严格,十分依赖仿真模型的精度,要不断更新仿真模型以适应光伏设备老化;I-V曲线法是通过计算光伏阵列I-V曲线中内外特征参数的差异性,进而通过智能算法实现故障诊断,能够识别的故障类型众多,还能够辨识阵列的积灰程度,但依赖算法的准确率,且需要大量故障数据集;时序电压电流法是通过信号分解或自编码等算法实现故障特征提取,再通过设定阈值或智能算法实现故障诊断,能有效的故障分类且实时检测光伏阵列的运行情况,但无法检测到老化故障和高阻故障,且难以检测复合故障
[0079]本发明针对光伏阵列多分类故障数据,采用KPCA提取其非线性特征主元,减少冗余数据,降低特征维度;构建CNN故障诊断模型,同时在CNN模型的基础上引入冠豪猪算法对其超参数进行寻优,优化后的CNN模型不仅能有效辨别光伏阵列各种单一故障状态,而且能辨别多种复合故障状态,实现光伏阵列多分类故障诊断,提高故障诊断的分类精度,解决传统方法收敛速度慢、搜寻效率低、训练时间长及无法诊断多重复合故障的问题。
Smart Images

Figure CN118606748B_ABST
Abstract
Description
Technical Field
[0001] This 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 Technology
[0002] Photovoltaic (PV) power generation technology aims to convert solar energy into clean and renewable energy, offering advantages such as unrestricted geographical location, flexible scale, and environmental friendliness. However, because PV modules operate in complex outdoor environments, they are prone to various faults, such as short circuits, open circuits, abnormal aging, and shading problems caused by trees or buildings, and even compound faults. These faults not only reduce power generation but can also damage PV modules, affecting the performance of the entire system and increasing maintenance costs and safety risks. Therefore, timely detection of PV array faults, accurate identification of fault types, and taking appropriate measures to restore normal operation are crucial for improving the reliability and stability of PV power generation systems.
[0003] Currently, domestic and foreign scholars have conducted research on fault diagnosis of photovoltaic arrays in three categories: physical detection method, power loss method, IV curve method, and time-series voltage and current method. Physical detection methods use physical means such as thermal imaging, electrical current, irradiation, and ultrasound to study and analyze the physical characteristics of faulty components. These methods are non-contact and can quickly detect faults, but they struggle with effective fault classification. The equipment is expensive, maintenance is costly, and they are affected by the environment, limiting their large-scale application. Power loss methods calculate the difference between theoretical and actual output voltage, current, and power values as input data for diagnostic algorithms. These methods offer high sensitivity and real-time fault detection, but require strict equipment installation and are highly dependent on the accuracy of the simulation model, necessitating continuous model updates to adapt to aging photovoltaic equipment. The IV curve method calculates the differences in internal and external characteristic parameters within the photovoltaic array's IV curve and then uses intelligent algorithms for fault diagnosis. It can identify numerous fault types and the degree of dust accumulation in the array, but it relies on algorithm accuracy and requires a large dataset of fault data. The time-series voltage-current method extracts fault features through signal decomposition or self-encoding algorithms, then uses threshold settings or intelligent algorithms for fault diagnosis. This method effectively classifies faults and monitors the photovoltaic array's operation in real time, but it cannot detect aging faults or high-resistance faults, and it struggles to detect complex faults. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides a photovoltaic array fault diagnosis method and device based on artificial intelligence. It utilizes kernel principal component analysis (KPCA), a nonlinear dimensionality reduction method based on kernel functions, to first map fault samples to a high-dimensional space. Then, it employs linear dimensionality reduction in the high-dimensional space to extract the principal components of the sample features input to the photovoltaic array fault diagnosis model. Furthermore, the Crested Porcupine Optimizer (CPO) algorithm optimizes the hyperparameters of the convolutional neural network (CNN), improving the accuracy of the fault diagnosis CNN model.
[0005] The technical solution of the present invention is as follows:
[0006] An artificial intelligence-based method for diagnosing photovoltaic array faults includes the following steps:
[0007] Step S1: Obtain the electrical parameters, irradiance, and temperature of the photovoltaic array under normal operating conditions and fault operating conditions;
[0008] Step S2: Perform KPCA dimensionality reduction and normalization on the data obtained in step S1, and use the processed data as the training set.
[0009] Step S3: Construct a CNN photovoltaic array fault diagnosis model. Optimize the CNN hyperparameters using the Crowned Porcupine Optimization Algorithm (CPO). Use the training set from Step S2 as input to train the optimized CNN fault diagnosis model. Output the normal state or fault operation state to obtain the CPO-CNN fault diagnosis model.
[0010] Step S4: Obtain the photovoltaic array fault diagnosis data, reduce and normalize it using KPCA, and input it into the trained CPO-CNN fault diagnosis model described in step S3 to output the photovoltaic array fault type.
[0011] Preferably, 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.
[0012] Preferably, step S2 includes the following steps:
[0013] (3-1) The principle of KPCA dimensionality reduction is to transform X = (x1, x2, ..., x...) into a dimensionless array. n ) T Mapped into a high-dimensional feature space. The kernel matrix K is:
[0014] K = (k ij ) n×n (1)
[0015] Wherein, 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, taking an integer between 1 and 10; x i and x j is the data sequence; n is the data dimension.
[0017] (3-2) Centralized kernel matrix for:
[0018]
[0019] in,
[0020] In the formula, L is an n×n identity matrix.
[0021] (3-3) Recalculate the eigenvalues λ1, λ2, ... λ of the centered kernel matrix. n and the corresponding feature vectors v1, v2, ... v n Sort the eigenvalues in descending order, and select the m largest eigenvalues and their corresponding eigenvectors based on the set dimension reduction dimension m, denoted as V. m =(v1,v2,...v m ), using the centralized kernel matrix and V m Multiplying them together, we obtain the dimensionality-reduced data matrix X' as follows:
[0022]
[0023] In the formula, This represents a mapping from low-dimensional to high-dimensional dimensions.
[0024] (3-4) The obtained dimensionality-reduced data is subjected to minimum-max normalization using a normalization formula, mapping all data to [0,1]. The normalization formula is as follows:
[0025]
[0026] In the formula, x * x represents the normalized data; x represents the original data; x min x max These are the minimum and maximum values of the sample data, respectively.
[0027] Preferably, in step S3 above, a one-dimensional convolutional neural network (1D-CNN) is used, which mainly consists 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 computation, the softmax activation function 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 converts the multi-class output values into a probability distribution ranging from [0,1] with a sum of 1. The model then determines the classification for each sample; the one with the highest probability is the final fault type for that sample. The expression is:
[0029]
[0030] In the formula, z i Let be the output value of the i-th node; C is the number of output nodes, i.e., the number of categories; i = 1, 2, ..., C;
[0031] The steps of the porcupine optimization algorithm are as follows:
[0032] Step S301: Initialize the CPO (Porcupine Optimization) algorithm parameters and the CNN hyperparameter optimization range, and randomly generate a porcupine population;
[0033] Step S302: Initialize the porcupine positions. The position of each porcupine is composed of the corresponding CNN hyperparameters.
[0034] Step S303: Input the hyperparameters into the CNN and train it using the training dataset to calculate the fitness value corresponding to each porcupine;
[0035] Step S304: Sort the porcupines according to their fitness values and obtain the current optimal crowned porcupine position;
[0036] Step S305: Continuously update and reorder the fitness values and optimal positions of the porcupines;
[0037] Step S306: In each iteration, update the population size using the cyclic population reduction technique (CPR); when the number of population iterations reaches the maximum number of iterations or the fitness meets the requirements, output the parameters corresponding to the optimal position of the porcupine, which are the optimal values of the CNN hyperparameters.
[0038] Step S307: Build a model using the optimal solution of CNN hyperparameters to obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model.
[0039] Preferably, the CNN hyperparameters include batch size, learning rate, regularization coefficient, kernel size and number of the two convolutional layers.
[0040] Using the training set classification error rate as the fitness function, the fitness value for each porcupine is calculated according to the following formula:
[0041]
[0042] In the formula, train right The number of correct diagnoses in the training set, train total This represents the total number of elements in the training set.
[0043] Preferably, the specific steps of the above-mentioned porcupine optimization algorithm are as follows:
[0044] (7-1) Initialize the CPO algorithm parameters, including population size N and maximum number of iterations T. max Number of independent variables m, upper limit of independent variables Lower bound of independent variable Objective function f, number of loops T, convergence rate a, percentage T of trade-off between the third and fourth defense mechanisms f The location information of each porcupine represents a set of hyperparameter settings for a CNN. The location of each porcupine in the population is randomly generated using equation (7):
[0045]
[0046] In the formula, This provides the location information for the i-th porcupine. This is the lower limit of the independent variable; The upper limit of the independent variable; A random number in the range [0, 1].
[0047] After initializing the population, calculate the fitness function for each individual in the population. And store the global optimal solution. and Then the search begins in the search space, and the search mechanism includes two phases: exploration and development.
[0048] (7-2) Exploration phase: The exploration phase reflects the porcupine's exploratory behavior. During this phase, the population will have two defense strategies: visual and auditory.
[0049] For visual defense strategies, when a porcupine becomes aware of a predator, it begins to raise and fan its quills, creating a stronger impression. Therefore, the predator has two options: either move towards it or move away. Using a normal distribution to generate random values, these options are mathematically modeled. If these random values are less than 1 or greater than -1, the predator is encouraged to move closer to the CP; otherwise, it will move away from the CP. The mathematical expression is:
[0050]
[0051]
[0052] In the formula, This represents the position information of the i-th porcupine in the (t+1)th iteration; The vector generated between the current porcupine and a randomly selected porcupine from the population represents the predator's position at iteration t; τ1 is a random number based on a 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] In a sound defense strategy, porcupines use sound to create noise and threaten predators. The porcupine's noise increases as the predator approaches. 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]. Indicates the location of the predator. To simulate three effects of sound on the distance between a predator and a porcupine;
[0056] (7-3) Development stage: The development stage reflects the exploitative behavior of porcupines. During this stage, the population will have two defense strategies: scent and physical attack.
[0057] As a defense strategy against odors, porcupines secrete a foul odor that spreads in their surrounding area to deter predators from approaching. The mathematical expression is:
[0058]
[0059] In the formula, τ3 is a random value in the interval [0,1], and r3 is a random number between [1,N]. It represents the position information of the i-th porcupine at the t-th iteration, δ, γ t , These are the parameters controlling the search direction, the defense factor, and the odor diffusion factor, respectively. The calculation formulas are shown below:
[0060]
[0061] In the formula, Let ε be the objective function value of the i-th porcupine in the t-th iteration, and let ε be a small value to avoid division by zero. `rand` is a vector of values randomly generated between [0,1]; `rand` is a variable randomly generated between [0,1]. This is used to simulate three scenarios that may occur with this strategy:
[0062] (a) When If the value is 0, the porcupine will stop spreading its scent because the predator will stop moving out of fear of the porcupine, thus keeping the distance between the predator and the porcupine constant.
[0063] (b) when When the value is 1, the porcupine will emit a significant odor because a predator is nearby;
[0064] (c) when It's a combination of 0 and 1; predators keep a safe distance from porcupines, so there's no need for them to release their scent widely.
[0065] The defensive strategy against physical attacks is physical attack. When a predator gets close and attacks with short, thick feathers, the porcupine will resort to physical attacks. During a physical attack, the two objects strongly merge, representing a one-dimensional inelastic collision, mathematically expressed as:
[0066]
[0067] In the formula, τ4 and τ5 are random values in the interval [0,1]; α is the convergence rate factor; The average force of the porcupine affecting the i-th predator; m i Let be the mass of the i-th individual (predator) at iteration t; Let be the initial velocity of the i-th porcupine at iteration t. Let be the final velocity of the i-th porcupine at the next iteration t+1, calculated using the following formula:
[0068]
[0069] Preferably, the aforementioned Cyclic Population Reduction (CPR) technique, in addition to accelerating the convergence speed, can also maintain population diversity. This strategy simulates that not all porcupines activate defense mechanisms, but only those porcupines that are threatened do so. The mathematical model is as follows:
[0070]
[0071] In the formula, T is the loop variable, which determines the number of times the process is executed during optimization; T max N represents the maximum number of iterations, t represents the current iteration number, and N represents the maximum number of iterations. min This represents the minimum number of individuals in the newly generated population.
[0072] The present invention also provides an artificial intelligence-based photovoltaic array fault diagnosis device, comprising:
[0073] Feature extraction module: used by the KPCA algorithm to extract nonlinear principal components of photovoltaic array fault datasets under open-circuit, short-circuit, and other fault conditions;
[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 as the training set to train the constructed CPO-CNN fault diagnosis model on the dataset after extracting nonlinear feature principal components by KPCA, to 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 extracted by KPCA into the trained CPO-CNN fault diagnosis model and output the photovoltaic array fault type.
[0077] The present invention also provides an artificial intelligence-based photovoltaic array fault diagnosis device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above-described method.
[0078] The beneficial effects of this invention are:
[0079] This invention addresses the multi-class fault data of photovoltaic arrays by employing KPCA to extract nonlinear feature principal components, reducing redundant data and feature dimensionality. A CNN fault diagnosis model is constructed, and the Crowned Pig Algorithm is introduced to optimize its hyperparameters. The optimized CNN model can effectively distinguish not only various single fault states of photovoltaic arrays but also multiple composite fault states, achieving multi-class fault diagnosis of photovoltaic arrays, improving the classification accuracy of fault diagnosis, and solving the problems of slow convergence speed, low search efficiency, long training time, and inability to diagnose multiple composite faults in traditional methods. Attached Figure Description
[0080] Figure 1 This is a flowchart illustrating the present invention;
[0081] Figure 2 This is a detailed schematic diagram of the construction process of the KPCA-CPO-CNN fault diagnosis model in this embodiment of the invention;
[0082] Figure 3 These are the output characteristic curves of the photovoltaic array under different operating conditions;
[0083] Figure 4 These are output characteristic diagrams of photovoltaic modules under different light intensities;
[0084] Figure 5Test set prediction results graph;
[0085] Figure 6 This is the confusion matrix diagram for the test set. Detailed Implementation
[0086] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0087] CNNs (Convolutional Neural Networks) are supervised learning models and related deep learning algorithms used for data analysis, particularly suitable for classification and pattern recognition tasks. This method learns feature representations of data by constructing deep convolutional neural networks to perform classification or regression tasks. CNNs can effectively solve problems such as image classification, object detection, and face recognition, featuring automatic feature extraction, adaptation to complex pattern recognition, and high-dimensional data processing. The Crested Porcupine Optimizer (CPO) is a novel metaheuristic algorithm (intelligent optimization algorithm) inspired by the four defensive behaviors of crested porcupines, characterized by fast convergence, high search efficiency, and few operating parameters. KPCA aims to map high-dimensional data to a lower-dimensional space through linear transformation, reducing data dimensionality, removing redundant information and noise, while retaining as much original data information as possible.
[0088] This invention considers the characteristics of multi-class faults in photovoltaic arrays and constructs a CNN fault diagnosis model. On the basis of the CNN model, the porcupine algorithm is introduced to optimize its hyperparameters. It can not only effectively identify various single fault states of photovoltaic arrays, but also effectively identify multiple compound fault states, realize multi-class fault diagnosis of photovoltaic arrays, and improve the classification accuracy of fault diagnosis. It solves the problems of slow convergence speed, low search efficiency, long running time and inability to diagnose multiple compound faults in traditional methods.
[0089] like Figure 1 As shown, an artificial intelligence-based photovoltaic array fault diagnosis method includes the following steps:
[0090] Step S1: Obtain the electrical parameters, irradiance, and temperature of the photovoltaic array under normal operating conditions and fault operating conditions;
[0091] Step S2: Perform KPCA dimensionality reduction and normalization on the data obtained in step S1, and use the processed data as the training set.
[0092] Step S3: Construct a CNN photovoltaic array fault diagnosis model. Optimize the CNN hyperparameters using the Crowned Porcupine Optimization Algorithm (CPO). Use the training set from Step S2 as input to train the optimized CNN fault diagnosis model. Output the normal state or fault operation state to obtain the CPO-CNN fault diagnosis model.
[0093] Step S4: Obtain the photovoltaic array fault diagnosis data, reduce and normalize it using KPCA, and input it into the trained CPO-CNN fault diagnosis model described in step S3 to output the photovoltaic array fault type.
[0094] Preferably, 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.
[0095] Preferably, step S2 includes the following steps:
[0096] (3-1) The principle of KPCA dimensionality reduction is to transform X = (x1, x2, ..., x...) into a dimensionless array. n ) T Mapped into a high-dimensional feature space. The kernel matrix K is:
[0097] K = (k ij ) n×n (1)
[0098] Wherein, 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, taking an integer between 1 and 10; x i and x j is the data sequence; n is the data dimension.
[0100] (3-2) Centralized kernel matrix for:
[0101]
[0102] in,
[0103] In the formula, L is an n×n identity matrix.
[0104] (3-3) Recalculate the eigenvalues λ1, λ2, ... λ of the centered kernel matrix. n and the corresponding feature vectors v1, v2, ... v nSort the eigenvalues in descending order, and select the m largest eigenvalues and their corresponding eigenvectors based on the set dimension reduction dimension m, denoted as V. m =(v1,v2,...v m ), using the centralized kernel matrix and V m Multiplying them together, we obtain the dimensionality-reduced data matrix X' as follows:
[0105]
[0106] In the formula, This represents a mapping from low-dimensional to high-dimensional dimensions.
[0107] (3-4) The obtained dimensionality-reduced data is subjected to minimum-max normalization using a normalization formula, mapping all data to [0,1]. The normalization formula is as follows:
[0108]
[0109] In the formula, x * x represents the normalized data; x represents the original data; x min x max These are the minimum and maximum values of the sample data, respectively.
[0110] Preferably, in step S3 above, a one-dimensional convolutional neural network (1D-CNN) is used, which mainly consists 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 computation, the softmax activation function 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 converts the multi-class output values into a probability distribution ranging from [0,1] with a sum of 1. The model then determines the classification for each sample; the one with the highest probability is the final fault type for that sample. The expression is:
[0112]
[0113] In the formula, z i Let be the output value of the i-th node; C is the number of output nodes, i.e., the number of categories; i = 1, 2, ..., C;
[0114] The steps of the porcupine optimization algorithm are as follows:
[0115] Step S301: Initialize the CPO (Porcupine Optimization) algorithm parameters and the CNN hyperparameter optimization range, and randomly generate a porcupine population;
[0116] Step S302: Initialize the porcupine positions. The position of each porcupine is composed of the corresponding CNN hyperparameters.
[0117] Step S303: Input the hyperparameters into the CNN and train it using the training dataset to calculate the fitness value corresponding to each porcupine;
[0118] Step S304: Sort the porcupines according to their fitness values and obtain the current optimal crowned porcupine position;
[0119] Step S305: Continuously update and reorder the fitness values and optimal positions of the porcupines;
[0120] Step S306: In each iteration, update the population size using the cyclic population reduction technique (CPR); when the number of population iterations reaches the maximum number of iterations or the fitness meets the requirements, output the parameters corresponding to the optimal position of the porcupine, which are the optimal values of the CNN hyperparameters.
[0121] Step S307: Build a model using the optimal solution of CNN hyperparameters to obtain the trained KPCA-CPO-CNN artificial intelligence fault diagnosis model.
[0122] Preferably, the CNN hyperparameters include batch size, learning rate, regularization coefficient, kernel size and number of the two convolutional layers.
[0123] Using the training set classification error rate as the fitness function, the fitness value for each porcupine is calculated according to the following formula:
[0124]
[0125] In the formula, train right The number of correct diagnoses in the training set, train total This represents the total number of elements in the training set.
[0126] Preferably, the specific steps of the above-mentioned porcupine optimization algorithm are as follows:
[0127] (7-1) Initialize the CPO algorithm parameters, including population size N and maximum number of iterations T. max Number of independent variables m, upper limit of independent variables Lower bound of independent variable Objective function f, number of loops T, convergence rate a, percentage T of trade-off between the third and fourth defense mechanisms f The location information of each porcupine represents a set of hyperparameter settings for a CNN. The location of each porcupine in the population is randomly generated using equation (7):
[0128]
[0129] In the formula, This provides the location information for the i-th porcupine. This is the lower limit of the independent variable; The upper limit of the independent variable; A random number in the range [0, 1].
[0130] After initializing the population, calculate the fitness function for each individual in the population. And store the global optimal solution. and Then the search begins in the search space, and the search mechanism includes two phases: exploration and development.
[0131] (7-2) Exploration phase: The exploration phase reflects the porcupine's exploratory behavior. During this phase, the population will have two defense strategies: visual and auditory.
[0132] For visual defense strategies, when a porcupine becomes aware of a predator, it begins to raise and fan its quills, creating a stronger impression. Therefore, the predator has two options: either move towards it or move away. Using a normal distribution to generate random values, these options are mathematically modeled. If these random values are less than 1 or greater than -1, the predator is encouraged to move closer to the CP; otherwise, it will move away from the CP. The mathematical expression is:
[0133]
[0134]
[0135] In the formula, This represents the position information of the i-th porcupine in the (t+1)th iteration; The vector generated between the current porcupine and a randomly selected porcupine from the population represents the predator's position at iteration t; τ1 is a random number based on a 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] In a sound defense strategy, porcupines use sound to create noise and threaten predators. The porcupine's noise increases as the predator approaches. 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]. Indicates the location of the predator. To simulate three effects of sound on the distance between a predator and a porcupine;
[0139] (7-3) Development stage: The development stage reflects the exploitative behavior of porcupines. During this stage, the population will have two defense strategies: scent and physical attack.
[0140] As a defense strategy against odors, porcupines secrete a foul odor that spreads in their surrounding area to deter predators from approaching. The mathematical expression is:
[0141]
[0142] In the formula, τ3 is a random value in the interval [0,1], and r3 is a random number between [1,N]. It represents the position information of the i-th porcupine at the t-th iteration, δ, γ t , These are the parameters controlling the search direction, the defense factor, and the odor diffusion factor, respectively. The calculation formulas are shown below:
[0143]
[0144] In the formula, Let ε be the objective function value of the i-th porcupine in the t-th iteration, and let ε be a small value to avoid division by zero. `rand` is a vector of values randomly generated between [0,1]; `rand` is a variable randomly generated between [0,1]. This is used to simulate three scenarios that may occur with this strategy:
[0145] (a) When If the value is 0, the porcupine will stop spreading its scent because the predator will stop moving out of fear of the porcupine, thus keeping the distance between the predator and the porcupine constant.
[0146] (b) when When the value is 1, the porcupine will emit a significant odor because a predator is nearby;
[0147] (c) when It's a combination of 0 and 1; predators keep a safe distance from porcupines, so there's no need for them to release their scent widely.
[0148] The defensive strategy against physical attacks is physical attack. When a predator gets close and attacks with short, thick feathers, the porcupine will resort to physical attacks. During a physical attack, the two objects strongly merge, representing a one-dimensional inelastic collision, mathematically expressed as:
[0149]
[0150] In the formula, τ4 and τ5 are random values in the interval [0,1]; α is the convergence rate factor; The average force of the porcupine affecting the i-th predator; m iLet be the mass of the i-th individual (predator) at iteration t; Let be the initial velocity of the i-th porcupine at iteration t. Let be the final velocity of the i-th porcupine at the next iteration t+1, calculated using the following formula:
[0151]
[0152] Preferably, the aforementioned Cyclic Population Reduction (CPR) technique, in addition to accelerating the convergence speed, can also maintain population diversity. This strategy simulates that not all porcupines activate defense mechanisms, but only those porcupines that are threatened do so. The mathematical model is as follows:
[0153]
[0154] In the formula, T is the loop variable, which determines the number of times the process is executed during optimization; T max N represents the maximum number of iterations, t represents the current iteration number, and N represents the maximum number of iterations. min This represents the minimum number of individuals in the newly generated population.
[0155] The present invention also provides an artificial intelligence-based photovoltaic array fault diagnosis device, comprising:
[0156] Feature extraction module: used by the KPCA algorithm to extract nonlinear principal components of photovoltaic array fault datasets under open-circuit, short-circuit, and other fault conditions;
[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 as the training set to train the constructed CPO-CNN fault diagnosis model on the dataset after extracting nonlinear feature principal components by KPCA, to 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 extracted by KPCA into the trained CPO-CNN fault diagnosis model and output the photovoltaic array fault type.
[0160] The present invention also provides an artificial intelligence-based photovoltaic array fault diagnosis device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above-described method.
[0161] Example:
[0162] like Figure 2As shown, to verify the effectiveness of the KPCA-CPO-CNN artificial intelligence fault diagnosis model of this invention, a 3x3 series-parallel photovoltaic array was built using Matlab / Simulink simulation software. The module model was DXM5-72P 180W, and its main parameters are shown in Table 1. Simulations were performed on 11 different scenarios during the actual operation of the photovoltaic array, including normal operation, open circuit, short circuit, and combined faults, and the corresponding IV curves were obtained. Figure 3 As shown. Under a light intensity of [100, 1000] W / m² 2 The step size was set to 10, and the temperature was set to [15, 55]℃. A total of 3300 sets of data were collected, including 3000 sets of samples for fault status labels (labels 2-10) and 300 sets of samples for normal status labels (label 1). The sample data were divided into training and test sets according to the label categories in an 8:2 ratio. KPCA was used to extract the nonlinear feature principal components of the dataset and normalize them. The CPO algorithm was used to optimize the CNN hyperparameters, namely batch size, learning rate, regularization coefficient, kernel size and number of two convolutional layers. The unoptimized CNN hyperparameters were set to their default values. The model's accuracy on the test set was 92.27%, indicating that the unoptimized CNN model is insufficient in photovoltaic array fault diagnosis and has a mediocre classification effect on the data, requiring further optimization.
[0163] Table 1 Main Parameters of Components
[0164]
[0165] Figure 4 For photovoltaic modules, the irradiance is 600W / m at a temperature of 25℃. 2 800W / m 2 1000W / m 2 The output characteristic curves were compared and found to be consistent with those provided in the manufacturer's manual, indicating that the constructed module model can well simulate actual photovoltaic modules and can be used for scientific experiments and related research.
[0166] This embodiment sets up 11 operating states for the photovoltaic array: normal (label 1), different degrees of aging (label 2), different degrees of shading (label 3), two strings open circuit (label 4), module short circuit (5-7), shading + short circuit (label 8), one string open circuit + two modules short circuit (label 9), one module short circuit + slight aging (label 10), and one module short circuit + severe aging (label 12). Aging faults are simulated by connecting a resistor in series in the branch circuit; the resistance is 3Ω for slight aging and 10Ω for severe aging. Shading faults are simulated by changing the irradiance of the shaded module. Open circuit faults are simulated by disconnecting the wires of the faulty photovoltaic string from its adjacent photovoltaic strings. Short circuit faults are simulated by connecting a 1×10Ω resistor in parallel across the faulty module. -6 The resistance of Ω is used to simulate other complex faults, and other complex faults are simulated by combining the above-mentioned individual faults. Using the above method in this embodiment, when constructing a multi-class fault diagnosis model for photovoltaic arrays, the CPO algorithm is used to optimize the parameters of the kernel size and number, learning rate, regularization coefficient, and batch size of the two convolutional layers in the CNN model. The initial population size N = 10 and the maximum number of iterations T of the porcupine algorithm are set. max =10, loop number variable T=2, convergence rate a=0.2, percentage T of the trade-off between the third and fourth defense mechanisms. f =0.8, the optimization range of CNN hyperparameters and the optimization results after iteration are shown in Table 2.
[0167] Table 2 Results of CNN Hyperparameter Optimization
[0168]
[0169] Figure 5 , Figure 6 This presents the fault diagnosis accuracy and confusion matrix of this invention. Analysis of the diagnostic results shows that the fault diagnosis accuracy on the test set achieved by using KPCA to extract nonlinear feature principal components and optimizing the CNN model using the CPO algorithm is 98.33%. That is, in photovoltaic array fault diagnosis, the KPCA-CPO-CNN artificial intelligence fault diagnosis model proposed in this invention is more reliable than the unoptimized CNN model.
[0170] To further verify the effectiveness and accuracy of the proposed KPCA-CPO-CNN AI fault diagnosis model, it was compared with LSTM, CNN, KPCA-CNN, and CPO-CNN models using the same dataset. Accuracy, precision, recall, and F1-score were used as evaluation metrics for the model. Accuracy represents the proportion of correctly predicted samples out of the total number of samples; precision represents the proportion of correctly predicted samples out of all predicted positive samples; recall represents the proportion of correctly predicted samples out of all true positive samples; and F1-score is the harmonic mean of precision and recall, with a value ranging from 0 to 1.
[0171] As shown in Table 3, the accuracy of the CNN model is 5.75% higher than that of the LSTM model, indicating that the CNN model has a strong ability to map nonlinear relationships in photovoltaic array fault diagnosis and is more accurate in fault diagnosis. The accuracy of the KPCA-CNN and CPO-CNN models is 1.21% and 5.76% higher than that of the basic CNN model, respectively, while the accuracy of the KPCA-CPO-CNN model is 0.3% higher than that of 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] Therefore, the KPCA-CPO-CNN artificial intelligence fault diagnosis model proposed in this application has better performance, and compared with the CPO-CNN model, the model of this invention has shorter training time and higher fault diagnosis accuracy.
[0175] This invention proposes a CPO-CNN artificial intelligence model for diagnosing photovoltaic array fault types. The model extracts nonlinear feature principal components from the data using the KPCA algorithm. Numerical examples verify the model's accuracy and efficiency, leading to the following conclusions:
[0176] Addressing the impact of excessively large dimensionality in photovoltaic array fault diagnosis datasets on model training efficiency
[0177] To mitigate the impact of the KPCA algorithm, this invention employs the KPCA algorithm to extract nonlinear principal components from the dataset, mapping the fault sample data to a high-dimensional space. This eliminates spatial correlation, filters noise and redundant data, while ensuring the accuracy of fault diagnosis. Furthermore, the model training time is reduced by 42.05%, demonstrating the feasibility of extracting nonlinear principal components and the effectiveness of the KPCA algorithm.
[0178] To address the problem that manually selecting CNN hyperparameters based on experience makes it difficult to construct the optimal network,
[0179] This invention uses the CPO algorithm to optimize the learning rate, regularization coefficient, batch size, convolutional kernel size and number in CNN. Experimental results show that the KPCA-CPO-CNN model has stronger global search capabilities and higher fault diagnosis accuracy.
[0180] This invention proposes an artificial intelligence-based photovoltaic array fault diagnosis model.
[0181] The accuracy of the proposed model reaches 98.33%, which is 11.81%, 6.06%, and 4.85% higher than that of LSTM, CNN, and KPCA-CNN models, respectively. Compared with the CPO-CNN model, the accuracy is improved by 0.3%, and the model training time is reduced by 42.05%. This indicates that the proposed model is effective, efficient, and highly accurate in identifying photovoltaic array fault types, and has reference value for operation and maintenance personnel to identify the current status of photovoltaic arrays.
[0182] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A photovoltaic array fault diagnosis method based on artificial intelligence, characterized in that... Includes the following steps: Step S1: Obtain the electrical parameters, irradiance, and temperature of the photovoltaic array under normal operating conditions and fault operating conditions; Step S2: Perform KPCA dimensionality reduction and normalization on the data obtained in step S1, and use the processed data as the training set. Step S3: Construct a CNN photovoltaic array fault diagnosis model. Optimize the CNN hyperparameters using the Crowned Porcupine Optimization Algorithm (CPO). Use the training set from Step S2 as input to train the optimized CNN fault diagnosis model. Output the normal state or fault operation state to obtain the CPO-CNN fault diagnosis model. In step S3, a one-dimensional convolutional neural network (1D-CNN) is used, consisting of an input layer, convolutional layers, pooling layers, fully connected layers, and an output layer. The convolutional layers are used to extract data features, and the pooling layers reduce the number of parameters and computational cost through activation functions. The classification is performed, and the output layer outputs the classification results. The classifier is located after the fully connected layer, through... The function can convert the output values of multi-class classification into a probability distribution in the range [0, 1] with a sum of 1. The final model determines the classification of each sample, and the one with the highest probability is the final fault type for that sample. The expression is: (5) In the formula, For the first The output value of each node; This represents the number of output nodes, i.e., the number of categories. ; The steps of the porcupine optimization algorithm are as follows: Step S301: Initialize the parameters of the porcupine optimization algorithm and the optimization range of CNN hyperparameters, and randomly generate a porcupine population; Step S302: Initialize the porcupine positions. The position of each porcupine is composed of the corresponding CNN hyperparameters. Step S303: Input the hyperparameters into the CNN and train it using the training dataset to calculate the fitness value corresponding to each porcupine; Step S304: Sort the porcupines according to their fitness values and obtain the current optimal crowned porcupine position; Step S305: Continuously update and reorder the fitness values and optimal positions of the porcupines; Step S306: In each iteration, the population size is updated using the cyclic population reduction technique; when the number of population iterations reaches the maximum number of iterations or the fitness meets the requirements, the parameters corresponding to the optimal position of the porcupine are output as the optimal values of the CNN hyperparameters. Step S307: Build a model using the optimal solution of CNN hyperparameters to obtain the trained CPO-CNN fault diagnosis model; Step S4: Obtain the photovoltaic array fault diagnosis data, reduce and normalize it using KPCA, and input it into the trained CPO-CNN fault diagnosis model described in step S3 to output the photovoltaic array fault type.
2. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1, 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, characterized in that, Step S2 includes the following steps: (3-1) The principle of KPCA dimensionality reduction is to reduce the dimensionality of the material to a lower level. Mapped to a high-dimensional feature space; kernel matrix for: (1) Among them, kernel function In the formula, The translation parameter is a constant term. The degree of the polynomial is an integer between 1 and 10. and For data sequences; For data dimensions; (3-2) Centralized kernel matrix for: (2) in, In the formula, yes The identity matrix; (3-3) Calculate the eigenvalues of the centered kernel matrix again. and the corresponding feature vector The eigenvalues are sorted in descending order, based on the set dimensionality reduction dimension. Select The largest eigenvalues and their corresponding eigenvectors are denoted as . Using a centralized kernel matrix and Multiplication yields the dimensionality-reduced data matrix. for: (3) In the formula, This is a mapping from low-dimensional to high-dimensional; (3-4) The obtained dimensionality-reduced data is subjected to max-min normalization using a normalization formula, mapping all data to [0,1]. The normalization formula is: (4) In the formula, The data is after normalization; This is the original data; , These are the minimum and maximum values of the sample data, respectively.
4. The method for fault diagnosis of photovoltaic arrays based on artificial intelligence according to claim 1, characterized in that, The CNN hyperparameters include batch size, learning rate, regularization coefficient, kernel size and number of the two convolutional layers.
5. The method for fault diagnosis of photovoltaic arrays based on artificial intelligence according to claim 1, characterized in that, Using the training set classification error rate as the fitness function, the fitness value for each porcupine is calculated according to the following formula: (6) In the formula, The number of correct diagnoses in the training set. This represents the total number of elements in the training set.
6. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1, characterized in that, The specific steps of the porcupine optimization algorithm are as follows: (6-1) Initialize the porcupine optimization algorithm parameters, including population size. Maximum number of iterations Number of independent variables Upper limit of independent variable Lower limit of independent variable Objective function Loop count Convergence speed The percentage of trade-offs between the third and fourth defense mechanisms The location information of each porcupine represents a set of hyperparameter settings for a CNN. The location of each porcupine in the population is randomly generated using equation (7): (7) In the formula, For the first Location information for the porcupine; This is the lower limit of the independent variable; The upper limit of the independent variable; A random number in the range [0,1]. After initializing the population, calculate the fitness function for each individual in the population. And store the global optimal solution. and Then, the search begins in the search space, and the search mechanism includes two phases: exploration and development. (6-2) Exploration phase: The exploration phase reflects the porcupine's exploratory behavior. During this phase, the population will have two defense strategies: visual and auditory. For visual defense strategies, a normal distribution is used to generate random values to mathematically simulate these options. If these random values are less than 1 or greater than -1, the predator is encouraged to move closer to the target area (CP); otherwise, the predator will move away from the CP. The mathematical expression is: (8) (9) In the formula, For the first Only porcupines in the first Position information for the next iteration; The vector generated between the current porcupine and a randomly selected porcupine from the population represents the predator's position at iteration t; These are random numbers based on a normal distribution. A random number in the interval [0,1]; This represents the current iteration number; A random number between [1, N]; The mathematical expression for sound defense strategies is: (10) In the formula, , Let N be two random integers between [1, N]. Let be a random number in the interval [0,1]. Indicates the location of the predator. To simulate three effects of sound on the distance between a predator and a porcupine; (6-3) Development phase: The development phase reflects the exploitative behavior of porcupines. During this phase, the population will have two defense strategies: scent and physical attack. The mathematical expression for odor defense strategies is: (11) In the formula, The random value is in the interval [0,1]. It is a random number between [1, N]. It is the first Only porcupines in the first Position information at the next iteration , , These are the parameters controlling the search direction, the defense factor, and the odor diffusion factor, respectively. The calculation formulas are shown below: (12) In the formula, For the first Only porcupines in the first The objective function value at the next iteration. To avoid small values that are divided by zero; A vector of values randomly generated between [0,1]. A variable randomly generated between [0,1]; This is used to simulate three scenarios that may occur with this strategy: (a) When If the value is 0, the porcupine will stop spreading its scent because the predator will stop moving out of fear of the porcupine, thus keeping the distance between the predator and the porcupine constant. (b) when When the value is 1, the porcupine will emit a significant odor because a predator is nearby; (c) when It's a combination of 0 and 1; predators keep a safe distance from porcupines, so there's no need for them to release their scent widely. The defense strategy against physical attacks is to use physical attacks themselves. During a physical attack, the two objects strongly merge, representing a one-dimensional inelastic collision, mathematically expressed as: (13) In the formula, , The value is a random value in the interval [0,1]. This is the convergence rate factor; To affect the first The average strength of a predator porcupine; For iteration Time The quality of each individual; For iteration Time The porcupine's initial speed, For the first Only the porcupine in the next iteration The final velocity at time t is calculated using the following formula: (14) 。 7. The photovoltaic array fault diagnosis method based on artificial intelligence according to claim 1, characterized in that, The mathematical model for the cyclic population reduction technique is as follows: (15) In the formula, This is a loop variable used to determine the number of times the process is executed during optimization. The maximum number of iterations, This represents the current iteration number. This represents the minimum number of individuals in the newly generated population.
8. A photovoltaic array fault diagnosis device based on artificial intelligence, used to implement the photovoltaic array fault diagnosis method based on artificial intelligence according to any one of claims 1 to 7, characterized in that, include: Feature extraction module: used by the KPCA algorithm to extract nonlinear principal components of photovoltaic array fault datasets under open-circuit and short-circuit 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 as the training set to train the constructed CPO-CNN fault diagnosis model on the dataset after extracting nonlinear feature principal components by KPCA, so as to obtain the trained CPO-CNN fault diagnosis model; Fault diagnosis module: Used to input the photovoltaic array fault data to be diagnosed extracted by KPCA into the trained CPO-CNN fault diagnosis model and output the photovoltaic array fault type.
9. A photovoltaic array fault diagnosis device based on artificial intelligence, comprising a processor and a memory, wherein the memory is used to store computer programs, characterized in that, The processor is used to execute the computer program to perform the artificial intelligence-based photovoltaic array fault diagnosis method as described in any one of claims 1 to 7.
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