Intelligent fault detection method for photovoltaic system
Through sparrow search optimization of K-mean clustering algorithm and improving snake optimization SRU network, combined with weather factors and photovoltaic module data, intelligent detection of photovoltaic system failures is realized, solving the problems of low detection efficiency and high labor costs in the existing technology, and improving The management level of photovoltaic power generation system.
Patent Information
- Application Number
- CN202411266200.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-14
AI Technical Summary
The existing photovoltaic system fault detection methods are inefficient in detection and require a lot of manual intervention. They cannot monitor faults in large-scale photovoltaic power generation systems in real time, resulting in cumbersome detection methods and time-consuming and labor-intensive.
The Sparrow Search Optimization K-mean Clustering Algorithm and the Improved Snake Optimization SRU Network are used to train intelligent detection models through weather factor data and photovoltaic module voltage and current data to judge the photovoltaic module faults in real time and achieve fault warning.
It improves the efficiency and accuracy of photovoltaic system fault detection, saves time and labor costs, helps operation and maintenance personnel to grasp the equipment status in a timely manner, and improves the performance and management level of photovoltaic power generation systems.
Smart Images

Figure CN119312240A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic system fault detection, and in particular to an intelligent photovoltaic system fault detection method. Background Art
[0002] Photovoltaic modules are the core of solar power generation systems, which can directly convert light energy into DC power. In theory, the service life of photovoltaic modules is about 20-25 years, but environmental factors may cause equipment failure, unstable operation, poor performance and other problems, thus affecting the normal operation of photovoltaic power generation systems.
[0003] At present, the main method for fault detection of photovoltaic components in photovoltaic systems is: the solar power generation monitoring center locates the fault through monitoring facilities, and the on-site inspection personnel are in place. After the power is turned off for a group of photovoltaic panels located, each photovoltaic panel is inspected one by one, and the faulty photovoltaic panel is replaced. However, it can only locate a group of photovoltaic panels, and cannot detect which photovoltaic panel is faulty. During on-site maintenance, power-off detection must be performed and each panel must be checked one by one. Therefore, this maintenance method has the problems of cumbersome detection means, low detection efficiency, and requires a lot of manual intervention and operation, which will consume a lot of time and labor costs. Especially in large-scale photovoltaic power generation systems, these problems will be particularly obvious. Summary of the invention
[0004] In view of the above problems, the present invention proposes an intelligent detection method for photovoltaic system faults, which analyzes and compares data such as weather environment and photovoltaic component operation status to obtain photovoltaic system fault warnings.
[0005] To achieve the above object, the present invention adopts the following technical solution: a photovoltaic system fault intelligent detection method, comprising:
[0006] Step 1: Obtain historical data and perform data preprocessing on the historical data, wherein the historical data includes: weather factor data and voltage and current data generated by photovoltaic components;
[0007] Step 2: Cluster the collected weather factor data into similar days using the sparrow search optimized K-means clustering algorithm;
[0008] Step 3: For each similar day data set, a photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network is built, and the data after the preprocessing is used as the training data of the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network to train the model;
[0009] Step 4: Input the collected real-time data of weather factors as input data into the photovoltaic system fault intelligent detection model built by the corresponding similar day data set to determine whether each photovoltaic component has a fault.
[0010] Furthermore, the weather factor data includes temperature, light intensity and humidity, and the data preprocessing includes outlier processing, missing value processing and data normalization.
[0011] Furthermore, the specific process of outlier processing is as follows: arrange the data in ascending order, the number in the middle position of the arranged data is the median, represented by Q2; the lower quartile is the value at the 25% position of the arranged data, represented by Q1; the upper quartile is the value at the 75% position of the arranged data, represented by Q3; define an indicator called the interquartile range IQR, IQR = Q3-Q1, a given interval [Q 1-F*IQR, Q3+F*IQR], where F is a positive number that controls the length of the interval, usually F is 1.5, values within the interval are normal values, and values outside the interval are defined as outliers.
[0012] Furthermore, the Lagrange interpolation method is used to process missing values in the data.
[0013] Furthermore, the specific steps of step 2 are as follows:
[0014] Step 1: Set the sparrow population parameters, including population size, maximum number of iterations T, and safety threshold ST;
[0015] Step 2: Initialize the individual positions of the sparrow population. The position dimension of each sparrow is dim, which is the parameter to be optimized, namely the number of clusters k and the cluster center u in the K-means algorithm. j ;
[0016] Step 3: Use the sparrow search algorithm to optimize the number of clusters k and cluster centers u in K-means j , calculate the fitness value of each sparrow in the population, arrange them from large to small, get the best and worst positions and their corresponding fitness values, and find the optimal number of clusters k and cluster center u j ;
[0017] Step 4: Update the positions of the discoverer, follower, and vigilant according to formulas (2.5)-(2.8);
[0018] The improved finder position update formula is as follows:
[0019]
[0020] w=δ·(w max -(w max -w min )·(1 / (e-1))·(e l / L -1)) (2.6)
[0021] in, is the position coordinate of the ith sparrow in the dth column after the l+1th iteration update; β is a uniform random number in (0, 1]; l and L represent the number of iterations and the maximum number of iterations respectively; Q is a standard normal random distribution number; E is a 1*d all-1 matrix; R and ST are the warning value belonging to [0, 1] and the safety value belonging to [0.5, 1] respectively, w max With w min are the maximum weight and the minimum weight respectively, and δ is a random number between 0 and 1;
[0022] The follower sparrow position update is shown in formula (2.7)
[0023]
[0024] In the formula, x worst (l) is the worst position among all sparrows; X p (l+1) is the best position among all sparrows when the number of iterations is l+1; A + =A T (AA T ) -1 , A is a 1-row d-column matrix whose internal elements are 1 or -1,
[0025] The position update of the vigilant sparrow is shown in formula (2.8)
[0026]
[0027] Where, X best (l) is the global optimal position, ζ is a normal distribution obeying (0, 1), H is a random number in [-1, 1], and f g and f w are the current global optimal and worst fitness values respectively. i is the fitness value of the i-th sparrow;
[0028] Step 5: Determine whether the iteration stop condition is met. If yes, stop the iteration and output the current optimal value. Otherwise, return to step 4 and continue iterating to optimize.
[0029] Step 6: Use the output optimal solution as the initial cluster center for K-means clustering;
[0030] Step 7: Update the cluster center, see the following formula (2.10);
[0031]
[0032] In the formula, m represents the number of samples in the corresponding cluster, x i Represents each point in the data sample, u jrepresents each sample center, j represents the number of cluster centers;
[0033] Step 8: Calculate the criterion function to determine whether the iteration stop condition is met, see formula (2.11). If it is met, stop the iteration and output the clustering result; otherwise, go to step 7.
[0034]
[0035] In the formula, u j and u′ j It represents the sample center point before and after the entire sample data points are classified.
[0036] Furthermore, in the step 3, the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network adopts the SRU neural network model, takes the weather factor data as input data, and takes the voltage and current generated by the photovoltaic components as output data, and trains the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network, wherein the improved snake (ISO) optimization algorithm is introduced to optimize the hyperparameters in the SRU model, thereby selecting the optimal parameter combination value;
[0037] Here are the steps:
[0038] (1: Set the maximum number of iterations T, the population size N, group the snakes evenly and initialize their positions according to the Logistic map, and use the Levy flight strategy to calculate the random step size L;
[0039] L = λ·Levy(γ)
[0040] Where λ is the Levy flight perturbation factor, and λ is a random number between [0, 1];
[0041] (2: Use the following formula to divide the population into two equal sub-populations, male N m and female N f ;
[0042] N m ≈N / 2
[0043] N f =NN m
[0044] (3: Calculate the fitness value of each individual in the population, find the best male individual and the best female individual; use the mean absolute error value MAE of the SRU network as the fitness value of the individual in ISO, the formula is as follows:
[0045]
[0046] Among them, i is the true value, P iis the predicted value, and n is the total number.
[0047] (4: Calculate the temperature Temp and the amount of food Q respectively by the following formulas;
[0048]
[0049] Where: t is the current number of iterations; T is the maximum number of iterations, c1 is a constant, which is 0.5.
[0050] (5: When the food amount Q is less than 0.25, it means that the snake enters the exploration stage. The exploration stage is completed by the following formula, and the process goes to step 12;
[0051] X i (t+1)=X rand (t)±c2×A×((X max -X min )×rand+X min )+L
[0052]
[0053] Where: X i (t+1) is the position of the i-th snake at the t+1 iteration; X rand (t) is the randomly selected snake position at the tth iteration; rand is a random number in the range [0, 1]; c2 is a constant, which is 0.05; A is the ability of the snake to find food, and f rand is the position X of the randomly selected snake rand The fitness value, f i is the position X of the i-th snake i The fitness value of , L is the random step length;
[0054] (6: When the food quantity Q>0.25 and the temperature Temp>0.6, the snake individual enters the development stage, and the snake individual position is updated by the following formula, and jumps to step 12;
[0055] X i (t+1)=X food ±c3×Temp×rand×(X food -X i (t))+L
[0056] Where: X i is the position of the individual snake; X food is the optimal position of the individual snake (i.e. the global optimal position); rand is a random number in the range of [0, 1]; c3 is a constant, which is 2;
[0057] (7: When the food quantity Q>0.25 and the temperature Temp<0.6, the snake individuals enter the fighting or mating mode;
[0058] (8: Generate a random number rand in [0, 1] and determine whether the number is greater than 0.6. If it is greater than 0.6, the snake enters the mating mode, otherwise it enters the fighting mode;
[0059] (9: When rand < 0.6, enter combat mode, complete the individual snake position update through the following formula, and jump to step 12;
[0060] X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t))+L
[0061] X i,f (t+1)=X i,f (t)+c3×FF×rand×(Q×X best,m -X i,f (t))+L
[0062]
[0063] Where: X i,m is the position of the ith male; X best,f is the best position in the female snake group; rand is a random number in the range of [0, 1]; FM is the male fighting ability, X i,f is the position of the ith female, X best,m is the best position in the male snake group, rand is a random number in the range of [0, 1]; FF is the female fighting ability, f best,f is the best position X in the female snake group best,f The fitness value of best,m is the best position X in the male snake group best,m The fitness value of i is the fitness value of the current individual;
[0064] (10: When rand is greater than 0.6, it enters the mating mode and completes the update of the individual snake position through the following formula;
[0065] X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t))+L
[0066] X i,f (t+1)=X i,f (t)+c3×M f×rand×(Q×X i,m (t)-X i,f (t))+L
[0067]
[0068] Where: X i,m is the position of the ith male; X i,f is the position of the ith female; rand is a random number in the range [0, 1]; M m and M f Separate into male and female mating abilities;
[0069] (11: If a snake egg hatches, the worst male and female are selected for replacement, see the following formula;
[0070] X worst,m =θX i (1-X i )
[0071] X worst,f =θX i (1-X i )
[0072] Where: X worst,m is the worst position in the male snake group, X worst,f is the worst position in the female snake group, θ is the Logistic parameter, θ = 3.99, X∈[0,1];
[0073] (12: Determine whether the iteration stop condition is met. If so, output the optimal value. Otherwise, continue iterating and return to step 3.
[0074] Furthermore, the snake population size N=30, and the maximum number of iterations T=300.
[0075] Furthermore, in step 4, the real-time weather factor data collected is input as input data into the photovoltaic system fault intelligent detection model constructed by the corresponding similar day data set, and then it is determined whether the voltage and current values generated by the photovoltaic components of the output data of the model exceed the set threshold value. If so, a fault warning is issued, otherwise no alarm is given.
[0076] The present invention can bring the following beneficial effects: it can not only save time and labor costs, but also help operation and maintenance personnel to timely grasp the equipment status, troubleshoot faults, and take corresponding measures, thereby improving the performance and management level of the photovoltaic power generation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is the flow chart of the similar day partitioning model based on the improved sparrow search algorithm (ISSA) to optimize K-means.
[0078] Figure 2 It is the basic structure of SRU network.
[0079] Figure 3 Flowchart of the photovoltaic system fault detection model based on the improved snake algorithm (ISO) to optimize the SRU network.
[0080] Figure 4 The figure is an overall flow chart of an intelligent detection method for photovoltaic system faults. DETAILED DESCRIPTION
[0081] The photovoltaic system fault intelligent detection method based on the improved snake (ISO) optimized SRU network proposed in the present invention first obtains historical data and performs data preprocessing on the historical data. The historical data includes: weather factor data and voltage and current data generated by photovoltaic components; in addition, data preprocessing includes outlier processing, missing value processing and data normalization. Then, the collected weather factor data is clustered for similar days using the sparrow search optimized K-means clustering algorithm; then, for each similar day data set, a photovoltaic system fault intelligent detection model based on the improved snake (ISO) optimized SRU network is built, and the data after the preprocessing is used as the training data of the photovoltaic system fault intelligent detection model of the improved snake (ISO) optimized SRU network, and the model is trained; finally, the collected weather factor data and other real-time data are input as input data into the photovoltaic system fault intelligent detection model built by the corresponding similar day data set, so as to determine whether each photovoltaic component has a fault.
[0082] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the present invention is clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the present invention is not limited to the following embodiments, and the specific implementation method can be determined according to the technical scheme of the present invention and the actual situation. In order to avoid confusing the essence of the present invention, the known methods, processes and flows are not described in detail.
[0083] Please refer to Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, the photovoltaic system fault intelligent detection method includes:
[0084] Step 1: Data preprocessing
[0085] In the process of data collection, there will inevitably be omissions and errors in data collection. When building a model, using such inaccurate data will inevitably reduce the accuracy of the model. Therefore, before building a model, the data must be preprocessed to ensure the accuracy and effectiveness of the data.
[0086] (1) Outlier processing
[0087] The present invention uses a box plot to identify and process data outliers. A box plot, also known as a box-whisker plot, a box plot or a box-shaped plot, is a statistical diagram used to display data dispersion information, and is named because of its box-like shape.
[0088] The present invention arranges the data in order from small to large. The number in the middle position of the arranged data is the median, which is represented by Q2; the lower quartile is the value at the 25% position of the arranged data, which is represented by Q1; the upper quartile is the value at the 75% position of the arranged data, which is represented by Q3.
[0089] Then define an indicator called the interquartile range IQR, which is the distance between the upper quartile (Q3, i.e., 75%) and the lower quartile (Q1, i.e., 25%), so IQR = Q3-Q1. The interquartile range IQR reflects the degree of dispersion of the middle 50% of the data. The smaller its value, the more concentrated the data in the middle; the larger its value, the more dispersed the data in the middle. Next, a reasonable interval is given. The values within this interval are normal values, and the values outside the interval are defined as outliers. In the box plot, the interval is generally [Q1-F*IQR, Q3+F*IQR], and F is a positive number that controls the length of the interval, usually F is 1.5. Therefore, it is only necessary to determine whether each value in this set of data is within the interval [Q1-1.5*IQR, Q3+1.5*IQR]. If it is not within this interval, it is marked as an outlier.
[0090] (2) Missing value processing
[0091] Because the Lagrange interpolation method has a better effect on interpolating data with strong regularity, the present invention uses the Lagrange interpolation method to process missing values of data. The Lagrange interpolation formula is as follows:
[0092]
[0093] In the formula, y i is the current value at the i-th point, x″ i , x″ j is the i-th moment and the j-th moment, n′ is the number of moments; x″ is the required moment, and y is the current value at the required moment.
[0094] For example, if the current values at the three moments x1, x2, and x3 are y1, y2, and y3 respectively, then the current value at any point in the middle can be expressed as:
[0095]
[0096] (3) Data normalization
[0097] Because the units of various influencing factors are different, it will have an adverse effect on the final prediction results, so the data needs to be normalized. The present invention uses the min-max normalization method to normalize the data. The data is mapped to [0, 1] through the min-max normalization method. The specific formula is as follows:
[0098]
[0099] In the formula, x * Respectively represent the data samples before and after transformation and normalization; x min 、x max Represent the maximum and minimum values in the data sample respectively;
[0100] Step 2: Optimize the similar day division of K-means clustering algorithm based on the improved sparrow search algorithm (ISSA)
[0101] Although the K-means clustering algorithm has the advantages of being simple, fast, and effective, its cluster centers and the number of clusters K need to be set manually, and the iterative method can only obtain a local optimal solution, but cannot guarantee a global optimal solution; in addition, different cluster numbers K and initial cluster center selections may lead to different clustering results. Therefore, the present invention iteratively optimizes the number of clusters K and the number of cluster centers in the K-means clustering algorithm by improving the sparrow search algorithm, thereby obtaining the optimal number of clusters K and the number of cluster centers.
[0102] (1) Improved Sparrow Search Algorithm (ISSA)
[0103] The present invention uses the following matrix to represent the position of the sparrow:
[0104]
[0105] Where N is the number of sparrows, i.e. the size of the sparrow population, and d represents the parameter dimension to be optimized. The fitness value of all sparrows can be described by the following formula:
[0106]
[0107] Among them, F X Each row in represents the fitness value of an individual sparrow. The silhouette coefficient value of K-means clustering is used as the fitness function. The silhouette coefficient (SC) formula is as follows:
[0108]
[0109] In the formula, a(i) is the average distance from sample i to other samples in the same cluster, which is called intra-cluster dissimilarity; b(i) is the average distance from sample i to all samples in another cluster.
[0110] The quality of the population generated by the sparrow search algorithm using a random generation method cannot be guaranteed. Tent chaotic mapping is suitable for population initialization. It has the characteristics of randomness, ergodicity and regularity, and can provide more diverse initial solutions for algorithm solving, which is conducive to algorithm optimization and solving. Therefore, the present invention uses Tent chaotic mapping to generate the initial population of sparrows. Because the basic Tent chaotic mapping is unstable, the random variable Tent chaotic mapping is used to initialize the sparrow population. Its expression is as follows: (Sparrow population position initialization formula)
[0111]
[0112] Where α is a variable between [0, 1]. rand(0, 1) means generating a random number between (0, 1). is the position coordinate of the i-th sparrow in the d-th column.
[0113] In the iterative optimization process of the sparrow search algorithm, dynamic adaptive weights are introduced into the discoverer position update formula. When each individual in the population updates its position, it will calculate the corresponding dynamic adaptive weight, and this weight will gradually decrease during the iteration process. In this way, the situation of over-reliance on the discoverer individual can be alleviated, so that the algorithm can better balance the relationship between global search and local search. The improved discoverer position update formula is as follows:
[0114]
[0115] w=δ·(w max -(w max -w min )·(1 / (e-1))·(e l / L -1)) (2.6)
[0116] in, is the position coordinate of the ith sparrow in the dth column after the l+1th iteration update; β is a uniform random number in (0, 1]; l and L represent the number of iterations and the maximum number of iterations respectively; Q is a standard normal random distribution number; E is a 1*d all-1 matrix; R and ST are the warning value belonging to [0, 1] and the safety value belonging to [0.5, 1] respectively. max With w min are the maximum weight and the minimum weight respectively, and δ is a random number between 0 and 1.
[0117] From formula (2.6), we can see that in the early stage of the algorithm search, the weight w is relatively large and slowly decreases, and the discoverer can perform a global search. In the later stage of the algorithm, the weight becomes smaller, and the discoverer can perform a local search in the region. In other words, the weight w can balance local and global searches well.
[0118] The position update mechanism of most sparrows in the Discoverer Sparrow Colony is based on jumping from the original position, and the next updated position is somewhere between the origin and the current position. The position update mechanism of a small number of sparrows is based on small displacements in different dimensions from the original position.
[0119] The position update of the follower sparrow is shown in formula (2.7). From the judgment condition of the formula, we can see that the position of the follower sparrow that satisfies the condition i>N / 2 is a poor position, and these sparrows can be called beggar sparrows. The update mechanism of the beggar sparrow is to jump around the origin in each dimension, trying to find a place with better food. When the non-beggar sparrow updates its position, each dimension moves closer to the best position of the discoverer sparrow.
[0120]
[0121] In the formula, x worst (l) is the worst position among all sparrows; X p (l+1) is the best position among all sparrows when the number of iterations is l+1; A + =A T (AA T ) -1 , A is a 1-row, d-column matrix whose internal elements are 1 or -1.
[0122] The position update of the vigilant sparrows is shown in formula (2.8). The update principle is that after the update of the discoverer sparrows and the follower sparrows, the updated sparrow colony is randomly selected to allocate the vigilant sparrow colony. It can be seen from the judgment conditions in formula (2.5) that the number of vigilant sparrows that meet the conditions is very small. This lucky sparrow will escape from its own position, and the updated position is based on its original position. The displacement distance is the ratio of the difference between its own distance and the worst distance to the difference between its own food and the worst food. The remaining sparrows occupy almost all the vigilant sparrows in the colony, and the updated position is greatly displaced towards the best position.
[0123]
[0124] Where, X best (l) is the global optimal position, ζ is a normal distribution that follows (0, 1). H is a random number in [-1, 1]. g and f w are the current global optimal and worst fitness values respectively. i is the fitness value of the i-th sparrow. ε is a constant to avoid the denominator being 0; that is, when f i -f w When it is 0, ε avoids the denominator being 0;
[0125] The specific steps of improving the sparrow algorithm are as follows:
[0126] 1) Determine the number of iterations, the size of the sparrow population, and the proportion of discoverers and alerters in the population. The population size N = 30, the maximum number of iterations T = 5, the proportion of discoverers is 20%, the proportion of alerters is 10%, and the safety threshold ST = 0.8.
[0127] 2) Use the random variable Tent chaotic map to initialize the parameters of the sparrow population and calculate the individual fitness in the initial population.
[0128] 3) Sort the sparrow individuals according to their fitness values from high to low.
[0129] 4) Use the finder sparrow position formula in formula (2.5) to determine the position of the finder sparrow, and use the follower sparrow position formula in formula (2.7) to determine the positions of all follower sparrows.
[0130] 5) Select some sparrow individuals from the sparrow population as vigilant sparrows, and use formula (2.8) to update the position of the vigilant sparrows.
[0131] 6) Calculate the individual fitness value again.
[0132] 7) Whether the entire operation has reached the maximum number of iterations. If it has, then output the position of the individual sparrow at this time, that is, the optimal parameter. If it has not reached the maximum number of iterations, then return to step 3).
[0133] (2) K-means clustering algorithm
[0134] K-means is a traditional distance-based clustering algorithm. Its steps are as follows:
[0135] Step 1: Randomly select k data sample points from the data set and assign them to the initialized cluster centers u1, u2, ..., u j ,…,u k .
[0136] Step 2: Calculate for each point x in the data sample i With each sample center u j The sample is assigned to the cluster corresponding to the nearest cluster center point.
[0137]
[0138] In the formula, d(x i ,u j ) represents x i with u j The distance between them. n represents the number of samples, and j represents the number of cluster centers.
[0139] Step 3: For each x in the entire sample data i Classify to the corresponding u j In the above example, we recalculate the sample center point u j .
[0140]
[0141] In the formula, m represents the number of samples in the corresponding cluster.
[0142] Step 4: Repeat steps 2-3 until the criterion function converges.
[0143]
[0144] In the formula, ux and u′ j It represents the sample center point before and after the entire sample data points are classified.
[0145] (3) Improved Sparrow Search Optimization K-means Algorithm (ISSA-K)
[0146] The sparrow search algorithm can make the number of clusters k and the cluster center parameter u in the k-means clustering algorithm i Automatically determine and optimize, no manual settings are required. The specific steps are as follows:
[0147] Step 1: Set the parameters of the sparrow population, including the population size N, the maximum number of iterations T, the safety threshold ST, etc. The population size N = 30, the maximum number of iterations T = 5, the proportion of discoverers is 20%, the proportion of vigilant people is 10%, and the safety threshold ST = 0.8.
[0148] Step 2: Initialize the individual positions of the sparrow population. The position dimension of each sparrow is dim, which is the parameter to be optimized, namely the number of clusters k and the cluster center u in the K-means algorithm. j .
[0149] Step 3: Use the sparrow search algorithm to optimize the number of clusters k and cluster centers u in K-means j . Calculate the fitness value of each sparrow's position in the population, arrange them from large to small, get the best and worst positions and their corresponding fitness values, and find the optimal number of clusters k and cluster center u j .
[0150] Step 4: Update the positions of the seeker, tracker, and defender according to formulas (2.5)-(2.8).
[0151] Step 5: Determine whether the iteration stop condition is met. If so, stop the iteration and output the current optimal value. Otherwise, return to step 4 and continue iterating to optimize.
[0152] Step 6: Use the output optimal solution as the initial cluster center for K-means clustering.
[0153] Step 7: Update the cluster center, see formula (2.10).
[0154] Step 8: Calculate the criterion function to determine whether the iteration stop condition is met, see formula (2.11). If it is met, stop the iteration and output the clustering result; otherwise, go to step 7.
[0155] Step 3: Optimize the photovoltaic system fault intelligent detection model of SRU network based on the improved snake algorithm (ISO).
[0156] (1) Improved Snake Optimization Algorithm (ISO)
[0157] The snake optimization algorithm is a group optimization algorithm. The population-based algorithm first generates solutions randomly, and then enhances the population through different numbers of iterations. The population-based algorithm has the advantages of expanding the spatial search range, enriching population diversity, mutual assistance, and sharing information, thus having better exploration capabilities. The idea of this algorithm is based on imitating the mating and reproduction of snakes. If there is enough food and very low temperature conditions, each snake will strive to find the best mate. The two most critical processes of this algorithm are the exploration stage and the development stage. The exploration stage is to enable the algorithm to search the entire solution space to find the optimal solution, while the development stage enables the algorithm to find new optimal solutions around other areas to improve the global optimization efficiency.
[0158] Initializing the population means randomly generating N individuals in the search space as the original population for calculation. The specific operation is to randomly generate a number within the value range for each dimension of each individual.
[0159] Right now:
[0160] X i =X min +rand×(X max -X min ) (3.1)
[0161] Where: X i is the position of the i-th snake; rand is a random number in the range [0, 1], X max and X min are the upper and lower bounds of the value range of the optimization problem, respectively.
[0162] The population is divided into two groups: female and male. Assume that the number of males is 50% and the number of females is 50%. The population is divided into two groups: male group and female group. The following two formulas are used to divide the population:
[0163] Nm≈N / 2 (3.2)
[0164] Nf =NN m (3.3)
[0165] Among them, N is the number of individuals in the population, that is, the population size; N m is the number of male individuals; N f is the number of female individuals.
[0166] Evaluate each group, that is, calculate the fitness value of each individual in each group of population. Then define the temperature and the amount of food. The temperature can be defined by the following formula:
[0167]
[0168] Where: t is the current number of iterations; T is the maximum number of iterations.
[0169] The quantity of food Q can be defined by the following formula:
[0170]
[0171] In the formula: c1 is a constant, which is 0.5.
[0172] If Q < 0.25, the snakes search for food by choosing any random location and update their positions.
[0173] X i (t+1)=X rand (t)±c r ×A×((X max -X min )×rand+X min ) (3.6)
[0175] Where: X i (t+1) is the position of the i-th snake at the t+1 iteration; X rand (t) is the randomly selected snake position at the tth iteration; rand is a random number in the range [0, 1]; c r is a constant, taking 0.05, and A is the ability of the snake to find food. The formula is as follows:
[0176]
[0177] Where: f rand is the position X of the randomly selected snake rand The fitness value, f i is the position X of the i-th snake i The fitness value of .
[0178] Under the condition of Q>0.25, if temp>0.6, the temperature is hot. The snake will only look for food, and the position update formula is as follows:
[0179] X i (t+1)=X food ±c3×Temp×rand×(X food -X i (t)) (3.8)
[0180] Where: X i is the position of the individual snake; X food is the optimal position of the individual snake (i.e. the global optimal position); rand is a random number in the range of [0, 1]; c3 is a constant, which is 2.
[0181] If Temp≤0.6, the temperature is cold and the snake will be in fighting mode or mating mode. If the random number rand<0.6, the snake will enter fighting mode and the position update formula is as follows:
[0182] X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t))(3.9)
[0183] Where: X i,m is the position of the ith male; X best,f is the best position in the female snake group; rand is a random number in the range of [0, 1]; FM is the male fighting ability.
[0184] X i,f (t+1)=X i,f (t)+c3×FF×rand×(Q×X best,m -X i,f (t)) (3.10)
[0186] Where: X i,f is the position of the ith female; X best,m is the best position in the male snake group; rand is a random number in the range of [0, 1]; FF is the fighting ability of females.
[0187] The formulas for calculating FM and FF are as follows:
[0188]
[0189] Where: f best,f is the best position X in the female snake group best,f The fitness value of best,mis the best position X in the male snake group best,m The fitness value of i is the fitness value of the current individual.
[0190] Mating mode
[0191] X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-x i,m (t))(3.13)
[0192] X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t)) (3.14)
[0194] Where: X i,m is the position of the ith male; X i,f is the position of the ith female; rand is a random number in the range [0, 1]; M m and M f The mating capacity of males and females is given by the following formula:
[0195]
[0196] Where: f i,m is the fitness value of the ith male position; f i,f is the fitness value of the ith female position. If the egg hatches, select the worst male and female and replace them.
[0197] X worst,m =X min +rand×(X max -X min ) (3.17)
[0198] X worst,f =X min +rand×(X max -X min ) (3.18)
[0199] Where: X worst,mmm The worst position in the male snake group; X worst,f This is the worst position among the female snakes.
[0200] The snake optimization algorithm uses random allocation at the initial population. Although this method can randomly assign values to the population in the solution space, it cannot make the snake population evenly distributed in the search space, affecting the accuracy and convergence speed of the algorithm. Therefore, the present invention introduces chaotic Logistic mapping to improve the snake optimization algorithm, optimize the initialization distribution of the snake population, and improve the accuracy and convergence speed of the snake optimization algorithm. The population initialization formula is as follows:
[0201] X i+1 =θX i (1-X i ) (3.19)
[0202] X worst,m =θX i (1-X i ) (3.20)
[0203] X worst,f =θX i (1-X i ) (3.21)
[0204] Where θ is the Logistic parameter, θ=3.99, X∈[0,1].
[0205] The snake optimization algorithm is prone to fall into the local optimum during the position update process. The Levy flight strategy is introduced to change the algorithm's movement strategy, balance the local search and global search mechanisms, and help the algorithm jump out of the local optimum. The random step length of the Levy flight obeys the Levy distribution. The improved snake optimization algorithm introduces the Levy flight mechanism during the position update process to improve the algorithm's global optimization and local search capabilities and speed up the algorithm's convergence. The formula is as follows:
[0206] L = λ·Levy(γ)(3.22)
[0207] Where λ is the Levy flight perturbation factor, λ is a random number between [0, 1], and the snake position update formula is as follows:
[0208] X i (t+1)=X rand (t)±c2×A×((X max -X min )×rand+X min )+L(3.23)
[0209] X i (t+1)=X food ±c3×Temp×rand×(X food -X i (t))+L(3.24)
[0210] Xi,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t))+L(3.25)
[0211] X i,f (t+1)=X i,f (t)+c3×FF×rand×(Q×X best,m -X i,f (t))+L(3.26)
[0212] X i,m (t+1)=X i,m (t)+c3×M mmm ×rand×(Q×X i,f (t)-X i,m (t))+L(3.27)
[0214] X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t))+L(3.28)
[0215] The improved snake optimization algorithm introduces chaos theory and Levy flight strategy on the basis of the basic snake optimization algorithm and proposes dynamic development probability. The process of the algorithm is as follows:
[0216] Step 1: Set the maximum number of iterations T, the population size N, group the snakes evenly and initialize their positions according to the Logistic map, and use the Levy flight strategy to calculate the random step size L; the population size N = 30, the maximum number of iterations T = 300.
[0217] Step 2: Use equations (3.2) and (3.3) to divide the population into two equal sub-populations (males and females);
[0218] Step 3: Calculate the fitness value of each individual in the population and find the best male and female individuals; use the mean absolute error value MAE of the SRU network as the fitness value of the individual in ISO, and the formula is as follows:
[0219]
[0220] Among them, i is the true value, P i is the predicted value, and n is the total number.
[0221] Step 4: Calculate the temperature Temp and the amount of food Q respectively using formulas (3.4) and (3.5);
[0222] Step 5: When the food quantity Q is less than 0.25, it means that the snake enters the exploration stage, and the exploration stage is completed through equations (3.23) and (3.7). Jump to step 12;
[0223] Step 6: When the amount of food Q>0.25 and the temperature Temp>0.6, the snake individual enters the development stage, and the snake individual position is updated by formula (3.24). Jump to step 12;
[0224] Step 7: When the food quantity Q>0.25 and the temperature Temp<0.6, the snake individual enters the fighting or mating mode;
[0225] Step 8: Generate a random number rand in [0,1] and check whether the number is greater than 0.6. If it is greater than 0.6, the snake enters the mating mode. Otherwise, it enters the fighting mode.
[0226] Step 9: When rand < 0.6, enter combat mode and complete the update of individual snake positions using formulas (3.25)(3.26)(3.11)(3.12). Jump to step 12;
[0227] Step 10: When rand is greater than 0.6, enter the mating mode and complete the update of the individual snake position through formulas (3.27)(3.28)(3.15)(3.16).
[0228] Step 11: If a snake egg is hatched (reinitialize the worst initialized snake position), select the worst male and female to replace, see formula (3.20) (3.21);
[0229] Step 12: Determine whether the iteration stop condition is met. If so, output the optimal value. Otherwise, continue iterating and return to step 3.
[0230] (2) Deep SRU Network
[0231] SRU is a new type of recurrent network developed on the basis of LSTM and GRU networks. Its structure is to achieve fast network training through parallel processing based on the above networks. Figure 2This is a schematic diagram of the structure of the SRU network. As can be seen from the figure, the SRU network consists of an input gate, a forget gate, a reset gate, an output gate, a cell state, and a residual connection. Its gate structure is basically composed of a feedforward network activation function. Here, the feedforward network calculation uses point-by-point multiplication, which is significantly better than the Hamiltonian operator of the LSTM network, and its calculation is simpler. In addition, the gate unit calculation mechanism of the SRU network is different from that of the traditional recurrent neural network. In fact, the calculation of the traditional recurrent neural network must wait for the calculation of the previous and next time before it can be performed. This serial operation reduces the learning speed of the traditional recurrent network. The SRU network is based on point multiplication operations and only needs to perform operations based on the input data at the current moment. Therefore, the SRU network is very convenient for parallel processing of the matrix operations involved.
[0232] The calculation process of a single-layer SRU network is as follows:
[0233]
[0234] In the formula, x t represents the input gate, f t represents the state of the forget gate, r r Indicates the reset gate state, c t is the internal state; W, W f With W r They are the parameter matrix, v f 、v r With b r are the parameter matrices obtained through training. Here, formulas (3.29) and (3.30) can be obtained by parallel calculation, and formula (3.32) uses the reset gate r t Formula (3.31) adaptively combines the input x t and the state c generated by the recurrent network t , where (1-r t ) is a skip connection that allows iterations to propagate directly to the previous layer.
[0235] (3) Improved Snake Algorithm (ISO) to Optimize SRU Network
[0236] Since hyperparameters such as the number of hidden layers and the number of hidden layer neurons in the deep SRU network need to be set manually, unreasonable settings will have a great impact on the final prediction results. Therefore, the present invention adopts an improved snake optimization algorithm to iteratively optimize the two hyperparameters of the number of hidden layers and the number of hidden layer neurons in the deep SRU network to further improve the prediction performance of the model.
[0237] The SRU network consists of three parts: input layer, hidden layer and output layer. The input corresponds to relevant influencing factors: such as weather, temperature and light intensity data, and the output is the voltage and current data generated by the photovoltaic components. The status of the photovoltaic components in the photovoltaic system is predicted by inputting the influencing factor data. If it is abnormal, a fault warning is issued, otherwise no fault warning is issued.
[0238] The specific steps of the improved snake algorithm (ISO) to optimize the SRU network are as follows:
[0239] Step 1: Set the maximum number of iterations T, the population size N, group the snakes evenly and initialize their positions according to the Logistic map, and calculate L using the Levy flight strategy; the population size N = 30, the maximum number of iterations T = 300.
[0240] Step 2: Use equations (3.2) and (3.3) to divide the population into two equal sub-populations (males and females);
[0241] Step 3: Calculate the fitness value of each individual in the population and find the best male and female individuals; use the mean absolute error value MAE of the SRU network as the fitness value of the individual in ISO, and the formula is as follows:
[0242]
[0243] Among them, i is the true value, P i is the predicted value, and n is the total number.
[0244] Step 4: Calculate the temperature Temp and the amount of food Q respectively using formulas (3.4) and (3.5);
[0245] Step 5: When the food quantity Q is less than 0.25, it means that the snake enters the exploration stage, and the exploration stage is completed through equations (3.23) and (3.7). Jump to step 12;
[0246] Step 6: When the amount of food Q>0.25 and the temperature Temp>0.6, the snake individual enters the development stage, and the snake individual position is updated by formula (3.24). Jump to step 12;
[0247] Step 7: When the food quantity Q>0.25 and the temperature Temp<0.6, the snake individual enters the fighting or mating mode;
[0248] Step 8: Generate a random number rand in [0,1] and check whether the number is greater than 0.6. If it is greater than 0.6, the snake enters the mating mode. Otherwise, it enters the fighting mode.
[0249] Step 9: When rand < 0.6, enter combat mode and complete the update of individual snake positions using formulas (3.25)(3.26)(3.11)(3.12). Jump to step 12;
[0250] Step 10: When rand is greater than 0.6, enter the mating mode and complete the update of the individual snake position through formulas (3.27)(3.28)(3.15)(3.16).
[0251] Step 11: If a snake egg is hatched (reinitialize the worst initialized snake position), select the worst male and female to replace, see formula (3.20) (3.21);
[0252] Step 12: Determine whether the iteration stop condition is met. If so, output the optimal value. Otherwise, continue iterating and return to step 3.
[0253] Step 13: Obtain the optimal combination of the number of hidden layers and the number of neurons in the hidden layers.
[0254] Step 4: PV panel failure warning
[0255] First, determine which type of similar day the weather data (temperature, humidity, light intensity, etc.) belongs to. Then, input the data as input into the photovoltaic fault intelligent detection model trained under the corresponding similar day type. Then determine whether the predicted data (voltage and current values generated by the photovoltaic module) exceeds the set threshold. If it exceeds, a fault warning is issued, otherwise no alarm is given.
[0256] Fault threshold setting description: The average absolute error and average relative error between the predicted voltage and current curve and the actual voltage and current curve are used as the setting standard for the error threshold. If only one of the two thresholds is exceeded or neither is exceeded, it is considered normal. Otherwise, it is a fault.
[0257] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should be included in the scope of the claims of the present invention. The techniques, shapes, and structural parts not described in detail in the present invention are all known technologies.
Claims
1. A photovoltaic system fault intelligent detection method, characterized in that: The steps include: Step 1: Obtain historical data and perform data preprocessing on the historical data, wherein the historical data includes: weather factor data and voltage and current data generated by photovoltaic components; Step 2: Cluster the collected weather factor data into similar days using the sparrow search optimized K-means clustering algorithm; Step 3: For each similar day data set, a photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network is built, and the data after the preprocessing is used as the training data of the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network to train the model; Step 4: Input the collected real-time data of weather factors as input data into the photovoltaic system fault intelligent detection model built by the corresponding similar day data set to determine whether each photovoltaic component has a fault.
2. A photovoltaic system fault intelligent detection method according to claim 1, characterized in that: The weather factor data include temperature, light intensity and humidity, and the data preprocessing includes outlier processing, missing value processing and data normalization.
3. A photovoltaic system fault intelligent detection method according to claim 2, characterized in that: The specific process of outlier processing is as follows: arrange the data in ascending order, the number in the middle position of the arranged data is the median, denoted by Q2; the lower quartile is the value at the 25% position of the arranged data, denoted by Q1; the upper quartile is the value at the 75% position of the arranged data, denoted by Q3; define an indicator called the interquartile range IQR, IQR = Q3-Q1, a given interval [Q1-F*IQR, Q3+F*IQR], where F is a positive number that controls the length of the interval, usually F is 1.5, values within the interval are normal values, and values outside the interval are defined as outliers.
4. The photovoltaic system fault intelligent detection method according to claim 2, characterized in that: The Lagrange interpolation method is used to handle missing values in the data.
5. A photovoltaic system fault intelligent detection method according to claim 1, characterized in that: The specific steps of step 2 are as follows: Step 1: Set the sparrow population parameters, including population size, maximum number of iterations, and safety threshold ST; Step 2: Initialize the individual positions of the sparrow population. The position dimension of each sparrow is dim, which is the parameter to be optimized, namely the number of clusters k and the cluster center u in the K-means algorithm. j ; Step 3: Use the sparrow search algorithm to optimize the number of clusters k and cluster centers u in K-means j , calculate the fitness value of each sparrow in the population, arrange them from large to small, get the best and worst positions and their corresponding fitness values, and find the optimal number of clusters k and cluster center u j ; Step 4: Update the positions of the discoverer, follower, and vigilant according to formulas (2.5)-(2.8); The improved finder position update formula is as follows: in=δ (in max -(In max -In min ) (1 / (e-1)) (e l / L -1)) (2.6) in, is the position coordinate of the ith sparrow in the dth column after the l+1th iteration update; β is a uniform random number in (0, 1]; l and L represent the number of iterations and the maximum number of iterations respectively; Q is a standard normal random distribution number; E is a 1*d all-1 matrix; R and ST are the warning value belonging to [0, 1] and the safety value belonging to [0.5, 1] respectively, w max With w min are the maximum weight and the minimum weight respectively, and δ is a random number between 0 and 1; The follower sparrow position update is shown in formula (2.7) In the formula, x worst (l) is the worst position among all sparrows; X p (l+1) is the best position among all sparrows when the number of iterations is l+1; A + =A T (AA T ) -1 , A is a 1-row d-column matrix whose internal elements are 1 or -1, The position update of the vigilant sparrow is shown in formula (2.8) In the formula, X best (l) is the global optimal position, ζ is a normal distribution obeying (0, 1), H is a random number in [-1, 1], and f g and f w are the current global optimal and worst fitness values, respectively, i is the fitness value of the i-th sparrow; Step 5: Determine whether the iteration stop condition is met. If yes, stop the iteration and output the current optimal value. Otherwise, return to step 4 and continue iterating to optimize. Step 6: Use the output optimal solution as the initial cluster center for K-means clustering; Step 7: Update the cluster center, see the following formula (2.10); In the formula, m represents the number of samples in the corresponding cluster, x i Represents each point in the data sample, u j represents each sample center, j represents the number of cluster centers; Step 8: Calculate the criterion function to determine whether the iteration stop condition is met, see formula (2.11). If it is met, stop the iteration and output the clustering result; otherwise, go to step 7. In the formula, u j and u′ j It represents the sample center point before and after the entire sample data points are classified.
6. A photovoltaic system fault intelligent detection method according to claim 1, characterized in that: In the step 3, the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network adopts the SRU neural network model, and the historical data after the preprocessing is used as the training data of the photovoltaic system fault intelligent detection model of the improved snake optimized SRU network, wherein the weather factor data is used as the input data, and the voltage and current generated by the photovoltaic components are used as the output data, and the photovoltaic system fault intelligent detection model based on the improved snake optimized SRU network is trained, and the improved snake optimization algorithm is introduced to optimize the hyperparameters in the SRU model, so as to select the optimal parameter combination value; Here are the steps: (1: Set the maximum number of iterations T, the population size N, group the snakes evenly and initialize their positions according to the Logistic map, and use the Levy flight strategy to calculate the random step size L; L = λ·Levy(γ) Where λ is the Levy flight perturbation factor, and λ is a random number between [0, 1]; (2: Use the following formula to divide the population into two equal sub-populations, male N m and female N f ; N m ≈N / 2 N f =N-N m (3: Calculate the fitness value of each individual in the population, find the best male individual and the best female individual; use the mean absolute error value MAE of the SRU network as the fitness value of the individual in ISO, the formula is as follows: Among them, i is the true value, P i is the predicted value, and n is the total number. (4: Calculate the temperature Temp and the amount of food Q respectively by the following formulas; Where: t is the current number of iterations; T is the maximum number of iterations, c1 is a constant, which is 0.5; (5: When the food amount Q is less than 0.25, it means that the snake enters the exploration stage. The exploration stage is completed by the following formula, and the process goes to step 12; X i (t+1)=X rand (t)±c2×A×((X max -X min )×rand+X min )+L Where: X i (t+1) is the position of the i-th snake at the t+1 iteration; X rand (t) is the randomly selected snake position at the tth iteration; rand is a random number in the range [0, 1]; c2 is a constant, which is 0.05; A is the ability of the snake to find food, and f rand is the position X of the randomly selected snake rand The fitness value, f i is the position X of the i-th snake i The fitness value of , L is the random step length; (6: When the food quantity Q>0.25 and the temperature Temp>0.6, the snake individual enters the development stage, and the snake individual position is updated by the following formula, and jumps to step 12; X i (t+1)=X food ±c3×Temp×rand×(X food -X i (t))+L Where: X i is the position of the individual snake; X food is the optimal position of the snake; rand is a random number in the range of [0, 1]; c3 is a constant, which is 2; (7: When the food quantity Q>0.25 and the temperature Temp<0.6, the snake individuals enter the fighting or mating mode; (8: Generate a random number rand in [0, 1] and determine whether the number is greater than 0.
6. If it is greater than 0.6, the snake enters the mating mode, otherwise it enters the fighting mode; (9: When rand < 0.6, enter combat mode, complete the individual snake position update through the following formula, and jump to step 12; X i,m (t+1)=X i,m (t)+c3×FM×rand×(Q×X best,f -X i,m (t))+L X i,f (t+1)=X i,f (t)+c3×FF×rand×(Q×X best,m -X i,f (t))+L Where: X i,m is the position of the ith male; X best,f is the best position in the female snake group; rand is a random number in the range of [0, 1]; FM is the male fighting ability, X i,f is the position of the ith female, X best,m is the best position in the male snake group, rand is a random number in the range of [0, 1]; FF is the female fighting ability, f best,f is the best position X in the female snake group best,f The fitness value of best,m is the best position X in the male snake group best,m The fitness value of i is the fitness value of the current individual; (10: When rand is greater than 0.6, it enters the mating mode and completes the update of the individual snake position through the following formula; X i,m (t+1)=X i,m (t)+c3×M m ×rand×(Q×X i,f (t)-X i,m (t))+L X i,f (t+1)=X i,f (t)+c3×M f ×rand×(Q×X i,m (t)-X i,f (t))+L Where: X i,m is the position of the ith male; X i,f is the position of the ith female; rand is a random number in the range [0, 1]; M m and M f Separate into male and female mating abilities; (11: If a snake egg hatches, the worst male and female are selected for replacement, see the following formula; X worst,m =θX i (1-X i ) X worst,f =θX i (1-X i ) Where: X worst,m is the worst position in the male snake group, X worst,f is the worst position in the female snake group, θ is the Logistic parameter, θ = 3.99, X∈[0,1]; (12: Determine whether the iteration stop condition is met. If so, output the optimal value. Otherwise, continue iterating and return to step 3.
7. A photovoltaic system fault intelligent detection method according to claim 6, characterized in that: The snake population size N=30, and the maximum number of iterations T=300.
8. A photovoltaic system fault intelligent detection method according to claim 1, characterized in that: In step 4, the collected real-time weather factor data is input as input data into the photovoltaic system fault intelligent detection model built by the corresponding similar day data set, and then it is determined whether the voltage and current values generated by the photovoltaic components of the output data of the model exceed the set threshold value. If so, a fault warning is issued, otherwise no alarm is given.