A method for identifying parameters of a photovoltaic cell
By combining adaptive genetic algorithms with a CNN-Transformer hybrid prediction model, accurate identification of photovoltaic cell parameters was achieved, solving the problems of easily getting trapped in local optima and being sensitive to initial parameters in existing technologies, thus improving identification accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ELECTRIC POWER CO LTD RESEARCH INSTITUTE
- Filing Date
- 2026-05-20
- Publication Date
- 2026-06-19
Smart Images

Figure CN122241383A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses a method for identifying photovoltaic cell parameters, belonging to the field of new energy technology. Background Technology
[0002] With the increasing global demand for renewable energy, photovoltaic (PV) power generation, as an important component of clean energy, relies on accurate modeling of PV cell characteristics for its efficient utilization. Parameter identification of PV cells, such as photocurrent, diode saturation current, series resistance, and parallel resistance in a dual-diode model, is a crucial step in optimizing system performance. Currently, parameter identification methods for modeling the current-voltage characteristics of PV cells mainly include analytical methods and gradient descent-based optimization algorithms. Analytical methods directly solve for parameters by simplifying the equivalent circuit model, resulting in high computational efficiency; while gradient descent algorithms utilize local derivative information to iteratively approximate the optimal parameter combination, achieving a certain degree of fitting of the current-voltage characteristics.
[0003] However, the current-voltage characteristics of photovoltaic cells are highly nonlinear and multimodal, revealing significant shortcomings in practical applications of the aforementioned traditional methods. Analytical methods, limited by simplification assumptions, struggle to accurately describe the complex physical behavior of actual photovoltaic cells. Gradient descent-based optimization algorithms are prone to getting trapped in local optima, and their convergence performance is highly dependent on the selection of initial parameters. Inappropriate initial values can lead to premature convergence or oscillatory divergence, resulting in insufficient parameter identification accuracy. These problems severely restrict the robustness and generalization ability of photovoltaic cell modeling, especially in scenarios with noise interference or frequent fluctuations in operating conditions. Therefore, existing technologies are prone to getting trapped in local optima and suffer from insufficient identification accuracy due to sensitivity to initial parameters. Summary of the Invention
[0004] The purpose of this invention is to provide a photovoltaic cell parameter identification method. By integrating an adaptive genetic algorithm and a CNN-Transformer hybrid prediction model, it achieves joint optimization of redundant feature removal, aging voltage prediction, and dual-diode model parameter inversion, thereby solving the problems of insufficient identification accuracy caused by existing technologies being prone to getting trapped in local optima and being sensitive to initial parameters.
[0005] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution:
[0006] This invention provides a method for identifying photovoltaic cell parameters, comprising:
[0007] Obtain raw monitoring data of photovoltaic cells, including voltage time series and current time series;
[0008] The raw monitoring data is preprocessed to obtain standardized monitoring data;
[0009] Based on the importance threshold of the input features, the contribution of each input feature in the standardized monitoring data is evaluated according to the measured aging voltage value corresponding to the standardized monitoring data, so as to obtain the core feature subset after removing redundant information;
[0010] The core feature subset and voltage time series are input into the CNN-Transformer hybrid prediction model for feature fusion and mapping, and the aging voltage prediction value is output.
[0011] Based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent.
[0012] Based on the current conservation equation of the dual-diode model, the photovoltaic cell parameters are obtained by simultaneously solving the photogenerated current, diode forward current, and parallel resistor current, with the optimization objective of minimizing the error between the predicted output current and the measured current.
[0013] Furthermore, the raw monitoring data is preprocessed to obtain standardized monitoring data, including:
[0014] Median filtering is used to perform nonlinear denoising on impulse noise and random interference in the original monitoring data to obtain nonlinearly denoised original monitoring data. Then, the nonlinearly denoised original monitoring data is locally sorted by a sliding window, and the center point value is replaced by the median value in the sliding window to obtain the preliminary denoised monitoring data.
[0015] A sliding window with a preset length and overlap rate is designed to truncate and rearrange the monitoring data after preliminary denoising to obtain reconstructed data;
[0016] based on The statistical distribution criteria are used to detect outliers and correct extreme values in the reconstructed data to obtain standardized monitoring data.
[0017] The monitoring data after preliminary denoising includes the voltage and current after preliminary denoising, respectively expressed as:
[0018] ;
[0019] ;
[0020] In the formula, , They are respectively The voltage and current after initial noise reduction at any given moment. It is a median function. The half-width of the median filtering sliding window ranges from [2,4], and the total width of the sliding window is... , Sampling time, The sampling interval time, and They represent Before the moment Raw voltage and raw current monitoring data at each sampling interval. and Then it means After a moment Raw voltage and raw current monitoring data at each sampling interval;
[0021] ;
[0022] In the formula, The first in the standardized monitoring data One input sample, For the first The voltage after preprocessing at the start time of each input sample. For the first The preprocessed voltage at the termination time of each input sample For the first The current after preprocessing at the termination time of each input sample. The value is the length of the sliding window, ranging from [10, 30]. For the first The sampling time of each input sample.
[0023] Furthermore, the input feature importance threshold and the hyperparameters of the CNN-Transformer hybrid model are obtained through an adaptive genetic algorithm, the method of which includes:
[0024] The gene encoding of each candidate solution is preset, and the gene encoding of each candidate solution simultaneously includes the hyperparameters of the CNN-Transformer hybrid prediction model and the candidate threshold;
[0025] The input features are filtered according to the candidate threshold corresponding to each candidate solution to obtain the corresponding feature subset;
[0026] Using the feature subset and the remaining hyperparameters of the same candidate solution, train a CNN-Transformer hybrid prediction model and compute prediction fitness on the validation set;
[0027] The recognition accuracy of photovoltaic cell parameter inversion is used as the basis for performance evaluation, and the root mean square error predicted by the CNN-Transformer hybrid prediction model is transformed into the fitness function of the adaptive genetic algorithm.
[0028] With the goal of maximizing the fitness function of the adaptive genetic algorithm, the hyperparameters and candidate thresholds corresponding to the global optimal candidate solution are obtained by iteratively executing genetic operations to search and evaluate different candidate solutions.
[0029] The hyperparameters and candidate thresholds corresponding to the globally optimal candidate solutions are determined as the hyperparameters of the CNN-Transformer hybrid prediction model and the input feature importance thresholds.
[0030] Furthermore, using the recognition accuracy of photovoltaic cell parameter inversion as the performance evaluation criterion, the root mean square error predicted by the CNN-Transformer hybrid prediction model is transformed into the fitness function of an adaptive genetic algorithm, including:
[0031] Construct training and validation sets that include a subset of core features, voltage time series sequences, and aging voltage predictions;
[0032] Based on the training set, the CNN-Transformer hybrid prediction model is trained through forward propagation to output the aging voltage prediction value;
[0033] Based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent.
[0034] Based on the current conservation equation of the dual-diode model, the predicted current value is obtained according to the photogenerated current, the diode forward current and the parallel resistor current.
[0035] Obtain the measured current values corresponding to the core feature subset;
[0036] Calculate the mean square error between the predicted current value and the measured current value, and use this mean square error as the loss function for training the CNN-Transformer hybrid prediction model, expressed as:
[0037] ;
[0038] In the formula, The loss function for training the CNN-Transformer hybrid prediction model. The total number of input samples in the training set. For the first The predicted current value corresponding to each input sample. For the first The measured current values corresponding to each input sample;
[0039] The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set is calculated and transformed into the fitness function of the adaptive genetic algorithm, expressed as:
[0040] ;
[0041] In the formula, For the first There are 10 candidate solutions. The root mean square error of the predicted values on the validation set of the CNN-Transformer hybrid prediction model;
[0042] The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set is expressed as:
[0043] ;
[0044] In the formula, The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set. For use of the The CNN-Transformer hybrid prediction model encodes the nth candidate solution. Voltage timing sequence corresponding to each input sample The predicted current values corresponding to the core feature subset obtained from the simulation. This is the total number of input samples.
[0045] Furthermore, with maximizing the fitness function of the adaptive genetic algorithm as the optimization objective, different candidate solutions are searched and evaluated through iterative execution of genetic operations to obtain the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution, including:
[0046] With maximizing the fitness function as the optimization objective, the probability of each candidate solution being selected in the candidate solution set is calculated based on the fitness value of the candidate solutions. A selection operation is performed to obtain a new generation of preferred candidate solution set, and the candidate solution set is updated using the new generation of preferred candidate solution set.
[0047] Based on the maximum fitness, average fitness, and the larger fitness value among the two candidate solutions to be crossed in the candidate solution set, the crossover probability is calculated. The crossover operation is performed on the new generation of preferred candidate solution set to obtain the candidate solution set after crossover. The candidate solution set is then updated using the candidate solution set after crossover.
[0048] Based on the maximum fitness, average fitness, and fitness of the candidate solutions in the cross-updated candidate solution set, the mutation probability is calculated. The mutation operation is then performed on the cross-updated candidate solution set to obtain a new generation of candidate solutions after mutation. The candidate solution set is then updated using the new generation of candidate solutions after mutation.
[0049] The updated candidate solution set is used as the initial population for the next iteration. The selection, crossover, and mutation operations are repeated until the preset iteration termination condition is met, and the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution are determined.
[0050] Furthermore, the probability of a candidate solution being selected is expressed as:
[0051] ;
[0052] In the formula, Indicates the first candidate solutions The probability of being selected. Indicates the first candidate solutions fitness value, This indicates the number of candidate solutions in the candidate set. This represents the sum of the fitness values of all candidate solutions in the candidate solution set;
[0053] The crossover probability is expressed as:
[0054] ;
[0055] In the formula, Indicates the crossover probability. This represents a constant used to adjust the crossover probability. This represents the maximum fitness of the candidate solution set. This represents the larger fitness value among the two candidate solutions to be crossed. This represents the average fitness of all candidate solutions in the candidate solution set. This represents the preset base value for the crossover probability. Indicates "if". Indicates "other situations";
[0056] The mutation probability is expressed as:
[0057] ;
[0058] In the formula, Indicates the probability of mutation. This represents a constant used to adjust the mutation probability. This represents the fitness of the current candidate solution. This represents the preset base value for the mutation probability.
[0059] Furthermore, based on the input feature importance threshold, the contribution of each input feature in the standardized monitoring data is evaluated according to the measured aging voltage value corresponding to the standardized monitoring data, resulting in a core feature subset after removing redundant information, including:
[0060] The importance score for each input feature is obtained by calculating the sum of squares of the partial derivatives of the measured aging voltage with respect to each input feature in the standardized monitoring data, and is expressed as follows:
[0061] ;
[0062] In the formula, For the first Input features Importance score For the first Measured aging voltage values corresponding to each input sample For the Input features The partial derivatives, The sign of the partial derivative. The sum of the input samples;
[0063] By normalizing the importance scores of all input features, the percentage of the importance score of each input feature relative to the sum of the importance scores of all input features is calculated, resulting in a normalized sequence of feature importance weights.
[0064] Based on the feature importance weight sequence, the input features are sorted in descending order from high to low feature importance weight;
[0065] Traverse the input features in descending order, retain the input features whose importance weight is higher than the input feature importance threshold, and obtain the core feature subset after removing redundant information;
[0066] The input features in the core feature subset are represented as follows:
[0067] ;
[0068] In the formula, The first in the core feature subset Each input feature The input feature importance threshold has a value range of [0.1, 0.3].
[0069] Furthermore, the network structure of the CNN-Transformer hybrid prediction model includes:
[0070] The input layer is used to receive the core feature subset and the voltage time series sequence, and perform standardization processing;
[0071] The CNN feature extraction layer is used to perform one-dimensional convolution, ReLU nonlinear activation and max pooling downsampling operations on the standardized core feature subset and voltage time series in sequence to capture local feature dependencies and discriminative short-term time series patterns to output local feature maps.
[0072] The Transformer encoding layer is used to perform linear transformation on the local feature map and calculate the global association weights of the sequence elements in the local feature map through a multi-head self-attention mechanism. Then, the feedforward network enhances the non-linear expression of the sequence elements in the local feature map, captures the long-term dependencies in the sequence elements in the local feature map, and obtains deep features that fuse the spatiotemporal context.
[0073] Fully connected layers are used to perform linear mapping and dimensionality compression on deep features of fused spatiotemporal context, transforming high-dimensional deep features into low-dimensional feature vectors that match the aging voltage prediction values.
[0074] The output layer is used to map the low-dimensional feature vector that matches the aging voltage prediction value and output the aging voltage prediction value.
[0075] Furthermore, based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent, including:
[0076] The thermal voltage is calculated using the thermal voltage formula based on the temperature of the photovoltaic cell.
[0077] Calculate the voltage across the diode based on the predicted aging voltage, output current, and series resistance.
[0078] Substitute the thermal voltage and the voltage across the diode into the formula for calculating the photocurrent to obtain the photocurrent.
[0079] The thermal voltage is expressed as:
[0080] ;
[0081] In the formula, Thermoelectric voltage, Boltzmann's constant, For the temperature of photovoltaic cells, It represents the electron charge.
[0082] The voltage across the diode is expressed as:
[0083] ;
[0084] In the formula, The voltage across the diode is This is the predicted aging voltage value. For output current, It is a series resistor;
[0085] The formula for calculating the photocurrent is as follows:
[0086] ;
[0087] In the formula, For photocurrent, To integrate deep features of spatiotemporal context, , These are the weight matrix and bias term used to predict photocurrent, respectively.
[0088] Furthermore, based on the current conservation equation of the dual-diode model, the photovoltaic cell parameters are solved by simultaneously solving the equations for the photogenerated current, the diode forward current, and the parallel resistor current, with the optimization objective of minimizing the error between the predicted and measured output current values. This includes:
[0089] By combining the photocurrent, the diode forward current, and the parallel resistor current, a conservation equation for the output current can be established.
[0090] Based on the conservation relationship of output current, with the optimization objective of minimizing the error between the predicted and measured values of output current, the parameters of the photovoltaic cell are inverted, including the photogenerated current.
[0091] The conservation equation for the output current is expressed as:
[0092] ;
[0093] In the formula, For output current, , These are the forward currents of diodes d1 and d2, respectively. This represents the current in the parallel resistor branch.
[0094] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0095] 1. This invention evaluates the contribution of each input feature in the standardized monitoring data based on the measured aging voltage value corresponding to the standardized monitoring data, according to the input feature importance threshold. This yields a core feature subset after removing redundant information, reducing the input dimension of the CNN-Transformer hybrid prediction model, reducing computational overhead, and avoiding overfitting. It can solve the problems of insufficient recognition accuracy caused by existing technologies being prone to getting trapped in local optima and being sensitive to initial parameters.
[0096] 2. This invention uses the recognition accuracy of photovoltaic cell parameter inversion as the performance evaluation criterion, and transforms the root mean square error predicted by the CNN-Transformer hybrid prediction model into the fitness function of an adaptive genetic algorithm. With maximizing the fitness function of the adaptive genetic algorithm as the optimization objective, it iteratively executes genetic operations to search and evaluate different candidate solutions, obtaining the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution. The hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution are then determined as the hyperparameters of the CNN-Transformer hybrid prediction model and the input feature importance threshold, automatically matching the optimal feature selection threshold and avoiding the loss of core features or the retention of redundant features caused by manually setting thresholds.
[0097] 3. This invention constructs a training set and a validation set containing a core feature subset, voltage time series, and aging voltage prediction values. It calculates the root mean square error of the prediction values of the CNN-Transformer hybrid prediction model on the validation set and transforms it into the fitness function of an adaptive genetic algorithm. With maximizing the fitness function as the optimization objective, it iteratively optimizes the candidate solution set through selection, crossover, and mutation genetic operations to determine the hyperparameters and core feature subset of the CNN-Transformer hybrid prediction model. The optimal candidate solution set is output as the optimal photovoltaic cell parameters. This invention can simultaneously complete the joint optimization of model structure matching and feature selection, improving the recognition accuracy and generalization ability of photovoltaic cell parameter inversion. Attached Figure Description
[0098] Figure 1 This is a flowchart illustrating a photovoltaic cell parameter identification method provided in an embodiment of the present invention;
[0099] Figure 2 This is a schematic diagram of the network structure of the CNN-Transformer hybrid prediction model provided in an embodiment of the present invention. Detailed Implementation
[0100] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0101] Example 1
[0102] like Figure 1 This embodiment describes a method for identifying photovoltaic cell parameters, including:
[0103] Step 1: Obtain the raw monitoring data of the photovoltaic cells, including voltage time series and current time series.
[0104] This embodiment acquires the original monitoring data of photovoltaic cells, including voltage and current time series, which can simultaneously retain the time series information of dynamic voltage and current in the parameter identification process, avoiding the loss of aging characteristics caused by single-series data.
[0105] Step 2: Preprocess the raw monitoring data to obtain standardized monitoring data.
[0106] This embodiment preprocesses the original monitoring data to obtain standardized monitoring data, which can eliminate the interference of different dimensions and amplitude differences on the contribution assessment and ensure that the standardized monitoring data has a uniform numerical scale when judging the importance threshold of input features.
[0107] Step 3: Based on the importance threshold of the input features, evaluate the contribution of each input feature in the standardized monitoring data according to the measured aging voltage value corresponding to the standardized monitoring data, and obtain the core feature subset after removing redundant information.
[0108] This embodiment evaluates the contribution of each input feature in the standardized monitoring data based on the input feature importance threshold and the measured aging voltage value corresponding to the standardized monitoring data. It obtains a core feature subset after removing redundant information, which can compress the input feature dimension without losing aging-related information, reduce the computational burden of the CNN-Transformer hybrid prediction model and suppress overfitting.
[0109] Step 4: Input the core feature subset and voltage time series into the CNN-Transformer hybrid prediction model for feature fusion and mapping, and output the aging voltage prediction value.
[0110] This embodiment inputs the core feature subset and voltage time series into the CNN-Transformer hybrid prediction model for feature fusion and mapping, and outputs the aging voltage prediction value. It can use CNN to extract local time series patterns and use Transformer to capture long-range dependencies, so that the aging voltage prediction value takes into account both instantaneous fluctuations and long-term degradation trends.
[0111] Step 5: Based on the predicted aging voltage and the photovoltaic cell temperature, derive the thermal voltage and diode terminal voltage in sequence to solve for the photocurrent.
[0112] In this embodiment, the thermal voltage and diode terminal voltage are derived sequentially based on the predicted aging voltage and the photovoltaic cell temperature to solve for the photocurrent. This can convert the predicted aging voltage into a physically interpretable intermediate electrical quantity, and correlate the solution process of the photocurrent with the actual operating temperature of the cell and the conduction state of the diode.
[0113] Step 6: Based on the current conservation equation of the dual-diode model, solve the photovoltaic cell parameters by simultaneously solving the photogenerated current, diode forward current, and parallel resistor current, with the optimization objective of minimizing the error between the predicted output current and the measured current.
[0114] This embodiment uses the current conservation equation based on the dual-diode model, combining the photogenerated current, diode forward current, and parallel resistor current. The photovoltaic cell parameters are solved by inversion with the optimization objective of minimizing the error between the predicted output current and the measured current. This method can backpropagate the current error to each physical parameter, so that the photovoltaic cell parameters solved by inversion simultaneously satisfy the time-series voltage constraint and the current conservation constraint, thereby improving the internal and external consistency of the parameter identification results.
[0115] Example 2
[0116] Based on the same inventive concept as Embodiment 1, this embodiment describes the implementation steps of a photovoltaic cell parameter identification method, including:
[0117] Step 1: Obtain the raw monitoring data of the photovoltaic cells.
[0118] In this embodiment, the raw monitoring data of the photovoltaic cell includes a voltage time series and a current time series.
[0119] Step 2: Preprocess the raw monitoring data to obtain standardized monitoring data.
[0120] Step 2.1: Median filtering is used to perform nonlinear denoising on the impulse noise and random interference in the original monitoring data to obtain the nonlinearly denoised original monitoring data. The nonlinearly denoised original monitoring data is then locally sorted using a sliding window, and the center point value is replaced with the median value in the sliding window to obtain the preliminary denoised monitoring data.
[0121] In this embodiment, the monitoring data after preliminary denoising includes the voltage and current after preliminary denoising, which are expressed as follows:
[0122] ;
[0123] ;
[0124] In the formula, , They are respectively The voltage and current after initial noise reduction at any given moment. It is a median function. The half-width of the median filtering sliding window ranges from [2,4], and the total width of the sliding window is... , Sampling time, The sampling interval time, and They represent Before the moment Raw voltage and raw current monitoring data at each sampling interval. and Then it means After a moment Raw voltage and raw current monitoring data at each sampling interval.
[0125] Step 2.2: Design a sliding window with a preset length and overlap rate to truncate and rearrange the monitoring data after preliminary denoising to obtain reconstructed data.
[0126] Step 2.3: Based on The statistical distribution criteria are used to detect outliers and correct extreme values in the reconstructed data to obtain standardized monitoring data.
[0127] In this embodiment, the input samples in the standardized monitoring data are represented as follows:
[0128] ;
[0129] In the formula, The first in the standardized monitoring data One input sample, For the first The voltage after preprocessing at the start time of each input sample. For the first The preprocessed voltage at the termination time of each input sample For the first The current after preprocessing at the termination time of each input sample. The value is the length of the sliding window, ranging from [10, 30]. For the first The sampling time of each input sample.
[0130] Step 3: Based on the input feature importance threshold, evaluate the contribution of each input feature in the standardized monitoring data according to the measured aging voltage value corresponding to the standardized monitoring data, and obtain the core feature subset after removing redundant information.
[0131] Step 3.1: Determine the input feature importance threshold and the hyperparameters of the CNN-Transformer hybrid model.
[0132] In this embodiment, the input feature importance threshold and the hyperparameters of the CNN-Transformer hybrid model are obtained through an adaptive genetic algorithm. The acquisition method includes:
[0133] Step 3.1.1: Preset the gene encoding of each candidate solution, wherein the gene encoding of each candidate solution simultaneously includes the hyperparameters of the CNN-Transformer hybrid prediction model and the candidate threshold.
[0134] Step 3.1.2: Filter the input features according to the candidate threshold corresponding to each candidate solution to obtain the corresponding feature subset.
[0135] Step 3.1.3: Using the feature subset and the remaining hyperparameters of the same candidate solution, train the CNN-Transformer hybrid prediction model and calculate the prediction fitness on the validation set.
[0136] Step 3.1.4: Use the recognition accuracy of photovoltaic cell parameter inversion as the basis for performance evaluation, and transform the root mean square error predicted by the CNN-Transformer hybrid prediction model into the fitness function of the adaptive genetic algorithm.
[0137] Step 3.1.4.1: Construct a training set and a validation set containing a subset of core features, a voltage time series sequence, and aging voltage prediction values.
[0138] Step 3.1.4.2: Based on the training set, train the CNN-Transformer hybrid prediction model through forward propagation and output the aging voltage prediction value.
[0139] Step 3.1.4.3: Based on the predicted aging voltage and the photovoltaic cell temperature, derive the thermal voltage and diode terminal voltage to solve for the photocurrent.
[0140] Step 3.1.4.4: Based on the current conservation equation of the dual-diode model, the predicted current value is obtained according to the photogenerated current, the diode forward current and the parallel resistor current.
[0141] Step 3.1.4.5: Obtain the measured current values corresponding to the core feature subset.
[0142] Step 3.1.4.6: Calculate the mean square error between the predicted current value and the measured current value, and use the mean square error between the predicted current value and the measured current value as the loss function for training the CNN-Transformer hybrid prediction model, expressed as:
[0143] ;
[0144] In the formula, The loss function for training the CNN-Transformer hybrid prediction model. The total number of input samples in the training set. For the first The predicted current value corresponding to each input sample. For the first The measured current value corresponding to each input sample.
[0145] Step 3.1.4.7: Calculate the root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set, and convert it into the fitness function of the adaptive genetic algorithm, expressed as:
[0146] ;
[0147] In the formula, For the first There are 10 candidate solutions. The root mean square error of the predictions on the validation set for the CNN-Transformer hybrid prediction model.
[0148] In this embodiment, the root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set is expressed as:
[0149] ;
[0150] In the formula, The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set. For use of the The CNN-Transformer hybrid prediction model encodes the nth candidate solution. Voltage timing sequence corresponding to each input sample The predicted current values corresponding to the core feature subset obtained from the simulation. This is the total number of input samples.
[0151] Step 3.1.5: With maximizing the fitness function of the adaptive genetic algorithm as the optimization objective, the genetic operation is performed iteratively to search and evaluate different candidate solutions, and obtain the hyperparameters and candidate thresholds corresponding to the global optimal candidate solution.
[0152] Step 3.1.5.1: With maximizing the fitness function as the optimization objective, calculate the probability of each candidate solution in the candidate solution set being selected based on the fitness value of the candidate solutions, perform the selection operation to obtain a new generation of preferred candidate solution set, and update the candidate solution set using the new generation of preferred candidate solution set.
[0153] In this embodiment, the probability of a candidate solution being selected is expressed as:
[0154] ;
[0155] In the formula, Indicates the first candidate solutions The probability of being selected. Indicates the first candidate solutions fitness value, This indicates the number of candidate solutions in the candidate set. This represents the sum of fitness values for all candidate solutions in the candidate solution set.
[0156] Step 3.1.5.2: Calculate the crossover probability based on the maximum fitness, average fitness, and the larger fitness value among the two candidate solutions to be crossed in the candidate solution set. Perform the crossover operation on the new generation of preferred candidate solution set to obtain the candidate solution set after crossover update, and update the candidate solution set using the candidate solution set after crossover update.
[0157] In this embodiment, the crossover probability is expressed as:
[0158] ;
[0159] In the formula, Indicates the crossover probability. This represents a constant used to adjust the crossover probability. This represents the maximum fitness of the candidate solution set. This represents the larger fitness value among the two candidate solutions to be crossed. This represents the average fitness of all candidate solutions in the candidate solution set. This represents the preset base value for the crossover probability. Indicates "if". Indicates "other situations".
[0160] Step 3.1.5.3: Calculate the mutation probability based on the maximum fitness, average fitness, and fitness of the individual to be mutated in the candidate solution set after cross-update. Perform mutation operation on the candidate solution set after cross-update to obtain the new generation of candidate solution set after mutation update, and update the candidate solution set with the new generation of candidate solution set after mutation update.
[0161] In this embodiment, the mutation probability is expressed as: ;
[0162] In the formula, Indicates the probability of mutation. This represents a constant used to adjust the mutation probability. This represents the fitness of the current candidate solution. This represents the preset base value for the mutation probability.
[0163] Step 3.1.5.4: Use the updated candidate solution set as the initial population for the next iteration, and repeat the selection operation, crossover operation, and mutation operation until the preset iteration termination condition is met, and determine the hyperparameters and candidate thresholds corresponding to the global optimal candidate solution.
[0164] In this embodiment, the hyperparameters corresponding to the global optimal candidate solution include the learning rate, the kernel size, and the number of attention heads, and the candidate threshold ranges from [0.1, 0.3].
[0165] Step 3.1.6: Determine the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solutions as the hyperparameters and input feature importance thresholds of the CNN-Transformer hybrid prediction model.
[0166] Step 3.2: Calculate the sum of squares of the partial derivatives of the measured aging voltage values with respect to each input feature in the standardized monitoring data to obtain the importance score of each input feature, expressed as:
[0167] ;
[0168] In the formula, For the first Input features Importance score For the first Measured aging voltage values corresponding to each input sample For the Input features The partial derivatives, The sign of the partial derivative. This is the total sum of the input samples.
[0169] Step 3.3: By normalizing the importance scores of all input features, calculate the percentage of the importance score of each input feature relative to the sum of the importance scores of all input features, and obtain the normalized feature importance weight sequence.
[0170] Step 3.4: Based on the feature importance weight sequence, sort the input features in descending order of feature importance weight from high to low.
[0171] Step 3.5: Traverse the input features in descending order, retain the input features whose importance weight is higher than the input feature importance threshold, and obtain the core feature subset after removing redundant information.
[0172] In this embodiment, the input features in the core feature subset are represented as follows:
[0173] ;
[0174] In the formula, The first in the core feature subset Each input feature The input feature importance threshold has a value range of [0.1, 0.3].
[0175] Step 4: Input the core feature subset and voltage time series into the CNN-Transformer hybrid prediction model for feature fusion and mapping, and output the aging voltage prediction value.
[0176] like Figure 2 As shown, the network structure of the CNN-Transformer hybrid prediction model includes an input layer, a CNN feature extraction layer, a Transformer encoding layer, a fully connected layer, and an output layer connected in sequence.
[0177] In this embodiment, the input layer receives the core feature subset and the voltage time series sequence and performs standardization processing; the CNN feature extraction layer sequentially performs one-dimensional convolution, ReLU nonlinear activation, and max pooling downsampling operations on the standardized core feature subset and the voltage time series sequence to capture local feature dependencies and discriminative short-term temporal patterns to output a local feature map; the Transformer encoding layer performs linear transformation on the local feature map and calculates the global association weights of sequence elements in the local feature map through a multi-head self-attention mechanism, and then enhances the nonlinear expression of sequence elements in the local feature map through a feedforward network to capture long-term dependencies in sequence elements in the local feature map, thereby obtaining deep features fused with spatiotemporal context; the fully connected layer performs linear mapping and dimensionality compression on the deep features fused with spatiotemporal context, transforming high-dimensional deep features into low-dimensional feature vectors that match the aging voltage prediction value; the output layer maps the low-dimensional feature vectors that match the aging voltage prediction value and outputs the aging voltage prediction value.
[0178] Step 5: Based on the predicted aging voltage and the photovoltaic cell temperature, derive the thermal voltage and diode terminal voltage in sequence to solve for the photocurrent.
[0179] Step 5.1: Calculate the thermal voltage using the thermal voltage formula based on the photovoltaic cell temperature.
[0180] In this embodiment, the thermal voltage is expressed as:
[0181] ;
[0182] In the formula, Thermoelectric voltage, Boltzmann's constant, For the temperature of photovoltaic cells, This represents the electron charge.
[0183] Step 5.2: Calculate the voltage across the diode based on the predicted aging voltage, output current, and series resistance.
[0184] In this embodiment, the voltage across the diode is expressed as:
[0185] ;
[0186] In the formula, The voltage across the diode is This is the predicted aging voltage value. For output current, It is a series resistor.
[0187] Step 5.3: Substitute the thermal voltage and the voltage across the diode into the calculation expression for the photocurrent to obtain the photocurrent.
[0188] In this embodiment, the calculation expression for the photocurrent is as follows:
[0189] ;
[0190] In the formula, For photocurrent, To integrate deep features of spatiotemporal context, , These are the weight matrix and bias term used to predict photocurrent, respectively.
[0191] Step 6: Based on the current conservation equation of the dual-diode model, solve the photovoltaic cell parameters by combining the photogenerated current, diode forward current, and parallel resistor current, with the optimization objective of minimizing the error between the predicted output current and the measured current.
[0192] Step 6.1: Establish the conservation equation for the output current based on the photocurrent, the diode forward current, and the parallel resistor current.
[0193] Step 6.2: Based on the conservation relationship of output current, with the optimization objective of minimizing the error between the predicted output current and the measured current, the photovoltaic cell parameters, including the photogenerated current, are inverted.
[0194] In this embodiment, the conservation equation for the output current is expressed as:
[0195] ;
[0196] In the formula, For output current, , These are the forward currents of diodes d1 and d2, respectively. This represents the current in the parallel resistor branch.
[0197] Example 3
[0198] Based on the same inventive concept as other embodiments, this embodiment describes a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the methods of Embodiment 1 or 2 described above.
[0199] Example 4
[0200] Based on the same inventive concept as other embodiments, this embodiment introduces a computer program product, including computer instructions that, when executed by a processor, implement the steps of the methods described in Embodiment 1 or 2 above.
[0201] In summary, the present invention evaluates the contribution of each input feature in the standardized monitoring data based on the measured aging voltage value corresponding to the standardized monitoring data, based on the input feature importance threshold, and obtains a core feature subset after removing redundant information. This reduces the input dimension of the CNN-Transformer hybrid prediction model, reduces computational overhead, and avoids overfitting. It can solve the problems of insufficient recognition accuracy caused by existing technologies being prone to getting trapped in local optima and being sensitive to initial parameters.
[0202] This invention uses the recognition accuracy of photovoltaic cell parameter inversion as the performance evaluation criterion, and transforms the root mean square error predicted by the CNN-Transformer hybrid prediction model into the fitness function of an adaptive genetic algorithm. With maximizing the fitness function of the adaptive genetic algorithm as the optimization objective, it iteratively executes genetic operations to search and evaluate different candidate solutions, obtaining the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution. These hyperparameters and candidate thresholds are then determined as the hyperparameters of the CNN-Transformer hybrid prediction model and the input feature importance threshold, automatically matching the optimal feature selection threshold and avoiding the loss of core features or the retention of redundant features caused by manually setting thresholds.
[0203] This invention constructs a training set and a validation set containing a core feature subset, a voltage time series sequence, and aging voltage prediction values. It calculates the root mean square error of the prediction values of the CNN-Transformer hybrid prediction model on the validation set and transforms it into the fitness function of an adaptive genetic algorithm. With maximizing the fitness function as the optimization objective, it iteratively optimizes the candidate solution set through selection, crossover, and mutation genetic operations. This determines the hyperparameters and core feature subset of the CNN-Transformer hybrid prediction model, outputting the optimal candidate solution set as the optimal photovoltaic cell parameters. This approach simultaneously achieves joint optimization of model structure matching and feature selection, improving the recognition accuracy and generalization ability of photovoltaic cell parameter inversion.
[0204] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0205] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0206] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for identifying photovoltaic cell parameters, characterized in that, include: Obtain raw monitoring data of photovoltaic cells, including voltage time series and current time series; The raw monitoring data is preprocessed to obtain standardized monitoring data; Based on the importance threshold of the input features, the contribution of each input feature in the standardized monitoring data is evaluated according to the measured aging voltage value corresponding to the standardized monitoring data, so as to obtain the core feature subset after removing redundant information; The core feature subset and voltage time series are input into the CNN-Transformer hybrid prediction model for feature fusion and mapping, and the aging voltage prediction value is output. Based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent. Based on the current conservation equation of the dual-diode model, the photovoltaic cell parameters are obtained by simultaneously solving the photogenerated current, diode forward current, and parallel resistor current, with the optimization objective of minimizing the error between the predicted output current and the measured current.
2. The photovoltaic cell parameter identification method according to claim 1, characterized in that, The raw monitoring data is preprocessed to obtain standardized monitoring data, including: Median filtering is used to perform nonlinear denoising on impulse noise and random interference in the original monitoring data to obtain nonlinearly denoised original monitoring data. Then, the nonlinearly denoised original monitoring data is locally sorted by a sliding window, and the center point value is replaced by the median value in the sliding window to obtain the preliminary denoised monitoring data. A sliding window with a preset length and overlap rate is designed to truncate and rearrange the monitoring data after preliminary denoising to obtain reconstructed data; based on The statistical distribution criteria are used to detect outliers and correct extreme values in the reconstructed data to obtain standardized monitoring data. The monitoring data after preliminary denoising includes the voltage and current after preliminary denoising, respectively expressed as: ; ; In the formula, , They are respectively The voltage and current after initial noise reduction at any given moment. It is a median function. The half-width of the median filtering sliding window ranges from [2,4], and the total width of the sliding window is... , Sampling time, The sampling interval time, and They represent Before the moment Raw voltage and raw current monitoring data at each sampling interval. and Then it means After a moment Raw voltage and raw current monitoring data at each sampling interval; The input samples in the standardized monitoring data are represented as follows: ; In the formula, The first in the standardized monitoring data One input sample, For the first The voltage after preprocessing at the start time of each input sample. For the first The preprocessed voltage at the termination time of each input sample For the first The current after preprocessing at the termination time of each input sample. The value is the length of the sliding window, ranging from [10, 30]. For the first The sampling time of each input sample.
3. The photovoltaic cell parameter identification method according to claim 1, characterized in that, The input feature importance threshold and the hyperparameters of the CNN-Transformer hybrid model are obtained through an adaptive genetic algorithm. The acquisition method includes: The gene encoding of each candidate solution is preset, and the gene encoding of each candidate solution simultaneously includes the hyperparameters of the CNN-Transformer hybrid prediction model and the candidate threshold. The input features are filtered according to the candidate threshold corresponding to each candidate solution to obtain the corresponding feature subset; Using the feature subset and the remaining hyperparameters of the same candidate solution, train a CNN-Transformer hybrid prediction model and compute prediction fitness on the validation set; The recognition accuracy of photovoltaic cell parameter inversion is used as the basis for performance evaluation, and the root mean square error predicted by the CNN-Transformer hybrid prediction model is transformed into the fitness function of the adaptive genetic algorithm. With the goal of maximizing the fitness function of the adaptive genetic algorithm, the hyperparameters and candidate thresholds corresponding to the global optimal candidate solution are obtained by iteratively executing genetic operations to search and evaluate different candidate solutions. The hyperparameters and candidate thresholds corresponding to the globally optimal candidate solutions are determined as the hyperparameters of the CNN-Transformer hybrid prediction model and the input feature importance thresholds.
4. The photovoltaic cell parameter identification method according to claim 3, characterized in that, Using the recognition accuracy of photovoltaic cell parameter inversion as the performance evaluation criterion, the root mean square error predicted by the CNN-Transformer hybrid prediction model is transformed into the fitness function of an adaptive genetic algorithm, including: Construct training and validation sets that include a subset of core features, voltage time series sequences, and aging voltage predictions; Based on the training set, the CNN-Transformer hybrid prediction model is trained through forward propagation to output the aging voltage prediction value; Based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent. Based on the current conservation equation of the dual-diode model, the predicted current value is obtained according to the photogenerated current, the diode forward current and the parallel resistor current. Obtain the measured current values corresponding to the core feature subset; Calculate the mean square error between the predicted current value and the measured current value, and use this mean square error as the loss function for training the CNN-Transformer hybrid prediction model, expressed as: ; In the formula, The loss function for training the CNN-Transformer hybrid prediction model. The total number of input samples in the training set. For the first The predicted current value corresponding to each input sample. For the first The measured current values corresponding to each input sample; The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set is calculated and transformed into the fitness function of the adaptive genetic algorithm, expressed as: ; In the formula, For the first There are 10 candidate solutions. The root mean square error of the predicted values on the validation set of the CNN-Transformer hybrid prediction model; The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set is expressed as: ; In the formula, The root mean square error of the predictions made by the CNN-Transformer hybrid prediction model on the validation set. For use of the The CNN-Transformer hybrid prediction model encodes the nth candidate solution. Voltage timing sequence corresponding to each input sample The predicted current values corresponding to the core feature subset obtained from the simulation. This is the total number of input samples.
5. The photovoltaic cell parameter identification method according to claim 4, characterized in that, With the goal of maximizing the fitness function of the adaptive genetic algorithm, the algorithm iteratively performs genetic operations to search for and evaluate different candidate solutions, obtaining the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution, including: With maximizing the fitness function as the optimization objective, the probability of each candidate solution being selected in the candidate solution set is calculated based on the fitness value of the candidate solutions. A selection operation is performed to obtain a new generation of preferred candidate solution set, and the candidate solution set is updated using the new generation of preferred candidate solution set. Based on the maximum fitness, average fitness, and the larger fitness value among the two candidate solutions to be crossed in the candidate solution set, the crossover probability is calculated. The crossover operation is performed on the new generation of preferred candidate solution set to obtain the candidate solution set after crossover. The candidate solution set is then updated using the candidate solution set after crossover. Based on the maximum fitness, average fitness, and fitness of the candidate solutions in the cross-updated candidate solution set, the mutation probability is calculated. The mutation operation is then performed on the cross-updated candidate solution set to obtain a new generation of candidate solutions after mutation. The candidate solution set is then updated using the new generation of candidate solutions after mutation. The updated candidate solution set is used as the initial population for the next iteration. The selection, crossover, and mutation operations are repeated until the preset iteration termination condition is met, and the hyperparameters and candidate thresholds corresponding to the globally optimal candidate solution are determined.
6. The photovoltaic cell parameter identification method according to claim 5, characterized in that, The probability of a candidate solution being selected is expressed as: ; In the formula, Indicates the first candidate solutions The probability of being selected. Indicates the first candidate solutions fitness value, This indicates the number of candidate solutions in the candidate set. This represents the sum of the fitness values of all candidate solutions in the candidate solution set; The crossover probability is expressed as: ; In the formula, Indicates the crossover probability. This represents a constant used to adjust the crossover probability. This represents the maximum fitness of the candidate solution set. This represents the larger fitness value among the two candidate solutions to be crossed. This represents the average fitness of all candidate solutions in the candidate solution set. This represents the preset base value for the crossover probability. Indicates "if". Indicates "other situations"; The mutation probability is expressed as: ; In the formula, Indicates the probability of mutation. This represents a constant used to adjust the mutation probability. This represents the fitness of the current candidate solution. This represents the preset base value for the mutation probability.
7. The photovoltaic cell parameter identification method according to claim 6, characterized in that, Based on the input feature importance threshold, the contribution of each input feature in the standardized monitoring data is evaluated according to the measured aging voltage value corresponding to the standardized monitoring data, resulting in a core feature subset after removing redundant information, including: The importance score for each input feature is obtained by calculating the sum of squares of the partial derivatives of the measured aging voltage with respect to each input feature in the standardized monitoring data, and is expressed as follows: ; In the formula, For the first Input features Importance score For the first Measured aging voltage values corresponding to each input sample For the Input features The partial derivatives, The sign of the partial derivative. The sum of the input samples; By normalizing the importance scores of all input features, the percentage of the importance score of each input feature relative to the sum of the importance scores of all input features is calculated, resulting in a normalized sequence of feature importance weights. Based on the feature importance weight sequence, the input features are sorted in descending order from high to low feature importance weight; Traverse the input features in descending order, retain the input features whose importance weight is higher than the input feature importance threshold, and obtain the core feature subset after removing redundant information; The input features in the core feature subset are represented as follows: ; In the formula, The first in the core feature subset Each input feature The input feature importance threshold has a value range of [0.1, 0.3].
8. The photovoltaic cell parameter identification method according to claim 1, characterized in that, The network structure of the CNN-Transformer hybrid prediction model includes: The input layer is used to receive the core feature subset and the voltage time series sequence, and perform standardization processing; The CNN feature extraction layer is used to perform one-dimensional convolution, ReLU nonlinear activation and max pooling downsampling operations on the standardized core feature subset and voltage time series in sequence to capture local feature dependencies and discriminative short-term time series patterns to output local feature maps. The Transformer encoding layer is used to perform linear transformation on the local feature map and calculate the global association weights of the sequence elements in the local feature map through a multi-head self-attention mechanism. Then, the feedforward network enhances the non-linear expression of the sequence elements in the local feature map, captures the long-term dependencies in the sequence elements in the local feature map, and obtains deep features that fuse the spatiotemporal context. Fully connected layers are used to perform linear mapping and dimensionality compression on deep features of fused spatiotemporal context, transforming high-dimensional deep features into low-dimensional feature vectors that match the aging voltage prediction values. The output layer is used to map the low-dimensional feature vector that matches the aging voltage prediction value and output the aging voltage prediction value.
9. The photovoltaic cell parameter identification method according to claim 8, characterized in that, Based on the predicted aging voltage and the photovoltaic cell temperature, the thermal voltage and diode terminal voltage are derived sequentially to solve for the photocurrent, including: The thermal voltage is calculated using the thermal voltage formula based on the temperature of the photovoltaic cell. Calculate the voltage across the diode based on the predicted aging voltage, output current, and series resistance. Substitute the thermal voltage and the voltage across the diode into the formula for calculating the photocurrent to obtain the photocurrent. The thermal voltage is expressed as: ; In the formula, Thermoelectric voltage, Boltzmann's constant, For the temperature of photovoltaic cells, It represents the electron charge. The voltage across the diode is expressed as: ; In the formula, The voltage across the diode is This is the predicted aging voltage value. For output current, It is a series resistor; The formula for calculating the photocurrent is as follows: ; In the formula, For photocurrent, To integrate deep features of spatiotemporal context, , These are the weight matrix and bias term used to predict photocurrent, respectively.
10. The photovoltaic cell parameter identification method according to claim 9, characterized in that, Based on the current conservation equation of the dual-diode model, the photovoltaic cell parameters are solved by simultaneously solving the equations for the photogenerated current, the diode forward current, and the parallel resistor current, with the optimization objective of minimizing the error between the predicted and measured output current values. The parameters include: By combining the photocurrent, the diode forward current, and the parallel resistor current, a conservation equation for the output current can be established. Based on the conservation relationship of output current, with the optimization objective of minimizing the error between the predicted and measured values of output current, the parameters of the photovoltaic cell are inverted, including the photogenerated current. The conservation equation for the output current is expressed as: ; In the formula, For output current, , These are the forward currents of diodes d1 and d2, respectively. This represents the current in the parallel resistor branch.