A Method, System and Device for Power Grid Operation Decision Analysis Based on Machine Learning

By using multi-layer gated cycle units in the grid operation decision analysis to improve the autoregression model, combined with the trend increment module and the improved killer predation algorithm, the problem of unconsidered time impact in the forecasting of power demand is solved, and higher prediction accuracy and nonlinear relationship capture capabilities are achieved.

CN118350568BActive Publication Date: 2025-05-27STATE GRID FUJIAN ELECTRIC POWER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410309198.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2025-05-27
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

The existing grid operation decision analysis method does not consider the time impact in the power demand forecast, resulting in poor generalization capabilities of the model, low prediction accuracy, and inability to capture nonlinear relationships.

Method used

Multi-layer gated loop unit is used to improve the autoregressive model, and the trend increment modules of periodic feature functions and event feature functions are connected in parallel to establish a fusion prediction model. The median of the absolute residual value is used as the loss function, and the orcas predation algorithm is improved through the Levi flight principle to perform hyperparameter optimization.

Benefits of technology

It improves the accuracy and robustness of power demand prediction, can better capture nonlinear relationships, and enhances the learning ability and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118350568B_ABST
    Figure CN118350568B_ABST
Patent Text Reader

Abstract

The present invention provides a power grid operation decision analysis method, system and device based on machine learning, relating to the technical field of data processing. The method includes: acquiring historical power grid operation data; constructing a trend increment module; constructing an improved autoregressive model with multiple layers of gated recurrent units, and connecting the trend increment module and the improved autoregressive model in parallel to obtain a fusion prediction model; training the fusion prediction model and performing hyperparameter optimization with the goal of minimizing the loss function; acquiring real-time power grid operation data; inputting the real-time power grid operation data into the trained fusion prediction model to output a power prediction sequence; determining an error propagation coefficient that is positively correlated with the prediction duration of the fusion power feature sequence, and calculating the total power dispatch within a preset duration in combination with the error propagation coefficient and the instantaneous power demand; and performing power dispatch according to the instantaneous power demand and the total power dispatch. The influence of error propagation in the prediction process is reduced, and the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly to a power grid operation decision analysis method, system and device based on machine learning. Background Art

[0002] Power grid operation decision analysis based on machine learning refers to using machine learning technology to process power grid operation data, and through model training and prediction, assisting power grid managers to make effective decisions to ensure the safe, stable and efficient operation of the power grid. In this method, historical power grid operation data is first collected and sorted out, and then machine learning algorithms are used to analyze and model these data to discover the rules and patterns in the data. Commonly used machine learning algorithms include neural networks, decision trees, support vector machines, etc. Through the analysis and modeling of historical data, a model for predicting future power grid operation conditions can be trained. These models can predict future power demands, possible faults and problems, and future power supply situations. By analyzing these prediction results, power grid managers can make corresponding decisions, such as adjusting power production plans, maintaining equipment, adjusting power supply strategies, etc., to cope with possible problems and ensure the normal operation of the power grid.

[0003] Power grid operation decision analysis based on machine learning can help power grid managers better understand the power grid operation situation, timely discover and solve problems, improve the reliability and stability of the power grid, and at the same time can also improve the efficiency of the power grid and the level of energy conservation and emission reduction.

[0004] However, the current power grid operation decision analysis method does not consider the power demand change data affected by time during the prediction process of power demand, resulting in a poor generalization ability of the finally trained prediction model, low prediction accuracy, the predicted power demand not being able to meet the actual power demand, and the currently used prediction model can only capture the linear relationship in historical data and cannot learn the complex non-linear relationship of power demand data, comprehensively leading to the problem of low prediction accuracy of power demand. Summary of the Invention

[0005] In order to solve the technical problem existing in the prior art that the current power grid operation decision analysis method does not consider the power demand change data affected by time during the prediction process of power demand, resulting in a poor generalization ability of the finally trained prediction model, low prediction accuracy, the predicted power demand not being able to meet the actual power demand, and the currently used prediction model can only capture the linear relationship in historical data and cannot learn the complex non-linear relationship of power demand data, comprehensively leading to the low prediction accuracy of power demand, the present invention provides a power grid operation decision analysis method, system and device based on machine learning.

[0006] The technical solutions provided by the embodiments of the present invention are as follows:

[0007] In the first aspect

[0008] A machine learning-based power grid operation decision analysis method provided by an embodiment of the present invention includes:

[0009] S1: Obtain historical power grid operation data;

[0010] S2: Construct a trend increment module with periodic feature functions and event feature functions of power operation data;

[0011] S3: Construct an improved autoregressive model with multiple layers of gated recurrent units, and connect the trend increment module and the improved autoregressive model in parallel to obtain a fusion prediction model;

[0012] S4: Establish a loss function by combining the median of the absolute value of the residuals, where the residuals are the differences between the actual values and the predicted values;

[0013] S5: Introduce the Levy flight principle to improve the orca predation algorithm, input the historical power grid operation data as training data into the fusion prediction model to train the fusion prediction model, and use the improved orca predation algorithm to optimize the hyperparameters of the fusion prediction model with the goal of minimizing the loss function;

[0014] S6: Obtain real-time power grid operation data;

[0015] S7: Input the real-time power grid operation data into the trained fusion prediction, and output a power prediction sequence, where the fusion power prediction sequence includes multiple instantaneous power demand quantities;

[0016] S8: Determine an error propagation coefficient that is positively correlated with the prediction duration of the fusion power feature sequence, and calculate the total power dispatch within a preset duration by combining the error propagation coefficient and the instantaneous power demand quantity;

[0017] S9: Perform power dispatch according to the instantaneous power demand quantity and the total power dispatch.

[0018] In the second aspect

[0019] A machine learning-based power grid operation decision analysis system provided by an embodiment of the present invention includes:

[0020] A processor;

[0021] A memory, on which computer-readable instructions are stored. When the computer-readable instructions are executed by the processor, the machine learning-based power grid operation decision analysis method as described in the first aspect is implemented.

[0022] In the third aspect

[0023] An equipment for power grid operation decision-making analysis based on machine learning provided by an embodiment of the present invention, which includes the method for power grid operation decision-making analysis based on machine learning as described in the first aspect.

[0024] The beneficial effects brought by the technical solution provided by the embodiment of the present invention at least include:

[0025] (1) In the present invention, by replacing the neurons of the traditional autoregressive model with a multi-layer gated recurrent unit that can fully capture non-linear data relationships, an improved autoregressive model is obtained, and a trend increment module with a periodic feature function and an event feature function of power operation data is established. The two are connected in parallel, simultaneously making up for the shortcomings of the autoregressive model in inaccurately capturing periodic and event data changes and being unable to capture non-linear data relationships, and improving the prediction accuracy of the obtained fusion prediction model. In addition, in order to avoid the error propagation problem caused by directly summing instantaneous power demands, an error propagation coefficient that is positively correlated with the prediction duration of the fused power feature sequence is introduced to correct the error of each instantaneous power demand, further improving the prediction accuracy of the fusion prediction model.

[0026] (2) In the present invention, a loss function is established based on the median of the absolute values of the residuals, so that most suitable values make most of the residuals fall within the threshold range, avoiding overfitting of the model training caused by historical abnormal data during the training process, and improving the prediction accuracy and the applicable range of the final model. In addition, the orca predation algorithm is improved based on the Levy flight principle to perform hyperparameter optimization on the fusion prediction model in combination with the loss function, increasing the diversity and global exploration ability of hyperparameter search. By simulating the step size distribution of Levy flight, the search space can be better explored, and it is more likely to avoid local optimal solutions, obtain better hyperparameters, and also improve the convergence speed during the optimization process, maintaining better learning ability and generalization ability of the fusion prediction model, and further improving the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0028] Figure 1 It is a schematic flow chart of a method for power grid operation decision-making analysis based on machine learning provided by an embodiment of the present invention;

[0029] Figure 2 It is a schematic structural diagram of a fusion prediction model provided by an embodiment of the present invention;

[0030] Figure 3 This is a schematic structural diagram of a power grid operation decision - making analysis system based on machine learning provided by an embodiment of the present invention. Detailed implementation manners

[0031] The following will describe the technical solutions in the present invention with reference to the accompanying drawings.

[0032] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as an "example" in the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of the word "example" is intended to present concepts in a specific manner. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two.

[0033] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when not emphasizing their differences, the meanings they express are the same. "Of", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be noted that when not emphasizing their differences, the meanings they express are the same.

[0034] In the embodiments of the present invention, sometimes subscripts such as W 1 may be miswritten as non - subscript forms such as W1. When not emphasizing their differences, the meanings they express are the same.

[0035] To make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments.

[0036] Refer to the attached specification Figure 1 , which shows a schematic flowchart of a power grid operation decision - making analysis method based on machine learning provided by an embodiment of the present invention.

[0037] The embodiments of the present invention provide a power grid operation decision - making analysis method based on machine learning. This method can be implemented by a power grid operation decision - making analysis device based on machine learning. The power grid operation decision - making analysis device based on machine learning can be a terminal or a server. The processing flow of the power grid operation decision - making analysis method based on machine learning can include the following steps:

[0038] S1: Obtain historical power grid operation data.

[0039] Among them, the historical power grid operation data mainly includes power demand data at various time periods, moments, and events. These data are the results of sampling or recording power demand within different time periods, and are used to reflect the load conditions of the power system at different time points.

[0040] The power demand data for each time period reflects the overall power demand of the power grid system within different time periods. For example, the power demand during the day, night, weekdays, weekends, etc. each day, and also includes periodic power demand. The power demand data at moments records the power demand of the power grid system at each specific moment (such as every hour, every 15 minutes, every minute, etc.), and is used to analyze the seasonal, periodic, and other change laws of power demand. The power demand data for events records the changes in power demand related to specific events, such as the impact of holidays, sudden weather changes, large-scale events, etc. on power demand.

[0041] These historical power grid operation data will be used to construct prediction models and decision-making analyses to support the operation decisions and dispatching arrangements of the power grid system. By analyzing the patterns and trends in the historical data, future power demand can be better predicted, and corresponding operation strategies can be formulated to ensure the stable operation and efficient operation of the power grid system.

[0042] S2: Construct a trend increment module with periodic feature functions and event feature functions of power operation data.

[0043] It should be noted that a trend increment module is constructed using periodic feature functions and event feature functions to extract the periodic and event features in the power operation data and transform them into a form that can be utilized by the prediction model, thereby more accurately predicting future power demand. The trend increment module is introduced to adjust the predicted values, and this adjustment can avoid the error propagation problem caused by directly summing the instantaneous power demand, thereby improving the robustness and prediction accuracy of the model.

[0044] In a possible implementation manner, S2 specifically includes:

[0045] S201: Establish a periodic feature function based on Fourier terms according to the different periods of power operation data:

[0046]

[0047]

[0048] Among them, S(τ) represents the periodic feature function, S p($\tau$) represents the periodic characteristic sub-function at the prediction step $\tau$, $p$ represents the period duration, $P$ represents the set of period durations, $k$ represents the number of Fourier terms at the period duration, $j$ represents the indicator parameter of the number of Fourier terms, $a$ j and $b$ j represent the sine term coefficient and cosine term coefficient of the $j$-th Fourier term respectively.

[0049] Optionally, $p = 365.25$ and $k = 6$ per year; $p = 7$ and $k = 3$ per week; $p = 1$ and $k = 6$ per day.

[0050] S202: According to the different event items, establish an event characteristic function in the form of binary variables:

[0051]

[0052] Among them, $E(t)$ represents the event characteristic function, $E$ represents the set of events at time $t$, $z$ e represents the power demand impact coefficient of event $e$.

[0053] S203: Combine the periodic characteristic function and the event characteristic function to construct a basic trend increment function:

[0054]

[0055] Among them, $c$ i , $i = 1, 2, \ldots n$ c represents the set of slope change points $n$ c , and represent the $i$-th slope change point $c$ i and the slope change point $c$ i-1 corresponding time respectively, represents the basic trend increment function within the time period , $k$ represents the slope within the time period , $m$ represents the offset within the time period .

[0056] S205: Use the periodic characteristic function and the event characteristic function as factors of the basic trend increment function to construct a trend increment module:

[0057]

[0058] Among them, represents the trend increment module within the time period , that is, the trend increment prediction value.

[0059] Specifically, according to different periods of power operation data (such as years, weeks, days), use Fourier terms to construct periodic feature functions. Fourier transform is a commonly used signal analysis method that can decompose a signal into a superposition of sine and cosine functions of different frequencies. Here, by setting different periodic durations and the number of Fourier terms, periodic feature functions suitable for different periods can be obtained. According to events in the power operation data (such as holidays, weather changes, etc.), construct event feature functions in the form of binary variables. These functions can capture the impact of events on power demand and play corresponding roles in the prediction model, adjusting the sensitivity of the model to events and periods, and thus improving prediction accuracy. Combine the periodic feature functions and event feature functions to construct basic trend increment functions. These functions can reflect the trends and changes in the power operation data and provide important inputs for subsequent prediction models. Use the periodic feature functions and event feature functions as factors of the basic trend increment functions to construct a trend increment module. This module takes the trend increment prediction value as the output, providing richer feature information for the prediction model, thereby improving the accuracy and robustness of the prediction.

[0060] Refer to Figure 2 , which shows a schematic structural diagram of a fusion prediction model provided by an embodiment of the present invention.

[0061] Figure 2 In it, the symbol “+” represents summation. Compared with traditional shallow models, the improved autoregressive model with multiple gated recurrent units can better learn the deep features in the time series by adding multiple hidden layers, thereby improving prediction performance. The input of each layer is the last p observed values of the time series. These observed values are processed by the gated recurrent unit, which can effectively capture the long-term dependencies in the sequence. The output of each hidden layer undergoes a non-linear transformation through the ReLU activation function and then is passed to the next layer. The structure of multiple stacked gated recurrent unit layers, each layer contains a gated recurrent unit and a ReLU activation function. This structure can effectively learn the complex features in the time series and improve the prediction performance of the model. The last layer outputs a prediction sequence of length h without using an activation function transformation. The trend increment module is connected in parallel to the improved autoregressive model as an auxiliary module of the sum value, and is summed with the prediction result of the improved autoregressive model according to the time series, so as to more accurately obtain the accurate prediction value at each future moment.

[0062] S3: Construct an improved autoregressive model with multiple gated recurrent units, and connect the trend increment module and the improved autoregressive model in parallel to obtain a fusion prediction model.

[0063] Among them, the gated recurrent unit is an improved recurrent neural network structure with stronger memory and long-term dependence modeling capabilities. This improvement enables the model to better capture non-linear data relationships and improves the prediction performance of the model. The autoregressive model is a statistical model used for time series prediction. It predicts future observations based on past observations of the time series. This model assumes that the observation at the current moment is related to the observations at several previous moments, and this correlation can be described by a linear regression model. By constructing an improved autoregressive model with multiple layers of gated recurrent units and connecting it in parallel with the trend increment module, a fusion prediction model is obtained. This fusion prediction model can comprehensively consider the periodic and event characteristics of historical data, as well as the long-term linear and non-linear dependencies learned by the autoregressive model, thereby improving the accurate prediction ability of electricity demand.

[0064] In a possible implementation, the fusion prediction model further includes an input module and an output module. The input module is respectively connected to the trend increment module and the improved autoregressive model, and the output module is respectively connected to the trend increment module and the improved autoregressive model.

[0065] S3 specifically includes:

[0066] S301: Construct an improved autoregressive model with multiple layers of gated recurrent units:

[0067] a 1 = f a (L 1 ([y t-p ,...,y t-1 ))

[0068] a i = f a (L i (a i-1 )),i ∈ [2,..., l - 1]

[0069] A t (t), A t (t + 1),..., A t (t + h - 1) = D l (a l-1 )

[0070] Among them, D l represents the l-th layer of gated recurrent units, a i represents the output value of the i-th layer of gated recurrent units, f a () represents the ReLU activation function, L i () represents the input of the i-th layer of gated recurrent units, L 1 ([y t-p ,..., y t-1) represents the input L of the first-layer gated recurrent unit 1 () are the last p observed values y of the observed time series (0, t) t-j , j ∈ (1, p), t represents the current moment, h represents the prediction value output length of the improved autoregressive model, A t (t + ο), ο ∈ (0, h - 1) represents the predicted value at time t + ο;

[0071] S302: Connect the trend increment module and the improved autoregressive model in parallel, that is, sum the predicted value of the improved autoregressive model and the trend increment predicted value of the trend increment module to obtain a fusion prediction model:

[0072]

[0073] Among them, R represents the fusion predicted value of the fusion prediction model.

[0074] It should be noted that by connecting the improved autoregressive model and the trend increment module in parallel, the fusion prediction model can simultaneously consider the information of historical time series data and the periodic and event-based trend changes. This comprehensive consideration enables the model to more comprehensively capture various changes and laws in the power grid operation data, thereby improving the prediction accuracy. The improved autoregressive model adopts multiple layers of gated recurrent units, which can better capture the non-linear relationships in the sequence data and has stronger modeling ability compared with the traditional autoregressive model. This improvement enables the model to more accurately predict the change trend of the power grid operation data.

[0075] S4: Establish a loss function in combination with the median of the absolute value of the residual.

[0076] Among them, the residual is the difference between the actual value and the predicted value.

[0077] It should be noted that using the median of the absolute value of the residual as the measurement standard of the loss function is more robust. The median is a statistic in the dataset and is not affected by outliers. Therefore, using the median as the loss function can reduce the interference of outliers on model training and make the model more robust.

[0078] In a possible implementation manner, the loss function is specifically:

[0079]

[0080]

[0081] Among them, represents the loss function between the actual value y and the predicted value ; The median of the absolute value of the residuals between the actual value and the predicted value is denoted as, β represents the intermediate variable, and the symbol "||" represents taking the absolute value.

[0082] Specifically, when the absolute value of the difference between the predicted value and the true value is less than or equal to the intermediate variable, the loss function is equivalent to the mean squared error; when the absolute value of the difference is greater than the intermediate variable, the loss function switches to the linear absolute error. This design enables the loss function to fit smoothly like the MSE for smaller errors and adopt the form of MAE for larger errors, thereby reducing the impact of outliers. Outliers may cause the model to learn incorrect patterns, introducing bias. The model tends to be sensitive to outliers and ignores other data points. The intermediate variable is set as a multiple of the median absolute deviation of the residuals between the actual value and the predicted value. Taking three times the median absolute deviation as the threshold makes most of the residuals fall within the appropriate range of the threshold, avoiding overfitting in the model training due to historical abnormal data and improving the prediction accuracy of the final model.

[0083] S5: Introduce the Lévy flight principle to improve the orca predation algorithm. Input the historical power grid operation data as training data into the fusion prediction model to train the fusion prediction model, and aim to minimize the loss function. Use the improved orca predation algorithm to perform hyperparameter optimization on the fusion prediction model.

[0084] Among them, the Lévy flight principle stems from the study of animal movement behavior in biology. This principle describes the movement pattern of animals when searching for food or migrating. By simulating this behavior, the search space can be better explored, increasing the global exploration ability of the algorithm. The Lévy flight principle is characterized by long-distance step lengths and random directions, which is conducive to jumping out of local optima. The orca predation algorithm is a heuristic optimization algorithm based on the group predation behavior of orcas in nature. In the traditional orca predation algorithm, each orca individual can only search the solution space within a fixed range. After introducing the Lévy flight principle, the individuals can move more flexibly, increasing the search range and diversity of the algorithm.

[0085] The Lévy flight principle enables the algorithm to better explore the search space, thus increasing the global search ability of the algorithm, which helps to find the global optimal solution rather than just the local optimal solution. By simulating the fast movement pattern of animals, the algorithm can converge to the vicinity of the optimal solution faster, thereby reducing the search time and the number of iterations. The randomness and diversity of the Lévy flight principle make the algorithm easier to jump out of local optima and avoid being trapped in the dilemma of local optima.

[0086] In summary, the orca predation algorithm improved by introducing the Lévy flight principle has the advantages of enhanced global search ability, fast convergence, and immunity to local optima, and can effectively improve the performance and efficiency of the optimization algorithm.

[0087] In a possible implementation, the hyperparameters specifically include the lag order, learning rate, and sliding window size of the improved autoregressive model.

[0088] Among them, the lag order is the number of historical time steps used for prediction in the autoregressive model. This parameter determines the amount of historical data that the model can consider and has an important impact on the performance of the model.

[0089] S5 specifically includes:

[0090] S501: Initialize the algorithm parameters of the improved orca hunting algorithm. Among them, the algorithm parameters include the population size and the maximum number of iterations.

[0091] S502: Generate an initial orca population. Among them, each orca represents a candidate hyperparameter.

[0092] S503: Calculate the update step size and update direction of the improved orca hunting algorithm in combination with the Levy flight principle:

[0093] w = A / |B| 1 / λ , 0 < λ ≤ 2, A ~ N(0, σ 2 ), B ~ N(0, σ 2 )

[0094]

[0095] Among them, w represents the update step size, σ represents the update direction, λ represents the Levy flight index, Γ() represents the gamma function, and both A and B represent random variables that conform to the Gaussian distribution with a value range of (0, σ 2 ).

[0096] S504: Combine the update step size and update direction to perform the driving stage and the encircling stage for each orca.

[0097] In a possible implementation, S504 specifically includes:

[0098] S504A: Combine the update step size and update direction to update the current position and current speed of each orca to complete the driving stage;

[0099] S504B: Randomly select three orcas to update the positions of the orcas to complete the encircling stage:

[0100]

[0101] ξ = 2 × (randn - 1 / 2) × (Maxrep - t) / Maxrep

[0102] Among them, It represents the position of the $i$-th orca in the $u$-th dimension at the current iteration $t$. They respectively represent the positions of the first randomly selected orca, the second randomly selected orca, and the third randomly selected orca. $\xi$ represents a random variable, and $\text{randn}$ represents a random number following a normal distribution. $\text{Maxrep}$ represents the maximum number of iterations.

[0103] S505: Combine with the deterministic Lévy flight wandering function, and update the orca position by combining the Lévy flight wandering function and the encirclement result.

[0104] In a possible implementation manner, S505 specifically includes:

[0105] S505A: Establish the Lévy flight wandering function $Le(w)$ by combining the update step size and the update direction:

[0106]

[0107] S505B: Establish the orca position update function according to the Lévy flight wandering function:

[0108]

[0109] Among them, It represents the new position of the orca at the end of the current iteration $t$. It represents the central position of the orca at the current iteration $t$, and $z$ t It represents the real-time position of the orca at the current iteration $t$.

[0110] S505C: Update the orca position using the orca position update function.

[0111] S506: Determine the optimal orca position through the fitness function.

[0112] S507: Retain the optimal orca position as the optimal hyperparameter.

[0113] Specifically, first, we need to initialize the parameters of the killer whale predation algorithm, including the population size and the maximum number of iterations. Then, we generate an initial population of killer whales, where each killer whale represents a candidate combination of hyperparameters, which may include different values of the lag order, learning rate, and sliding window size. Using the Lévy flight principle, we calculate the update step size and update direction for each killer whale to move in the search space. This step ensures that the killer whales can maintain a certain degree of randomness and diversity during the search process, helping to jump out of local optima. During the herding phase and the encircling phase, based on the calculated update step size and update direction, we perform herding and encircling operations on each killer whale. The herding operation aims to move the killer whale individuals to new positions, while the encircling operation aims to accelerate convergence and find better solutions. By combining the Lévy flight wandering function and the encircling results, we update the positions of the killer whales. This process involves calculating new positions and updating the state of the killer whale population for the next iteration. Finally, through the fitness function, we determine the optimal position of the killer whale, that is, the position with the best combination of hyperparameters. Ultimately, we use the hyperparameters corresponding to the found optimal killer whale position as the final model hyperparameters and use them to train the fusion prediction model.

[0114] This hyperparameter optimization method based on the improved killer whale predation algorithm can effectively improve the performance and prediction accuracy of the fusion prediction model, while avoiding the limitations of conventional methods such as grid search, such as being vulnerable to problems like fixed search spaces and randomness limitations.

[0115] S6: Obtain real-time power grid operation data.

[0116] Among them, the real-time power grid operation data includes the power grid operation data at the current moment and multiple historical power grid operation data observations before the current moment. This is the data basis for prediction. The fusion prediction model analyzes the real-time power grid operation data, fits linear and nonlinear relationships, and obtains more accurate prediction results.

[0117] S7: Input the real-time power grid operation data into the trained fusion prediction model and output the power prediction sequence.

[0118] Among them, the fusion power prediction sequence includes multiple instantaneous power demand quantities.

[0119] It is understandable that real-time power grid operation data is passed as input to the fusion prediction model. These real-time data may include the current timestamp, power demand, weather conditions, etc. The model will utilize these input data and combine with the previously trained parameters and weights to predict the power demand for a period of time in the future. The output power prediction sequence includes the instantaneous power demand at multiple time points. These predicted values are obtained based on the model's analysis and prediction of the input data, and can be used to formulate the operation strategy of the power grid, conduct power dispatching, and make other relevant decisions. By continuously inputting real-time data and obtaining the prediction sequence, we can continuously monitor the operation of the power grid and make timely adjustments and decisions to ensure the stable operation of the power grid.

[0120] S8: Determine the error propagation coefficient that is positively correlated with the prediction duration of the fusion power feature sequence, and calculate the total power dispatching volume within the preset duration by combining the error propagation coefficient and the instantaneous power demand.

[0121] It should be noted that the error propagation coefficient reflects the characteristic that the longer the prediction duration, the greater the impact of error propagation. Specifically, as the prediction duration increases, the error propagation coefficient will increase, which means that in the prediction over a long time range, the model has a weaker tolerance for errors and the prediction accuracy may decrease. By combining this coefficient and the instantaneous power demand output by the fusion prediction model, the total power dispatching volume within the preset duration is calculated. This total volume reflects the amount of power that needs to be dispatched in the future to meet the predicted demand.

[0122] By considering the impact of error propagation, the total power dispatching volume required within the preset duration is estimated more accurately, which helps the power grid operator make reasonable dispatching decisions to ensure the normal operation of the power grid and meet the power demand of users.

[0123] In a possible implementation manner, S8 specifically includes:

[0124] S801: Calculate the error propagation coefficient:

[0125] θ t =(1 - e -αt )×I(t)

[0126]

[0127] where θ t represents the error propagation coefficient at the current moment t, e represents the base of the natural logarithm, α represents a constantly positive decay exponent, and I(t) represents the relative error between the observed value O(t) and the predicted value P(t) at time t;

[0128] S802: Calculate the total power dispatching volume within the prediction duration according to the error propagation coefficient:

[0129]

[0130] Among them, M represents the total amount of power dispatching, and A t (i) represents the instantaneous power demand at the i-th prediction moment, and θ i represents the error propagation coefficient at time i.

[0131] It should be noted that by fully considering the impact of prediction errors on power dispatching, the total amount of power dispatching calculated within the prediction duration is made more accurate and reliable, which helps grid operators make more accurate decisions to ensure the stable operation of the power grid.

[0132] S9: Perform power dispatching according to the instantaneous power demand and the total amount of power dispatching.

[0133] Specifically, if the actual power demand exceeds the available power supply, the system can take some measures to balance the supply and demand relationship, such as adjusting the output power of generators, dispatching standby power sources, or performing load regulation, etc., to meet the needs of users. On the contrary, if the available power supply exceeds the actual demand, some measures can be taken to adjust the production and transmission of power to avoid the adverse effects caused by excess power on the system.

[0134] The beneficial effects brought by the technical solution provided by the embodiments of the present invention at least include:

[0135] (1) In the present invention, by replacing the neurons of the traditional autoregressive model with a multi-layer gated recurrent unit that can fully capture non-linear data relationships, an improved autoregressive model is obtained, and a trend increment module with a periodic feature function and an event feature function of power operation data is established. The two are connected in parallel, simultaneously making up for the shortcomings of the autoregressive model in inaccurately capturing periodic and event data changes and being unable to capture non-linear data relationships, and improving the prediction accuracy of the obtained fusion prediction model. In addition, in order to avoid the error propagation problem caused by directly summing the instantaneous power demands, an error propagation coefficient that is positively correlated with the prediction duration of the fused power feature sequence is introduced to correct the error of each instantaneous power demand, further improving the prediction accuracy of the fusion prediction model.

[0136] (2) In the present invention, a loss function is established based on the median of the absolute values of the residuals, so that most appropriate values that cause most of the residuals to fall within the threshold range are obtained, avoiding overfitting in the model training caused by historical abnormal data during the training process, and improving the prediction accuracy and the applicable range of the final model. In addition, the orca predation algorithm is improved based on the Lévy flight principle to perform hyperparameter optimization on the fusion prediction model in combination with the loss function, increasing the diversity and global exploration ability of hyperparameter search. By simulating the step length distribution of Lévy flight, the search space can be better explored, and it is more likely to avoid local optimal solutions, obtain better hyperparameters, and also improve the convergence speed during the optimization process, maintaining better learning ability and generalization ability of the fusion prediction model, and further improving the prediction accuracy.

[0137] Refer to the attached Figure 3 , which shows a schematic structural diagram of a power grid operation decision analysis system based on machine learning provided by the present invention.

[0138] The present invention also provides a power grid operation decision analysis system 20 based on machine learning, which is applied to the above-mentioned power grid operation decision analysis method based on machine learning, and includes:

[0139] A processor 201;

[0140] A memory 202, on which computer-readable instructions are stored. When the computer-readable instructions are executed by the processor 201, the power grid operation decision analysis method based on machine learning as in the method embodiment is implemented.

[0141] The power grid operation decision analysis system 20 provided by the present invention can execute the above-mentioned power grid operation decision analysis method based on machine learning and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate further.

[0142] The beneficial effects brought by the technical solutions provided in the embodiments of the present invention at least include:

[0143] (1) In the present invention, by replacing the neurons of the traditional autoregressive model with multi-layer gated recurrent units that can fully capture non-linear data relationships, an improved autoregressive model is obtained, and a trend increment module with a periodic feature function and an event feature function of power operation data is established. The two are connected in parallel, simultaneously making up for the deficiencies of the autoregressive model in inaccurately capturing periodic and event data changes and being unable to capture non-linear data relationships, and improving the prediction accuracy of the obtained fusion prediction model. In addition, in order to avoid the error propagation problem caused by directly summing instantaneous power demands, an error propagation coefficient that is positively correlated with the prediction duration of the fused power feature sequence is introduced to correct the error of each instantaneous power demand, further improving the prediction accuracy of the fusion prediction model.

[0144] (2) In the present invention, a loss function is established based on the median of the absolute value of the residuals, so that most suitable values that enable most of the residuals to fall within the threshold range are obtained, avoiding overfitting in the model training caused by historical abnormal data during the training process, and improving the prediction accuracy and the applicable range of the final model. In addition, the orca hunting algorithm is improved based on the Lévy flight principle to perform hyperparameter optimization on the fusion prediction model in combination with the loss function, increasing the diversity of hyperparameter search and the global exploration ability. By simulating the step length distribution of the Lévy flight, the search space can be better explored, and it is more likely to avoid local optimal solutions, obtain better hyperparameters, improve the convergence speed during the optimization process, maintain better learning ability and generalization ability of the fusion prediction model, and further improve the prediction accuracy.

[0145] It should be understood that the processor in the embodiments of the present invention may be a central processing unit (CPU), and this processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.

[0146] It should also be understood that the memory in the embodiments of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0147] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that contains one or more collections of available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media. The semiconductor media can be solid-state drives.

[0148] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood by referring to the context.

[0149] In the present invention, "at least one" means one or more, and "a plurality" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.

[0150] It should be understood that in various embodiments of the present invention, the magnitudes of the serial numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0151] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0152] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices, apparatuses, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0153] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0154] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0156] If the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0157] An embodiment of the present invention provides a power grid operation decision analysis device based on machine learning. This device includes the power grid operation decision analysis method based on machine learning as described in the method embodiment.

[0158] The power grid operation decision analysis device based on machine learning provided by the present invention can implement the steps and effects of the power grid operation decision analysis method based on machine learning in the above-mentioned method embodiment. To avoid repetition, the present invention will not elaborate further.

[0159] The beneficial effects brought by the technical solution provided by the embodiment of the present invention at least include:

[0160] (1) In the present invention, by replacing the neurons of the traditional autoregressive model with multi-layer gated recurrent units that can fully capture non-linear data relationships, an improved autoregressive model is obtained. And a trend increment module with a periodic feature function and an event feature function of power operation data is established, and the two are connected in parallel, simultaneously making up for the shortcomings that the autoregressive model cannot accurately capture the changes of periodic and event data and cannot capture non-linear data relationships, and improving the prediction accuracy of the obtained fusion prediction model. In addition, in order to avoid the error propagation problem caused by directly summing instantaneous power demands, an error propagation coefficient that is positively correlated with the prediction duration of the fused power feature sequence is introduced to correct the error of each instantaneous power demand, further improving the prediction accuracy of the fusion prediction model.

[0161] (2) In the present invention, a loss function is established based on the median of the absolute value of the residuals, so that most of the appropriate values make most of the residuals fall within the threshold range, avoiding overfitting in the model training caused by historical abnormal data during the training process, and improving the prediction accuracy and the applicable range of the final model. In addition, the orca predation algorithm is improved based on the Lévy flight principle to perform hyperparameter optimization on the fusion prediction model in combination with the loss function, increasing the diversity and global exploration ability of hyperparameter search. By simulating the step length distribution of the Lévy flight, the search space can be better explored, and it is more likely to avoid local optimal solutions, obtain better hyperparameters, and also improve the convergence speed during the optimization process, maintaining better learning ability and generalization ability of the fusion prediction model, and further improving the prediction accuracy.

[0162] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

[0163] The following points need to be explained:

[0164] (1) The drawings of the embodiments of the present invention only relate to the structures involved in the embodiments of the present invention, and other structures can refer to the general design.

[0165] (2) For clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layer or region is enlarged or reduced, that is, these drawings are not drawn according to the actual scale. It can be understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element can be "directly" on or under the other element or there can be intermediate elements.

[0166] (3) Without conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.

[0167] As above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A power grid operation decision analysis method based on machine learning, characterized in that: include: S1: Obtain historical power grid operation data; S2: Construct a trend increment module with periodic characteristic functions and event characteristic functions of power operation data; S3: constructing an improved autoregressive model with multi-layer gated recurrent units, and connecting the trend increment module and the improved autoregressive model in parallel to obtain a fusion prediction model; S4: Establish a loss function in combination with the median of the absolute value of the residual, wherein the residual is the difference between the actual value and the predicted value; S5: Introducing the Levy flight principle to improve the killer whale predation algorithm, inputting the historical power grid operation data as training data into the fusion prediction model to train the fusion prediction model, and using the improved killer whale predation algorithm to optimize the hyperparameters of the fusion prediction model with the goal of minimizing the loss function; S6: Obtain real-time power grid operation data; S7: inputting the real-time power grid operation data into the trained fusion prediction, and outputting a power prediction sequence, wherein the fusion power prediction sequence includes a plurality of instantaneous power demands; S8: determining an error propagation coefficient that is positively correlated with the predicted duration of the fused power feature sequence, and calculating the total amount of power dispatch within a preset duration in combination with the error propagation coefficient and the instantaneous power demand; S9: performing power dispatch according to the instantaneous power demand and the total power dispatch amount; Wherein, the S2 specifically includes: S201: Establishing a periodic characteristic function based on Fourier terms according to the different periods of the power operation data: Where S(τ) represents the periodic characteristic function, S p (τ) represents the periodic characteristic subfunction under the prediction step length τ, p represents the period duration, P represents the period duration set, k represents the number of Fourier terms under the period duration, j represents the indicator parameter of the number of Fourier terms, a j and b j Respectively represent the sine term coefficient and cosine term coefficient of the j-th Fourier term; S202: According to different event items, an event feature function in the form of a binary variable is established: Where E(t) represents the event characteristic function, E represents the event set at time t, z e represents the power demand impact coefficient of event e; S203: Combining the period characteristic function and the event characteristic function, constructing a basic trend increment function: Among them, c i , i=1,2,…n c Indicates the slope change point n c A collection of and Respectively represent the i-th slope change point c i and the slope change point c i-1 The corresponding moment, Indicates time period The basic trend increment function within, k represents the time period The slope within, m represents the time period The offset within S205: Using the periodic characteristic function and the event characteristic function as factors of the basic trend increment function to construct the trend increment module: in, Indicates time period The trend increment module within is the trend increment prediction value.

2. The power grid operation decision analysis method based on machine learning according to claim 1 is characterized in that: The fusion prediction model also includes an input module and an output module, wherein the input module is connected to the trend increment module and the improved autoregressive model respectively, and the output module is connected to the trend increment module and the improved autoregressive model respectively; The S3 specifically includes: S301: Building an improved autoregressive model with multi-layer gated recurrent units: a 1 =f a (L 1 ([y t-p ,...,y t-1 ])) a i =f a (L i (a i-1 )),i∈[2,...,l-1] A t (t),A t (t+1),...,A t (t+h-1)=D l (a l-1 ) Among them, D l represents the gated recurrent unit at layer l, a i represents the output value of the gated recurrent unit at layer i, f a ( ) represents the ReLU activation function, L i ( ) represents the input of the i-th layer gated recurrent unit, L 1 ([y t-p ,...,y t-1 ]) represents the input L of the first layer of gated recurrent unit 1 ( ) is the last p observations y of the observation time series (0, t) t-j ,j∈(1,p), t represents the current time, h represents the output length of the predicted value of the improved autoregressive model, A t (t+o), o∈(0,h-1) represents the predicted value at time t+o; S302: The trend increment module and the improved autoregressive model are connected in parallel, that is, the prediction value of the improved autoregressive model is summed with the trend increment prediction value of the trend increment module to obtain the fusion prediction model: Wherein, R represents the fusion prediction value of the fusion prediction model.

3. The power grid operation decision analysis method based on machine learning according to claim 1, characterized in that: The loss function is specifically: in, Represents the actual value y and the predicted value The loss function between It represents the median of the absolute value of the residual between the actual value and the predicted value, β represents the intermediate variable, and the symbol "||" means taking the absolute value.

4. The method for analyzing power grid operation decision based on machine learning according to claim 1, characterized in that: The hyperparameters specifically include the lag order, learning rate and sliding window size of the improved autoregressive model; The S5 specifically includes: S501: Initializing algorithm parameters of the improved killer whale predation algorithm, wherein the algorithm parameters include population size and maximum number of iterations; S502: Generate an initial killer whale group, where each killer whale represents a candidate hyperparameter; S503: Calculate the update step size and update direction of the improved killer whale predation algorithm in combination with the Levy flight principle: Wherein, w represents the update step size, σ represents the update direction, λ represents the Levy flight index, Γ( ) represents the gamma function, and A and B both represent the value range dimension (0,σ ) that conforms to the Gaussian distribution. 2 ) random variables; S504: performing a driving phase and a rounding-up phase on each killer whale in combination with the update step length and the update direction; S505: updating the position of the killer whale based on the determined Levy flight walk function and the Levy flight walk function and the capture result; S506: Determine the optimal killer whale position through a fitness function; S507: Keep the optimal killer whale position as the optimal hyperparameter.

5. The method for analyzing power grid operation decision based on machine learning according to claim 4, characterized in that: The S504 specifically includes: S504A: combining the update step size and the update direction, updating the current position and current speed of each killer whale, and completing the driving phase; S504B: Randomly select three killer whales to update the positions of the killer whales, completing the capture phase: ξ=2×(randn-1 / 2)×(Maxrep-t) / Maxrep in, represents the position of the i-th killer whale in the u-th dimension at the current iteration number t, represent the randomly selected first killer whale position, the second killer whale position and the third killer whale position respectively, ξ represents a random variable, randn represents a random number obeying a normal distribution, and Maxrep represents the maximum number of iterations.

6. The method for analyzing power grid operation decision based on machine learning according to claim 4, characterized in that: The S505 specifically includes: S505A: Establish the Levy flight walk function Le(w) in combination with the update step size and the update direction: S505B: Establish a killer whale position update function based on the Levy flight walk function: in, represents the new position of the killer whale at the end of the current iteration number t, represents the center position of the killer whale at the current iteration number t, z t Indicates the real-time position of the killer whale at the current iteration number t; S505C: Update the killer whale position using the killer whale position update function.

7. The method for analyzing power grid operation decision based on machine learning according to claim 1, characterized in that: The S8 specifically includes: S801: Calculate the error propagation coefficient: i t =(1-e -αt )×I(t) Among them, θ t represents the error propagation coefficient at the current time t, e represents the base of the natural logarithm, α represents the decay exponent which is always positive, and I(t) represents the relative error between the observed value O(t) at time t and the predicted value P(t); S802: Calculate the total amount of power dispatch within the predicted time period according to the error propagation coefficient: Wherein, M represents the total amount of power dispatch, A t (i) represents the instantaneous power demand at the i-th prediction moment, θ i represents the error propagation coefficient at time i.

8. A power grid operation decision analysis system based on machine learning, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method for analyzing power grid operation decision based on machine learning as described in any one of claims 1 to 7 is implemented.

9. A power grid operation decision analysis device based on machine learning, characterized in that: It comprises a power grid operation decision analysis method based on machine learning as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Power grid planning dynamic method and system based on reinforcement learning and predictive analysis

    CN116805198A

  • Limit order book trend prediction apparatus and method, device, and storage medium

    WO2023040009A1