Photovoltaic parameter modeling method based on hybrid swarm intelligence algorithm
By combining particle group optimization and fireflies algorithm in photovoltaic parameter modeling, using Latin super -cubic design and Python technology to dynamically adjust and optimize strategies, solve the problem of insufficient search refinement and poor adaptability of photovoltaic parameter modeling in existing technology It has achieved efficient and accurate photovoltaic power forecasts.
Patent Information
- Application Number
- CN202411936181.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing hybrid group intelligent algorithms have problems such as insufficient search precision, poor adaptability and easy to fall into local optimality in photovoltaic parameter modeling, resulting in low accuracy and efficiency of photovoltaic system parameter modeling.
A photovoltaic parameter modeling method based on hybrid swarm intelligence algorithm is adopted, combined with particle swarm optimization and firefly algorithm. Through the collaborative combination of global exploration and local optimization, Latin hypercube design and Python technology are used to generate feature weight vectors, build population collections, and dynamically adjust Optimize strategies to improve model adaptability and accuracy.
It improves the accuracy and efficiency of photovoltaic power prediction, enhances the adaptability and versatility of the model, avoids local optimal traps, and achieves a balance between global search and local optimization.
Smart Images

Figure CN119358425A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic parameter modeling, and in particular to a photovoltaic parameter modeling method based on a hybrid swarm intelligent algorithm. Background Art
[0002] In the field of modern intelligent optimization algorithms, swarm intelligence algorithms, as an important meta-heuristic method, have been widely used in the optimization and modeling tasks of complex systems. Hybrid swarm intelligence algorithms combine multiple swarm intelligence optimization techniques and show significant advantages in solving multi-objective optimization, nonlinear problems and high-dimensional space exploration. In the field of photovoltaic parameter modeling based on hybrid swarm intelligence algorithms, these algorithms are used to deal with nonlinear modeling and complex prediction tasks of photovoltaic power generation systems. However, in order to improve search efficiency, the algorithm may reduce the sophistication of the search, thereby sacrificing model accuracy, which has a negative impact on the modeling accuracy of photovoltaic system parameters. The adaptability of hybrid swarm intelligence algorithms is also poor, and optimization strategies need to be redesigned for different problems and scenarios. Especially in photovoltaic parameter modeling, due to the highly nonlinear and dynamic characteristics of photovoltaic output power, the algorithm performance is often strongly constrained by the characteristics of the problem.
[0003] Regarding the application of hybrid swarm intelligence algorithms in the field of photovoltaic parameter modeling, the current research status mainly focuses on improving the balance between the algorithm's global exploration ability and local search ability. Traditional optimization algorithms (such as single particle swarm optimization or genetic algorithm) have certain limitations in photovoltaic parameter modeling. For example, they are prone to falling into local optimal solutions in high-dimensional nonlinear spaces, causing the output power prediction results to deviate from the actual value. In addition, in photovoltaic power generation systems, traditional optimization algorithms find it difficult to quickly search for a relatively global optimal solution that meets the actual situation while ensuring modeling accuracy and balancing search efficiency. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm, which solves the problems in the above-mentioned background technology.
[0005] To achieve the above objectives, the present invention is implemented by the following technical solutions: A photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm comprises the following steps:
[0006] S1. Pre-collect input parameters and target output parameters of the photovoltaic system, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, and the target output parameters include photovoltaic output power data;
[0007] S2, preprocessing the relevant environmental variables of the photovoltaic components, component characteristics and photovoltaic output power data, and generating a real-time parameter set after dimensionless processing;
[0008] S3. Based on Latin hypercube design, determine the sampling range of each feature weight, and use Python technology to generate n feature weight vectors Q, and combine each feature weight vector Q to construct a population set , according to the population set Combined with particle swarm optimization technology, a global exploration phase is conducted to obtain the real-time photovoltaic power prediction value Ggyz and fitness ;
[0009] S4, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S3 , determine whether the error of the current search is within an acceptable range. If it is within the acceptable range, enter the local optimization stage and use the firefly algorithm to update the new position of each particle ,After iterative updates, the balance state between search efficiency and accuracy is analyzed, and the output balance index Phzs is fitted in combination with the trained balance prediction model;
[0010] S5. Preset an evaluation threshold W, and compare and analyze the balance index Phzs with the evaluation threshold W to select a relatively better particle position.
[0011] Preferably, the specific steps of S1 include:
[0012] S11. Collect input parameters and target output parameters of the photovoltaic system in advance through monitoring instruments, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, wherein the relevant environmental variables of the photovoltaic components include solar radiation intensity, ambient temperature, scattered radiation ratio, direct radiation intensity, reflected radiation intensity, wind speed, wind direction, relative humidity, air pressure, solar altitude angle and solar azimuth; component characteristics include component surface temperature, panel aging coefficient Mhxs, component surface reflectivity, open circuit voltage, short circuit current, maximum power point voltage, maximum power point current, component inclination angle, component azimuth angle and component installation height;
[0013] The panel aging coefficient Mhxs is obtained by the following formula: ;
[0014] In the formula, Indicates the running time, Indicates component design life;
[0015] S12. Obtain the real-time photovoltaic output power Ssg of the photovoltaic module in real time by using the output record of the inverter.
[0016] Preferably, the specific steps of S2 include:
[0017] S21. Perform data cleaning and time alignment on the collected relevant environmental variables, component characteristics and photovoltaic output power data, wherein data cleaning includes checking and processing abnormal values and missing values in the collected data, using upper and lower bound constraints to eliminate abnormal data, and filling missing data through the nearest neighbor algorithm;
[0018] S22. Scale the data preprocessed in S21 using dimensionless processing technology so that the data falls between 0 and 1, and generate a real-time parameter set after aggregation.
[0019] Preferably, the specific steps of S3 include:
[0020] S31, according to the parameter set obtained in the historical period, and combined with the trained balance prediction model, determine several groups of historical photovoltaic power prediction values in the historical period , several groups of historical photovoltaic power forecast values within the historical period Obtained by the following formula: ;
[0021] Where n represents the total number of features, i=1, 2, ..., n, represents the numerical value of the i-th feature, represents the weight of the i-th feature.
[0022] Preferably, the specific step S3 also includes:
[0023] S32. According to step S31, the sampling range of each feature weight is preliminarily determined. The sampling range is determined by: , extract the maximum and minimum values of the weight corresponding to each feature, and use the maximum and minimum values of the weight corresponding to each feature as the upper and lower limits of each feature weight, recorded as the feature weight sampling range ;
[0024] S33, based on Latin hypercube design, the sampling range of each feature weight is Divide into N uniform sub-regions and obtain the sampling range of each feature weight The range of each sub-region within the region is determined, and a sampling point is randomly selected in each sub-region to determine the value at the sampling point. The corresponding feature weight vector Q is constructed for the weight corresponding to each feature, where the feature weight vector Q is expressed as: Represents the value at the Nth sampling point of the i-th feature;
[0025] S34, shuffle the N groups of feature values in each feature weight vector Q to randomly arrange the N groups of feature values, and obtain a combined weight vector R according to each randomly arranged feature weight vector Q, wherein each combined weight vector R corresponds to a particle, and construct a population set , where the population set The expression is: Indicates The weight vector after the combination.
[0026] Preferably, the specific step S3 also includes:
[0027] S35, based on several groups of historical photovoltaic power forecast values in the historical period in S31 The acquisition method is combined with the real-time parameter set in S22 to calculate the real-time photovoltaic power prediction value Ggyz, and based on the real-time photovoltaic power prediction value Ggyz and the real-time photovoltaic output power Ssg of the photovoltaic components in the real-time parameter set, the prediction error degree is analyzed, and the fitness under different particle conditions is calculated. , which is obtained by the following formula: ;
[0028] Where G represents the monitoring period, g=1, 2, ..., G, represents the real-time photovoltaic output power during the g-th monitoring period, Represents the real-time photovoltaic power forecast value in the g-th monitoring period.
[0029] Preferably, the specific steps of S4 include:
[0030] S41, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S35 , and combined with the population set in S34 , analyze the population set The statistical distribution characteristics of the fitness values of each particle in the , the fitness standard deviation Obtained by the following formula: ;
[0031] Where M represents the total number of combinations, j = 1, 2, ..., M, represents the fitness after the jth combination, represents the average fitness.
[0032] Preferably, the specific step S4 also includes:
[0033] S42, according to the fitness standard deviation , by taking the fitness standard deviation Compare with the preset threshold to determine whether the error of the current search is within an acceptable range. If the fitness standard deviation When the preset threshold is exceeded, it is determined that the error of the current search is not within the acceptable range, and steps S3, S41 and S42 are repeated until the fitness standard deviation is reached. If the preset threshold is not exceeded, the repetitive operation is stopped; if the fitness standard deviation When the preset threshold is not exceeded, the error of the current search is judged to be within an acceptable range and the local optimization stage is entered.
[0034] Preferably, the specific step S4 also includes:
[0035] S43, after entering the local optimization stage, the standard deviation of the fitness that can enter the local optimization stage The corresponding population set Determine and group the population The position of each combined weight vector R is updated by using the firefly algorithm to update the new position of each combined weight vector R, and the position of each particle in each combined weight vector R is marked as the current particle position , mark the new position of the weight vector R after updating each combination as the updated particle position , the updated particle position The specific formula is as follows: ;
[0036] In the formula, and They represent the current particle position under the jth combination condition and the current particle position under the kth combination condition, respectively. represents the distance between the current particle position under the jth combination condition and the current particle position under the kth combination condition, represents the attraction strength; e is the Euler number;
[0037] S44, according to the updated particle position obtained in S43 , count the time Zsj executed in the optimization process, and update the particle position Substitute to get fitness To obtain the updated fitness , based on the updated fitness The time Zsj executed in the optimization process is used to analyze the balance between search efficiency and accuracy, and the output balance index Phzs is fitted and output after the trained balance prediction model and dimensionless processing. The balance index Phzs is obtained by the following formula: ;
[0038] In the formula, Indicates the improvement in fitness; Indicates the minimum error set, Indicates the execution time of the optimization process. Indicates the preset maximum allowed optimization time. and are weight values, where 0 < <1,0< <1, and The specific value is set by the user according to the situation.
[0039] Preferably, the specific steps of S5 include:
[0040] S51. By comparing and analyzing the balance index Phzs with the evaluation threshold W, a relatively better particle position is selected. The specific contents are as follows:
[0041] If the balance index Phzs falls within the evaluation threshold W, the updated fitness The corresponding updated particle position as a relatively optimal particle position;
[0042] If the balance index Phzs does not fall within the evaluation threshold W, the updated fitness The corresponding updated particle position Not considered as a relatively optimal particle position.
[0043] The present invention provides a photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm, which has the following beneficial effects:
[0044] (1) Combination of global search and local optimization: Through the global search capability of particle swarm optimization technology and the local optimization capability of firefly algorithm, the algorithm can explore relatively optimal solutions in complex nonlinear photovoltaic parameter space and avoid falling into local optimality. The Latin hypercube design is used to determine the sampling range of feature weights and generate n feature weight vectors, which effectively covers the parameter space, improves the quality and diversity of population initialization, and enhances the global exploration capability of the algorithm. Through dynamic judgment of real-time photovoltaic power prediction value and fitness, it quickly evaluates whether the error range of the current model is acceptable, thereby reducing unnecessary iterative calculation time. Adaptive optimization mechanism: In the local optimization stage, the firefly algorithm is used to dynamically update the particle position, combined with the balance index fitted by the balance prediction model, to achieve a coordinated improvement in optimization accuracy and search efficiency, and ensure the stability and convergence speed of the algorithm during the optimization process. By comparing and analyzing the balance index with the evaluation threshold, the relatively optimal particle position is selected, providing efficient and reliable decision support for photovoltaic power prediction and system optimization. Efficient application of Python technology: In the optimization process, Python technology is used to automatically generate feature weight vectors and construct population sets, which simplifies the algorithm implementation process and improves development efficiency. The present invention not only improves the accuracy and efficiency of photovoltaic power prediction, but also enhances the adaptability and versatility of the model through the synergistic combination of global search and local optimization, real-time data processing and dimensionless, dynamic adjustment of the equilibrium prediction model and other technical means. It overcomes the problems of traditional algorithms that are prone to fall into local optimality, low search efficiency and insufficient adaptability, and provides an efficient, accurate and intelligent solution for photovoltaic parameter modeling.
[0045] (2) The Latin hypercube design is used to divide the sampling range of each feature weight into N uniform sub-regions, and a sampling point is randomly selected in each sub-region to generate a feature weight vector Q, which effectively covers the entire parameter space. This method avoids the problem of insufficient or repeated parameter space coverage that may be caused by random sampling, ensures the uniformity and diversity of feature weight sampling, and enhances the global exploration ability of the algorithm. By shuffling N groups of feature values, the order of the original sampling values is disrupted, the combined weight vector is generated, and the population set is constructed. The diverse initial solutions provide a wide search space for the particle swarm optimization algorithm, which helps to jump out of the local optimum and improve the global search efficiency. By scientifically setting the weight sampling range and generating the initial solution using the Latin hypercube design, random trials of feature weights in the early stage of model training are avoided, greatly reducing the complexity of model construction.
[0046] (3) By combining the acquisition method of historical photovoltaic power prediction values and the real-time parameter set, the photovoltaic power prediction value is calculated in real time, and the error analysis is performed with the actual photovoltaic output power. The prediction error is measured by the fitness value. Through the calculation of real-time fitness and the error evaluation of different particle conditions, particles with higher prediction accuracy are screened out, which significantly improves the prediction reliability and accuracy of the model. Combining the fitness values of particles in the population set with the real-time power prediction value not only dynamically optimizes the weight distribution of particles, but also provides high-precision initial conditions for subsequent global search and local optimization. By analyzing the fitness statistical distribution characteristics of particles in the population set and calculating the fitness standard deviation, the fitness standard deviation provides an intuitive quantitative indicator of the real-time population quality for the optimization algorithm, helps identify the current search stage, and reasonably allocates the proportion of global and local searches. When the fitness standard deviation exceeds the preset threshold, it means that the fitness values of the population particles are quite different and the optimization algorithm is in the global exploration stage. At this time, re-execute steps S3 (global exploration), S41 (fitness distribution analysis) and S42 (error evaluation) to ensure that the search does not converge prematurely. When the fitness standard deviation does not exceed the preset threshold, it means that the fitness values of the particles in the population tend to be consistent, the population gradually converges and approaches the optimal solution, and enters the local optimization stage, which improves the efficiency of the search process and avoids unnecessary global search.
[0047] (4) Dynamic screening based on the balance index. The balance index quantifies the balance performance of particles between efficiency and accuracy by comprehensively evaluating the fitness improvement and time consumption during the optimization process. When it falls within the evaluation threshold, it indicates that the current particle position has a better optimization effect, can balance the search efficiency and prediction accuracy, and the screened particle position is more reliable. By eliminating particle positions that do not fall within the evaluation threshold, the interference of unstable particle solutions in the optimization process is reduced, making the relatively better particle positions screened closer to the global optimal solution. The ultimately selected better particle positions provide high-precision parameter configuration for the photovoltaic power prediction model, ensuring that the prediction results are more accurate and stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 The present invention is a schematic flow chart of a photovoltaic parameter modeling method based on a hybrid swarm intelligent algorithm. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Example 1
[0051] See also Figure 1 The present invention provides a photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm, comprising the following steps:
[0052] S1. Pre-collect input parameters and target output parameters of the photovoltaic system, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, and the target output parameters include photovoltaic output power data;
[0053] S2, preprocessing the relevant environmental variables of the photovoltaic components, component characteristics and photovoltaic output power data, and generating a real-time parameter set after dimensionless processing;
[0054] S3. Based on Latin hypercube design, determine the sampling range of each feature weight, and use Python technology to generate n feature weight vectors Q, and combine each feature weight vector Q to construct a population set , according to the population set Combined with particle swarm optimization technology, a global exploration phase is conducted to obtain the real-time photovoltaic power prediction value Ggyz and fitness ;
[0055] S4, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S3 , determine whether the error of the current search is within an acceptable range. If it is within the acceptable range, enter the local optimization stage and use the firefly algorithm to update the new position of each particle ,After iterative updates, the balance state between search efficiency and accuracy is analyzed, and the output balance index Phzs is fitted in combination with the trained balance prediction model;
[0056] S5. Preset an evaluation threshold W, and compare and analyze the balance index Phzs with the evaluation threshold W to select a relatively better particle position.
[0057] In this embodiment, through steps S1 and S2, the present invention first comprehensively collects and dimensionlessly processes the input parameters (including environmental variables and component characteristics) and target output parameters (photovoltaic output power data) of the photovoltaic system. By generating a real-time parameter set, the consistency of the data and the standardization of the model input are improved, and the modeling error caused by dimensional differences is effectively reduced. In step S3, a population initialization method based on Latin hypercube design is used to ensure that the sampling range of the feature weights is fully covered. At the same time, multiple feature weight vectors are generated using Python technology, and the population set is combined to construct a population set. This method combines particle swarm optimization technology to give full play to the global search capability, effectively avoiding the problem of uneven initial population distribution or insufficient search range, thereby improving the efficiency of the global exploration stage of the model, and quickly obtaining the real-time photovoltaic power prediction value and fitness. In step S4, the firefly algorithm is used to update the particle position after entering the local optimization stage through the evaluation of the real-time photovoltaic power prediction value and fitness. The present invention further enhances the fineness of local search through the attraction mechanism of the firefly algorithm, and effectively solves the problem of global and local balance. In addition, combined with the trained balance prediction model, the balance index is fitted and output, which provides a reference for the performance evaluation and optimization direction of the model. In step S5, by comparing and analyzing the preset evaluation threshold with the balance index, the particle position with relatively good optimization performance can be accurately screened out. This process significantly improves the quality of the model optimization results and reduces the performance deviation problem caused by local optimality. The present invention effectively addresses the following difficulties in photovoltaic parameter modeling through the design of a hybrid swarm intelligent algorithm: the problem of being easily trapped in local optimality: combining the global exploration capability of the particle swarm optimization technology and the local search capability of the firefly algorithm, further avoiding the optimization process from falling into local optimality too early, the trade-off between search efficiency and accuracy: by quickly screening the better solution in the global exploration stage and enhancing the fine optimization of the solution in the local optimization stage, the search efficiency and accuracy are effectively balanced.
[0058] Example 2
[0059] Please refer to Figure 1 , specifically: S1 specific steps include:
[0060] S11. Collect input parameters and target output parameters of the photovoltaic system in advance through monitoring instruments, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, wherein the relevant environmental variables of the photovoltaic components include solar radiation intensity, ambient temperature, scattered radiation ratio, direct radiation intensity, reflected radiation intensity, wind speed, wind direction, relative humidity, air pressure, solar altitude angle and solar azimuth; component characteristics include component surface temperature, panel aging coefficient Mhxs, component surface reflectivity, open circuit voltage, short circuit current, maximum power point voltage, maximum power point current, component inclination angle, component azimuth angle and component installation height;
[0061] The panel aging coefficient Mhxs is obtained by the following formula: ;
[0062] In the formula, Indicates the running time, Indicates component design life;
[0063] S12. Obtain the real-time photovoltaic output power Ssg of the photovoltaic module in real time by using the output record of the inverter.
[0064] The specific steps of S2 include:
[0065] S21. Perform data cleaning and time alignment on the collected data of relevant environmental variables, component characteristics and photovoltaic output power generation to ensure data quality and consistency. Data cleaning includes checking and processing outliers and missing values in the collected data, using upper and lower bound constraints to eliminate outliers (such as radiation intensity exceeding physical limits), and filling missing data through the nearest neighbor algorithm;
[0066] S22. Scale the data preprocessed in S21 using dimensionless processing technology so that the data falls between 0 and 1, and generate a real-time parameter set after aggregation.
[0067] In this embodiment, comprehensive photovoltaic system input parameters, including environmental variables and component characteristics, are collected through monitoring instruments, and the comprehensive impact of the operating environment and equipment characteristics of the photovoltaic system on the output power is fully considered. The real-time output power of the photovoltaic components is recorded using an inverter to ensure the real-time and accuracy of the output parameters. A panel aging coefficient calculation formula based on the component operating time and design life is provided, which intuitively reflects the degree of component aging, can dynamically update component status information, and ensure the practicality and timeliness of parameter modeling. Through the comprehensive collection of environmental variables, component characteristics and real-time output power, a high-quality input data set is generated, laying a solid data foundation for the subsequent modeling process. In the data preprocessing step S21, through the upper and lower bound constraints and the nearest neighbor algorithm, outliers (such as radiation intensity exceeding physical limits) are eliminated and missing values are filled to ensure data integrity. The data time alignment operation keeps the timestamps of different data sources consistent, ensuring that each set of input data corresponds to the output power data one by one, and avoiding modeling errors caused by data misalignment. Through dimensionless processing technology, data of different dimensions are uniformly scaled to the range of [0,1], eliminating the interference of dimensional differences on model building and improving the comparability of parameters and the efficiency of model training.
[0068] Example 3
[0069] Please refer to Figure 1 , specifically: S3 specific steps include:
[0070] S31, according to the parameter set obtained in the historical period, and combined with the trained balance prediction model, determine several groups of historical photovoltaic power prediction values in the historical period , several groups of historical photovoltaic power forecast values within the historical period Obtained by the following formula: ;
[0071] Where n represents the total number of features, i=1, 2, ..., n, represents the numerical value of the i-th feature, represents the weight of the i-th feature, wherein the total number of features n is the number of features that affect the photovoltaic output power, and the panel aging coefficient Mhxs in the above S11 is a feature that affects the photovoltaic output power.
[0072] The specific steps of S3 also include:
[0073] S32. According to step S31, the sampling range of each feature weight is preliminarily determined. The sampling range is determined by: , extract the maximum and minimum values of the weight corresponding to each feature, and use the maximum and minimum values of the weight corresponding to each feature as the upper and lower limits of each feature weight, recorded as the feature weight sampling range ;
[0074] S33, based on Latin hypercube design, the sampling range of each feature weight is Divide into N uniform sub-regions and obtain the sampling range of each feature weight The range of each sub-region within the region is determined, and a sampling point is randomly selected in each sub-region to determine the value at the sampling point. The corresponding feature weight vector Q is constructed for the weight corresponding to each feature, where the feature weight vector Q is expressed as: Represents the value at the Nth sampling point of the i-th feature;
[0075] S34, shuffle the N groups of feature values in each feature weight vector Q to randomly arrange the N groups of feature values so that each integer is shuffled to a random position, and obtain a combined weight vector R according to each randomly arranged feature weight vector Q, wherein each combined weight vector R corresponds to a particle, and construct a population set , where the population set The expression is: Indicates The combined weight vector R refers to the weights corresponding to the various features involved in each calculation of the photovoltaic power prediction value.
[0076] The purpose of shuffling is to disrupt the order of the original sampled values, thereby avoiding the systematic bias caused by the fixed order. Generate diversity: In the process of combining parameter vectors, random permutations are used to ensure that the values of each parameter are combined into a diverse initial solution. Avoid correlation: If the order of the parameter sampling values is the same, the combined parameter vectors will be correlated, and random permutations break this correlation.
[0077] In this embodiment, the maximum and minimum values of each feature weight are extracted from historical data as upper and lower limits, avoiding the irrationality of weight range setting, making the feature weight sampling range closer to the actual scene, ensuring the scientificity and robustness of model parameter optimization, and this method of determining feature weights based on historical data improves the reliability and adaptability of the photovoltaic power prediction model, making the prediction results more in line with the actual situation. The feature weight sampling range is divided into N uniform sub-regions, and sampling points are randomly selected in each sub-region, avoiding the problem of concentrated sampling in the parameter space and improving the uniformity and diversity of population initialization. The generation of feature weight vectors covers the entire sampling range, providing a high-quality initial solution for global search and reducing the local stagnation problem of the optimization algorithm in the early stage of search. The sampling values of each feature weight vector are randomly arranged, breaking the fixedness of the original sampling order and eliminating the systematic deviation between feature weights. The combined weight vector is generated by random arrangement to ensure that each particle has independence and diversity in the initial population, avoiding the problem of early convergence of the population. Through Latin hypercube design and random arrangement technology, the generated population set improves the search efficiency of the model in the parameter space and enhances the global search capability. Each particle weight vector in the initial population set is a diversified combination of random permutations, which ensures the global distribution of the population in the parameter space and expands the search range. Random permutations break the correlation of the original parameter sampling values, reduce the potential correlation between parameters, and avoid the problem of a single model convergence direction caused by a fixed order. Different weight vectors provide multiple optimization paths in the global search stage, providing a variety of optimization solutions for the subsequent calculation of photovoltaic power prediction values, and improving the algorithm's ability to jump out of the local optimum.
[0078] Example 4
[0079] Please refer to Figure 1 , specifically: S3 specific steps also include:
[0080] S35, based on several groups of historical photovoltaic power forecast values in the historical period in S31 The acquisition method is combined with the real-time parameter set in S22 to calculate the real-time photovoltaic power prediction value Ggyz, and based on the real-time photovoltaic power prediction value Ggyz and the real-time photovoltaic output power Ssg of the photovoltaic components in the real-time parameter set, the prediction error degree is analyzed, and the fitness under different particle conditions is calculated. , which is obtained by the following formula: ;
[0081] Where G represents the monitoring period, g=1, 2, ..., G, represents the real-time photovoltaic output power during the g-th monitoring period, Represents the real-time photovoltaic power prediction value in the gth monitoring period. The smaller the fitness value, the lower the model error and the better the solution.
[0082] The specific steps of S4 include:
[0083] S41, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S35 , and combined with the population set in S34 , analyze the population set The statistical distribution characteristics of the fitness values of each particle in the population, that is, the degree of dispersion of the particle mass in the current population, are used to obtain the fitness standard deviation , the fitness standard deviation Obtained by the following formula: ;
[0084] Where M represents the total number of combinations, j = 1, 2, ..., M, represents the fitness after the jth combination, represents the average fitness.
[0085] The specific steps of S4 also include:
[0086] S42, according to the fitness standard deviation , by taking the fitness standard deviation Compare with the preset threshold to determine whether the error of the current search is within an acceptable range. If the fitness standard deviation When the preset threshold is exceeded, it means that the population set The fitness values of the particles in the equation are quite different, indicating that the population diversity is high and the optimization algorithm may still be in the global search stage. At this time, it will be judged that the error of the current search is not within the acceptable range, and steps S3, S41 and S42 will be repeated until the fitness standard deviation is reached. If the preset threshold is not exceeded, the repetitive operation is stopped; if the fitness standard deviation When the preset threshold is not exceeded, it means that the population set The fitness values of the particles in the algorithm tend to be consistent, indicating that the population is gradually converging and may be close to the optimal solution. At this time, it is judged that the error of the current search is within an acceptable range and enters the local optimization stage.
[0087] In this embodiment, the photovoltaic power prediction value in the historical period is combined with the real-time parameter set to realize the dynamic update of the real-time photovoltaic power prediction value, so that the model can generate accurate prediction results under the real-time changing environment and component conditions of the photovoltaic system. Based on the real-time photovoltaic power prediction value and the actual output power of the photovoltaic component, the prediction error under different particle conditions is accurately analyzed, and the fitness value is calculated and obtained. Through the calculation and analysis of the fitness value, a scientific basis is provided for the evaluation of the quality of the particles, thereby improving the accuracy of photovoltaic power prediction. Combined with the fitness value of each particle in the population set, the standard deviation of the population fitness is calculated, and the dynamic analysis of the distribution characteristics of the population fitness provides a quantitative basis for the switching of the optimization algorithm in the global exploration stage and the local search stage. By comparing the fitness standard deviation with the preset threshold, it is dynamically determined whether the error of the current search is within an acceptable range. If it exceeds the threshold, it means that the population diversity is high and the algorithm is still in the global search stage. At this time, steps S3, S41 and S42 are repeated to continue global optimization and enhance the exploration ability of the solution. If it does not exceed the threshold, it means that the fitness value of the population tends to be consistent, and the algorithm gradually converges to the possible optimal solution. At this time, it switches to the local optimization stage for refined search. The introduction of dynamic search stage control avoids the algorithm from falling into the local optimum due to early convergence, or waste of computing resources due to excessive exploration, thereby enhancing the intelligence and stability of the optimization process. In the global search stage, the population diversity is judged by the fitness standard deviation, and the error under different particle conditions is analyzed by combining the real-time photovoltaic power prediction value and the fitness value to ensure that the population fully explores the parameter space under high diversity conditions. As the population diversity gradually decreases, the algorithm can switch to the local optimization stage in time to avoid efficiency loss caused by excessive global search. When the fitness standard deviation is lower than the preset threshold, it indicates that the population is gradually converging, and the algorithm switches to the local optimization stage to perform refined search on the parameters to further improve the accuracy of model prediction. The dynamic switching between global and local search achieves an optimal balance between search efficiency and accuracy, so that the photovoltaic power prediction model can take into account both fast convergence and high accuracy. Based on the dynamic analysis of real-time photovoltaic power prediction values and fitness values, the model can adapt to changes in environmental variables and component characteristics (such as panel aging, changes in climate conditions, etc.) in different photovoltaic scenarios, thereby enhancing the adaptability of the model. Through dynamic error judgment and distribution feature analysis, it is ensured that the model optimization process can accurately depict the complex nonlinear relationship between photovoltaic power output and environmental variables and component characteristics. The present invention significantly improves the accuracy, stability and optimization efficiency of the photovoltaic power prediction model through the calculation of real-time photovoltaic power prediction values, error analysis of fitness values, dynamic monitoring of population fitness distribution characteristics, and adaptive switching in the search phase. Dynamic adjustment of the switching conditions between global exploration and local optimization avoids early convergence and over-search problems, further enhancing the adaptability and practical application value of the model in complex photovoltaic scenarios.
[0088] Example 5
[0089] Please refer to Figure 1 Specifically: S4 includes the following specific steps:
[0090] S43, after entering the local optimization stage, the standard deviation of the fitness that can enter the local optimization stage The corresponding population set Determine and group the population The position of each combined weight vector R (the result of combining each feature weight vector Q) is updated by using the firefly algorithm to update the new position of each combined weight vector R and mark the position of each particle in each combined weight vector R as the current particle position , mark the new position of the weight vector R after updating each combination as the updated particle position , the updated particle position The specific formula is as follows: ;
[0091] In the formula, and They represent the current particle position under the jth combination condition and the current particle position under the kth combination condition, respectively. It represents the distance between the current particle position under the jth combination condition and the current particle position under the kth combination condition, that is, the distance between the current solution and the target solution, which is obtained by calculating their Euclidean distance. It represents the attraction strength, which controls the degree of closeness of the local solution to the target solution and is determined according to the size of the Euclidean distance; e is the Euler number, which is approximately 2.71828;
[0092] S44, according to the updated particle position obtained in S43 , count the time Zsj executed in the optimization process, and update the particle position Substitute to get fitness The formula of step S35 is used to obtain the updated fitness. , based on the updated fitness The time Zsj executed in the optimization process is used to analyze the balance between search efficiency and accuracy, and the output balance index Phzs is fitted and output after the trained balance prediction model and dimensionless processing. The balance index Phzs is obtained by the following formula: ;
[0093] In the formula, Indicates the improvement of fitness, through the updated fitness and the current particle position Fitness under conditions Get the difference between Indicates the minimum error set, Indicates the execution time of the optimization process. Indicates the preset maximum allowed optimization time. and are weight values, where 0 < <1,0< <1, and The specific value is set by the user according to the situation.
[0094] The initial model is constructed using convolutional neural network technology, and the initial model is trained and tested with the parameter set obtained in the historical period and the real-time parameter set. The trained initial model is used as the state recognition model, and the feature information in the state recognition model is obtained respectively. The state recognition model is trained and tested with the obtained feature information, and the trained state recognition model is used as the equilibrium prediction model.
[0095] In this embodiment, the firefly algorithm is used to calculate the attraction strength between particles and update the particle position according to the particle fitness of the combined weight vector. Through the particle position update formula, the particles can approach the better target particles to achieve accurate adjustment of the model parameters. The calculation of the Euclidean distance provides accurate quantification of the distance between particles, and combined with the attraction strength, further improves the convergence and accuracy of local optimization. The dynamic marking of the particle position (current particle position and updated particle position) ensures the traceability of the optimization process and enhances the transparency of the model adjustment. The updated particle position is substituted into the fitness formula, and the fitness value of the updated particle is dynamically calculated to further reflect the improvement of the error after the particle position is updated. The smaller the updated fitness value, the better the particle position and the higher the accuracy of the model prediction, thereby significantly improving the local optimization ability of the photovoltaic power prediction model. Combined with the time executed during the optimization process and the improvement of the fitness, the balance index is obtained. The balance index dynamically reflects the balance between the search efficiency and the model accuracy of the particles during the optimization process: the fitness improvement range represents the improvement effect of the fitness after optimization, and the larger the fitness improvement range, the higher the search accuracy. The relative proportion of execution time reflects the search efficiency. The smaller the proportion, the faster the optimization process. By introducing the balance index, the efficiency and accuracy of the local optimization process can be comprehensively evaluated to ensure that the model converges quickly while maintaining high prediction accuracy. According to the dynamic analysis of the balance index, the local optimization strategy can be adjusted in time to prevent the model from being over-optimized and causing extended calculation time or reduced efficiency. During the optimization process, the dual control of the preset maximum allowable optimization time and minimum error ensures an organic balance between search efficiency and accuracy.
[0096] In the local optimization stage, by updating the particle position, recalculating the fitness value and combining the dynamic analysis of the fitness standard deviation, the population particles can continuously adjust and optimize according to the difference in fitness value, ensuring the flexibility of the model in local search. The introduction of the balance index effectively improves the adaptability of the model to different scenarios, enabling it to dynamically adjust the search strategy according to specific problems. Through the continuous update of the fitness value during the optimization process, the model can automatically adapt to different environmental variables and component characteristic changes (such as solar radiation, component aging, etc.), improving the robustness of the model. The use of the balance prediction model to fit the optimization results output enables the model to maintain stable performance in complex photovoltaic scenarios and avoid fluctuations in model effects due to changes in input data. Through the fitness standard deviation and the preset threshold, it is dynamically determined whether to enter the local optimization stage, and the particle position and fitness value calculation are automatically adjusted, which greatly reduces the manual intervention in the optimization process, reduces the development cost and adjustment difficulty. The balanced evaluation of fitness and execution time further reduces the risk caused by resource waste during the optimization process, making the optimization algorithm more efficient and reliable. By dynamically recording the particle positions (current position and updated position), combined with the fitness update formula and the balance index calculation formula, the results of the optimization process are more transparent and explainable, which helps to analyze the specific improvement effect of each iteration and provide an intuitive reference for model optimization. In the local optimization stage, the present invention effectively improves the optimization accuracy, search efficiency and model robustness of the photovoltaic power prediction model through the dynamic evaluation of the particle position update, fitness update and balance index of the firefly algorithm. The particle position update is combined with the balance prediction model to dynamically analyze the balance between search efficiency and accuracy, ensuring that the model maintains the accuracy of the relatively optimal solution while converging efficiently, while reducing development costs and optimization risks, and providing a scientific, efficient and reliable optimization strategy for photovoltaic parameter modeling.
[0097] Example 6
[0098] Please refer to Figure 1 Specifically: S5 includes the following steps:
[0099] S51. By comparing and analyzing the balance index Phzs with the evaluation threshold W, a relatively better particle position is selected. The specific contents are as follows:
[0100] If the balance index Phzs falls within the evaluation threshold W, the updated fitness The corresponding updated particle position as a relatively optimal particle position;
[0101] If the balance index Phzs does not fall within the evaluation threshold W, the updated fitness The corresponding updated particle position Not considered as a relatively optimal particle position.
[0102] In this embodiment, the balance index is comprehensively calculated by combining the two key factors of fitness improvement and optimization time, dynamically reflecting the balance state of search efficiency and accuracy during the optimization process. By comparing it with the evaluation threshold, the advantages and disadvantages of each particle position can be scientifically evaluated to ensure that the relatively better particle position screened out has higher fitness and optimization value. If it falls within the evaluation threshold, it means that the optimization result has reached the established efficiency and accuracy requirements. At this time, the particle position corresponding to the updated fitness is selected as the relatively better position. This screening mechanism based on fitness association can significantly improve the reliability of the screening results and ensure the accuracy of the model and the credibility of the optimization results. By setting the evaluation threshold, the screening criteria can be dynamically adjusted according to the actual needs of different photovoltaic scenes, so that the algorithm can adapt to a variety of complex conditions. Through the real-time comparison of the balance index and the evaluation threshold, the particle position that meets the requirements can be quickly screened out, which significantly shortens the processing time of invalid solutions during the optimization process and improves the overall efficiency of the algorithm. If the balance index does not fall within the evaluation threshold, the corresponding particle position is eliminated and is not used as a relatively better solution. This screening mechanism can effectively avoid the interference of low-quality particles on the final optimization results and ensure the stability of the model. For particles that do not meet the threshold, the system will not force them to accept, thereby reducing the model error caused by mis-screening. By screening relatively optimal particle positions, it is ensured that the optimization process gradually tends to the global optimal solution, and the accuracy of the optimization results is avoided from being disturbed by premature convergence or low-quality solutions, thereby improving the convergence of the entire modeling process. The balance index comprehensively considers the fitness and time factors, and is not only applicable to the optimization problems of the current photovoltaic scene, but can also be extended to the parameter optimization of other complex nonlinear systems. The range of the evaluation threshold is dynamically adjusted so that the model can flexibly adapt to different scenes and needs. The relatively optimal particle positions finally screened out not only meet the accuracy requirements, but also take into account the optimization efficiency, providing reliable support for the practical application of subsequent photovoltaic power prediction. Through the dynamic comparison and analysis of the balance index and the evaluation threshold, the present invention realizes high-precision and high-efficiency optimization result screening in the particle position screening process. This method effectively avoids the interference of mis-screening and invalid solutions, significantly improves the stability and adaptability of model optimization, and provides scientific and reliable parameter support for the photovoltaic power prediction model, while enhancing the versatility and application value of the algorithm in different scenes.
[0103] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm, characterized in that: The following steps are included: S1. Pre-collect input parameters and target output parameters of the photovoltaic system, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, and the target output parameters include photovoltaic output power data; S2, generating a real-time parameter set by preprocessing the relevant environmental variables, component characteristics and photovoltaic output power data of the photovoltaic components and performing dimensionless processing; S3. Based on Latin hypercube design, determine the sampling range of each feature weight, and use Python technology to generate n feature weight vectors Q, and combine each feature weight vector Q to construct a population set , according to the population set Combined with particle swarm optimization technology, a global exploration phase is conducted to obtain the real-time photovoltaic power prediction value Ggyz and fitness ; S4, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S3 , determine whether the error of the current search is within an acceptable range. If it is within the acceptable range, enter the local optimization stage and use the firefly algorithm to update the new position of each particle ,After iterative updates, the balance state between search efficiency and accuracy is analyzed, and the output balance index Phzs is fitted in combination with the trained balance prediction model; S5. Preset an evaluation threshold W, and compare and analyze the balance index Phzs with the evaluation threshold W to select a relatively better particle position.
2. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 1, characterized in that: The specific steps of S1 include: S11. Collect input parameters and target output parameters of the photovoltaic system in advance through monitoring instruments, wherein the input parameters include relevant environmental variables and component characteristics of the photovoltaic components, wherein the relevant environmental variables of the photovoltaic components include solar radiation intensity, ambient temperature, scattered radiation ratio, direct radiation intensity, reflected radiation intensity, wind speed, wind direction, relative humidity, air pressure, solar altitude angle and solar azimuth; component characteristics include component surface temperature, panel aging coefficient Mhxs, component surface reflectivity, open circuit voltage, short circuit current, maximum power point voltage, maximum power point current, component inclination angle, component azimuth angle and component installation height; The panel aging coefficient Mhxs is obtained by the following formula: ; In the formula, Indicates the running time, Indicates component design life; S12. Obtain the real-time photovoltaic output power Ssg of the photovoltaic module in real time by using the output record of the inverter.
3. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 2, characterized in that: The specific steps of S2 include: S21. Perform data cleaning and time alignment on the collected relevant environmental variables, component characteristics and photovoltaic output power data, wherein data cleaning includes checking and processing abnormal values and missing values in the collected data, using upper and lower bound constraints to eliminate abnormal data, and filling missing data through the nearest neighbor algorithm; S22. Scale the data preprocessed in S21 using dimensionless processing technology so that the data falls between 0 and 1, and generate a real-time parameter set after aggregation.
4. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 3 is characterized by: The specific steps of S3 include: S31, according to the parameter set obtained in the historical period, and combined with the trained balance prediction model, determine several groups of historical photovoltaic power prediction values in the historical period , several groups of historical photovoltaic power forecast values within the historical period Obtained by the following formula: ; Where n represents the total number of features, i=1, 2, ..., n, Indicates the numerical value of the i-th feature, represents the weight of the i-th feature.
5. The photovoltaic parameter modeling method based on hybrid swarm intelligence algorithm according to claim 4 is characterized in that: The specific steps of S3 also include: S32. According to step S31, the sampling range of each feature weight is preliminarily determined. The sampling range is determined by: , extract the maximum and minimum values of the weights corresponding to each feature, and use the maximum and minimum values of the weights corresponding to each feature as the upper and lower limits of each feature weight, recorded as the feature weight sampling range ; S33, based on Latin hypercube design, the sampling range of each feature weight is Divide into N uniform sub-regions and obtain the sampling range of each feature weight The range of each sub-region within the region is determined, and a sampling point is randomly selected in each sub-region to determine the value at the sampling point. The corresponding feature weight vector Q is constructed for the weight corresponding to each feature, where the feature weight vector Q is expressed as: Represents the value at the Nth sampling point of the i-th feature; S34, shuffle the N groups of feature values in each feature weight vector Q to randomly arrange the N groups of feature values, and obtain the combined weight vector R according to each randomly arranged feature weight vector Q, each combined weight vector R corresponds to a particle, and construct a population set , where the population set The expression is: Indicates The weight vector after the combination.
6. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 5, characterized in that: The specific steps of S3 also include: S35, based on several groups of historical photovoltaic power forecast values in the historical period in S31 The acquisition method is combined with the real-time parameter set in S22 to calculate the real-time photovoltaic power prediction value Ggyz, and based on the real-time photovoltaic power prediction value Ggyz and the real-time photovoltaic output power Ssg of the photovoltaic components in the real-time parameter set, the prediction error degree is analyzed, and the fitness under different particle conditions is calculated. , which is obtained by the following formula: ; Where G represents the monitoring period, g=1, 2, ..., G, represents the real-time photovoltaic output power during the g-th monitoring period, Represents the real-time photovoltaic power forecast value in the g-th monitoring period.
7. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 6, characterized in that: The specific steps of S4 include: S41, based on the real-time photovoltaic power prediction value Ggyz and fitness in step S35 , and combined with the population set in S34 , analyze the population set The statistical distribution characteristics of the fitness values of each particle in the , the fitness standard deviation Obtained by the following formula: ; Where M represents the total number of combinations, j = 1, 2, ..., M, represents the fitness after the jth combination, represents the average fitness.
8. The photovoltaic parameter modeling method based on hybrid swarm intelligence algorithm according to claim 7, characterized in that: The specific steps of S4 also include: S42, according to the fitness standard deviation , by taking the fitness standard deviation Compare with the preset threshold to determine whether the error of the current search is within an acceptable range. If the fitness standard deviation When the preset threshold is exceeded, it is determined that the error of the current search is not within the acceptable range, and steps S3, S41 and S42 are repeated until the fitness standard deviation is reached. When the preset threshold is not exceeded, the repetitive operation is stopped; If the fitness standard deviation When the preset threshold is not exceeded, the error of the current search is judged to be within an acceptable range and the local optimization stage is entered.
9. The photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 1, characterized in that: The specific steps of S4 also include: S43, after entering the local optimization stage, the standard deviation of the fitness that can enter the local optimization stage The corresponding population set Determine and group the population The position of each combined weight vector R is updated by using the firefly algorithm to update the new position of each combined weight vector R, and the position of each particle in each combined weight vector R is marked as the current particle position , mark the new position of the weight vector R after updating each combination as the updated particle position , the updated particle position The specific formula is as follows: ; In the formula, and They represent the current particle position under the jth combination condition and the current particle position under the kth combination condition, respectively. represents the distance between the current particle position under the jth combination condition and the current particle position under the kth combination condition, Indicates the strength of attraction; e is the Euler number; S44, according to the updated particle position obtained in S43 , count the time Zsj executed in the optimization process, and update the particle position Substitute to get fitness To obtain the updated fitness , based on the updated fitness The time Zsj executed in the optimization process is used to analyze the balance between search efficiency and accuracy, and the output balance index Phzs is fitted and output after the trained balance prediction model and dimensionless processing. The balance index Phzs is obtained by the following formula: ; In the formula, Indicates the improvement in fitness; Indicates the minimum error set, Indicates the execution time of the optimization process. Indicates the preset maximum allowed optimization time. and are weight values, where 0 < <1,0< <1, and The specific value is set by the user according to the situation.
10. A photovoltaic parameter modeling method based on a hybrid swarm intelligence algorithm according to claim 9, characterized in that: The specific steps of S5 include: S51. By comparing and analyzing the balance index Phzs with the evaluation threshold W, a relatively better particle position is selected. The specific contents are as follows: If the balance index Phzs falls within the evaluation threshold W, the updated fitness The corresponding updated particle position as a relatively optimal particle position; If the balance index Phzs does not fall within the evaluation threshold W, the updated fitness The corresponding updated particle position Not considered as a relatively optimal particle position.
Citation Information
Patent Citations
Optical power prediction method based on adaptive classification strategy and hybrid optimization SVR
CN111079980A
Photovoltaic online parameter identification method based on global maximum power point tracking and hybrid optimization algorithm
CN113595132A
Photovoltaic power generation capacity prediction method based on VFOA optimization SVM model
CN116865230A
Hybrid photovoltaic power prediction method and system based on multi-source data fusion
US20220373984A1
Cited By
Photovoltaic power station power short-term prediction method based on improved ESOA-GA
CN119647548A
Multi-objective design optimization method suitable for photovoltaic integrated enclosure structure
CN122174341A