Load prediction model construction method and device and power load prediction method
By using the neural network model trained by source domain features and using a small amount of target domain features to adjust parameters, the problem of reduced accuracy of power load prediction when the navigation area changes is solved, and a load forecast model adapted to the new area is quickly constructed, reducing the data cost. requirements and training time.
Patent Information
- Application Number
- CN202410665239.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-10-01
AI Technical Summary
When the navigation area changes, the prediction accuracy of the existing power load prediction model decreases, and it requires a large amount of training data in the new area and a long time to rebuild the model.
Through a preset neural network model trained based on source domain features, a small number of target domain features are used to adjust parameters, and a load forecasting model adapted to new areas is built, reducing dependence on data in new areas and reducing training time.
It realizes the rapid construction of accurate load prediction model when the navigation area changes, reduces the demand for new area data and training time, and improves the prediction accuracy.
Smart Images

Figure CN118735029A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship power systems, and in particular to a method and device for constructing a load prediction model and a method for predicting power load. Background Art
[0002] As the trend of ships becoming larger and smarter continues to strengthen, the power demand of modern tugboats is also increasing. In order to provide reliable operation support for the ship's power system, it is necessary to predict the tugboat's power load and assist ship managers in planning the power system's operation strategy in advance to ensure the stability and economy of the ship's power system operation.
[0003] However, the current power load prediction model is designed specifically for each navigation area. When the navigation area changes, the prediction accuracy of the power load prediction model decreases when it is used to predict other navigation areas. If predictions are needed for other navigation areas, a large amount of training data for other navigation areas needs to be obtained, and a long training time is spent to rebuild the power load prediction model. Summary of the invention
[0004] Based on this, it is necessary to provide a method and device for constructing a load prediction model and a method for predicting power load in response to the above technical problems.
[0005] A method for constructing a load forecasting model, comprising:
[0006] Determining a model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features;
[0007] Determine the target domain feature according to the application environment; wherein the number of samples of the target domain feature is less than the number of samples of the source domain feature;
[0008] Based on the target domain characteristics, the model to be adjusted is trained to obtain a load forecasting model.
[0009] A method for predicting power load, comprising:
[0010] Obtain the monitoring data to be tested;
[0011] Based on the load prediction model described in any of the above embodiments, load prediction is performed according to the monitoring data to be tested to obtain a load prediction result.
[0012] A device for constructing a load forecasting model, comprising:
[0013] A model to be adjusted module, used to determine a model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features;
[0014] A target feature module, used to determine a target domain feature according to an application environment; wherein the number of samples of the target domain feature is smaller than the number of samples of the source domain feature;
[0015] The model adjustment module is used to train the model to be adjusted based on the target domain characteristics to obtain a load forecasting model.
[0016] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method for constructing a load forecasting model described in any of the above embodiments when executing the computer program.
[0017] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for constructing a load forecasting model described in any of the above embodiments.
[0018] The method and device for constructing the load forecasting model described above determine the model to be adjusted, the model to be adjusted is obtained by training a preset neural network model through a large number of source domain features, the target domain features are determined according to the area to be navigated, that is, the application environment, and the parameters of the model to be adjusted are adjusted through a small number of target domain features to obtain a load forecasting model that can adapt to the current application environment. In this way, whenever the navigation area changes, there is no need to obtain a large amount of training data for the changed navigation area, nor is it necessary to spend a long time training the model; instead, the model to be adjusted that has been trained with a large amount of training data is selected as the basis, a small amount of training data for the changed navigation area is collected, and the parameters of the model to be adjusted are adjusted, and a load forecasting model is obtained in a shorter training time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of an application scenario of a method for constructing a load forecasting model in an embodiment;
[0020] Figure 2 is a structural block diagram of a device for constructing a load forecasting model in one embodiment;
[0021] Figure 3 is an internal structure diagram of a computer device in one embodiment;
[0022] Figure 4 A schematic diagram of training a transfer learning tugboat power load prediction model in one embodiment;
[0023] Figure 5 is a working principle diagram of a stacked autoencoder network in one embodiment;
[0024] Figure 6aA heat map of the SAE power load monitoring data of the stacked autoencoder network before deep feature extraction under the benchmark working condition in one embodiment;
[0025] Figure 6b The improved loss function under the baseline condition in one embodiment is Heat map of SAE power load monitoring data after deep feature extraction using a stacked autoencoder network;
[0026] Figure 7 A flowchart of hyperparameter optimization of an η-CPSO algorithm in one embodiment;
[0027] Figure 8 This is a comparison chart of tugboat power load data prediction results before and after η-CPSO-LSTM algorithm parameter optimization under a baseline condition in an embodiment;
[0028] Fig. 9 This is a diagram showing the effect of tugboat power load prediction using a transfer learning model under working condition 3 in an embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] Embodiment 1
[0031] In this embodiment, Figure 1 As shown, a method for constructing a load forecasting model is provided, which includes:
[0032] Step 110, determining a model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features.
[0033] In this embodiment, the model to be adjusted is a model obtained by training the preset neural network model through a large number of source domain features. Since the number of samples of the source domain features is large, rich training data is provided, and the model to be adjusted obtained by training can ensure a certain accuracy in different application environments. When the application environment to be predicted changes, the model to be adjusted can be used as the basis for transfer learning, and parameters can be adjusted on this basis to adapt to changes in the navigation area, that is, the application environment.
[0034] Step 120, determining the target domain feature according to the application environment; wherein the number of samples of the target domain feature is smaller than the number of samples of the source domain feature.
[0035] In this embodiment, the application environment is the navigation area where the load forecasting model is currently required to be constructed. In order to adapt the load forecasting model to the application environment, it is necessary to obtain the target domain features of the application environment, which are used as the basis for adjusting the model to be adjusted, so that the adjusted load forecasting model can adapt to the current application environment. When the application environment is different, the target domain features will be obtained for each application environment respectively, which will be used as the basis for adjusting the model to be adjusted respectively, and each load forecasting model adapted to the application environment will be obtained respectively, so that the model to be adjusted can be generalized and applied to different application environments, and each generalization only needs to obtain fewer target domain features for the application environment, and the process of transfer learning to adjust parameters is faster.
[0036] Step 130: Based on the target domain characteristics, the model to be adjusted is trained to obtain a load forecasting model.
[0037] In this embodiment, the target domain features are features obtained for the application environment. When the application environment is different, the determined target domain features are different. When training the model to be adjusted, the parameters of several hidden layers are frozen, and the parameters of several other hidden layers are adjusted through the target domain features. Since the target domain features can reflect the characteristics of the application environment, the parameter adjustment of the hidden layer can make the model adapt to the application environment, so that the load forecasting model can make the prediction result more accurate when predicting the application environment.
[0038] In this embodiment, the method for constructing the load forecasting model is based on the model to be adjusted that has been trained with a large number of source domain features, determines the target domain features according to the area to be navigated, that is, the application environment, and adjusts the parameters of the model to be adjusted through a small number of target domain features to obtain a load forecasting model that can adapt to the current application environment. In this way, whenever the navigation area changes, there is no need to obtain a large amount of training data for the changed navigation area, nor is it necessary to spend a long time training the model; instead, the model to be adjusted that has been trained with a large amount of training data is selected as the basis, a small amount of training data for the changed navigation area is collected, and the parameters of the model to be adjusted are adjusted, and a load forecasting model is obtained in a shorter training time.
[0039] In one embodiment, before the step of determining the model to be adjusted, the following steps are included:
[0040] Obtain source domain sample data and target domain sample data;
[0041] Calculating the similarity between the source domain sample data and the target domain sample data to obtain migration similarity;
[0042] Before determining the steps of the model to be adjusted, include:
[0043] Establishing a source domain extraction function based on the migration similarity and / or the source domain sample data and the source domain reconstructed features;
[0044] Taking minimization of the source domain extraction function as a goal, feature extraction is performed on the source domain sample data to obtain the source domain feature; wherein the function value of the source domain extraction function is inversely correlated with the migration similarity, and the function value of the source domain extraction function is positively correlated with the source domain fitting difference;
[0045] and / or,
[0046] Establishing a target domain extraction function based on the migration similarity and / or the target domain fitting difference between the target domain sample data and the target domain reconstruction feature;
[0047] With the minimization of the target domain extraction function as the goal, feature extraction is performed on the target domain sample data to obtain the target domain feature; wherein the function value of the target domain extraction function is inversely correlated with the migration similarity, and the function value of the target domain extraction function is positively correlated with the target domain fitting difference.
[0048] In this embodiment, the source domain sample data is the data collected for training the preset neural network model and obtained from different application environments, and the target domain sample data is the data collected for parameter adjustment of the model to be adjusted and obtained from the application environment for the current load forecasting model to be constructed. The source domain sample data and the target domain sample data include at least several identical parameter indicators, for example, the source domain sample data and the target domain sample data both include at least five dimensions of parameter indicators: navigation area temperature, navigation area relative humidity, navigation area speed, navigation area ship draft and navigation area past load. The greater the similarity between the source domain sample data and the target domain sample data, the greater the similarity between the navigation area environment reflected by the source domain sample data and the navigation area environment reflected by the target domain sample data, and the source domain sample data can better reflect the navigation area environment reflected by the target domain sample data. In the case of a large number of samples of the source domain sample data, the parameters of the model to be adjusted obtained by training the source domain sample data are adjusted, and the load forecasting model obtained can more accurately predict the power load in the application environment corresponding to the target domain sample data. The degree of similarity can be the absolute value of the similarity coefficient of the same parameter index between the source domain sample data and the target domain sample data. When there are multiple identical parameter indexes, the absolute value of the similarity coefficient corresponding to each parameter index can be calculated respectively, and a weight coefficient is assigned to the absolute value of the similarity coefficient of each parameter index. Then, the absolute value of the similarity coefficient corresponding to each parameter index and its corresponding weight coefficient are summed up, and the result is taken as the degree of similarity.
[0049] In this embodiment, in order to better extract deep features from the source domain sample data and the target domain sample data as source domain features and target domain features, it is preferred to extract features that are relatively similar between the source domain sample data and the target domain sample data and features with small data differences before and after feature extraction as deep features. For example, when the source domain sample data and the target domain sample data are more similar, that is, the greater the migration similarity, the smaller the function value of the corresponding source domain extraction function, the model to be adjusted obtained by training the source domain sample data can better explain the application environment corresponding to the target domain sample data, and the load prediction model after the parameters of the model to be adjusted can more accurately predict the load. In this embodiment, in order to extract reconstructed data with a smaller difference from the data before feature construction, so as to improve the prediction accuracy of the model, the feature extraction of source domain sample data is taken as an example to explain that before and after feature extraction, that is, before and after feature reconstruction, when the data difference before and after feature extraction is small, that is, the smaller the source domain fitting difference, it means that the fitting degree between the source domain sample data before feature reconstruction and the source domain features after feature reconstruction is high, and the source domain features can reflect the application environment corresponding to the source domain sample data, which is conducive to improving the prediction accuracy of the load prediction model trained by the source domain features. Therefore, in feature extraction, a source domain extraction function is constructed according to the migration similarity and / or the source domain fitting difference. The source domain extraction function is used to quantify the difference between the source domain sample data and the source domain features. The smaller the function value of the source domain extraction function is, the better the effect of feature extraction is. Feature extraction can be performed through the SAE network, and different source domain features are obtained in iterative extraction. The function value of the source domain extraction function is calculated in each iteration, and each function value reflects the feature extraction effect in the corresponding iterative process. In order to select the optimal source domain feature from the results of each iteration, the feature extraction is iteratively performed with the goal of minimizing the source domain extraction function, and the deep feature corresponding to the minimum value of the function value of the source domain extraction function is selected as the source domain feature.
[0050] In one embodiment, the migration similarity includes the sum of the absolute values of the similarity coefficients corresponding to the same parameter indicators between the source domain sample data and the target domain sample data. In this embodiment, the source domain sample data and the target domain sample data may have multiple same parameter indicators. In order to comprehensively consider the influence of each parameter indicator on the migration similarity, the absolute values of the similarity coefficients corresponding to each parameter indicator are summed, and the result is used as the migration similarity.
[0051] In one embodiment, the similarity coefficient is calculated as shown in formula (1):
[0052]
[0053] In formula (1), r irepresents the similarity coefficient of the i-th parameter indicator, Xi represents the i-th sample value of the parameter indicator in the source domain sample data, Yi represents the i-th sample value of the parameter indicator in the target domain sample data, n is the number of samples used to calculate the similarity coefficient of the i-th parameter indicator in the source domain sample data or the target domain sample data, represents the average value of the i-th parameter index in the source domain sample data, It represents the average value of the i-th parameter index in the target domain sample data. It should be understood that the number of samples in the source domain sample data is often larger than the number of samples in the target domain sample data. In order to calculate the correlation coefficient of the i-th parameter index, the source domain sample data can be sampled intermittently, for example, one sample is determined for calculating the correlation coefficient every 10 samples.
[0054] Furthermore, the calculation of migration similarity is shown in formula (2):
[0055] r pearson =|r1|+|r2|+…+|r i | (2)
[0056] In formula (2), r pearson represents the migration similarity, r i Represents the similarity coefficient of the i-th parameter index, i = 1, 2, ..., n.
[0057] In one embodiment, the step of establishing a source domain extraction function based on the migration similarity and / or the source domain fitting difference between the source domain sample data and the source domain reconstruction feature further includes:
[0058] Calculating the quotient of the source domain fitting difference and the sample length of the source domain sample data to obtain the length source domain fitting difference;
[0059] The source domain extraction function is established based on the migration similarity and / or the length source domain quasi-difference; wherein the function value of the source domain extraction function is positively correlated with the length source domain quasi-difference;
[0060] and / or,
[0061] The step of establishing a target domain extraction function based on the migration similarity and / or the target domain fitting difference between the target domain sample data and the target domain reconstruction feature also includes:
[0062] Calculating the quotient of the target domain fitting difference and the sample length of the target domain sample data to obtain the length target domain fitting difference;
[0063] The source domain extraction function is established based on the migration similarity and / or the length target domain quasi-difference; wherein the function value of the target domain extraction function is positively correlated with the length target domain quasi-difference.
[0064] In this embodiment, when the function value of the source domain extraction function is minimized, the feature extractor, such as SAE, tends to select a larger transfer similarity and / or source domain fitting difference.
[0065] In one embodiment, the quotient of the source domain fitting difference and the sample length of the source domain sample data is the source domain fitting difference divided by the sample length of the source domain sample data, and the quotient obtained is used as the length source domain pseudo difference. Since the source domain fitting difference is related to the sample length of the operation, the larger the sample length, the larger the source domain fitting difference. Therefore, when calculating the source domain fitting difference, when the degree of fit between the source domain sample data before feature reconstruction and the source domain features after feature reconstruction is high, and the sample length is larger, the calculated source domain fitting difference may also be larger. In order to more accurately measure the degree of fit between the source domain features and the source domain sample data after feature reconstruction, the quotient of the source domain fitting difference and its sample length is calculated to obtain the length source domain pseudo difference, which can measure the error of each sample before and after feature reconstruction. The smaller the length source domain pseudo difference, the smaller the error of feature reconstruction averaged to each sample, which means that the degree of fit between the source domain sample data and the source domain features is greater. Since the function value of the source domain extraction function is positively correlated with the length source domain pseudo difference, when the length source domain pseudo difference is smaller, the function value of the source domain extraction function is smaller, which is conducive to selecting source domain features with smaller error of feature reconstruction averaged to each sample.
[0066] Furthermore, the source domain extraction function is shown in formula (3-1):
[0067]
[0068] In formula (3-1), Loss input_Xs represents the function value of the source domain extraction function, r pearson represents the migration similarity, represents the loss function value of SAE feature reconstruction using stacked autoencoder network, r i represents the similarity coefficient of the i-th parameter index, i = 1, 2, ..., n, l represents the sample length of the source domain sample data, x s represents the sample value of the source domain sample data, and d(e(x)) represents the data feature value after the stacked autoencoder network SAE reconstructs the feature of the source domain sample data.
[0069] Furthermore, the target domain extraction function is shown in formula (3-2):
[0070]
[0071] In formula (3-2), Loss input_Xt represents the function value of the target domain extraction function, r pearson represents the migration similarity, represents the loss function value of SAE feature reconstruction using stacked autoencoder network, r i represents the similarity coefficient of the i-th parameter index, i = 1, 2, ..., n, l2 represents the sample length of the target domain sample data, x t represents the sample value of the target domain sample data, d(e(x t )) represents the data feature value after the stacked autoencoder network SAE reconstructs the target domain sample data.
[0072] In one embodiment, the step of determining the model to be adjusted includes:
[0073] Determining the preset neural network model;
[0074] The preset neural network model is trained based on the source domain features, and model parameters are optimized based on a particle swarm optimization algorithm to obtain a model to be adjusted.
[0075] In this embodiment, in order to construct the model to be adjusted, a convolutional neural network, a recursive neural network or a generative adversarial network is determined as a preset neural network model according to actual needs, and then the preset neural network model is trained according to the extracted source domain features, and the model parameters are determined based on the particle swarm optimization algorithm in order to determine the optimal parameters to determine the final model to be adjusted, so that the model to be adjusted can predict the load more accurately.
[0076] Furthermore, when the model parameters are optimized based on the particle swarm optimization algorithm, the loss function of the model to be adjusted, the speed and position of the improved η-CPSO algorithm are shown in equations (4) and (5):
[0077]
[0078]
[0079] In formula (4) to formula (5), X s is the source domain sample data, l1 is the sample length of the source domain sample data, is the predicted value of the tugboat power load monitoring data in the source domain sample data, is the actual value of the tugboat power load monitoring data in the source domain sample data, c1 and c2 are learning factors, the values of r1, r2 and u are random numbers in the range of [0,1], and p id is the individual optimal position of the idth particle at time t, x id is the position of the idth particle at time t, p gd is the global optimal position, v id is the particle velocity, f is the chaos mapping function, α is the scale factor, η is the compression factor,
[0080] In one embodiment, based on the target domain characteristics, the step of training the model to be adjusted to obtain a load forecasting model includes:
[0081] Calculating a domain classification error between the source domain feature and the target domain feature;
[0082] Establishing a parameter adjustment objective function based on the domain classification error;
[0083] Through the target domain characteristics, the model to be adjusted is trained with the goal of minimizing the parameter adjustment objective function to determine the load forecasting model; wherein the function value of the parameter adjustment objective function is inversely correlated with the domain classification error.
[0084] In this embodiment, in order to improve the migration effect from the model to be adjusted to the load forecasting model, and thus improve the prediction accuracy of the load forecasting model, the domain classification error is used to calculate the parameter adjustment objective function in the training of the model to be adjusted. The parameter adjustment objective function is a function that measures the degree of loss of the model to be adjusted, and is trained with the goal of minimizing the function value of the parameter adjustment objective function. The function value of the parameter adjustment objective function is inversely correlated with the domain classification error. The larger the domain classification error, the higher the distribution alignment of the source domain features and the target domain features, and the better the migration effect. At this time, the function value of the parameter adjustment objective function is smaller. Therefore, minimizing the function value of the parameter adjustment objective function is conducive to improving the migration effect.
[0085] In one embodiment, based on the target domain characteristics, the step of training the model to be adjusted to obtain a load forecasting model includes:
[0086] Based on the target domain characteristics, the weight matrix of the model to be adjusted is iteratively calculated, and the model to be adjusted is trained with the goal of minimizing the parameter adjustment objective function to obtain the load forecasting model, and there is a positive correlation between the weight matrix and the function value of the parameter adjustment objective function.
[0087] In this embodiment, the weight matrix is the weight matrix of the second layer LSTM (long short-term memory recursive neural network) in the load forecasting model, which is used to map the source domain features to the target domain feature space. When predicting the migration of tugboat power load in the target domain, by adding the weight matrix to the parameter adjustment objective function of the prediction model of tugboat power load in multiple fields, the weight matrix of the second layer LSTM is updated with the goal of minimizing the function value of the parameter adjustment objective function, and the feature adaptation matrix A, i.e., the weight matrix, of each iteration step in the update process can be obtained. Furthermore, there is a positive correlation between the F norm of the weight matrix and the function value of the parameter adjustment objective function. In this way, adding the F norm of the weight matrix to the parameter adjustment objective function can achieve the attenuation of the model weight, which helps to reduce the model's dependence on training data, make the model more stable, and show better performance when facing new data.
[0088] In one embodiment, the parameter adjustment objective function is constructed by regression prediction error and MMD distribution distance, wherein the function value of the parameter adjustment objective function is positively correlated with the regression prediction error, and the function value of the parameter adjustment objective function is positively correlated with the MMD distribution distance. In this embodiment, the regression prediction error is the regression error between the predicted value and the actual value in the target domain sample data. When the regression prediction error is smaller, the target domain features extracted from the target domain sample data are used to adjust the parameters of the model to be adjusted, which is conducive to the load forecasting model after the adjustment to perform load forecasting more accurately. The MMD (maximum mean discrepancy) distribution distance is the MMD distance between the source domain features and the target domain features, which is the distance after the source domain features and the target domain features are mapped to the Hilbert space by the Gaussian kernel function. When the MMD distribution distance is smaller, it means that the distribution of the source domain features and the target domain features is more similar in the Hilbert space, and the effect of transfer learning is better. Since the function value of the parameter adjustment objective function is positively correlated with the MMD distribution distance, the smaller the MMD distribution distance, the better the effect of transfer learning, and the smaller the function value of the corresponding parameter adjustment objective function, therefore, minimizing the function value of the parameter adjustment objective function is conducive to improving the effect of transfer learning.
[0089] Furthermore, the calculation formula of the regression prediction error is shown in formula (6):
[0090]
[0091] In formula (6), Loss Xt is the regression prediction error, is the predicted value of the tugboat power load monitoring data in the target domain sample data, is the actual value of the tugboat power load monitoring data in the target domain sample data, and l2 is the sample length of the target domain sample data.
[0092] Furthermore, the calculation formula of MMD distribution distance is shown in formula (7):
[0093]
[0094] In formula (7), MMD 2 [X,Y] is the MMD distribution distance, x i Eigenvalues of source domain features, y i The characteristic value of the target domain feature, n is the number of samples of the source domain feature, m is the number of samples of the target domain feature, κ ω (·,·) is the weighted kernel function, d is the number of feature parameters, |r i| is the absolute value of the calculated Pearson correlation coefficient between the same feature parameters in the source domain and the target domain, κ(·,·) is the Gaussian kernel function, and κ(·,*) is obtained by selecting n different variance values and fusing multiple kernel functions using the ensemble average algorithm to obtain the ensemble optimization. The width parameters σ of multiple kernel functions are different. Each kernel function is calculated separately to obtain the value of each kernel function, and the average value of each kernel function value is calculated as the function value of the Gaussian kernel function κ(·,·). For example, 5 kernel functions are set, and the width parameters σ of the 5 kernel functions are 0.25, 0.5, 1, 2 and 4 respectively. The function values of the 5 kernel functions are calculated, and the function values of the 5 kernel functions are averaged as the function value of the Gaussian kernel function κ(·,·).
[0095] Furthermore, the calculation formula of domain classification error is shown in formula (8):
[0096]
[0097] In formula (8), L y (G y (G r (x i )) yi ,d i ) is the domain classification error, G y (G r (x i )) yi For data point x i Through a LSTM layer G r and a classification layer G y The classification results obtained are that the source domain label is 1 and the target domain label is 0.
[0098] Furthermore, the parameter adjustment objective function is shown in formula (9):
[0099]
[0100] In formula (9), Loss is the function value of the parameter adjustment objective function, MMD 2 [X,Y] is the MMD distribution distance, L y (G y (G r (x i )) yi ,d i ) is the domain classification error, λ is the regularization coefficient, is the quadratic norm of the adaptation matrix A.
[0101] In this embodiment, the improved η-CPSO optimization algorithm and transfer learning method are used to realize the construction of tugboat power load prediction pre-training model and transfer learning model based on LSTM neural network. The five-dimensional feature data of temperature, relative humidity, speed, ship draft and previous load monitoring data are comprehensively considered, and accurate tugboat power load prediction models are established under various working conditions, which greatly reduces the modeling cost.
[0102] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0103] Embodiment 2
[0104] In this embodiment, a method for constructing a load prediction model is provided, which includes:
[0105] Step 1: Use the feature weight allocation method and stacked autoencoder network (SAE) to perform preliminary alignment of feature distribution and data deep feature extraction on the source domain data and the target domain data, and obtain the deep features of the tugboat power load monitoring data after eliminating some differences in feature distribution between the source domain and target domain data.
[0106] Step 2: Train the η-CPSO-LSTM model based on the deep features of the source domain tugboat power load monitoring data in step S1 to obtain the optimal η-CPSO-LSTM model, that is, the transfer learning pre-training model.
[0107] Step 3: Use the source domain tugboat power load prediction pre-trained model as the target domain model migration benchmark, and use the parameter fine-tuning method to minimize the target domain power load monitoring data regression prediction error To minimize the MMD distance between the source domain and the target domain data and maximize the domain classification loss on the source domain and the target domain data As the goal, an adaptation matrix A is obtained that can further reduce the difference in domain feature distribution. At the same time, the feature adaptation matrix A is used as a regularization term in the loss function of the target domain migration prediction model to realize the target domain tugboat power load prediction.
[0108] Furthermore, step one includes:
[0109] S11, by calculating the Pearson correlation coefficient between different feature parameter data in the source domain and the target domain, the corresponding weight is assigned to the same feature parameter in different fields. The calculation method of the Pearson correlation coefficient between the same feature parameters in different fields is shown in formula (1):
[0110]
[0111] In formula (1), are the average value of a feature parameter data in the source domain and the average value of the corresponding feature parameter data in the target domain, respectively. i , Y i are the values corresponding to the i-th observation data in the two feature parameter data in the source domain and the target domain, respectively. In addition, when the lengths of the feature parameter data in the source domain and the target domain are inconsistent, in order to facilitate the calculation of the Pearson correlation coefficient value, the intermittent sampling method is also used to make the longer feature parameter data consistent with the shorter feature parameter data length. Assume that the calculated Pearson correlation coefficient values between the corresponding feature parameter data in the source domain and the target domain are r1, r2, …, r i , then the data similarity between the source domain and the target domain is defined as shown in formula (2):
[0112] r pearson =|r1|+|r2|+…+|r i | (2)
[0113] S12, the stacked autoencoder network is composed of multiple layers of sparse autoencoders, that is, the output of the hidden layer of the previous autoencoder is used as the input of the next autoencoder; the SAE structure of the stacked autoencoder network with 3 hidden layers is [7-3-7], the input layer includes 60 seconds of monitoring data of the actual power load of the leading tugboat at the operating point, the temperature, relative humidity, ship speed and draft data at the current operating point, a total of 5 dimensions, the number of neurons in the first hidden layer is 7, the number of neurons in the second hidden layer is 3, the number of neurons in the third hidden layer is 7, and the sample dimension of the output layer is 5.
[0114] S13, feature weight allocation and stacked autoencoder network SAE perform preliminary alignment of feature distribution and data feature extraction on source domain data and target domain data. By minimizing the objective function as shown in formula (3) through unsupervised learning, the deep features corresponding to the multi-domain tugboat power load monitoring data after the preliminary alignment of feature distribution can be obtained.
[0115]
[0116] In formula (3), l is the length of the data sample in the source domain or the target domain, x is the data sample in the source domain or the target domain, and d(e(x)) is the data sample representation after the stacked autoencoder network SAE feature reconstruction.
[0117] Furthermore, step 2 includes: optimizing the number of neurons, learning rate, batch size, dropout and number of cycles in the LSTM neural network using the η-CPSO optimization algorithm improved by the compression factor and the chaotic optimization mode to minimize the source domain power load forecasting result. As the goal, the optimal η-CPSO-LSTM model is obtained, that is, the transfer learning pre-training model. The loss function of the pre-training model and the speed and position update formulas of the improved η-CPSO algorithm are as follows:
[0118]
[0119]
[0120] In formula (4) to formula (5), X s is the source domain, l1 is the length of the source domain data sample, are the predicted value and actual value of the tugboat power load monitoring data in the source domain, c1 and c2 are learning factors, r1, r2 and u are random numbers in the range of [0,1], p id is the individual optimal position of the idth particle at time t, x id is the position of the idth particle at time t, p gd is the global optimal position, v id is the particle velocity, f is the chaos mapping function, α is the scale factor, η is the compression factor, In this embodiment, c1=c2=1.4.
[0121] Furthermore, in step 3, when migrating the target domain tugboat power load prediction model, the shallow parameters in the pre-trained model are frozen by the parameter fine-tuning method, and the regression prediction error of the target domain power load monitoring data is minimized in each iterative calculation. The goal is to minimize the MMD distance between the source domain and the target domain data and maximize the domain classification loss on the source domain and the target domain data. Minimize the loss function LOSS and update the pre-trained model parameters, and simultaneously give the weight matrix corresponding to the second LSTM layer in the model parameter update, that is, the feature adaptation matrix A at this time. Regression prediction error As shown in formula (6), the MMD distance between the source domain and target domain data is shown in formula (7), and the domain classification loss on the source domain and target domain data is shown in formula (8).
[0122]
[0123]
[0124]
[0125] In formula (7) to formula (8), X t is the target domain, l2 is the length of the target domain data sample, are the predicted value and actual value of the tugboat power load monitoring data in the target domain, n and m are the number of samples in the source domain and the target domain respectively, and κ ω (·,·) is the weighted kernel function, d is the number of feature parameters, |r i | is the absolute value of the calculated Pearson correlation coefficient between the same feature parameters in the source domain and the target domain, κ(·,·) is the Gaussian kernel function, and by selecting n different variance values and using the ensemble average algorithm to fuse multiple kernel functions, the integrated optimized kernel function κ is obtained s (·,·), the source domain label is 1, and the target domain label is 0. For data point x i Through a LSTM layer G r and a classification layer G y The classification results obtained.
[0126] Fusion regression prediction error MMD distance between source and target domain data, domain classification loss on source and target domain data The optimization objective of the transfer learning tugboat power load migration prediction by minimizing the F norm of the feature adaptation matrix A is shown in formula (9):
[0127]
[0128] In formula (9), λ is the regularization coefficient, is the square of the F-norm of the adaptation matrix A.
[0129] At the same time, under the mapping of the feature adaptation matrix A, the source domain data and the target domain data have a more similar feature distribution than after the feature distribution alignment in step S1, which is more helpful to build an accurate target domain tugboat power load prediction model.
[0130] Matrix A is the regression prediction error Loss Xt, MMD, domain classification loss are obtained in the error back propagation. The feature adaptation matrix A is used to map the features of the source domain to the feature space of the target domain. In actual operation, this matrix is the weight matrix of the second layer LSTM in the neural network of this case. In the target domain tugboat power load migration prediction, by adding it to the loss function of the multi-domain tugboat power load prediction model, taking the most loss function LOSS as the target, the weight matrix of the second layer LSTM is updated, and the feature adaptation matrix A of each iteration step in the update process can be obtained. At the same time, the F norm of the adaptation matrix A is added to the loss function LOSS to achieve the attenuation of the model weight. This helps to reduce the model's dependence on training data, make the model more stable, and show better performance when facing new data.
[0131] In one embodiment, the power load monitoring data of the tugboat under various working conditions are collected, and the data are preprocessed, and the training samples and the test samples are divided according to a certain ratio.
[0132] In one embodiment, the deep features of the monitoring data extracted by the SAE network under various working conditions are used as the input of the tugboat power load prediction model to train the model, wherein the baseline working condition data is used to establish a tugboat power load prediction pre-training model of the η-CPSO-LSTM neural network, and other working condition monitoring data are used to fine-tune the pre-training model parameters.
[0133] In one embodiment, the power load monitoring data is preprocessed, including: 3sigma data anomaly detection, sym8 wavelet threshold denoising, min-max data normalization processing; at the same time, it is also necessary to ensure that the sample size of the baseline operating condition monitoring data can meet the minimum sample requirement for accurately constructing the tugboat power load pre-training model, and the sample size of the baseline operating condition monitoring data >> the sample size of other operating condition monitoring data.
[0134] In this embodiment, the following advantages are achieved:
[0135] 1. The present invention utilizes a stacked autoencoder network, increases the depth of the hidden layer, and uses a back propagation algorithm to fine-tune the network parameters under the guidance of the error function, so that the entire network can better realize deep feature extraction of multi-condition monitoring data.
[0136] 2. The present invention uses an improved η-CPSO algorithm to optimize the hyperparameters of the pre-training model, so that the pre-training model constructed under the benchmark working conditions has higher accuracy and stronger generalization performance.
[0137] 3. The present invention uses the transfer learning method to fine-tune the parameters of the pre-training model of the tugboat power load under multiple working conditions, and can quickly build a high-precision prediction model for the tugboat power load under other working conditions with very few data samples.
[0138] 4. The present invention adds MMD distance and domain classification error L d The optimization function of the tugboat power load prediction model can effectively guide the neural network to better discover the common attributes of tugboat power load monitoring data from data collected under various working conditions, effectively reduce the inter-domain differences between different working conditions, and is extremely beneficial to improving the accuracy of the tugboat power load prediction model.
[0139] This embodiment uses the left main shaft power load monitoring data of a typical tugboat under various working conditions as the research object to elaborate on the implementation method of the present invention. The various working conditions of the tugboat involved include: working condition 1: left main shaft 750r / min full speed sailing test; working condition 2: left main shaft 534r / min medium speed sailing test; working condition 3: left main shaft 388r / min boost sailing. Figure 4 As shown, the present embodiment proposes a method for predicting the multi-operating-condition power load of a tugboat based on transfer learning, comprising the following steps:
[0140] S1. Collect the power load monitoring data of tugboats under various working conditions, perform data preprocessing, and divide the training samples and test samples according to a certain ratio. The multi-working condition tugboat power load monitoring data should at least include the characteristic parameters involved in Table 1 below.
[0141] Table 1 Characteristic parameters of tugboat power load monitoring data
[0142]
[0143] The power load monitoring data is preprocessed using 3sigma data anomaly detection, sym8 wavelet threshold denoising, and min-max data normalization methods; at the same time, it is also necessary to ensure that the sample size of the benchmark working condition monitoring data can meet the minimum sample requirements for the accurate construction of the tugboat power load pre-training model, and the sample size of the benchmark working condition monitoring data >> the sample size of other working condition monitoring data. In this embodiment, the data sampling rate is 1s / time, the data recording time under the benchmark working condition is not less than 5min, and the data recording time under other working conditions is not less than 30s. At the same time, the power load monitoring data training samples and test samples are divided at a ratio of 4:1, and working condition 1 is designated as the benchmark working condition.
[0144] S2. Establish a stacked autoencoder network SAE with 3 hidden layers and improve the loss function Loss input , used for deep feature extraction of multi-condition power load monitoring data.
[0145] From construction experience, it is known that the tugboat operating conditions, temperature at the operating point, relative humidity, ship speed, draft and the tugboat's past power load data are the key factors affecting the tugboat's power load at future times. Figure 5As shown, in step S2, the stacked autoencoder network is composed of multiple layers of sparse autoencoders, that is, the output of the hidden layer of the previous autoencoder is used as the input of the next autoencoder; the SAE structure of the stacked autoencoder network with 3 hidden layers is [7-3-7], the input layer includes the monitoring data of the actual power load of the leading tugboat for 60 seconds at the operating point, the temperature, relative humidity, ship speed and draft data at the current operating point, a total of 5 dimensions, the number of neurons in the first hidden layer is 7, the number of neurons in the second hidden layer is 3, the number of neurons in the third hidden layer is 7, and the sample dimension of the output layer is 7, where the improved loss function Loss under the baseline condition is input The effect of deep feature extraction of SAE power load monitoring data using stacked autoencoder network is shown in Figure 2. Figure 6a and Figure 6b As shown, compared with the unextracted power load monitoring data, the correlation between the extracted deep data features is significantly enhanced.
[0146] S3. Improved loss function Loss using multiple working conditions input The deep features of the monitoring data extracted by the SAE network are used as the input training model of the tugboat power load prediction model, among which the benchmark operating condition data is used to establish the tugboat power load prediction pre-training model of the improved η-CPSO-LSTM neural network, and other operating condition monitoring data are used to fine-tune the pre-training model parameters.
[0147] like Figure 7 As shown in the figure, the improved η-CPSO-LSTM neural network uses the chaotic optimization mode and compression factor to optimize the number of neurons, learning rate, batch size, dropout and number of cycles of the LSTM neural network in the pre-training model. The speed and position update formulas of the improved η-CPSO algorithm are as follows:
[0148] v id (t+1)=ηv id (t)+c1r1(t)[p id (t)-x id (t)]+c2r2(t)[p gd (t)-d(t)+αf(u(v id (t)))]
[0149] x id (t+1)=x id (t)+v id (t+1)
[0150] Where c1 and c2 are learning factors. In this embodiment, c1=c2=1.4. r1, r2 and u are random numbers in the range of [0,1]. id is the individual optimal position of the idth particle at time t, x idis the position of the idth particle at time t, p gd is the global optimal position, v id is the particle velocity, f is the chaos mapping function, α is the scale factor, η is the compression factor, At the same time, the number of hidden layers of the tugboat power load prediction model in this embodiment is 3, including 2 LSTM layers and one fully connected layer. The number of neurons of the benchmark working condition LSTM neural network after η-CPSO optimization is 90, the learning rate is 0.0804, the batch size is 260, the dropout is 0.2236 and the number of cycles is 610. The prediction results of the tugboat power load data are shown in Table 2. Figure 8 shown.
[0151] Table 2 Error evaluation index of tugboat power load prediction pre-training model
[0152]
[0153] From Table 2, Figure 8 The experimental results show that the accuracy of the tugboat power load prediction pre-training model after tuning the η-CPSO optimization algorithm model is greatly improved compared with the Grid Search method; in addition, establishing an accurate mapping relationship between tugboat power load monitoring data is also the primary prerequisite for the application of transfer learning. Therefore, the LSTM neural network pre-training model after the η-CPSO hyperparameter optimization of the present invention can be used as a benchmark for subsequent model migration.
[0154] At the same time, the parameters of the pre-trained model of the tugboat power load under the baseline operating condition can be partially reused when fine-tuning the models of other operating conditions. Specifically, in the fine-tuning model, the parameters involved in the first hidden layer are fixed, and the parameters involved in the last two hidden layers, namely the LSTM2 layer and the fully connected layer, participate in the back propagation in the neural network training to achieve parameter fine-tuning.
[0155] In addition, in step S4, five different σ values (0.25, 0.5, 1, 2, 4) are selected and their corresponding Gaussian kernel functions are calculated respectively. Then, the integrated average algorithm is used to fuse multiple kernel functions to obtain the final kernel function. The fusion formula is as follows:
[0156]
[0157] S4. Calculation of the MMD distance and domain classification error L between the deep features of the tugboat power load monitoring data under various working conditions after SAE network feature extraction y , the calculation formula is as follows:
[0158]
[0159]
[0160] Among them, n and m are the number of samples in the source domain and the target domain respectively, and κ ω (·,·) is the weighted kernel function, d is the number of feature parameters, |r i | is the absolute value of the calculated Pearson correlation coefficient between the same feature parameters in the source domain and the target domain, κ(·,·) is the Gaussian kernel function, and by selecting n different variance values and using the ensemble average algorithm to fuse multiple kernel functions, the integrated optimized kernel function κ is obtained s (·,·), the source domain label is 1, and the target domain label is 0. For data point x i Through a LSTM layer G r and a classification layer G y The classification results obtained.
[0161] S5. Fusion regression prediction error MMD distance between source and target domain data, domain classification loss on source and target domain data The optimization goal of the transfer learning tugboat power load migration prediction by minimizing the F norm of the feature adaptation matrix A is:
[0162]
[0163] in, X t is the target domain, l2 is the length of the target domain data sample, are the predicted value and actual value of the tugboat power load monitoring data in the target domain, respectively. When fine-tuning the transfer learning model, λ is taken as 0.5. At the same time, under the mapping of the feature adaptation matrix A, the source domain data and the target domain data have a more similar feature distribution than after the deep feature extraction in step S2, which is more helpful to build an accurate target domain tugboat power load prediction model. This embodiment takes working condition 3 as an example. After the optimization calculation in the above steps, the tugboat power load prediction effect of working condition 3 (data recording time 200s) is shown in Table 3. Fig. 9 shown.
[0164] Table 3 Error evaluation index of transfer learning tugboat power load prediction model
[0165]
[0166]
[0167] From Table 3, Fig. 9The experimental results show that transfer learning can significantly shorten the construction time of the tugboat power load prediction model under other working conditions. In the construction of a new learning or transfer learning tugboat power load prediction model, appropriately reducing the learning rate helps to improve the model prediction performance. However, no matter which model initialization method is used, transfer learning is more advantageous.
[0168] Embodiment 3
[0169] In this embodiment, a method for predicting power load is provided, which includes:
[0170] Step 110, obtaining monitoring data to be tested;
[0171] Step 120: Based on the load prediction model described in any of the above embodiments, load prediction is performed according to the monitoring data to be tested to obtain a load prediction result.
[0172] Embodiment 4
[0173] In this embodiment, Figure 2 As shown, a device for constructing a load forecasting model is provided, comprising:
[0174] The model to be adjusted module 210 is used to determine the model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features;
[0175] A target feature module 220, configured to determine a target domain feature according to an application environment; wherein the number of samples of the target domain feature is smaller than the number of samples of the source domain feature;
[0176] The model adjustment module 230 is used to train the model to be adjusted based on the target domain characteristics to obtain a load forecasting model.
[0177] In one embodiment, the device further comprises:
[0178] A migration similarity module is used to obtain source domain sample data and target domain sample data; calculate the similarity between the source domain sample data and the target domain sample data to obtain migration similarity;
[0179] A source domain extraction module, used to establish a source domain extraction function based on the migration similarity and / or the source domain sample data and the source domain reconstructed feature source domain fitting difference; with the minimization of the source domain extraction function as the goal, perform feature extraction on the source domain sample data to obtain the source domain feature; wherein the function value of the source domain extraction function is inversely correlated with the migration similarity, and the function value of the source domain extraction function is positively correlated with the source domain fitting difference;
[0180] and / or,
[0181] A target domain extraction module is used to establish a target domain extraction function based on the migration similarity and / or the target domain sample data and the target domain reconstructed features; with the minimization of the target domain extraction function as the goal, perform feature extraction on the target domain sample data to obtain the target domain features; wherein the function value of the target domain extraction function is inversely correlated with the migration similarity, and the function value of the target domain extraction function is positively correlated with the target domain fitting difference.
[0182] In one embodiment, the source domain extraction module is used to calculate the quotient of the source domain fitting difference and the sample length of the source domain sample data to obtain the length source domain quasi-difference; establish the source domain extraction function based on the migration similarity and / or the length source domain quasi-difference; wherein the function value of the source domain extraction function is positively correlated with the length source domain quasi-difference;
[0183] and / or,
[0184] The target domain extraction module is used to calculate the quotient of the target domain fitting difference and the sample length of the target domain sample data to obtain the length target domain quasi-difference; establish the source domain extraction function based on the migration similarity and / or the length target domain quasi-difference; wherein the function value of the target domain extraction function is positively correlated with the length target domain quasi-difference.
[0185] In one embodiment, the model adjustment module 230 is used to calculate the domain classification error between the source domain feature and the target domain feature; establish a parameter adjustment objective function based on the domain classification error; through the target domain feature, the model to be adjusted is trained with the goal of minimizing the parameter adjustment objective function to determine the load forecasting model; wherein the function value of the parameter adjustment objective function is inversely correlated with the domain classification error.
[0186] In one embodiment, the model adjustment module 230 is used to iteratively calculate the weight matrix of the model to be adjusted based on the target domain characteristics, train the model to be adjusted with the goal of minimizing the parameter adjustment objective function, and obtain the load forecasting model, and there is a positive correlation between the weight matrix and the function value of the parameter adjustment objective function.
[0187] In one embodiment, the model to be adjusted module 210 is used to determine the preset neural network model; train the preset neural network model based on the source domain characteristics, and optimize the model parameters based on the particle swarm optimization algorithm to obtain the model to be adjusted.
[0188] For the specific limitations of the load forecasting model construction device, please refer to the limitations of the load forecasting model construction method mentioned above, which will not be repeated here. Each unit in the above-mentioned load forecasting model construction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned units can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned units.
[0189] Embodiment 5
[0190] In this embodiment, a computer device is provided. Its internal structure diagram can be shown as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the non-volatile storage medium is deployed with a database, which is used to store a load forecasting model. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with other computer devices that deploy application software. When the computer program is executed by the processor, a method for constructing a load forecasting model is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0191] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0192] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for constructing a load forecasting model described in any of the above embodiments when executing the computer program.
[0193] Embodiment 6
[0194] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for constructing a load forecasting model described in any of the above embodiments are implemented.
[0195] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0196] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0197] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a load forecasting model, characterized in that: include: Determining a model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features; Determine the target domain feature according to the application environment; wherein the number of samples of the target domain feature is less than the number of samples of the source domain feature; Based on the target domain characteristics, the model to be adjusted is trained to obtain a load forecasting model.
2. The method according to claim 1, characterized in that Before determining the steps of the model to be adjusted, include: Obtain source domain sample data and target domain sample data; Calculating the similarity between the source domain sample data and the target domain sample data to obtain migration similarity; Before determining the steps of the model to be adjusted, include: Establishing a source domain extraction function based on the migration similarity and / or the source domain sample data and the source domain reconstructed features; Taking minimization of the source domain extraction function as a goal, feature extraction is performed on the source domain sample data to obtain the source domain feature; wherein the function value of the source domain extraction function is inversely correlated with the migration similarity, and the function value of the source domain extraction function is positively correlated with the source domain fitting difference; and / or, Establishing a target domain extraction function based on the migration similarity and / or the target domain fitting difference between the target domain sample data and the target domain reconstruction feature; With the minimization of the target domain extraction function as the goal, feature extraction is performed on the target domain sample data to obtain the target domain feature; wherein the function value of the target domain extraction function is inversely correlated with the migration similarity, and the function value of the target domain extraction function is positively correlated with the target domain fitting difference.
3. The method according to claim 2, characterized in that The step of establishing a source domain extraction function based on the migration similarity and / or the source domain fitting difference between the source domain sample data and the source domain reconstruction feature also includes: Calculating the quotient of the source domain fitting difference and the sample length of the source domain sample data to obtain the length source domain fitting difference; The source domain extraction function is established based on the migration similarity and / or the length source domain quasi-difference; wherein the function value of the source domain extraction function is positively correlated with the length source domain quasi-difference; and / or, The step of establishing a target domain extraction function based on the migration similarity and / or the target domain fitting difference between the target domain sample data and the target domain reconstruction feature also includes: Calculating the quotient of the target domain fitting difference and the sample length of the target domain sample data to obtain the length target domain fitting difference; The source domain extraction function is established based on the migration similarity and / or the length target domain quasi-difference; wherein the function value of the target domain extraction function is positively correlated with the length target domain quasi-difference.
4. The method according to claim 2, characterized in that: The step of training the model to be adjusted based on the target domain characteristics to obtain a load forecasting model includes: Calculating a domain classification error between the source domain feature and the target domain feature; Establishing a parameter adjustment objective function based on the domain classification error; Through the target domain characteristics, the model to be adjusted is trained with the goal of minimizing the parameter adjustment objective function to determine the load forecasting model; wherein the function value of the parameter adjustment objective function is inversely correlated with the domain classification error.
5. The method according to claim 1, characterized in that: The step of training the model to be adjusted based on the target domain characteristics to obtain a load forecasting model includes: Based on the target domain characteristics, the weight matrix of the model to be adjusted is iteratively calculated, and the model to be adjusted is trained with the goal of minimizing the parameter adjustment objective function to obtain the load forecasting model, and there is a positive correlation between the weight matrix and the function value of the parameter adjustment objective function.
6. The method according to claim 1, characterized in that The steps to determine the model to be adjusted include: Determining the preset neural network model; The preset neural network model is trained based on the source domain features, and model parameters are optimized based on a particle swarm optimization algorithm to obtain a model to be adjusted.
7. A method for predicting power load, characterized in that: include: Obtain the monitoring data to be tested; Based on the load prediction model described in any one of claims 1 to 6, load prediction is performed according to the monitoring data to be tested to obtain a load prediction result.
8. A device for constructing a load forecasting model, characterized in that: include: A model to be adjusted module, used to determine a model to be adjusted; wherein the model to be adjusted is obtained by training a preset neural network model based on source domain features; A target feature module, used to determine a target domain feature according to an application environment; wherein the number of samples of the target domain feature is smaller than the number of samples of the source domain feature; The model adjustment module is used to train the model to be adjusted based on the target domain characteristics to obtain a load forecasting model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
