Micro-grid energy optimization method and device based on distributed deep reinforcement learning

By using LSTM models and dynamic time warping differential methods to identify abnormal wind turbines in microgrids, and combining this with DS fusion technology, the problem of prediction uncertainty on the power supply side of wind turbines is solved, thereby improving the robustness and adaptability of energy dispatch in microgrids.

CN120892835AActive Publication Date: 2025-11-04NANTONG INST OF TECH

Patent Information

Application Number
CN202511433169.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2025-11-04
Estimated Expiration
2045-10-09

AI Technical Summary

Technical Problem

Existing microgrid energy optimization methods based on distributed deep reinforcement learning fail to adequately quantify the prediction error characteristics under different wind conditions when facing prediction uncertainties on the wind turbine power supply side. They also lack real-time detection and dynamic correction mechanisms for abnormal wind turbine states, making it difficult to ensure the robustness of energy dispatch.

Method used

By acquiring historical electricity consumption and meteorological data of the microgrid, an LSTM model is used for prediction. The prediction error is obtained by combining a sliding window, and an abnormal wind turbine is identified by the dynamic time warping difference method to generate mutually exclusive power supply intervals. The DS fusion technology is used to integrate multi-source information to generate power supply prediction values.

Benefits of technology

It improves the robustness of microgrid energy dispatch under wind energy volatility and forecast uncertainty scenarios, reduces the bias of single forecast models caused by faults or weather fluctuations, and enhances the adaptability of power supply mode decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892835A_ABST
    Figure CN120892835A_ABST
Patent Text Reader

Abstract

The invention provides a micro-grid energy optimization method and device based on distributed deep reinforcement learning, and relates to the technical field of micro-grid energy optimization and intelligent scheduling, and the method comprises the steps: building a feature sequence according to a time sequence based on historical electricity consumption, meteorological data and corresponding power supply amount; then training an LSTM model by using the two types of sequences to obtain a power consumption and power supply prediction model, obtaining a prediction error through a sliding window, then obtaining meteorological data of the next time period in the future, obtaining a power supply prediction value in combination with a historical sequence, and obtaining a prediction result based on historical meteorological combination error distribution; calculating the probability that the power supply quantity predicted value belongs to each interval as a first type of evidence; and then a second type of evidence is distributed by taking the future weather and working condition similarity as a weight, an abnormal fan is identified by adopting a dynamic time warping difference method, a power supply quantity predicted value is corrected, a third type of evidence is generated, finally D-S fusion is performed, a power supply quantity predicted value in the next time period in the future is output, and a power supply mode decision is made.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of micro-grid energy optimization and intelligent scheduling, in particular to a micro-grid energy optimization method and device based on distributed deep reinforcement learning. BACKGROUND

[0002] In the micro-grid environment with wind turbines as the core distributed power supply, due to the strong volatility and intermittency of wind energy, the power output is significantly uncertain due to environmental factors. How to accurately coordinate the energy scheduling of wind turbine clusters, energy storage units and the main grid, and balance the power supply reliability has become the core problem of energy management in such micro-grids.

[0003] In the prior art, the publication number CN114285075A discloses a micro-grid energy online optimization method based on distributed deep reinforcement learning. The deep reinforcement learning algorithm adopted by the method fits the strategy and value function through a neural network, and after training, it can quickly generate an optimal solution for time-varying loads and environmental changes, effectively alleviating the challenges brought by load time variability. On this basis, the distributed deep reinforcement learning method further decomposes the large-scale micro-grid system into multiple sub-modules through a multi-agent framework, and each agent is responsible for the management of local power generation units, energy storage or loads, reducing the learning complexity of a single neural network and improving the applicability of the model in large-scale systems. For example, the Actor network interacts with the local environment to generate action strategies, and the Critic network integrates global information to optimize value estimation, achieving collaborative management of distributed energy production and utilization.

[0004] However, the existing optimization method based on distributed deep reinforcement learning still has certain limitations: its core focuses on the generation and execution of optimization strategies, and does not adequately consider the prediction uncertainty of the wind turbine power supply side. In actual operation, random fluctuations in wind speed and air pressure result in large prediction errors in wind turbine power generation, coupled with power output anomalies caused by wind turbine equipment failures and blade aging, which directly affect the reliability of the optimization strategy. The existing method does not adequately quantify the prediction error characteristics under different wind conditions, and lacks real-time detection and dynamic correction mechanisms for abnormal states of wind turbines, making it difficult to ensure the robustness of energy scheduling in scenarios with strong wind energy volatility and high prediction uncertainty.

[0005] The above information disclosed in the background section is only used to enhance the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0006] The present application aims to provide a micro-grid energy optimization method and device based on distributed deep reinforcement learning to solve the problems raised in the background.

[0007] To achieve the above object, the present application provides the following technical solutions: The micro-grid energy optimization method based on distributed deep reinforcement learning comprises the following specific steps: The historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z consecutive time periods are acquired and normalized, and the historical power consumption feature sequence and the historical meteorological-power supply feature sequence are constructed in chronological order; The historical power consumption feature sequence is used to train the LSTM model to obtain a power consumption prediction model, the historical meteorological-power supply feature sequence is used to train the LSTM model to obtain a power supply prediction model, and the prediction error is obtained through a sliding window method; The meteorological data of the next time period in the future are acquired, the historical meteorological data of the previous M1 time periods and the power supply are input into the power supply prediction model to obtain the power supply prediction value of the next time period, the historical meteorological data are clustered to divide the working conditions, the total power supply intervals are generated, the prediction error is weighted based on the meteorological data of the period and the similarity of each working condition, the future error distribution is obtained, and the probability that the power supply prediction value belongs to each total power supply interval is calculated as the first type of evidence; The similarity of the meteorological data of the next time period in the future and each working condition is used as a weight to distribute the second type of evidence to the total power supply interval corresponding to each working condition, the dynamic time warping difference method is used to analyze the power supply of each wind turbine in the previous TA time periods at the current time, the abnormal wind turbine is identified, the power supply of the abnormal wind turbine is set to zero, the power supply prediction value of the next time period in the future is corrected, and the power supply prediction value is mapped to the total power supply interval to generate the third type of evidence; The three types of evidence are fused by D-S fusion, the third type of evidence is dominant in the evidence conflict, and the power supply prediction value of the next time period in the future is output, which is compared with the power consumption prediction value obtained by inputting the historical power consumption of the previous M2 consecutive time periods at the current time into the power consumption prediction model to make a power supply mode decision.

[0008] The historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z consecutive time periods are acquired and normalized, and the historical power consumption feature sequence and the historical meteorological-power supply feature sequence are constructed in chronological order; The historical power consumption feature sequence is used to train the LSTM model to obtain a power consumption prediction model, the historical meteorological-power supply feature sequence is used to train the LSTM model to obtain a power supply prediction model, and the prediction error is obtained through a sliding window method; The meteorological data of the next period in the future is acquired, and historical meteorological data of M1 previous periods and power supply amount are input into a power supply amount prediction model to obtain a power supply amount prediction value of the next period, a working condition is divided based on historical meteorological data clustering, a total power supply amount interval is generated, a prediction error is weighted based on meteorological data of the period and a similarity of each working condition, a future error distribution is obtained, and a probability that the power supply amount prediction value belongs to each total power supply amount interval is calculated as first type evidence; The meteorological data of the next period in the future and the similarity of each working condition are taken as weights, second type evidence is distributed to the total power supply amount interval corresponding to each working condition, a dynamic time warping difference method is used to analyze the power supply amount of each fan in the previous TA periods at the current time, an abnormal fan is identified and its power supply amount is set to zero to correct the power supply amount prediction value of the next period in the future, and the power supply amount prediction value is mapped to the total power supply amount interval to generate third type evidence; The three types of evidence are fused by D-S fusion, the third type of evidence is dominant in evidence conflict, and the power supply amount prediction value of the next period in the future is output, which is compared with the power consumption prediction value obtained by inputting historical power consumption of M2 consecutive periods at the current time into a power consumption prediction model to make a power supply mode decision.

[0009] Further, a method for training an LSTM model using a historical meteorological-power supply amount feature sequence to obtain a power supply amount prediction model is as follows: First, Z consecutive periods in the past are marked as a historical total period number Z, power supply amount data of M2 consecutive periods is extracted from the historical meteorological-power supply amount feature sequence, and is marked as a historical data subset, a training window length is set to M1 periods, and 0

[0010] Further, a method for obtaining a prediction error by a sliding window is as follows: From the past Z consecutive time period, select the independent time period data which does not participate in the power supply capacity prediction model training as the error calculation benchmark, set the sliding window with the same length as the training time, that is M1, intercept the feature sequence input power supply capacity prediction model containing M1 consecutive time periods, get the prediction value of the next time period, calculate the absolute error with the actual value of the power supply capacity of the time period, then slide the window along the time axis by 1 time period, repeat the above prediction and error calculation process, integrate all the calculated errors in time sequence as the error set, denoted as prediction error.

[0011] Further, the method for generating mutually exclusive total power supply capacity intervals based on historical meteorological data clustering is: Based on the historical data subset, the wind speed value and the air pressure value of each time period are extracted to form a two-dimensional feature vector, and then the K-means clustering algorithm is used for clustering analysis on the standardized feature vector to divide the working condition categories. The elbow method is used to determine the optimal clustering number. The specific process is as follows: for the preset clustering numbers , , is an integer greater than 2, the clustering error sum of squares is calculated respectively, the relationship curve of and SSE is drawn, and the value when the elbow inflection point appears in the relationship curve is selected as the final working condition category number. In the clustering process, the Euclidean distance is used as the sample similarity measure, and the clustering center is iteratively optimized until convergence. Finally, the working condition categories are obtained, and each working condition corresponds to a clustering center, that is, the typical wind speed and air pressure value of the working condition as the working condition center; Based on the historical data subset, the power supply capacity data of each time period is extracted, the K-means clustering algorithm is used, and the elbow method is used to determine the optimal clustering number. The specific process is as follows: for the preset clustering numbers , , is an integer greater than 2, the clustering error sum of squares is calculated respectively, the relationship curve of and SSE is drawn, and the value when the elbow inflection point appears in the relationship curve is selected as the final clustering number. In the clustering process, the Euclidean distance is used as the sample similarity measure, and the clustering center is iteratively optimized until convergence. Finally, the The cluster centers are sorted in ascending order of numerical value, the minimum value in the power supply data is taken as the starting lower bound minus a buffer value, the buffer value is 5% of the minimum value, the maximum value in the power supply data is taken as the termination upper bound plus the same buffer value, the buffer value is 5% of the maximum value, the interval dividing points of each total power supply interval are calculated, for the sorted cluster centers, the numerical average value of each two adjacent cluster centers is taken as the interval dividing point between them, that is, the first dividing point is the average value of the first cluster center and the second cluster center after sorting, the second dividing point is the average value of the second cluster center and the third cluster center, and so on, until the average value of the last two adjacent cluster centers is calculated as the second last dividing point, and finally the total power supply interval is formed.

[0012] Further, the method for calculating the probability of the predicted value belonging to each total power supply interval as the first type of evidence is: Select independent period data not participating in the power supply prediction model training from the past Z consecutive periods, calculate the Euclidean distance of the wind speed and air pressure of each period from each working condition center, attribute the period to the nearest working condition category and attach a unique working condition label, match the corresponding prediction error, traverse all records with working condition labels, extract all error values corresponding to the same working condition label into a group, generate the error probability distribution corresponding to the working condition, and there are groups; Calculate the similarity of the next period and the working condition, the next period is the next period of the current time, the specific process is, obtain the wind speed and air pressure data of the next period from the weather bureau, perform normalization processing, calculate the distance between the wind speed and air pressure data of the period and each working condition center by using the Euclidean distance, convert the distance into similarity by inverse distance method, and normalize all working condition similarities by dividing by the sum of all similarities; Extract the error values of all prediction error data under a certain working condition, and estimate the probability density corresponding to any error value by using kernel density estimation method: ; In the formula, represents any error value to be estimated, represents the th error value, represents the probability density function, that is, the probability density of the error value, represents the number of error values, represents the bandwidth, represents the kernel function; ; Among them, the kernel function adopts Gaussian kernel: ; For the selection of bandwidth, the specific process is, presetting the candidate number, generating each candidate bandwidth, for each candidate bandwidth, based on the error data under the working condition, using the above probability density function formula, substituting each error value to obtain each estimated density , and combining the frequency of discrete data to calculate the deviation square: ; In the formula, , the deviation square of the first error value, taking the average value of all sample deviation squares as the mean square error under the bandwidth, finally selecting the candidate bandwidth which makes the mean square error minimum as the selection, the frequency of the discrete data is ; For the next period in the future, the error probability density function obtained by the kernel density estimation of each working condition is weighted and superimposed with the normalized working condition similarity as the weight, to obtain the comprehensive error probability density function of the period: ; In the formula, , the comprehensive error probability density function of the period, , the normalized working condition similarity of the period and the first working condition, , the error probability density function of the period and the first working condition, ; The power supply capacity prediction result of a period is recorded as , and the actual possible value formula of the power supply capacity of the period is constructed: ; In the formula, , the actual possible value of the power supply capacity of the period is recorded as the actual power supply capacity, therefore, the probability density function of the actual power supply capacity of the period can be derived from the comprehensive error distribution: ; In the formula, , the probability density function when the actual power supply capacity is ; The probability that the actual power supply capacity falls in each total power supply capacity interval is calculated: ; In the formula, , the probability that the actual power supply capacity falls in the first total power supply capacity interval, , the upper limit of the first total power supply capacity interval, , the lower limit of the first total power supply capacity interval, wherein, an index representing a total power supply amount interval, , a number of total power supply amount intervals, and the calculated is respectively assigned to the corresponding total power supply amount interval, i.e. forming the first type of evidence of the time period.

[0013] Further, the similarity between the future next time period meteorological data and each working condition is taken as a weight, and the method for distributing the second type of evidence to the total power supply amount interval corresponding to each working condition is as follows: independent time period data not participating in the training of the power supply amount prediction model is selected from the past Z consecutive time periods, the power supply amount of each time period and the corresponding working condition are grouped to generate samples, and the frequency of each power supply amount data falling in each total power supply amount interval under a certain working condition is counted: ; In the formula, represents the th working condition, th total power supply amount interval basic BPA, represents the th working condition, th total power supply amount interval, represents the th working condition, th total power supply amount interval basic BPA, th normalized working condition similarity weight is taken, and the basic BPA of each working condition is weighted and summed to obtain the second type of evidence of the total power supply amount interval of the time period: ; In the formula, represents the th total power supply amount interval BPA in the second type of evidence.

[0014] Further, the dynamic time warping difference method is used to analyze the power supply amount of each fan in the past TA time periods at the current time, identify abnormal fans, and correct the power supply amount of the future next time period prediction value by setting the power supply amount of the abnormal fans to zero. The method is as follows: For the set of fans under each working condition, the time step is set, and , the current time is taken as the reference, including the current time and the past consecutive time steps, , and the power supply amount of the abnormal fan is set to zero. Real-time power supply data of all wind turbines are collected at consecutive time steps to form a continuous power supply sequence. The power supply sequence is converted into a power supply sequence with a mean of 0 and a standard deviation of 1 using the z-score method. The adjacent differences of the power supply sequence are calculated to form a first-order difference power supply change trend sequence. Based on the first-order difference sequence of all wind turbines, the median of each time step is taken as the reference value for that step to form a first-order difference group reference trend sequence. Next, the first-order differential power supply trend sequence and the first-order differential group reference trend sequence are further differentially analyzed to obtain the second-order differential power supply trend sequence and the second-order differential group reference trend sequence. The absolute difference between the corresponding positions of the two sequences is calculated to form a distance matrix. Then, the minimum value between the current distance and the previous cumulative distance is used to construct the cumulative distance matrix. The value in the lower right corner of the cumulative matrix is ​​the DTW distance between the wind turbine and the group reference trend. After collecting the DTW distance data of all wind turbines under the current operating conditions, the mean of all distances is first calculated, and then the average of the sum of squares of the deviations of all distances from the mean is calculated. The square root is taken to obtain the standard deviation. The threshold is set to the mean of the DTW distance of all wind turbines plus 3 times the standard deviation. When the DTW distance of a single wind turbine exceeds this threshold, the wind turbine is marked as an abnormal wind turbine. The power supply of the abnormal wind turbine is set to zero, and the power supply prediction value for the next period is corrected.

[0015] Furthermore, mapping to the total power supply range, the method for generating the third type of evidence is as follows: The predicted power supply for the next time period, corrected for abnormal wind turbines, is matched with the total power supply range to determine the confidence level for the third type of evidence. ; In the formula, Indicating the third type of evidence, the first... BPA for each total power supply range This represents a reliability parameter with a value of 0.9. This represents the predicted power supply for the next time period after correction for abnormal fan operation.

[0016] Furthermore, the method for outputting the predicted power supply value for the next time period and comparing it with the predicted power supply value obtained from the power consumption prediction model based on the historical power consumption of the previous M2 consecutive time periods to make a power supply mode decision is as follows: First, the orthogonal sum rules of the Dempster-Shafer evidence theory are used to fuse the first, second, and third types of evidence: ; In the formula, For each of the three types of evidence, a conflict threshold is pre-set for the total power supply range. ,and ,when , it is determined that the evidences exist significant conflicts, and a weighted fusion strategy is adopted mainly based on the third type of evidence: ; In the formula, denotes the comprehensive basic probability distribution, denotes a weight coefficient, wherein, ; When , it is determined that the evidences do not exist significant conflicts, and the comprehensive basic probability distribution is calculated: ; Based on the comprehensive basic probability distribution, the lower limit of the total power supply interval with the highest confidence is selected as the corrected future next time period power supply prediction value, which is compared with the future next time period power consumption prediction value, when the future next time period power supply prediction value is higher than the power consumption prediction value, the energy storage mode is preferentially prepared to supplement power supply, otherwise, on the basis of the prepared energy storage mode to supplement power supply, the standby energy and external power grid are prepared to supplement power supply.

[0017] The application further provides a micro-grid energy optimization device based on distributed deep reinforcement learning, which is used for executing the micro-grid energy optimization method based on distributed deep reinforcement learning. A data sequence module is configured to acquire historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z continuous time periods, and perform normalization processing, and construct historical power consumption feature sequences and historical meteorological-power supply feature sequences in time sequence. A prediction error statistical module is configured to train an LSTM model using the historical power consumption feature sequences to obtain a power consumption prediction model, train the LSTM model using the historical meteorological-power supply feature sequences to obtain a power supply prediction model, and acquire prediction errors in a sliding window manner. A first type of evidence module is configured to acquire historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z continuous time periods, and construct historical power consumption feature sequences and historical meteorological-power supply feature sequences in time sequence, obtain a power supply prediction value of the next time period, divide working conditions based on historical meteorological data clustering, generate mutually exclusive total power supply intervals, combine the meteorological data of the time period and the similarity of each working condition, weight the prediction errors to obtain a future error distribution, and calculate the probability of the power supply prediction value belonging to each total power supply interval as the first type of evidence. The second type of evidence module is used for distributing the second type of evidence to the total power supply interval corresponding to each working condition by taking the similarity between the future next period meteorological data and each working condition as a weight, and the dynamic time warping difference method is used to analyze the power supply of each fan in the TA time periods before the current time, identify the abnormal fan, and correct the future next period power supply prediction value by setting the power supply of the abnormal fan to zero and mapping to the total power supply interval to generate the third type of evidence; The evidence fusion module is used for D-S fusion of the three types of evidence, the third type of evidence is dominant in evidence conflict, and the future next period power supply prediction value is output.

[0018] Compared with the prior art, the beneficial effects of the present application are: By using the dynamic time warping difference method, the single fan power supply data in the fixed time window before the current time is analyzed, the abnormal fan is identified, and the power supply of the abnormal fan is set to zero, so that the power supply prediction not only depends on the meteorological condition and the historical rule, but also considers the factor of fan failure, and the future next period power supply prediction value is corrected to adapt to the actual running scene, and the present application also clusters and divides the working conditions according to the historical meteorological data and generates mutually exclusive total power supply intervals, and the future error distribution is obtained by combining the period meteorological data and the similarity weighted prediction error of each working condition, and then the first type, the second type and the third type of evidence are constructed, the multi-source information is integrated by D-S fusion, the prediction error characteristics under different working conditions are fused, the deviation caused by the single prediction model due to failure or meteorological fluctuation is reduced, and the adaptability to uncertainty is improved when the power supply mode is decided. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 The present application is a whole method flowchart; Figure 2 The present application is a power supply model error statistical chart; Figure 3 The present application is a first type of evidence distribution chart; Figure 4 The present application is a fault and non-fault period prediction accuracy schematic diagram; Figure 5 The present application is a whole device structure schematic diagram. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with specific embodiments.

[0021] It should be noted that, unless otherwise defined, technical terms or scientific terms used in the present application shall have the usual meaning understood by a person with ordinary skill in the art to which the present application belongs. The terms "first", "second" and similar words used in the present application do not represent any order, number or importance, but are only used to distinguish different components. The terms "include" or "contain" and similar words mean that the elements or objects before the words cover the elements or objects listed after the words and their equivalents, without excluding other elements or objects. The terms "connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "up", "down", "left", "right" and the like are only used to represent relative positional relationships, which may change accordingly when the absolute position of the described object changes.

[0022] Embodiments: Please refer to Figures 1 to 4 The present application provides a technical solution: The micro-grid energy optimization method based on distributed deep reinforcement learning comprises the following specific steps: Step 1: Obtain the historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z consecutive time periods and normalize the data, and construct the historical power consumption feature sequence and the historical meteorological-power supply feature sequence in time order; Obtain the historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z consecutive time periods, and Z is an integer greater than 0. For the setting of time periods, the output fluctuation law of the power supply should be captured, for example, set the basic time period granularity to 15 minutes, even if the short-term output sudden drop caused by cloud shading can be captured, for example, collect the total historical power consumption, historical meteorological data and corresponding power supply for 168 hours, and the corresponding time period is 672, which covers the daily variation period of wind speed. The meteorological data is wind speed and air pressure, and the collection frequency is set to 1 minute / time, that is, in each 15-minute time period, 900 consecutive wind speed and air pressure data can be collected. The historical power consumption feature sequence and the historical meteorological-power supply feature sequence are constructed in time order based on the power consumption and power supply of each time period, and the historical power consumption feature sequence and the historical meteorological-power supply feature sequence are normalized by using the min-max normalization method. For the historical meteorological-power supply feature sequence, the wind speed and air pressure curves of each time period are recorded synchronously.

[0023] Step 2: Use the historical power consumption feature sequence to train the LSTM model to obtain the power consumption prediction model, use the historical meteorological-power supply feature sequence to train the LSTM model to obtain the power supply prediction model, and obtain the prediction error by using the sliding window method; The LSTM is a time series model, and the core capability is to learn the correlation between historical time series features and future prediction targets, which is suitable for power supply and electricity consumption prediction. The electricity consumption prediction model is constructed, and the specific process is to extract all time period electricity consumption data from the historical electricity consumption feature sequence, only divide the training set and independent validation set accounting for 80%, and take the electricity consumption of the first periods in the training set as a single input sequence. The corresponding prediction label is set to the actual electricity consumption of the period, the input structure is sample number x x 1, the sample number is the total number of all time periods of the historical electricity consumption feature sequence minus , the LSTM model is constructed, the input layer receives the time series input of sample number x x 1, which is directly transmitted to the hidden layer. Two layers of LSTM hidden layer are set, and the number of neurons in each layer is 64. Each LSTM unit selectively remembers and updates information through the input gate, the forgetting gate and the output gate, so as to capture short-term fluctuation patterns and long-term trend characteristics in the input time window. The TAnh activation function is used to make the output value stable in the range of [-1, 1]. A random inactivation layer is separately added after each LSTM network, and the dropout rate is set to 0.2, that is, 20% of the neuron output is randomly shielded to prevent model overfitting. The output layer outputs a dimension of 1. The mean square error is used as the loss function to measure the deviation between the predicted value and the true value. The Adam optimizer is used, the initial learning rate is set to 0.001, and the learning rate is attenuated to half of the original every 50 epochs. The learning rate is attenuated to half of the original to balance the learning speed and stability. The iteration training is stopped when the validation set loss does not decrease for 20 consecutive epochs to avoid overfitting.

[0024] The power supply prediction model is constructed, and the specific process is to first extract M2 consecutive time period power supply data from the historical meteorological-power supply feature sequence, denoted as a historical data subset, and mark the total time period number Z. The training window length is set to , and 0 < M1 < M2 < Z, leaving part of the data not involved in training, so that the true bias of the constructed model to unfamiliar data can be obtained subsequently, the sample number is calculated by M2 minus M1 plus 1, and then the power supply amount of each period under the training time window, the meteorological data under the training time window and the next period after the end of the window are used to realize that the known future meteorology is used as input, increase the accuracy of model prediction, avoid over-emphasizing the power supply amount characteristics, and thus ignore the key influence of meteorological data on power supply, arrange the processed power supply and meteorological data in chronological order to form a three-dimensional input structure with a sample number, a training window length and a feature dimension of each time step, the meteorological data includes wind speed, air pressure, and the feature dimension of each period is the sum of the data points of wind speed and air pressure in a single period and the data points of wind speed and air pressure in the next period after the end of the window, and the prediction label corresponding to each sample is the power supply amount in the next period after the end of the training window, ensuring that the model learns the rules associated with power supply under different meteorological data; Then, an LSTM model is constructed, the input layer receives the three-dimensional input structure and the dimension remains unchanged, thereby receiving three-dimensional time series data, preserving the time sequence information and the relationship between meteorological variables and power supply and other characteristics, 2 layers of LSTM hidden layers are set, the number of neurons in each layer is 64, the first layer extracts short-term and long-term dependencies, and the second layer captures the dynamic coupling relationship between meteorology and power supply in the first M1 periods, which is more suitable for learning time series patterns, a TAnh activation function is used, a random inactivation layer is separately added after each LSTM network, and the dropout rate is set to 0.2, that is, 20% of the neuron outputs are randomly shielded, to prevent model overfitting and make it have better generalization ability on unseen data, the output layer has an output dimension of 1, which realizes random shielding of part of the neuron outputs with a certain probability during the training process, and a linear activation function is used to ensure that the prediction result is a continuous real value. During the model training process, the historical data subset is used as the data basis for model training, the time series cross-validation method is used to divide the data set, the training set accounts for 70%, the validation set accounts for 20%, and the test set accounts for 10%, the mean square error is used as the loss function to measure the difference between the predicted value and the true value, the Adam optimizer is used, the initial learning rate is set to 0.001, and it is attenuated to 0.5 of the original every 50 epochs, and the iteration is stopped when the validation set loss does not decrease continuously for 20 epochs, to avoid invalid iteration and overfitting; From the past Z consecutive period, select the independent period data that does not participate in the power supply capacity prediction model training, for example, extract the power supply capacity data of M2 consecutive periods for training from the historical meteorological-power supply capacity feature sequence, as the error calculation benchmark, truly reflect the generalization ability of the model in the actual prediction scene, set the sliding window with the same length as the training, M1, intercept the feature sequence containing M1 consecutive periods, input the power supply capacity prediction model, get the predicted value of the next period, calculate the absolute error with the actual value of the period, then slide the window along the time axis by 1 period, repeat the above prediction and error calculation process, integrate all the calculated errors in chronological order into an error set, denoted as prediction error, reflect the degree of deviation, thereby correcting the power supply capacity prediction based on the prediction error, reducing the decision risk, Table 1 shows the absolute error between the power supply capacity prediction value and the actual value of the power supply capacity prediction model under the independent period data that does not participate in the power supply capacity prediction model training, 40 groups of continuous data containing fan sudden failure situation from 09:30-10:44 are intercepted, and the data table is generated after summarizing; Table 1 Prediction error statistics table

[0025] As Figure 2 shown in the figure, the power supply capacity prediction value and the actual value of most periods are highly consistent, the prediction value and the actual value have high degree of fit, under the normal scene of no fan failure, the LSTM prediction model can effectively learn the time sequence rule of power supply capacity, in the period of 09:30-10:29 and 09:45-10:44, the fan sudden failure output drops sharply, leading to a sharp decrease in actual power supply capacity, the power supply capacity prediction model is trained based on most historical normal data, making the error between the prediction value and the actual value sharply enlarged, the influence of actual power supply capacity caused by fan failure needs to be considered.

[0026] Step 3: Obtain the historical power consumption, historical meteorological data and corresponding power supply capacity of the microgrid in the past Z consecutive periods, and construct the historical power consumption feature sequence and the historical meteorological-power supply capacity feature sequence in chronological order, get the power supply capacity prediction value of the next period, based on the historical meteorological data clustering, divide the working conditions, generate mutually exclusive total power supply capacity intervals, and combine the meteorological data of the period with the similarity of each working condition, weight the prediction error, get the future error distribution, calculate the probability of the power supply capacity prediction value belonging to each total power supply capacity interval as the first type of evidence; By using the short-term forecast function of the meteorological bureau API or the field meteorological station associated with the microgrid, the meteorological data for the next time period is obtained. The data is then normalized according to the Min-Max standardized parameters of the training set. The power supply of the M1 consecutive time periods before the next time period is extracted, along with the meteorological data for each time period. The meteorological data for the next time period is then combined with the data for the next time period and normalized according to the Min-Max standardized parameters. This is then integrated into a three-dimensional input structure and input into the power supply prediction model to obtain the predicted power supply value for the next time period. The specific process of clustering and classifying operating conditions based on historical meteorological data is as follows: To cover a large number of meteorological scenarios, the average wind speed and air pressure of each time period within the past Z consecutive time periods are used as the wind speed and air pressure values ​​for each time period. Wind speed and air pressure values ​​for each time period are extracted from a subset of historical data to form a two-dimensional feature vector. Wind speed and air pressure are core meteorological factors affecting the power supply of a microgrid, but both are continuous variables. Directly using continuous meteorological data for modeling can easily lead to overfitting. Therefore, the K-means clustering algorithm is used to perform cluster analysis on the standardized feature vector to classify operating conditions, distinguish the error in predicting power supply under various operating conditions, and make the error distribution more consistent with future actual scenarios, avoiding deviations caused by global errors. The elbow method is used to determine the optimal number of clusters, ensuring that each operating condition has enough samples to support statistical regularities while also distinguishing significantly different meteorological scenarios, i.e., operating conditions. Specifically, the process involves setting a pre-defined number of clusters for each condition. , , For integers greater than 2, calculate the sum of squared clustering errors (SSE) and plot them. The relationship curve with SSE was used, and the value at the elbow inflection point of the curve was selected as the final number of working condition categories. During clustering, Euclidean distance was used as the sample similarity measure, and the cluster centers were iteratively optimized until convergence, ultimately yielding the desired result. Each working condition is categorized into several categories, and each working condition corresponds to a cluster center, which is the typical wind speed and air pressure value of that working condition. This provides a basis for subsequent classification of working conditions based on meteorological similarity. Power supply data for each time period was extracted from a subset of historical data. The K-means clustering algorithm was used, and the elbow method was used to determine the optimal number of clusters. Power supply is not a random discrete value, but is affected by factors such as weather, load, and equipment status, exhibiting natural clustering characteristics. Artificially setting intervals ignores the distribution pattern of the data itself, resulting in a disconnect between the intervals and the actual power supply level. K-means is an unsupervised learning algorithm that can automatically cluster similar values ​​in power supply into a cluster, which is consistent with the continuous numerical characteristics of power supply. At the same time, any prediction model has prediction errors and cannot guarantee that the predicted value is completely consistent with the actual value. The average value of the centers of adjacent clusters is used as the dividing point to ensure that all actual power supply can be included in a certain interval, providing a unified domain of discourse for the generation of three types of BPA evidence.

[0027] The specific process is to calculate the cluster error sum of squares (SSE) for each cluster number set in advance, draw a relationship curve of the cluster number and the SSE, select the value when the elbow inflection point of the relationship curve appears as the final cluster number, take the Euclidean distance as the sample similarity degree in the clustering process, and iteratively optimize the cluster center until convergence to obtain the cluster center. The cluster center is sorted in ascending order of the numerical value, the minimum value in the power supply data is taken as the starting lower bound, and the buffer value is subtracted, the buffer value is 5% of the minimum value, the maximum value in the power supply data is taken as the termination upper bound, and the same buffer value is added, the buffer value is 5% of the maximum value, the interval points of each total power supply interval are calculated, for the sorted cluster center, the average value of the numerical value of each two adjacent cluster centers is taken as the interval point between them, that is, the first interval point is the average value of the first cluster center and the second cluster center after sorting, the second interval point is the average value of the second cluster center and the third cluster center, and so on, until the average value of the last two adjacent cluster centers is calculated as the second last interval point, and finally the total power supply interval is formed. In the historical meteorological-power supply characteristic sequence, the data of the period not participating in the power supply prediction model training is selected, so that the generated error distribution is more general, the wind speed and air pressure of each period are calculated, and the Euclidean distance of each period from each working condition center is calculated. The closer the Euclidean distance of the meteorological data of each period to a working condition center, the more similar the meteorological scene of the period to the working condition, so the period is attributed to the nearest working condition category and is attached with a unique working condition label. The prediction error characteristics of different working conditions are significantly different, and the error distribution of each working condition is bound to the specific meteorological scene. After matching the prediction error of the period, all records with working condition labels are traversed, all error values corresponding to the same working condition label are extracted and grouped, and the error probability distribution corresponding to the working condition is generated, a total of groups;

[0028] The similarity between the future next period and the working condition is calculated, the future next period is recorded as the next period of the current time, and the specific process is as follows: the wind speed and air pressure data of the future next period are obtained from the meteorological bureau, normalized, the Euclidean distance between the wind speed and air pressure data of the period and each working condition center is calculated, the distance is inversely proportional to the similarity, and the similarity of all working conditions is normalized by dividing the sum of all similarities, so as to quantify the correlation strength between the future meteorological scene and the historical typical working condition. If there is no similarity weighting, the error distribution of a single working condition will lead to a large deviation between the predicted error and the actual error. ​​​​The power supply amount prediction error is affected by working conditions such as wind speed and air pressure, and the distribution thereof often does not conform to standard parameter distributions such as normal distribution and uniform distribution. Kernel density estimation is a non-parametric method, which does not need to preset a distribution form, but only fits a curve through error samples themselves, and can adaptively capture the real distribution form of errors under different working conditions. Therefore, the error values of all prediction error data under a working condition are extracted, and the kernel density estimation method is used to estimate the probability density corresponding to any error value: ; In the formula, represents an arbitrary error value to be estimated, represents an error value, represents an error value, represents a probability density function, that is, the probability density of the error value, represents the number of error values, represents a bandwidth, represents a kernel function; ; The kernel function adopts a Gaussian kernel: ; For the selection of the bandwidth, the specific process is as follows. A preset number of candidates is generated, and each candidate bandwidth is generated. For each candidate bandwidth, based on the error data under the working condition, the above-mentioned probability density function formula is used to substitute each error value to obtain each estimated density . The deviation square of each error value is calculated in combination with the frequency of discrete data: ; In the formula, represents the deviation square of the error value, the average value of the deviation squares of all samples is taken as the mean square error under the bandwidth, and the candidate bandwidth that makes the mean square error minimum is finally selected as the selection. The frequency of the discrete data is ; For the next time period in the future, the error probability density functions obtained by the kernel density estimation of each working condition are weighted and superimposed with the normalized working condition similarity as the weight, to obtain the comprehensive error probability density function of the time period: ; In the formula, represents the comprehensive error probability density function of the time period, represents the normalized working condition similarity of the time period and the th working condition, represents the error probability density function of the time period and the th working condition, ; The power supply amount prediction result of a time period is recorded as , and the actual possible value formula of the power supply amount of the time period is constructed: ; In the formula, The actual possible value of the power supply during this period is denoted as the actual power supply. Therefore, the probability density function of the actual power supply during this period can be derived from the comprehensive error distribution: ; In the formula, This indicates the actual power supply. The probability density function at time; Calculate the probability that the actual power supply falls within each total power supply range: ; In the formula, This indicates that the actual power supply falls on the [number]th [item]. The probability within a given total power supply range Indicates the first The upper limit of the total power supply range Indicates the first The lower bound of each total power supply range, where... Indicates the index of the total power supply range. This formula reflects the range within which the actual power supply is likely to fall, further improving the reliability of decision-making. The above calculations... Each of these is assigned to a corresponding total power supply interval, thus forming the first type of evidence for that time period. This outputs risk evidence that can be directly used for scheduling, supporting reliable decision-making.

[0029] like Figure 3 As shown, meteorological clustering using an unsupervised clustering algorithm divides the power supply into three operating conditions. BPA1, BPA2, and BPA3 correspond to the confidence probabilities of the current predicted power supply falling within the three total power supply intervals, respectively. For the target time period, the probability distribution of power supply under different operating conditions is different, and the confidence probabilities of each power supply interval are generated, transforming meteorological and forecast error information into probabilistic evidence required for decision-making.

[0030] Step 4: Using the similarity between the meteorological data of the next time period and each working condition as a weight, assign the second type of evidence to the total power supply interval corresponding to each working condition. Using the dynamic time warping difference method, analyze the power supply of each wind turbine in the previous TA time periods, identify abnormal wind turbines and set their power supply to zero to correct the predicted value of power supply in the next time period, and map it to the total power supply interval to generate the third type of evidence. Data from independent time periods that were not used in the power supply prediction model training were selected from Z consecutive time periods. The power supply and corresponding operating conditions of each time period were grouped to generate samples. For a certain operating condition, the frequency of each power supply data falling within each total power supply interval was calculated. ; In the formula, Indicates the first The first working condition for the first The basic BPA for each total power supply range, Indicates the first Under what operating conditions does the power supply fall into the first... The number of samples for each total power supply range. Indicates the first The total number of samples under operating conditions is used to statistically analyze the long-term pattern of power supply falling within a certain range of total power supply under specific meteorological conditions. With the first Using normalized operating condition similarity as weights, the base BPA of each operating condition is weighted and summed to obtain the second type of evidence for the total power supply range during that period: ; In the formula, Indicating the second type of evidence, the first By establishing a BPA for each total power supply range, an objective reference system independent of the prediction model is constructed.

[0031] Set the time step for each set of fans under each operating condition. ,and Based on the current time, including the current time and the time going back. A continuous time step ,according to Real-time power supply data of all wind turbines are collected at continuous time steps to form a continuous power supply sequence. This avoids accidental misjudgment due to a small amount of data. The power supply sequence is converted into a power supply sequence with a mean of 0 and a standard deviation of 1 using the z-score method to eliminate individual differences of wind turbines and achieve trend comparability. The adjacent differences of the power supply sequence are calculated to form a first-order differential power supply change trend sequence. Based on the first-order differential sequence of all wind turbines, the median of each time step is taken as the reference value for that step to form a first-order differential group reference trend sequence, which reflects the direction and magnitude of power generation change. After that, the first-order difference of the first-order difference power supply trend sequence and the first-order difference group reference trend sequence is taken to obtain the second-order difference power supply trend sequence and the second-order difference group reference trend sequence, which essentially reflects the change rate of the trend, thereby realizing early identification of the implicit fault. The absolute difference value of the corresponding positions of the two is calculated to form a distance matrix, and the sum of the current distance and the minimum value in the cumulative distance of the previous step is calculated to build a cumulative distance matrix. The value in the lower right corner of the cumulative matrix is the DTW distance of the fan and the group reference trend. After collecting the DTW distance data of all fans under the current working condition, the mean of all distances is first calculated, and then the average of the sum of squares of the deviations of all distances from the mean is calculated. After square root, the standard deviation is obtained. The threshold is set to be the mean of the DTW distances of all fans plus 3 times the standard deviation, which excludes the occasional fluctuations of normal fans. When the DTW distance of a single fan exceeds the threshold, the trend of the fan deviates from the group, and there is a high probability of its own fault. The fan is marked as an abnormal fan. After setting the power supply of the abnormal fan to zero, the future next period power supply prediction value is corrected. If it is not corrected, the prediction model will still calculate the power supply under the condition that the abnormal fan is running normally. In the early stage of implicit fault, the fan will not shut down immediately, but the power generation will gradually decrease. When the motor burns out or the control system fails, the fan cannot run directly, and the power supply is 0. If this part is not excluded during prediction, the total predicted power supply value will be too high, which may lead to scheduling decision errors.

[0032] After excluding the fault interference, i.e. setting the power supply of the abnormal fan to zero, the evidence is converted into interval reliability allocation, which provides a basis for subsequent multi-evidence fusion. The future next period power supply prediction value after the abnormal fan correction is matched with the total power supply interval to allocate the reliability of the third type of evidence: ; In the formula, BPA represents the BPA of the first total power supply interval in the third type of evidence, represents the reliability parameter, which is 0.9, represents the future next period power supply prediction value after the abnormal fan correction, wherein, The value is 0.9, which means that its reliability is much higher than that of the uncorrected prediction value, so that in the subsequent fusion, the problem of insufficient power supply to meet the power demand when the fan fails can be reflected preferentially, and the potential risk is not ignored.

[0033] Step 5: D-S fusion of the three types of evidence, with the third type of evidence as the dominant evidence in case of evidence conflict, to output the future next period power supply prediction value. The power consumption prediction value obtained by inputting the historical power consumption of the current time and the previous M2 continuous time periods into the power consumption prediction model is compared and the power supply mode decision is made; ​The first type of evidence is affected by dynamic factors such as aging of meteorological equipment, and cannot completely match the current working condition. The second type of evidence is essentially power supply data reflecting real-time non-exceptional fan operation. The third type of evidence is aimed at solving fan abnormalities and avoiding high fan power supply. To make a conclusion without relying on a single evidence, the dispersed confidence is concentrated in a consistent power supply interval, and the uncertainty is reduced. First, the orthogonal sum rule of Dempster-Shafer evidence theory is used to fuse the first, second and third types of evidence: ; In the formula, are the total power supply intervals corresponding to the three types of evidence, and the conflict threshold is set in advance , and For example, the conventional setting is 0.6, which can be adjusted according to the actual situation. When , it is determined that there is a significant conflict between the evidence. The reason is that when there is a significant conflict between the evidence, the difference between the three types of evidence in judging the power supply is too large. If the original D-S theory is used for fusion, multiple total power supply intervals will be fused into a meaningless interval, and the result will be unreliable. Therefore, in order to integrate the possibility of equipment failure, close to the actual operation scene, and avoid overestimating the power supply prediction value, it is assumed that the third type of evidence is the most reliable, and the weighted fusion strategy is adopted with the third type of evidence as the dominant: ; In the formula, represents the comprehensive basic probability distribution, represents the weight coefficient, wherein , which ensures that the weight of the third type of evidence is higher than the average of the first two types of evidence, This item avoids completely ignoring the average credibility of the first two types of evidence; When , it is determined that there is no significant conflict between the evidence, which means that the judgment of the three types of evidence has more overlap. At this time, the original D-S fusion is effective, and the influence of the third type of evidence on the result is small, avoiding affecting the determination result. The comprehensive basic probability distribution is calculated: ; To avoid the total comprehensive credibility being less than 1, As a normalization factor, the basic requirement of the probability distribution is met, based on the comprehensive basic probability distribution, the lower limit of the total power supply interval with the highest confidence is selected as the corrected future next period power supply prediction value, and the future next period power supply prediction value is obtained by comparing the power consumption prediction model, when the future next period power supply prediction value is higher than the power consumption prediction value, the energy storage mode is prepared to supplement power supply in priority, otherwise, on the basis of preparing energy storage mode to supplement power supply, standby energy, external power grid is prepared to supplement power supply, table 2 shows that under the condition that there is part of wind turbine failure in period 39-40, the confidence distribution and conflict determination of three kinds of evidence recorded in 40 continuous periods, after collecting the BPA value of three kinds of evidence, whether there is conflict is determined by comparing the preset threshold value, and the evidence conflict determination table is generated after summarizing; Table 2 evidence conflict determination table

[0034] As Figure 4 shown, in the first 38 periods without wind turbine failure, the difference between the actual power supply and the predicted power supply fluctuates, but the overall trend matching degree is high, reflecting that the prediction model can effectively capture the power supply relationship under normal scenario, when there is wind turbine failure in 39-40 periods, the actual value of power supply drops sharply, although the predicted power supply is lower than the actual power supply, but the accuracy of the prediction result is still high, avoiding the problem of lack of early response.

[0035] Please refer to Figure 5 , the application further provides a micro-grid energy optimization device based on distributed deep reinforcement learning, which is used for executing the micro-grid energy optimization method based on distributed deep reinforcement learning described above, comprising: A data sequence module is configured to acquire historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z continuous periods and normalize the data, and construct historical power consumption feature sequence and historical meteorological-power supply feature sequence in time sequence. A prediction error statistical module is configured to train the LSTM model using the historical power consumption feature sequence to obtain a power consumption prediction model, train the LSTM model using the historical meteorological-power supply feature sequence to obtain a power supply prediction model, and obtain prediction errors in a sliding window manner. The first type of evidence module is used to obtain historical power consumption of the micro-grid, historical meteorological data and corresponding power supply in the past Z consecutive time periods, and construct historical power consumption feature sequence and historical meteorological-power supply feature sequence in time sequence, to obtain the power supply prediction value of the next time period, divide the working conditions based on historical meteorological data clustering, generate mutually exclusive total power supply intervals, and combine the meteorological data of the time period and the similarity of each working condition to weight the prediction error, to obtain the future error distribution, and calculate the probability of the power supply prediction value belonging to each total power supply interval as the first type of evidence; The second and third types of evidence modules are used to take the similarity of the future next time period meteorological data and each working condition as a weight, to distribute the second type of evidence for the total power supply interval corresponding to each working condition, and adopt the dynamic time warping difference method to analyze the power supply of each fan in the past TA time periods, to identify abnormal fans and correct the future next time period power supply prediction value by setting the power supply of the abnormal fans to zero, and map to the total power supply interval to generate the third type of evidence. The evidence fusion module is used to perform D-S fusion on the three types of evidence, the third type of evidence is dominant in evidence conflict, and outputs the power supply prediction value of the future next time period, compares the power consumption prediction value obtained by inputting the historical power consumption of the past M2 consecutive time periods into the power consumption prediction model, and makes a power supply mode decision.

[0036] The above formulas are all dimensionless values, and the formulas are obtained by collecting a large amount of data to simulate a formula of the latest real situation, and the preset parameters in the formula are set by a person skilled in the art according to the actual situation.

[0037] The above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. When realized by software, the above embodiments can be realized in the form of a computer program product in whole or in part. Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized by hardware or software methods depends on the specific application and design constraints of the technical solutions.

[0038] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, which can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0039] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application.

Claims

1. A microgrid energy optimization method based on distributed deep reinforcement learning, characterized in that, The specific steps include: Obtaining historical power consumption, historical meteorological data and corresponding power supply of the micro-grid in the past Z consecutive time periods and normalizing the data, and constructing a historical power consumption feature sequence and a historical meteorological-power supply feature sequence in chronological order; Training the LSTM model using the historical power consumption feature sequence to obtain a power consumption prediction model, training the LSTM model using the historical meteorological-power supply feature sequence to obtain a power supply prediction model, and obtaining a prediction error through a sliding window method; Obtaining meteorological data of the next time period in the future and inputting the historical meteorological data and power supply of the previous M1 time periods into the power supply prediction model to obtain a power supply prediction value of the next time period, dividing the working conditions based on the historical meteorological data clustering, generating mutually exclusive total power supply intervals, and weighting the prediction error by combining the meteorological data of the period and the similarity of each working condition to obtain a future error distribution, and calculating the probability of the power supply prediction value belonging to each total power supply interval as the first type of evidence; Taking the similarity of the meteorological data of the next time period in the future and each working condition as a weight, assigning the second type of evidence to the total power supply interval corresponding to each working condition, using the dynamic time warping difference method to analyze the power supply of each fan in the previous TA time periods at the current time, identifying abnormal fans and setting their power supply to zero to correct the power supply prediction value of the next time period in the future, and mapping it to the total power supply interval to generate the third type of evidence; D-S fusion of the three types of evidence, with the third type of evidence as the dominant evidence, outputting the power supply prediction value of the next time period in the future, comparing it with the power consumption prediction value obtained by inputting the historical power consumption of the previous M2 consecutive time periods into the power consumption prediction model, and making a power supply mode decision. 2.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 1, wherein: The method for training the LSTM model using the historical meteorological-power supply feature sequence to obtain the power supply prediction model is: First, mark the past Z consecutive time periods as the historical total time period number Z, extract the power supply data of M2 consecutive time periods from the historical meteorological-power supply feature sequence, denoted as a historical data subset, set the training window length to M1 time periods, and 0 3.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 2, characterized in that: The method for obtaining the prediction error through a sliding window method is: The independent time period data not participating in the training of the power supply amount prediction model is selected from the past Z continuous time periods as the error calculation benchmark, a sliding window with a length of M1 consistent with the training is set, a feature sequence inputting the power supply amount prediction model is intercepted, a prediction value of the next time period is obtained, an absolute error is calculated with the actual value of the power supply amount of the time period, then the window is slid along the time axis by one time period, the above prediction and error calculation process is repeated, all the calculated errors are integrated in chronological order into an error set, denoted as a prediction error. 4.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 2, characterized in that: The method for generating mutually exclusive total power supply amount intervals based on historical meteorological data clustering is: Based on historical data subset extraction of each period of wind speed, air pressure value, composition of two-dimensional feature vector, and then using K-means clustering algorithm for clustering analysis of the normalized feature vector to divide the working condition category, through the elbow method to determine the optimal clustering number, the specific process is to calculate the clustering error sum of squares for each clustering number , , is greater than 2, respectively, draw the relationship curve of and SSE, select the value when the elbow inflection point of the relationship curve as the final working condition category number, the Euclidean distance as the sample similarity measure in the clustering process, iterative optimization of clustering center until convergence, finally get working condition category, each working condition corresponds to a clustering center, that is, the typical wind speed, air pressure value of the working condition as the working condition center; Based on the historical data subset extraction of each period of power supply data, using K-means clustering algorithm, elbow method is used to determine the optimal clustering number, the specific process is to calculate the clustering error sum of squares for each clustering number , , is greater than 2, draw the relationship curve of and SSE, select the value when the elbow inflection point appears in the relationship curve as the final clustering number, take the Euclidean distance as the sample similarity measure in the clustering process, and iterate and optimize the clustering center until convergence, get cluster centers, sort the cluster centers in ascending order, take the minimum value of the power supply data minus the buffer value as the starting lower bound, the buffer value is 5% of the minimum value, take the maximum value of the power supply data plus the same buffer value as the termination upper bound, the buffer value is 5% of the maximum value, calculate the interval points of each total power supply interval, for the sorted cluster centers, take the average value of each two adjacent cluster centers as the interval point between them, that is, the first interval point is the average value of the first cluster center and the second cluster center after sorting, the second interval point is the average value of the second cluster center and the third cluster center, and so on, until the average value of the last two adjacent cluster centers is calculated as the second last interval point, and finally form the total power supply interval. 5.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 3, characterized in that: The method for calculating the probability of the prediction value belonging to each total power supply amount interval as the first type of evidence is: From the past Z consecutive time period, select the independent time period data which does not participate in the power supply quantity prediction model training, calculate the Euclidean distance of wind speed, air pressure of each time period and each working condition center, attribute the time period to the nearest working condition category, and attach a unique working condition label, match the corresponding prediction error, traverse all records with working condition labels, extract all error values corresponding to the same working condition label into a group, generate the error probability distribution corresponding to the working condition, a total of groups; The similarity of the future next time period to the working condition is calculated, the future next time period is denoted as the next time period of the current time, the specific process is that the wind speed and pressure data of the future next time period are obtained from the meteorological bureau, normalized, the Euclidean distance between the wind speed and pressure data of the time period and the center of each working condition is calculated, the similarity is converted by the inverse distance method, and the similarity of all working conditions is normalized by dividing the sum of all similarities; The error value of all prediction error data under a certain working condition is extracted, and the kernel density estimation method is used to estimate the probability density corresponding to any error value: ; wherein denotes an arbitrary error value to be estimated, denotes the error value, denotes the probability density function, i.e. the probability density of the error value, denotes the number of error values, denotes the bandwidth, denotes the kernel function; ; The kernel function adopts Gaussian kernel: ; For the selection of bandwidth, the specific process is, preset candidate number, generate each candidate bandwidth, for each candidate bandwidth, based on the error data under the working condition, use the above probability density function formula, substitute each error value to obtain each estimated density , combined with the frequency calculation deviation square of discrete data: ; In the formula, indicates the square of the deviation of the error value, the average of the square of the deviation of all samples is taken as the mean square error under the bandwidth, and finally the candidate bandwidth that makes the mean square error minimum is selected as the selection, the frequency of the discrete data is ; For the future next time period, the normalized working condition similarity is used as the weight, and the error probability density function obtained by kernel density estimation for each working condition is weighted and superimposed to obtain the comprehensive error probability density function of the time period: ; wherein denotes the integrated error probability density function of this period, denotes the normalized similarity of this period to the th working condition, denotes the error probability density function of this period to the th working condition, ; The power supply amount prediction result of a certain period is recorded as The actual possible value formula of the power supply amount of the period is constructed: ; wherein denotes the actual possible value of the power supply in this period, denoted as actual power supply, thus the probability density function of the actual power supply in this period can be derived from the comprehensive error distribution: ; wherein represents the probability density function of the actual power supply amount when The probability of the actual power supply amount falling within each total power supply amount interval is calculated: ; In the formula, denotes the probability that the actual power supply falls in the th total power supply interval, denotes the upper limit of the th total power supply interval, denotes the lower limit of the th total power supply interval, wherein, denotes the index of the total power supply interval, , denotes the number of total power supply intervals, and the above calculated is respectively assigned to the corresponding total power supply interval, i.e. the first type of evidence of the time period is formed.

6. The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 5, characterized in that: The method for distributing the second type of evidence to the total power supply amount interval corresponding to each working condition by using the similarity of the future next time period meteorological data to each working condition as the weight is: The independent time period data not participating in the training of the power supply amount prediction model is selected from the past Z continuous time periods, the power supply amount and the corresponding working condition of each time period are grouped, samples are generated, and the frequency of each power supply amount data falling within each total power supply amount interval under a certain working condition is counted: ; In the formula, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power supply interval BPA under the first working condition, represents the number of samples of the first total power The first type of evidence is obtained by weighting and summing the basic BPA of each condition with the normalized condition similarity as the weight. The second type of evidence of the total power supply interval is obtained by weighting and summing the basic BPA of each condition with the normalized condition similarity as the weight. ; In the formula, BPA represents the BPA of the i-th total power supply interval in the second type of evidence. BPA represents the BPA of the i-th total power supply interval in the second type of evidence. 7.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 1, characterized in that: The dynamic time warping difference method is used to analyze the power supply amount of each fan in the past TA time periods, identify abnormal fans, and set the power supply amount of the abnormal fans to zero to correct the prediction value of the power supply amount of the future next time period. Setting time step for each fan set under each working condition , and , taking the current time as the basis, including the current time and the previous continuous time steps, , collecting real-time power supply data of all fans in continuous time steps to form a continuous power supply sequence, converting the power supply sequence into a power supply sequence with a mean of 0 and a standard deviation of 1 by z-score method, calculating the adjacent difference value of the power supply sequence to form a first-order difference power supply change trend sequence, and taking the median of each time step as the reference value of the step based on the first-order difference sequence of all fans to form a first-order difference group reference trend sequence; After that, the first-order difference of the first-order difference power supply trend sequence and the first-order difference group reference trend sequence is taken to obtain the second-order difference power supply trend sequence and the second-order difference group reference trend sequence, the absolute difference value of the corresponding positions of the two is calculated to form a distance matrix, and then the sum of the current distance and the minimum value in the previous step cumulative distance is calculated to construct a cumulative distance matrix. The value in the lower right corner of the cumulative matrix is the DTW distance of the fan and the group reference trend. After collecting the DTW distance data of all fans under the current working condition, the mean of all distances is calculated, and then the average of the sum of squares of the deviation of all distances from the mean is calculated. After square root, the standard deviation is obtained. The threshold is set to be the mean of the DTW distances of all fans plus 3 times the standard deviation. When the DTW distance of a single fan exceeds the threshold, the fan is marked as an abnormal fan. After setting the power supply of the abnormal fan to zero, the future next period power supply prediction value is corrected. 8.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 2, characterized in that: The third type of evidence is generated by mapping to the total power supply interval, and the method is: The future next period power supply prediction value corrected by the abnormal fan is matched with the total power supply interval to allocate confidence to the third type of evidence: ; In the formula, represents the BPA of the first total power supply interval in the third type of evidence, represents the reliability parameter, and takes a value of 0.9, represents the predicted value of the power supply after the abnormal fan correction in the next time period in the future.​ 9.The microgrid energy optimization method based on distributed deep reinforcement learning according to claim 1, characterized in that: The method for outputting the future next period power supply prediction value, comparing it with the power consumption prediction value obtained by inputting the historical power consumption of the previous M2 consecutive periods into the power consumption prediction model, and making a power supply mode decision is: First, the first type, the second type, and the third type of evidence are fused using the orthogonal sum rule of Dempster-Shafer evidence theory: ; In the formula, respectively, the total power supply interval corresponding to the three types of evidence, and the conflict threshold is set in advance , and When , it is determined that there is a significant conflict between the evidence, and the third type of evidence is used as the dominant evidence to adopt a weighted fusion strategy: ; wherein denotes the combined basic probability distribution, denotes the weight factor, wherein ; When , determining that there is no significant conflict in the evidence, computing a combined basic probability assignment: ; Based on the comprehensive basic probability distribution, the lower bound of the total power supply interval with the highest confidence is selected as the corrected future next period power supply prediction value, which is compared with the future next period power consumption prediction value. When the future next period power supply prediction value is higher than the power consumption prediction value, the energy storage mode is preferred for supplementary power supply. Conversely, on the basis of the energy storage mode for supplementary power supply, standby energy and external power grid are used for supplementary power supply.

10. A microgrid energy optimization device based on distributed deep reinforcement learning, characterized in that: The device is used to execute the microgrid energy optimization method based on distributed deep reinforcement learning in any of claims 1-9: The data sequence module is used to obtain the historical power consumption, historical meteorological data, and corresponding power supply of the microgrid in the past Z consecutive periods and normalize the data, and construct the historical power consumption feature sequence and the historical meteorological-power supply feature sequence in chronological order; The prediction error statistics module is used to train the LSTM model using the historical power consumption feature sequence to obtain the power consumption prediction model, train the LSTM model using the historical meteorological-power supply feature sequence to obtain the power supply prediction model, and obtain the prediction error through the sliding window method. The first type of evidence module is used to obtain historical power consumption of the micro-grid, historical meteorological data and corresponding power supply in the past Z consecutive time periods, and construct historical power consumption feature sequence and historical meteorological-power supply feature sequence in time sequence, obtain power supply prediction value of the next time period, divide working conditions based on historical meteorological data clustering, generate mutually exclusive total power supply interval, combine meteorological data of the time period with similarity of each working condition, weight prediction error to obtain future error distribution, calculate probability of the power supply prediction value belonging to each total power supply interval as the first type of evidence; The second and third types of evidence modules are used to take similarity of future next time period meteorological data and each working condition as weight, assign the second type of evidence to the total power supply interval corresponding to each working condition, analyze power supply of each fan in the past TA time periods at the current time by using dynamic time warping difference method, identify abnormal fan and correct power supply prediction value of the future next time period by zeroing power supply of the abnormal fan, and map to the total power supply interval to generate the third type of evidence; The evidence fusion module is used to perform D-S fusion on the three types of evidence, the third type of evidence is dominant in evidence conflict, and output power supply prediction value of the future next time period is compared with power consumption prediction value obtained by inputting historical power consumption of the past M2 consecutive time periods into the power consumption prediction model to make power supply mode decision.

Citation Information

Patent Citations

  • Micro-grid energy online optimization method based on distributed deep reinforcement learning

    CN114285075A

  • Wind power prediction error modeling method based on meteorological mode recognition

    CN111008504A

  • System and method for predicting future power supply quantity based on historical power supply and weather data

    CN112381266A

  • Power marketing data cleaning method and device

    CN114090562A

  • Power consumption demand prediction method based on LSTM-SVR

    CN115759415A

Cited By

  • Tunnel large deformation prediction method based on geologic feature adaptation and PSO-RF algorithm

    CN121562429A

  • Industrial solid waste carbon sequestration potential prediction and mechanism mining method

    CN122220344A