CNN-based ship solar energy output prediction method and device
By adopting a CNN-based prediction method in ship solar energy output prediction, combining BPNN and RBFNN neural networks, the problem of low accuracy in the existing technology is solved, and more efficient and stable solar energy output prediction is achieved.
Patent Information
- Application Number
- CN202411636464.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-04-08
AI Technical Summary
The prior art has the problem of low accuracy when predicting ship solar energy output, especially when processing high-dimensional, nonlinear, complex solar energy output data.
Using a prediction method based on convolutional neural network (CNN) to collect and process the power output data and historical meteorological data of the marine solar power generation system, a neural network architecture is designed and a hybrid prediction model is built, and CNN feature extraction is predicted by combining BPNN and RBFNN neural networks.
It improves the accuracy and stability of solar output prediction, can extract feature information more effectively, approximate any complex nonlinear mapping relationship, and ensures faster convergence speed and smaller network structure.
Smart Images

Figure CN119782697A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ship power, and in particular to a method and device for predicting ship solar energy output based on CNN. Background Art
[0002] With the adjustment of the global energy structure and the rapid development of renewable energy technology, solar energy, as a clean and renewable energy, has been widely used in shipboard power systems. However, the instability and volatility of solar energy output, especially under changing climate conditions, has brought great challenges to the stable operation of the power system. Accurately predicting the solar energy output range not only helps to optimize power dispatching and improve energy utilization, but also effectively reduce economic losses and safety hazards caused by insufficient or excessive power.
[0003] At present, the solar energy output prediction methods in power systems mainly include two categories: prediction methods based on physical models and prediction methods based on data-driven. The prediction methods based on physical models mainly rely on meteorological data and the physical characteristics of solar power generation systems, and predict solar energy output by establishing complex mathematical models. However, this method usually requires a large amount of real-time data and complex calculations, and has high requirements on the accuracy and robustness of the model.
[0004] On the other hand, data-driven prediction methods, especially machine learning technology, have been widely used in fields such as wind power prediction due to their advantages such as model-free and high accuracy. In terms of solar output prediction, existing machine learning-based prediction methods are mostly based on back propagation neural networks (BPNN), radial basis function neural networks (RBFNN), extreme learning machines (ELM) and Elman neural networks, as well as hybrid models of these machine learning categories. These methods predict future solar output by learning the mapping relationship between input and output from historical data. However, these methods have certain limitations when processing high-dimensional, nonlinear, and complex solar output data, and their prediction accuracy and stability need to be further improved. Summary of the invention
[0005] The purpose of the present invention is to provide a method and device for predicting ship solar energy output based on CNN in order to overcome the low accuracy defect of the above-mentioned prior art.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A method for predicting ship solar energy output based on CNN, comprising the following steps:
[0008] S1: Collecting power output data of the ship's solar power generation system and historical meteorological data corresponding to the power output data, and processing the power output data and historical meteorological data to obtain clean data;
[0009] S2: After normalizing the clean data, divide it into training sample set and test sample set;
[0010] S3: Design neural network architecture and build hybrid prediction model;
[0011] S4: Train the hybrid prediction model according to the training sample set, verify the hybrid prediction model through the test sample set, and use the verified hybrid prediction model to predict power output data through current meteorological data.
[0012] Further, step S1 includes:
[0013] S11: Connect the data collector to the data collection substation through the communication port, so that the data collection substation sends a collection request to the data center station, and the data center station transmits the authorized data to the data collection substation through the channel and thread;
[0014] S12: Use the Hadoop log system framework to build the Flume system architecture, and connect the agent component of the Flume system architecture to the communication port of the data collection substation;
[0015] S13: Connect the Source end of the agent component to the data source to obtain data, and pass the data from the Source end to the sink end through the channel end;
[0016] S14: Write the collected data to the HDFS cluster through the sink to form an initial data set.
[0017] Furthermore, the processing of power output data and historical meteorological data includes: missing value processing, duplicate data processing, outlier processing and consistency processing.
[0018] Furthermore, the clean data is also transformed into standardized data, and the calculation expression of the standardized data transformation is:
[0019]
[0020] In the formula, is the standardized data, X ij For clean data, is the mean of the clean data, S is the sum of the standardized data and the clean data, i=1,2,...,n, j=1,2,...,n, n is a natural number greater than 0.
[0021] Furthermore, the normalization process includes the following steps:
[0022] S21: Set the standardized interval [a, b], set the data set after the standardized transformation as X, traverse each data in the data set X, and select the maximum value max and the minimum value min;
[0023] S22: Calculate the normalization coefficient k, the calculation expression is:
[0024]
[0025] S23: According to Y=a+k(X-min) or Y=b+k(X-max), obtain normalized data normalized to the standardization interval [a, b].
[0026] Furthermore, the neural network architecture includes a feature extraction module, a feature prediction module and an attention mechanism layer, the feature extraction module includes a CNN input layer and a stacked convolutional layer, the stacked convolutional layer includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a fifth convolutional layer, the processing flow of the first convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the second convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the third convolutional layer is convolution-ReLU, the processing flow of the fourth convolutional layer is convolution-ReLU, and the processing flow of the fifth convolutional layer is convolution-ReLU-pooling.
[0027] Furthermore, the feature prediction module includes a BPNN hidden layer for receiving the output from the fifth convolutional layer, and the attention mechanism layer includes a RBFNN output layer and a fully connected layer for receiving the output from the BPNN hidden layer, mapping the output data of the RBFNN output layer to the fully connected layer, and obtaining the hybrid prediction model through the output of the fully connected layer.
[0028] Furthermore, the training process of training the hybrid prediction model according to the training sample set includes the following steps:
[0029] S41: Import the sample data in the training sample set into the CNN input layer;
[0030] S42: Define the cross entropy loss function to measure the difference between the model's prediction results on the training data and the actual labels;
[0031] S43: Define the optimizer according to the stochastic gradient descent algorithm and set the hyperparameter data;
[0032] S44: In each training iteration, training data is input into the model, the model prediction results are calculated, and the calculated loss values are compared. The error is then back-propagated through the optimizer and the model parameters are updated until the model converges or reaches a predetermined number of training times.
[0033] Furthermore, in step S2, a validation data set is also divided; in step S4, the sample data of the test sample set is input into the hybrid prediction model, and the accuracy of the validation model on the test sample set is calculated, and different hyperparameters are used to train the model, and the model is optimized through the validation data set, and the hyperparameters include the number of iterations and the learning rate.
[0034] A second aspect of the present invention is a CNN-based ship solar energy output prediction device, comprising a memory, a processor, and a program stored in the memory, wherein the processor implements any of the above methods when executing the program.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1) The present invention is based on the power output data and the historical meteorological data corresponding to the power output data. After standardization, it combines the convolution, pooling and other operations of CNN to automatically learn the local features and hierarchical structure of the data, so as to extract more effective and richer feature information, thereby improving the prediction accuracy.
[0037] 2) The present invention combines BPNN and RBFNN neural networks to predict CNN feature extraction, improves the stability and generalization ability of the model, can approximate arbitrarily complex nonlinear mapping relationships, and ensures a faster convergence speed and a smaller network structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of optimization steps of the hybrid model for predicting solar energy output of ships according to the present invention;
[0039] Figure 2 This is a schematic diagram of a data acquisition module of the present invention;
[0040] Figure 3 The figure is a schematic diagram of the data processing flow of the present invention. DETAILED DESCRIPTION
[0041] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0042] Example 1
[0043] The present invention is a method and device for predicting ship solar energy output based on CNN. Figure 1 As shown, the method comprises the following steps:
[0044] S1: Collecting power output data of the ship's solar power generation system and historical meteorological data corresponding to the power output data, and processing the power output data and historical meteorological data to obtain clean data;
[0045] The power output data includes the total area of solar photovoltaic panels, the daily power generation of solar photovoltaic panels and the daily utilization hours of solar photovoltaic panels. The historical meteorological data includes daily radiation, sunshine time, wind speed, wind direction, ambient temperature, ambient humidity, air pressure and photovoltaic panel module temperature.
[0046] The power output data includes the daily power generation of the solar photovoltaic panels located on the ship. The daily power generation of the solar photovoltaic panels is related to the total area of the solar photovoltaic panels and the daily utilization time. It is also related to the local daily meteorological data. The daily radiation also includes radiation data such as total radiation, direct radiation, reflected radiation, heat radiation and ultraviolet radiation.
[0047] The data collection process includes:
[0048] S11: Connect the data collector to the data collection substation through the communication port, so that the data collection substation sends a collection request to the data center station, and the data center station transmits the authorized data to the data collection substation through the channel and thread;
[0049] S12: Use the Hadoop log system framework to build the Flume system architecture, and connect the agent component of the Flume system architecture to the communication port of the data collection substation;
[0050] S13: Connect the Source end of the agent component to the data source to obtain data, and pass the data from the Source end to the sink end through the channel end;
[0051] S14: Write the collected data to the HDFS cluster through the sink to form an initial data set.
[0052] Specifically, the data collection substation is installed at the ship's solar photovoltaic panel with a bracket structure, and the meteorological data sensor is connected and controlled by the sensor control module to collect meteorological data, wherein the meteorological data sensor includes a solar radiation sensor, a wind sensor, a temperature and humidity sensor, and an air pressure sensor. The data collection module is connected to the solar controller data to receive power data, and the communication terminal equipment transmits the power data and meteorological data to the data center station through the channel thread for processing and storage.
[0053] The data is sampled according to the SDI-12 protocol, and the sampling frequency of air pressure is 6 times / min, that is, sampling is performed every 10 seconds. Then, the 6 numerical samples sampled in each minute are counted, and the maximum and minimum values are removed. The arithmetic mean is calculated with the remaining 4 sample values. This value is the observed value of the minute and is used as the instantaneous value.
[0054] Since the radiation and temperature and humidity data are analog outputs, the data sampling and statistical methods are the same as those for measuring air pressure;
[0055] Since data such as wind speed and wind direction vary greatly in time and space, the sampling rate was changed to 1 time / s, and 5 minutes of wind data were collected and the average value was calculated.
[0056] During the interactive transmission of data, data errors will be generated due to the influence of impulse noise. The erroneous data will be mixed with other normal data, thus forming dirty data. Therefore, dirty data sets can be screened out through data classification, sorting, deduplication and merging, and data cleaning can be performed on dirty data sets, including missing value processing, duplicate data processing, outlier processing and consistency processing, specifically:
[0057] Missing value processing: Identify and process missing values. Missing values refer to missing or undefined values in the data. Methods for processing missing values include deletion, filling, and marking. Among them, the method of deleting missing values is relatively direct and suitable for situations where there are fewer missing values and they are randomly distributed, but it may lead to a reduction in data volume and an increase in deviation. Commonly used filling methods include mean filling, median filling, and mode filling. The modification method generally uses specific value markers to modify missing data.
[0058] Duplicate data processing: Duplicate values refer to the same observations that appear multiple times in the data. Duplicate data can be removed by deleting duplicate rows with the same values in all columns or by removing duplicate rows based on specific columns.
[0059] Outlier processing: Outliers refer to values in the data that are significantly different from other observed values. Methods for processing outliers include deletion, replacement correction and marking. The method of deleting outliers is relatively direct, but may lead to a reduction in the amount of data and an increase in deviation. Common methods for replacing outliers include median replacement, mean replacement and interpolation replacement. Modification refers to the use of specific values to mark and modify the abnormal part of the data.
[0060] Consistency processing: Inconsistent values refer to values that appear in the data that are inconsistent with other observed values. Methods for processing inconsistent values include deletion, replacement, and modification. Direct deletion of inconsistent values may result in a reduction in data volume and an increase in deviation. Methods for replacing inconsistent values include median replacement and mean replacement. Modification method refers to the use of specific values for marking and modification.
[0061] S2: After normalizing the clean data, divide it into training sample set and test sample set;
[0062] Before normalization, standardization is performed first. The calculation expression for standardized data conversion is:
[0063]
[0064] In the formula, is the standardized data, X ij For clean data, is the mean of the clean data, S is the sum of the standardized data and the clean data, i=1,2,...,n, j=1,2,...,n, n is a natural number greater than 0.
[0065] The normalization process is:
[0066] S21: Set the standardized interval [a, b], set the data set after the standardized transformation as X, traverse each data in the data set X, and select the maximum value max and the minimum value min;
[0067] S22: Calculate the normalization coefficient k, the calculation expression is:
[0068]
[0069] S23: According to Y=a+k(X-min) or Y=b+k(X-max), obtain normalized data normalized to the standardization interval [a, b].
[0070] Specifically, the data after standardization transformation is independent of the dimension of the variable, and after transformation, the mean of each variable is 0 and the standard deviation is 1. The processing formula for the maximum value normalization is:
[0071]
[0072] Where, X * The processed data set.
[0073] S3: Design neural network architecture and build hybrid prediction model;
[0074] The neural network architecture includes a feature extraction module, a feature prediction module and an attention mechanism layer. The feature extraction module includes a CNN input layer and stacked convolutional layers. The stacked convolutional layers include the first convolutional layer, the second convolutional layer, the third convolutional layer, the fourth convolutional layer and the fifth convolutional layer. The processing flow of the first convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the second convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the third convolutional layer is convolution-ReLU, the processing flow of the fourth convolutional layer is convolution-ReLU, and the processing flow of the fifth convolutional layer is convolution-ReLU-pooling.
[0075] Specifically, the sample data of the training sample set is input through the CNN input layer, the FeatureMap output by the first convolutional layer is input into the ReLU function through ReLU, and then the pooled data is locally normalized and output to the second convolutional layer;
[0076] The FeatureMap output by the first convolutional layer is input into the ReLU function through ReLU, and the pooled data is locally normalized and output to the third convolutional layer; the FeatureMap output by the second convolutional layer is input into the ReLU function through ReLU, and then output to the fourth convolutional layer; the FeatureMap output by the third convolutional layer is input into the ReLU function through ReLU, and then output to the fifth convolutional layer;
[0077] The FeatureMap output by the fourth convolutional layer is input into the ReLU function through ReLU, and then output to the BPNN hidden layer after pooling.
[0078] Furthermore, the feature prediction module includes a BPNN hidden layer for receiving the output from the fifth convolutional layer, and the attention mechanism layer includes a RBFNN output layer and a fully connected layer for receiving the output from the BPNN hidden layer, mapping the output data of the RBFNN output layer to the fully connected layer, and obtaining the hybrid prediction model through the output of the fully connected layer.
[0079] Specifically, the BPNN hidden layer receives the output from the fifth convolutional layer, and then receives the output from the BPNN hidden layer through the RBFNN output layer. The output data of the RBFNN output layer is mapped through the fully connected layer, and the hybrid prediction model is obtained through the output of the fully connected layer.
[0080] S4: Train the hybrid prediction model according to the training sample set, verify the hybrid prediction model through the test sample set, and use the verified hybrid prediction model to predict power output data through current meteorological data.
[0081] The training process of training the hybrid prediction model according to the training sample set includes the following steps:
[0082] S41: Import the sample data in the training sample set into the CNN input layer;
[0083] S42: Define the cross entropy loss function to measure the difference between the model's prediction results on the training data and the actual labels;
[0084] S43: Define the optimizer according to the stochastic gradient descent algorithm and set the hyperparameter data;
[0085] S44: In each training iteration, training data is input into the model, the model prediction results are calculated, and the calculated loss values are compared. The error is then back-propagated through the optimizer and the model parameters are updated until the model converges or reaches a predetermined number of training times.
[0086] Specifically, data loading and preprocessing: Before training the model, you need to load and preprocess the training data, and divide the images and corresponding labels of the loaded training set into small batches of data for training;
[0087] Define the loss function: When training a model, you need to define a loss function to measure the difference between the model's prediction results on the training data and the actual labels. The intersection-and-drop loss function can effectively measure the classification performance of the model.
[0088] Define optimizer: The optimizer is used to update the parameters of the model so that the model can be gradually optimized and improve performance. Commonly used optimizer algorithms include stochastic gradient descent, Adam, etc.
[0089] Cyclic training: In each training epoch, the training data is input into the model, the model's prediction results are calculated and compared with the actual labels to obtain the loss value, and then the optimizer is used to backpropagate the error and update the model's parameters. This process will be repeated for multiple training iterations until the model converges or reaches the predetermined number of training rounds.
[0090] Furthermore, the sample data of the test sample set is input into the hybrid prediction model, and the accuracy of the verification model on the test sample set is calculated. The model is trained using different hyperparameters, and the model is optimized using the verification data set. The hyperparameters include the number of iterations and the learning rate.
[0091] Specifically, evaluate the model: During the training process, the performance of the model needs to be evaluated regularly. In order to evaluate the generalization ability of the model on unprocessed data, the test set is input into the trained model and the accuracy or other evaluation indicators of the model on the test set are calculated;
[0092] Parameter adjustment and optimization: If the performance of the model on the training set and test set is not ideal, you can consider adjusting the model's hyperparameters, adding training data, changing the network structure, etc. to further optimize the model.
[0093] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0094] The processing unit performs the various methods and processes described above, such as methods S1 to S4. In some embodiments, methods S1 to S4 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of methods S1 to S4 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S4 in any other appropriate manner (e.g., by means of firmware).
[0095] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A ship solar energy output prediction method based on CNN, characterized in that: The following steps are involved: S1: Collecting power output data of the ship's solar power generation system and historical meteorological data corresponding to the power output data, and processing the power output data and historical meteorological data to obtain clean data; S2: After normalizing the clean data, divide it into training sample set and test sample set; S3: Design neural network architecture and build hybrid prediction model; S4: Train the hybrid prediction model according to the training sample set, verify the hybrid prediction model through the test sample set, and use the verified hybrid prediction model to predict power output data through current meteorological data.
2. A method for predicting ship solar energy output based on CNN according to claim 1, characterized in that: Step S1 includes: S11: Connect the data collector to the data collection substation through the communication port, so that the data collection substation sends a collection request to the data center station, and the data center station transmits the authorized data to the data collection substation through the channel and thread; S12: Use the Hadoop log system framework to build the Flume system architecture, and connect the agent component of the Flume system architecture to the communication port of the data collection substation; S13: Connect the Source end of the agent component to the data source to obtain data, and pass the data from the Source end to the sink end through the channel end; S14: Write the collected data to the HDFS cluster through the sink to form an initial data set.
3. The method for predicting ship solar energy output based on CNN according to claim 1, characterized in that: The processing of the power output data and the historical meteorological data includes: missing value processing, duplicate data processing, abnormal value processing and consistency processing.
4. The method for predicting ship solar energy output based on CNN according to claim 1, characterized in that: The clean data is also subjected to standardized data conversion, and the calculation expression of the standardized data conversion is: In the formula, is the standardized data, X ij For clean data, is the mean of the clean data, S is the sum of the standardized data and the clean data, i=1,2,...,n, j=1,2,...,n, n is a natural number greater than 0.
5. The method for predicting ship solar energy output based on CNN according to claim 4, characterized in that: The normalization process comprises the following steps: S21: Set the standardized interval [a, b], set the data set after the standardized transformation as X, traverse each data in the data set X, and select the maximum value max and the minimum value min; S22: Calculate the normalization coefficient k, the calculation expression is: S23: According to Y=a+k(X-min) or Y=b+k(X-max), obtain normalized data normalized to the standardization interval [a, b].
6. The method for predicting ship solar energy output based on CNN according to claim 1, characterized in that: The neural network architecture includes a feature extraction module, a feature prediction module and an attention mechanism layer. The feature extraction module includes a CNN input layer and a stacked convolutional layer. The stacked convolutional layer includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a fifth convolutional layer. The processing flow of the first convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the second convolutional layer is convolution-ReLU-pooling-normalization, the processing flow of the third convolutional layer is convolution-ReLU, the processing flow of the fourth convolutional layer is convolution-ReLU, and the processing flow of the fifth convolutional layer is convolution-ReLU-pooling.
7. The method for predicting ship solar energy output based on CNN according to claim 6, characterized in that: The feature prediction module includes a BPNN hidden layer, which is used to receive the output from the fifth convolutional layer. The attention mechanism layer includes an RBFNN output layer and a fully connected layer, which are used to receive the output from the BPNN hidden layer, map the output data of the RBFNN output layer to the fully connected layer, and obtain a hybrid prediction model through the output of the fully connected layer.
8. The method for predicting ship solar energy output based on CNN according to claim 6, characterized in that: The training process of training the hybrid prediction model according to the training sample set includes the following steps: S41: Import the sample data in the training sample set into the CNN input layer; S42: Define the cross entropy loss function to measure the difference between the model's prediction results on the training data and the actual labels; S43: Define the optimizer according to the stochastic gradient descent algorithm and set the hyperparameter data; S44: In each training iteration, training data is input into the model, the model prediction results are calculated, and the calculated loss values are compared. The error is then back-propagated through the optimizer and the model parameters are updated until the model converges or reaches a predetermined number of training times.
9. The method for predicting ship solar energy output based on CNN according to claim 1, characterized in that: In step S2, a validation data set is also divided; in step S4, the sample data of the test sample set is input into the hybrid prediction model, and the accuracy of the validation model on the test sample set is calculated, and different hyperparameters are used to train the model, and the model is optimized through the validation data set. The hyperparameters include the number of iterations and the learning rate.
10. A ship solar energy output prediction device based on CNN, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.