Power grid side dynamic electrical carbon factor prediction method and device based on incremental learning

Through a method based on incremental learning, for the prediction of dynamic electricity carbon factors on the grid side, time stamp sequential classification and multiple trainings are used to update model weights, which solves the problem of insensitivity to current data in the existing technology and improves prediction accuracy and real-time properties, achieving more accurate power grid control.

CN118536670APending Publication Date: 2024-08-23GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410677487.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing grid-side dynamic electricity carbon factor prediction methods are insensitive to current data, resulting in low prediction accuracy, lack of real-time performance and accurate capture of dynamic electricity carbon factors.

Method used

An incremental learning-based method is adopted to obtain the current feature data of the area to be predicted, classify and train according to the timestamp order, update the model weights, and conduct multiple trainings combined with the timestamp information to enhance the model's sensitivity to the time series features of the data. , improve prediction accuracy.

Benefits of technology

The prediction accuracy and real-time performance of the dynamic electric carbon factor are improved, making the dynamic electric carbon factor prediction on the grid side more accurate and supporting more precise control strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536670A
    Figure CN118536670A
Patent Text Reader

Abstract

The invention discloses a power grid side dynamic electrical carbon factor prediction method and device based on incremental learning, relates to the field of carbon emission prediction regulation and control, and solves the technical problem that the prediction precision of a dynamic electrical carbon factor is not high due to the fact that an existing prediction method is not sensitive to current data. According to the first classification ratio, classifying the first feature data according to a timestamp sequence to obtain first training data and first prediction data; inputting the first training data into a first prediction model, and training according to a first training method to obtain a second prediction model; inputting the first training data into a second prediction model, and performing training according to a second training method in combination with timestamp information of the first training data to obtain a third prediction model; and inputting the first prediction data into a third prediction model to obtain a dynamic electrical carbon factor prediction value of the to-be-predicted area, so that the to-be-predicted area controls the plurality of power grid nodes according to the dynamic electrical carbon factor prediction value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of carbon emission prediction and control, and in particular to a method and device for predicting a dynamic electric carbon factor on a power grid side based on incremental learning. Background Art

[0002] With the continuous expansion of the scale of power systems, the increase in electricity demand and the growing global attention to sustainable development, the prediction and control of carbon emissions are becoming increasingly important. As an important evaluation indicator of the carbon emission level of power systems, the accurate prediction of the dynamic electric carbon factor can improve the accuracy and rationality of carbon emission regulation.

[0003] At present, some grid-side carbon factor prediction methods are mainly based on statistical models or basic machine learning algorithms, such as linear regression, ARIMA (autoregressive integrated moving average), support vector machine or artificial neural network, etc. These methods are difficult to capture the complex spatiotemporal relationship between the nodes of the power grid, resulting in low prediction accuracy and lack of real-time performance. At present, there are also some studies that try to use deep learning models to predict the dynamic carbon factor of the power grid, including but not limited to recurrent neural networks, long short-term memory networks and convolutional neural networks. Although these deep learning methods have improved the modeling ability of the spatiotemporal relationship between the nodes of the power grid, the accuracy of data processing of each node of the power grid is insufficient, and there is a lack of real-time performance and sensitivity to current data, resulting in low prediction accuracy of dynamic carbon factors, and then the accuracy of optimizing the power grid operation strategy based on the prediction results is lacking. Summary of the invention

[0004] The present invention provides a method and device for predicting a dynamic electric carbon factor on the power grid side based on incremental learning, so as to solve the technical problem that the existing prediction method is insensitive to current data, resulting in low prediction accuracy of the dynamic electric carbon factor.

[0005] In a first aspect, the present application provides a method for predicting a dynamic carbon factor of a power grid based on incremental learning, comprising:

[0006] Acquire current first characteristic data of the area to be predicted; wherein the first characteristic data includes respective grid-connected electrical data of a plurality of grid nodes in the area to be predicted;

[0007] According to a preset first classification ratio, the first feature data is classified in a timestamp order to obtain first training data and first prediction data;

[0008] Inputting the first training data into a preset first prediction model, training the first prediction model according to a preset first training method, updating the model weights during training, and obtaining a second prediction model; wherein the first prediction model is obtained by training with historical feature data of the area to be predicted;

[0009] Inputting the first training data into a second prediction model, training the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, updating the model weights during training, and obtaining a third prediction model;

[0010] The first prediction data is input into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

[0011] In this way, the current first characteristic data of the area to be predicted is first obtained, and then classified according to the first classification ratio in the order of timestamps, so that the timing characteristics of the first training data and the first prediction data can be more prominent, which is conducive to learning the timing characteristics of the data during subsequent model training, and then the first training data is input into the first prediction model for training to obtain the second prediction model, which can enable the model to learn the characteristics of the current data, and then train again according to the timestamp information of the first training data to obtain the third prediction model, which can enable the model to focus on learning the timing characteristics of the data and enhance the model's sensitivity to the time of the data. Therefore, when the dynamic electric carbon factor prediction value is predicted according to the first prediction data, the prediction accuracy of the dynamic electric carbon factor can be improved, so that the area to be predicted can be more accurately controlled according to the dynamic electric carbon factor prediction value.

[0012] Furthermore, before obtaining the current first feature data of the area to be predicted, the method further includes:

[0013] Obtain the current initial feature data of the area to be predicted;

[0014] Calculating, according to a preset first statistical feature determination method, a plurality of statistical feature values ​​corresponding to the initial feature data and the category of the initial feature data;

[0015] Cleaning the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data;

[0016] Normalizing the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data;

[0017] According to a preset time series processing method, the second preprocessed data is divided into a plurality of time series data according to a preset first time length, and then the plurality of time series data are aggregated to obtain the first feature data.

[0018] In this way, the initial feature data is first obtained, and then the initial feature data is cleaned and normalized according to multiple statistical feature values ​​calculated by the first statistical feature determination method. This can make the data more in line with the current task requirements, speed up the subsequent model training, and improve the effect of model training. The data is then processed in time series, divided into multiple time series data according to the first time length, and then aggregated to obtain the first feature data. This can convert the original data with weak time series features into data with strong time series features, which is beneficial to the subsequent model learning data's time series features.

[0019] Furthermore, the cleaning of the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data specifically includes:

[0020] Calculating a first deviation degree of each piece of the initial feature data according to the multiple statistical feature values;

[0021] Marking data in the initial feature data whose first deviation degree is greater than a first threshold value to obtain a plurality of abnormal data points;

[0022] The multiple abnormal data points are removed from the initial feature data to obtain first preprocessed data.

[0023] In this way, the first deviation degree is calculated according to multiple statistical characteristic values, and abnormal data points are marked and eliminated according to the first deviation degree, so that outliers can be eliminated in the data processing stage, avoiding the influence of outliers on the speed of model training and the accuracy of model prediction.

[0024] Furthermore, the step of inputting the first training data into a preset first prediction model, training the first prediction model according to a preset first training method, updating the model weights during training, and obtaining a second prediction model specifically includes:

[0025] Based on a preset first feature extraction method, converting the first training data into a plurality of first feature vectors;

[0026] Inputting the plurality of first feature vectors into the first prediction model, and training the model according to an incremental gradient descent method to obtain a trained first prediction model;

[0027] Inputting the preset first verification data into the trained first prediction model to obtain a first prediction result;

[0028] Verifying the first prediction result according to the first verification data to obtain a first verification result;

[0029] When the first verification result does not meet the preset standard, updating the first weight of the first prediction model, and training again until the first verification result meets the preset standard and the training is completed;

[0030] The first prediction model that has completed training is output as the second prediction model.

[0031] In this way, the first training data is first converted into multiple first feature vectors, and then input into the first prediction model. The trained model is obtained by training according to the incremental gradient descent method, which enables the model to learn the characteristics of the current data, and then predict and verify according to the first verification data. The first weights are updated and trained again according to the verification results, which can make the weights converge to the range required by the task, thereby obtaining a model that better meets the task requirements.

[0032] Furthermore, after inputting the first prediction data into the third prediction model to obtain the predicted value of the dynamic electric carbon factor of the area to be predicted, the method further includes:

[0033] Calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method;

[0034] Calculating a first error of a predicted value of the dynamic electric-carbon factor according to the observed value of the dynamic electric-carbon factor;

[0035] According to the first error, the first weight of the first prediction model is adjusted to obtain a first updated weight, and the first updated weight is used as the first weight of the current first prediction model.

[0036] In this way, the corresponding dynamic electric carbon factor observation value is calculated according to the first characteristic data, and then the first error of the dynamic electric carbon factor prediction value is calculated, and then the first weight is adjusted according to the first error. In this way, the weight of the model can be modified according to the actual observed value of the dynamic electric carbon factor, making the model more in line with the task requirements of dynamic electric carbon factor prediction.

[0037] Furthermore, the first training data is input into a second prediction model, and the second prediction model is trained according to a preset second training method in combination with the timestamp information of the first training data, and the model weight is updated during training to obtain a third prediction model, which specifically includes:

[0038] Based on a preset second feature extraction method, converting the first training data into a plurality of second feature vectors;

[0039] Obtaining a plurality of feature weights corresponding to the plurality of second feature vectors according to a maximum timestamp in the first training data and respective timestamps of the plurality of second feature vectors;

[0040] Combining the plurality of feature weights with the plurality of second feature vectors accordingly to obtain a plurality of third feature vectors;

[0041] Inputting the plurality of third feature vectors into the second prediction model, and training the model according to an incremental gradient descent method to obtain a trained second prediction model;

[0042] Inputting the preset second verification data into the trained second prediction model to obtain a second prediction result;

[0043] Verifying the second prediction result according to the second verification data to obtain a second verification result;

[0044] When the second verification result does not meet the preset standard, updating the second weight of the second prediction model, and training again until the second verification result meets the preset standard and the training is completed;

[0045] The second prediction model that has completed training is output as the third prediction model.

[0046] In this way, the first training data is first converted into multiple second eigenvectors, and then the feature weights are calculated according to the largest timestamp in the first training data and the timestamps of the multiple second eigenvectors, and then multiple third eigenvectors are obtained by combining them. This can increase the time series characteristics of the data, and then train the second prediction model according to the incremental gradient descent method, so that the model can learn the time series characteristics of the data more fully and enhance the model's time sensitivity to the data. Then, predictions are made and verified according to the second verification data, and the second weights are updated and trained again according to the verification results, so that the weights can converge to the range required for the task, thereby obtaining a model that better meets the needs of dynamic electro-carbon factor prediction.

[0047] In a second aspect, the present application provides a power grid-side dynamic electric carbon factor prediction device based on incremental learning, comprising a data acquisition module, a data classification module, a first training module, a second training module and a first prediction module;

[0048] The data acquisition module is used to acquire the current first characteristic data of the area to be predicted; wherein the first characteristic data includes the grid-connected electrical data of each of the multiple grid nodes in the area to be predicted;

[0049] The data classification module is used to classify the first feature data in a timestamp order according to a preset first classification ratio to obtain first training data and first prediction data;

[0050] The first training module is used to input the first training data into a preset first prediction model, train the first prediction model according to a preset first training method, update the model weight during training, and obtain a second prediction model; wherein the first prediction model is obtained by training the historical feature data of the area to be predicted;

[0051] The second training module is used to input the first training data into a second prediction model, train the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, update the model weight during training, and obtain a third prediction model;

[0052] The first prediction module is used to input the first prediction data into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

[0053] Furthermore, it also includes a data processing module; the data processing module includes an initial acquisition submodule, a feature determination submodule, a data cleaning submodule, a normalization processing submodule and a time series processing submodule;

[0054] The initial acquisition submodule is used to obtain the current initial feature data of the area to be predicted;

[0055] The feature determination submodule is used to calculate the initial feature data and a plurality of statistical feature values ​​corresponding to the category of the initial feature data according to a preset first statistical feature determination method;

[0056] The data cleaning submodule is used to clean the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data;

[0057] The normalization processing submodule is used to perform normalization processing on the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data;

[0058] The time series processing submodule is used to divide the second pre-processed data into multiple time series data according to a preset first time length according to a preset time series processing method, and then aggregate the multiple time series data to obtain first feature data.

[0059] Further, the data cleaning submodule includes a deviation calculation unit, an abnormality marking unit and a data screening unit;

[0060] The deviation calculation unit is used to calculate a first deviation degree of each piece of data of the initial feature data according to the multiple statistical feature values;

[0061] The abnormal marking unit is used to mark the data in the initial feature data whose first deviation degree is greater than a first threshold value, so as to obtain a plurality of abnormal data points;

[0062] The data screening unit is used to remove the multiple abnormal data points from the initial feature data to obtain first preprocessed data.

[0063] Further, the first training module includes a first extraction submodule, a first training submodule, a first prediction submodule, a first verification submodule, a first update submodule and a first output submodule;

[0064] The first extraction submodule is used to convert the first training data into a plurality of first feature vectors based on a preset first feature extraction method;

[0065] The first training submodule is used to input the plurality of first feature vectors into the first prediction model, and perform training according to an incremental gradient descent method to obtain a trained first prediction model;

[0066] The first prediction submodule is used to input the preset first verification data into the trained first prediction model to obtain a first prediction result;

[0067] The first verification submodule is used to verify the first prediction result according to the first verification data to obtain a first verification result;

[0068] The first updating submodule is used to update the first weight of the first prediction model when the first verification result does not meet the preset standard, and to perform training again until the training is completed when the first verification result meets the preset standard;

[0069] The first output submodule is used to output the trained first prediction model as the second prediction model.

[0070] Furthermore, it also includes a feedback update module; the feedback update module includes an observation calculation submodule, an error calculation submodule and a weight update submodule;

[0071] The observation calculation submodule is used to calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method;

[0072] The error calculation submodule is used to calculate the first error of the dynamic electric carbon factor prediction value according to the dynamic electric carbon factor observation value;

[0073] The weight updating submodule is used to adjust the first weight of the first prediction model according to the first error to obtain a first updated weight, and use the first updated weight as the first weight of the current first prediction model.

[0074] Further, the second training module includes a second extraction submodule, a weight determination submodule, a feature combination submodule, a second training submodule, a second prediction submodule, a second verification submodule, a second update submodule and a second output submodule;

[0075] The second extraction submodule is used to convert the first training data into a plurality of second feature vectors based on a preset second feature extraction method;

[0076] The weight determination submodule is used to obtain a plurality of feature weights corresponding to the plurality of second feature vectors according to the maximum timestamp in the first training data and the timestamps of the plurality of second feature vectors;

[0077] The feature combination submodule is used to combine the multiple feature weights with the multiple second feature vectors to obtain multiple third feature vectors;

[0078] The second training submodule is used to input the plurality of third feature vectors into the second prediction model, and perform training according to the incremental gradient descent method to obtain a trained second prediction model;

[0079] The second prediction submodule is used to input the preset second verification data into the trained second prediction model to obtain a second prediction result;

[0080] The second verification submodule is used to verify the second prediction result according to the second verification data to obtain a second verification result;

[0081] The second updating submodule is used to update the second weight of the second prediction model when the second verification result does not meet the preset standard, and to perform training again until the training is completed when the second verification result meets the preset standard;

[0082] The second output submodule is used to output the trained second prediction model as the third prediction model.

[0083] In this way, the current first characteristic data of the area to be predicted is first obtained, and then classified according to the first classification ratio in the order of timestamps, so that the timing characteristics of the first training data and the first prediction data can be more prominent, which is conducive to learning the timing characteristics of the data during subsequent model training, and then the first training data is input into the first prediction model for training to obtain the second prediction model, which can enable the model to learn the characteristics of the current data, and then train again according to the timestamp information of the first training data to obtain the third prediction model, which can enable the model to focus on learning the timing characteristics of the data and enhance the model's sensitivity to the time of the data. Therefore, when the dynamic electric carbon factor prediction value is predicted according to the first prediction data, the prediction accuracy of the dynamic electric carbon factor can be improved, so that the area to be predicted can be more accurately controlled according to the dynamic electric carbon factor prediction value. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 : A flow chart of an embodiment of a method for predicting a dynamic carbon factor of a power grid side based on incremental learning provided by the present invention;

[0085] Figure 2 : A module structure diagram of an embodiment of a grid-side dynamic electric carbon factor prediction device based on incremental learning provided by the present invention. DETAILED DESCRIPTION

[0086] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0087] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, unless otherwise clearly and specifically defined, "multiple" and "several" mean two or more.

[0088] Embodiment 1

[0089] See also Figure 1 , a method for predicting a dynamic carbon factor of a power grid side based on incremental learning is provided in an embodiment of the present invention, comprising steps S101 to S105, each of which is specifically as follows:

[0090] Step S101: Acquire the current first characteristic data of the area to be predicted; wherein the first characteristic data includes the respective grid-connected electrical data of a plurality of grid nodes within the area to be predicted.

[0091] Furthermore, before obtaining the current first feature data of the area to be predicted, the method further includes:

[0092] Obtain the current initial feature data of the area to be predicted;

[0093] Calculating, according to a preset first statistical feature determination method, a plurality of statistical feature values ​​corresponding to the initial feature data and the category of the initial feature data;

[0094] Cleaning the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data;

[0095] Normalizing the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data;

[0096] According to a preset time series processing method, the second preprocessed data is divided into a plurality of time series data according to a preset first time length, and then the plurality of time series data are aggregated to obtain the first feature data.

[0097] In an optional embodiment, the categories of the multiple statistical feature values ​​include mean μ, standard deviation σ, maximum value max(D raw ) and minimum value min(D raw ).

[0098] In an optional embodiment, the normalizing the first preprocessed data according to the multiple characteristic values ​​to obtain the second preprocessed data specifically includes:

[0099] Selecting each of the first pre-processed data in turn as current processing data;

[0100] According to a preset normalization processing method, the data values ​​corresponding to each category of the currently processed data are normalized according to the maximum value and the minimum value to obtain second preprocessed data;

[0101] The normalization processing method is specifically as follows:

[0102]

[0103] Among them, D norm (t) is the specific value of the data after normalization, D raw (t) is the original data value, max(D raw ) is the maximum value of a certain category of data in the initial feature data, min(D raw ) is the minimum value of a certain category of data in the initial feature data.

[0104] In an optional embodiment, the aggregating the multiple time series data to obtain the first feature data is specifically:

[0105] D sequence (h)=Aggregate(D norm (t));

[0106] Among them, D sequence (h) is the data after time series processing, Aggregate is the data aggregation operation, and h is the first time length.

[0107] In an optional embodiment, the preferred value of the first duration is 1 hour.

[0108] In this way, the initial feature data is first obtained, and then the initial feature data is cleaned and normalized according to multiple statistical feature values ​​calculated by the first statistical feature determination method. This can make the data more in line with the current task requirements, speed up the subsequent model training, and improve the effect of model training. The data is then processed in time series, divided into multiple time series data according to the first time length, and then aggregated to obtain the first feature data. This can convert the original data with weak time series features into data with strong time series features, which is beneficial to the subsequent model learning data's time series features.

[0109] Furthermore, the cleaning of the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data specifically includes:

[0110] Calculating a first deviation degree of each piece of the initial feature data according to the multiple statistical feature values;

[0111] Marking data in the initial feature data whose first deviation degree is greater than a first threshold value to obtain a plurality of abnormal data points;

[0112] The multiple abnormal data points are removed from the initial feature data to obtain first preprocessed data.

[0113] In an optional embodiment, the first deviation degree of each piece of data of the initial feature data is calculated according to the multiple statistical feature values, specifically:

[0114] According to the multiple statistical feature values, and in accordance with a preset first deviation calculation method, multiple initial deviation degrees corresponding to each category of each piece of data in the initial feature data are calculated, and the maximum value of the multiple initial deviation degrees is used as the first deviation degree of the corresponding data;

[0115] The first deviation calculation method is specifically:

[0116]

[0117] in, is the initial deviation degree, D raw (t) is the specific value of the original data currently calculated in the current category, μ is the mean corresponding to the currently calculated category, σ is the standard deviation corresponding to the currently calculated category, and k is the deviation coefficient.

[0118] In an optional embodiment, the preferred value of the first threshold is 1.

[0119] In this way, the first deviation degree is calculated according to multiple statistical characteristic values, and abnormal data points are marked and eliminated according to the first deviation degree, so that outliers can be eliminated in the data processing stage, avoiding the influence of outliers on the speed of model training and the accuracy of model prediction.

[0120] Step S102: Classify the first feature data in timestamp order according to a preset first classification ratio to obtain first training data and first prediction data.

[0121] Step S103: input the first training data into a preset first prediction model, train the first prediction model according to a preset first training method, update the model weights during training, and obtain a second prediction model; wherein the first prediction model is obtained by training with historical feature data of the area to be predicted.

[0122] In an optional embodiment, the first prediction model is obtained by training the historical characteristic data of the area to be predicted, specifically:

[0123] The first prediction model is obtained by training the historical feature data of the area to be predicted through a convolutional neural network combined with an attention mechanism;

[0124] The forward calculation formula of the convolutional neural network and the attention mechanism is specifically:

[0125]

[0126] A CNN (i, j, k) = ReLU(Z CNN (i, j, k));

[0127]

[0128] A Output(i,j,k) =Sigmoid(O Attention(i,j,k) );

[0129] Among them, Z CNN (i, j, k) is the linear combination output of the convolutional layer at position (i, j, k); W CNN (m, n, p) is the weight of the convolution kernel, and its size is M×N×P; X input (i+m-1, j+n-1, k+p-1) is the value of the input feature map at position (i+m-1, j+n-1, k+p-1); b CNN is the convolution bias value; M, N, P are the depth, width and height of the convolution kernel respectively; A CNN (i, j, k) is the activation output of the convolutional layer at position (i, j, k); ReLU is the activation function; Attention (i, j, k) is the weighted sum output of the attention mechanism at position (i, j, k); W Attention (m, n, p) is the weight of the attention mechanism, with a size of M×N×P; A CNN(i+m-1, j+n-1, k+p-1) is the activation output of the convolutional layer at position (i+m-1, j+n-1, k+p-1); M, N, P are the depth, width and height of the attention mechanism respectively; A Output (i, j, k) is the final activation output of the output layer at position (i, j, k); Sigmoid is the gated activation function;

[0130] The loss function of the convolutional neural network is specifically:

[0131]

[0132] Among them, L MSE is the mean square error, N is the number of samples, y i , are the true value of the sample and the predicted value of the sample respectively.

[0133] Furthermore, the step of inputting the first training data into a preset first prediction model, training the first prediction model according to a preset first training method, updating the model weights during training, and obtaining a second prediction model specifically includes:

[0134] Based on a preset first feature extraction method, converting the first training data into a plurality of first feature vectors;

[0135] Inputting the plurality of first feature vectors into the first prediction model, and training the model according to an incremental gradient descent method to obtain a trained first prediction model;

[0136] Inputting the preset first verification data into the trained first prediction model to obtain a first prediction result;

[0137] Verifying the first prediction result according to the first verification data to obtain a first verification result;

[0138] When the first verification result does not meet the preset standard, updating the first weight of the first prediction model, and training again until the first verification result meets the preset standard and the training is completed;

[0139] The first prediction model that has completed training is output as the second prediction model.

[0140] In an optional embodiment, the updating of the first weight of the first prediction model is specifically:

[0141]

[0142] Among them, θ new ,θ old are the first weight after update and the first weight before update respectively, α is the learning rate, is the gradient of the loss function with respect to the parameters.

[0143] In this way, the first training data is first converted into multiple first feature vectors, and then input into the first prediction model. The trained model is obtained by training according to the incremental gradient descent method, which enables the model to learn the characteristics of the current data, and then predict and verify according to the first verification data. The first weights are updated and trained again according to the verification results, which can make the weights converge to the range required by the task, thereby obtaining a model that better meets the task requirements.

[0144] Step S104: input the first training data into the second prediction model, train the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, update the model weights during training, and obtain a third prediction model.

[0145] Furthermore, the first training data is input into a second prediction model, and the second prediction model is trained according to a preset second training method in combination with the timestamp information of the first training data, and the model weight is updated during training to obtain a third prediction model, which specifically includes:

[0146] Based on a preset second feature extraction method, converting the first training data into a plurality of second feature vectors;

[0147] Obtaining a plurality of feature weights corresponding to the plurality of second feature vectors according to a maximum timestamp in the first training data and respective timestamps of the plurality of second feature vectors;

[0148] Combining the plurality of feature weights with the plurality of second feature vectors accordingly to obtain a plurality of third feature vectors;

[0149] Inputting the plurality of third feature vectors into the second prediction model, and training the model according to an incremental gradient descent method to obtain a trained second prediction model;

[0150] Inputting the preset second verification data into the trained second prediction model to obtain a second prediction result;

[0151] Verifying the second prediction result according to the second verification data to obtain a second verification result;

[0152] When the second verification result does not meet the preset standard, updating the second weight of the second prediction model, and training again until the second verification result meets the preset standard and the training is completed;

[0153] The second prediction model that has completed training is output as the third prediction model.

[0154] In an optional embodiment, the feature weight is specifically:

[0155]

[0156] Among them, W real-time (t) is the feature weight at time t corresponding to the current second feature vector, α is the preset weight coefficient, t max is the largest timestamp in the first training data.

[0157] In an optional embodiment, verifying the second prediction result according to the second verification data to obtain the second verification result specifically includes:

[0158] The second verification result includes the accuracy of the second prediction model;

[0159] The accuracy of the second prediction model is specifically:

[0160]

[0161] Among them, RMSE is the root mean square error, N is the number of samples, and y i , are the true value of the sample and the predicted value of the sample respectively.

[0162] In this way, the first training data is first converted into multiple second eigenvectors, and then the feature weights are calculated according to the largest timestamp in the first training data and the timestamps of the multiple second eigenvectors, and then multiple third eigenvectors are obtained by combining them. This can increase the time series characteristics of the data, and then train the second prediction model according to the incremental gradient descent method, so that the model can learn the time series characteristics of the data more fully and enhance the model's time sensitivity to the data. Then, predictions are made and verified according to the second verification data, and the second weights are updated and trained again according to the verification results, so that the weights can converge to the range required for the task, thereby obtaining a model that better meets the needs of dynamic electro-carbon factor prediction.

[0163] Step S105: input the first prediction data into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

[0164] Furthermore, after inputting the first prediction data into the third prediction model to obtain the predicted value of the dynamic electric carbon factor of the area to be predicted, the method further includes:

[0165] Calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method;

[0166] Calculating a first error of a predicted value of the dynamic electric-carbon factor according to the observed value of the dynamic electric-carbon factor;

[0167] According to the first error, the first weight of the first prediction model is adjusted to obtain a first updated weight, and the first updated weight is used as the first weight of the current first prediction model.

[0168] In an optional embodiment, the first error is specifically:

[0169] Error=C final (t)-C observed (t);

[0170] Among them, Error, C final (t), C observed (t) are the first error, the observed value of the dynamic electric carbon factor, and the predicted value of the dynamic electric carbon factor, respectively.

[0171] In an optional embodiment, adjusting the first weight of the first prediction model according to the first error to obtain a first updated weight is specifically:

[0172]

[0173] Among them, θ updated ,θ current are the first updated weight and the first unupdated weight respectively, η is the learning rate, is the gradient of the first error with respect to the weight.

[0174] In this way, the corresponding dynamic electric carbon factor observation value is calculated according to the first characteristic data, and then the first error of the dynamic electric carbon factor prediction value is calculated, and then the first weight is adjusted according to the first error. In this way, the weight of the model can be modified according to the actual observed value of the dynamic electric carbon factor, making the model more in line with the task requirements of dynamic electric carbon factor prediction.

[0175] The present invention first obtains the current first feature data of the area to be predicted, and classifies them according to the first classification ratio in the order of timestamps, so that the timing characteristics of the first training data and the first prediction data are more prominent, which is beneficial to learning the timing characteristics of the data during subsequent model training. The first training data is then input into the first prediction model for training to obtain the second prediction model, which enables the model to learn the characteristics of the current data. The third prediction model is then trained again according to the timestamp information of the first training data, which enables the model to focus on learning the timing characteristics of the data and enhance the model's sensitivity to the time of the data. Therefore, when the dynamic electric-carbon factor prediction value is predicted according to the first prediction data, the prediction accuracy of the dynamic electric-carbon factor can be improved, so that the area to be predicted can be more accurately controlled according to the dynamic electric-carbon factor prediction value.

[0176] Embodiment 2

[0177] See also Figure 2 , a grid-side dynamic electric carbon factor prediction device based on incremental learning provided by an embodiment of the present invention, comprising a data acquisition module 210, a data classification module 220, a first training module 230, a second training module 240 and a first prediction module 250;

[0178] The data acquisition module 210 is used to acquire the current first characteristic data of the area to be predicted; wherein the first characteristic data includes the grid-connected electrical data of each of the multiple grid nodes in the area to be predicted;

[0179] The data classification module 220 is used to classify the first feature data in a timestamp order according to a preset first classification ratio to obtain first training data and first prediction data;

[0180] The first training module 230 is used to input the first training data into a preset first prediction model, train the first prediction model according to a preset first training method, update the model weight during training, and obtain a second prediction model; wherein the first prediction model is obtained by training the historical feature data of the area to be predicted;

[0181] The second training module 240 is used to input the first training data into a second prediction model, train the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, update the model weight during training, and obtain a third prediction model;

[0182] The first prediction module 250 is used to input the first prediction data into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

[0183] Furthermore, it also includes a data processing module 260; the data processing module includes an initial acquisition submodule, a feature determination submodule, a data cleaning submodule, a normalization processing submodule and a time series processing submodule;

[0184] The initial acquisition submodule is used to obtain the current initial feature data of the area to be predicted;

[0185] The feature determination submodule is used to calculate the initial feature data and a plurality of statistical feature values ​​corresponding to the category of the initial feature data according to a preset first statistical feature determination method;

[0186] The data cleaning submodule is used to clean the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data;

[0187] The normalization processing submodule is used to perform normalization processing on the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data;

[0188] The time series processing submodule is used to divide the second pre-processed data into multiple time series data according to a preset first time length according to a preset time series processing method, and then aggregate the multiple time series data to obtain first feature data.

[0189] Further, the data cleaning submodule includes a deviation calculation unit, an abnormality marking unit and a data screening unit;

[0190] The deviation calculation unit is used to calculate a first deviation degree of each piece of data of the initial feature data according to the multiple statistical feature values;

[0191] The abnormal marking unit is used to mark the data in the initial feature data whose first deviation degree is greater than a first threshold value, so as to obtain a plurality of abnormal data points;

[0192] The data screening unit is used to remove the multiple abnormal data points from the initial feature data to obtain first preprocessed data.

[0193] Further, the first training module 230 includes a first extraction submodule 231, a first training submodule 232, a first prediction submodule 233, a first verification submodule 234, a first update submodule 235 and a first output submodule 236;

[0194] The first extraction submodule 231 is used to convert the first training data into a plurality of first feature vectors based on a preset first feature extraction method;

[0195] The first training submodule 232 is used to input the plurality of first feature vectors into the first prediction model, and perform training according to the incremental gradient descent method to obtain a trained first prediction model;

[0196] The first prediction submodule 233 is used to input the preset first verification data into the trained first prediction model to obtain a first prediction result;

[0197] The first verification submodule 234 is used to verify the first prediction result according to the first verification data to obtain a first verification result;

[0198] The first updating submodule 235 is used to update the first weight of the first prediction model when the first verification result does not meet the preset standard, and perform training again until the first verification result meets the preset standard and the training is completed;

[0199] The first output submodule 236 is used to output the trained first prediction model as the second prediction model.

[0200] Furthermore, it also includes a feedback update module 270; the feedback update module includes an observation calculation submodule, an error calculation submodule and a weight update submodule;

[0201] The observation calculation submodule is used to calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method;

[0202] The error calculation submodule is used to calculate the first error of the dynamic electric carbon factor prediction value according to the dynamic electric carbon factor observation value;

[0203] The weight updating submodule is used to adjust the first weight of the first prediction model according to the first error to obtain a first updated weight, and use the first updated weight as the first weight of the current first prediction model.

[0204] Further, the second training module 240 includes a second extraction submodule 241, a weight determination submodule 242, a feature combination submodule 243, a second training submodule 244, a second prediction submodule 245, a second verification submodule 246, a second update submodule 247 and a second output submodule 248;

[0205] The second extraction submodule 241 is used to convert the first training data into a plurality of second feature vectors based on a preset second feature extraction method;

[0206] The weight determination submodule 242 is used to obtain a plurality of feature weights corresponding to the plurality of second feature vectors according to the maximum timestamp in the first training data and the timestamps of the plurality of second feature vectors;

[0207] The feature combination submodule 243 is used to combine the plurality of feature weights with the plurality of second feature vectors to obtain a plurality of third feature vectors;

[0208] The second training submodule 244 is used to input the plurality of third feature vectors into the second prediction model, and perform training according to the incremental gradient descent method to obtain a trained second prediction model;

[0209] The second prediction submodule 245 is used to input the preset second verification data into the trained second prediction model to obtain a second prediction result;

[0210] The second verification submodule 246 is used to verify the second prediction result according to the second verification data to obtain a second verification result;

[0211] The second updating submodule 247 is used to update the second weight of the second prediction model when the second verification result does not meet the preset standard, and perform training again until the training is completed when the second verification result meets the preset standard;

[0212] The second output submodule 248 is used to output the trained second prediction model as the third prediction model.

[0213] In this way, the current first characteristic data of the area to be predicted is first obtained, and then classified according to the first classification ratio in the order of timestamps, so that the timing characteristics of the first training data and the first prediction data can be more prominent, which is conducive to learning the timing characteristics of the data during subsequent model training, and then the first training data is input into the first prediction model for training to obtain the second prediction model, which can enable the model to learn the characteristics of the current data, and then train again according to the timestamp information of the first training data to obtain the third prediction model, which can enable the model to focus on learning the timing characteristics of the data and enhance the model's sensitivity to the time of the data. Therefore, when the dynamic electric-carbon factor prediction value is predicted according to the first prediction data, the prediction accuracy of the dynamic electric-carbon factor can be improved, so that the area to be predicted can be more accurately controlled according to the dynamic electric-carbon factor prediction value.

[0214] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for predicting dynamic carbon factor of power grid side based on incremental learning, characterized in that: include: Acquire current first characteristic data of the area to be predicted; wherein the first characteristic data includes respective grid-connected electrical data of a plurality of grid nodes in the area to be predicted; According to a preset first classification ratio, the first feature data is classified in a timestamp order to obtain first training data and first prediction data; Inputting the first training data into a preset first prediction model, training the first prediction model according to a preset first training method, updating the model weights during training, and obtaining a second prediction model; wherein the first prediction model is obtained by training with historical feature data of the area to be predicted; Inputting the first training data into a second prediction model, training the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, updating the model weights during training, and obtaining a third prediction model; The first prediction data is input into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

2. According to claim 1, a method for predicting the dynamic carbon factor of the power grid side based on incremental learning is characterized in that: Before obtaining the current first feature data of the area to be predicted, the method further includes: Obtain the current initial feature data of the area to be predicted; Calculating, according to a preset first statistical feature determination method, a plurality of statistical feature values ​​corresponding to the initial feature data and the category of the initial feature data; Cleaning the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data; Normalizing the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data; According to a preset time series processing method, the second preprocessed data is divided into a plurality of time series data according to a preset first time length, and then the plurality of time series data are aggregated to obtain the first feature data.

3. According to claim 2, a method for predicting the dynamic carbon factor of the power grid side based on incremental learning is characterized in that: The cleaning of the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data specifically includes: Calculating a first deviation degree of each piece of the initial feature data according to the multiple statistical feature values; Marking data in the initial feature data whose first deviation degree is greater than a first threshold value to obtain a plurality of abnormal data points; The multiple abnormal data points are removed from the initial feature data to obtain first preprocessed data.

4. According to a method for predicting the dynamic carbon factor of the power grid side based on incremental learning according to claim 1, it is characterized in that: The step of inputting the first training data into a preset first prediction model, training the first prediction model according to a preset first training method, updating the model weights during training, and obtaining a second prediction model specifically includes: Based on a preset first feature extraction method, converting the first training data into a plurality of first feature vectors; Inputting the plurality of first feature vectors into the first prediction model, and training the model according to an incremental gradient descent method to obtain a trained first prediction model; Inputting the preset first verification data into the trained first prediction model to obtain a first prediction result; Verifying the first prediction result according to the first verification data to obtain a first verification result; When the first verification result does not meet the preset standard, updating the first weight of the first prediction model, and training again until the first verification result meets the preset standard and the training is completed; The first prediction model that has completed training is output as the second prediction model.

5. A method for predicting the dynamic carbon factor of the power grid side based on incremental learning according to claim 4, characterized in that: After inputting the first prediction data into the third prediction model to obtain the predicted value of the dynamic electric carbon factor of the area to be predicted, the method further includes: Calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method; Calculating a first error of a predicted value of the dynamic electric-carbon factor according to the observed value of the dynamic electric-carbon factor; According to the first error, the first weight of the first prediction model is adjusted to obtain a first updated weight, and the first updated weight is used as the first weight of the current first prediction model.

6. A method for predicting the dynamic carbon factor of the power grid side based on incremental learning according to claim 1, characterized in that: The inputting the first training data into the second prediction model, training the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, updating the model weights during training, and obtaining the third prediction model specifically includes: Based on a preset second feature extraction method, converting the first training data into a plurality of second feature vectors; Obtaining a plurality of feature weights corresponding to the plurality of second feature vectors according to a maximum timestamp in the first training data and respective timestamps of the plurality of second feature vectors; Combining the plurality of feature weights with the plurality of second feature vectors accordingly to obtain a plurality of third feature vectors; Inputting the plurality of third feature vectors into the second prediction model, and training the model according to an incremental gradient descent method to obtain a trained second prediction model; Inputting the preset second verification data into the trained second prediction model to obtain a second prediction result; Verifying the second prediction result according to the second verification data to obtain a second verification result; When the second verification result does not meet the preset standard, updating the second weight of the second prediction model, and training again until the second verification result meets the preset standard and the training is completed; The second prediction model that has completed training is output as the third prediction model.

7. A grid-side dynamic carbon factor prediction device based on incremental learning, characterized in that: It includes a data acquisition module, a data classification module, a first training module, a second training module and a first prediction module; The data acquisition module is used to acquire the current first characteristic data of the area to be predicted; wherein the first characteristic data includes the grid-connected electrical data of each of the multiple grid nodes in the area to be predicted; The data classification module is used to classify the first feature data in a timestamp order according to a preset first classification ratio to obtain first training data and first prediction data; The first training module is used to input the first training data into a preset first prediction model, train the first prediction model according to a preset first training method, update the model weight during training, and obtain a second prediction model; wherein the first prediction model is obtained by training the historical feature data of the area to be predicted; The second training module is used to input the first training data into a second prediction model, train the second prediction model according to a preset second training method and in combination with the timestamp information of the first training data, update the model weight during training, and obtain a third prediction model; The first prediction module is used to input the first prediction data into the third prediction model to obtain a dynamic electric carbon factor prediction value of the area to be predicted, so that the area to be predicted controls the multiple power grid nodes according to the dynamic electric carbon factor prediction value.

8. A grid-side dynamic electric carbon factor prediction device based on incremental learning according to claim 7, characterized in that: It also includes a data processing module; the data processing module includes an initial acquisition submodule, a feature determination submodule, a data cleaning submodule, a normalization processing submodule and a time series processing submodule; The initial acquisition submodule is used to obtain the current initial feature data of the area to be predicted; The feature determination submodule is used to calculate the initial feature data and a plurality of statistical feature values ​​corresponding to the category of the initial feature data according to a preset first statistical feature determination method; The data cleaning submodule is used to clean the initial feature data according to the multiple statistical feature values ​​to obtain first preprocessed data; The normalization processing submodule is used to perform normalization processing on the first preprocessed data according to the multiple characteristic values ​​to obtain second preprocessed data; The time series processing submodule is used to divide the second pre-processed data into multiple time series data according to a preset first time length according to a preset time series processing method, and then aggregate the multiple time series data to obtain first feature data.

9. A grid-side dynamic electric carbon factor prediction device based on incremental learning according to claim 8, characterized in that: The data cleaning submodule includes a deviation calculation unit, an abnormal marking unit and a data screening unit; The deviation calculation unit is used to calculate a first deviation degree of each piece of data of the initial feature data according to the multiple statistical feature values; The abnormal marking unit is used to mark the data in the initial feature data whose first deviation degree is greater than a first threshold value, so as to obtain a plurality of abnormal data points; The data screening unit is used to remove the multiple abnormal data points from the initial feature data to obtain first preprocessed data.

10. The device for predicting the dynamic carbon factor of the power grid side based on incremental learning according to claim 7, characterized in that: The first training module includes a first extraction submodule, a first training submodule, a first prediction submodule, a first verification submodule, a first update submodule and a first output submodule; The first extraction submodule is used to convert the first training data into a plurality of first feature vectors based on a preset first feature extraction method; The first training submodule is used to input the plurality of first feature vectors into the first prediction model, and perform training according to an incremental gradient descent method to obtain a trained first prediction model; The first prediction submodule is used to input the preset first verification data into the trained first prediction model to obtain a first prediction result; The first verification submodule is used to verify the first prediction result according to the first verification data to obtain a first verification result; The first updating submodule is used to update the first weight of the first prediction model when the first verification result does not meet the preset standard, and to perform training again until the training is completed when the first verification result meets the preset standard; The first output submodule is used to output the trained first prediction model as the second prediction model.

11. A power grid side dynamic electric carbon factor prediction device based on incremental learning according to claim 10, characterized in that: It also includes a feedback update module; the feedback update module includes an observation calculation submodule, an error calculation submodule and a weight update submodule; The observation calculation submodule is used to calculate the dynamic electric carbon factor observation value of the area to be predicted corresponding to the first characteristic data according to a preset first calculation method; The error calculation submodule is used to calculate the first error of the dynamic electric carbon factor prediction value according to the dynamic electric carbon factor observation value; The weight updating submodule is used to adjust the first weight of the first prediction model according to the first error to obtain a first updated weight, and use the first updated weight as the first weight of the current first prediction model.

12. A grid-side dynamic electric carbon factor prediction device based on incremental learning according to claim 7, characterized in that: The second training module includes a second extraction submodule, a weight determination submodule, a feature combination submodule, a second training submodule, a second prediction submodule, a second verification submodule, a second update submodule and a second output submodule; The second extraction submodule is used to convert the first training data into a plurality of second feature vectors based on a preset second feature extraction method; The weight determination submodule is used to obtain a plurality of feature weights corresponding to the plurality of second feature vectors according to the maximum timestamp in the first training data and the timestamps of the plurality of second feature vectors; The feature combination submodule is used to combine the multiple feature weights with the multiple second feature vectors to obtain multiple third feature vectors; The second training submodule is used to input the plurality of third feature vectors into the second prediction model, and perform training according to the incremental gradient descent method to obtain a trained second prediction model; The second prediction submodule is used to input the preset second verification data into the trained second prediction model to obtain a second prediction result; The second verification submodule is used to verify the second prediction result according to the second verification data to obtain a second verification result; The second updating submodule is used to update the second weight of the second prediction model when the second verification result does not meet the preset standard, and to perform training again until the training is completed when the second verification result meets the preset standard; The second output submodule is used to output the trained second prediction model as the third prediction model.

Citation Information

Cited By

  • Neurogenetic disease recognition model construction method and system

    CN122117342A